VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   2085
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   2085
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows の既定値
   Begin VB.CommandButton CmdExit 
      Caption         =   "終了"
      Height          =   375
      Left            =   2400
      TabIndex        =   1
      Top             =   840
      Width           =   1575
   End
   Begin VB.CommandButton CmdRun 
      Caption         =   "実行"
      Height          =   375
      Left            =   600
      TabIndex        =   0
      Top             =   840
      Width           =   1575
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Eng As CaoEngine
Private Ctrl As CaoController
Private Arm As CaoRobot

Private Sub Form_Load()

    ' CAOエンジン生成
    Set Eng = New CaoEngine
    
    ' コントローラ接続
    Set Ctrl = Eng.Workspaces(0).AddController("Sample", _
                                               "CaoProv.Dummy", _
                                               "", _
                                               "")

End Sub

Private Sub CmdRun_Click()
    
    ' ロボットオブジェクト生成
    Set Arm = Ctrl.AddRobot("Arm1")
                            
    ' Pick&Place
    With Arm
        .Speed -1, 100
        .Move 1, "@P P11", "NEXT"
        .Move 2, "P12", "NEXT"
        .Move 2, "@P P11", "NEXT"
        .Move 1, "@P P13", "NEXT"
        .Move 2, "P14", "NEXT"
        .Move 2, "@P P12", "NEXT"
    End With

End Sub


Private Sub CmdExit_Click()
    Unload Me
End Sub


