ID : 1514
Format Sample 2
In this example, the NetwoRC provider is used to operate a robot.
Robot.pcs
'!TITLE "Robot"
Sub Main
Dim g_ctrl as Object ' CaoController object
Dim g_Robot as Object ' CaoRobot object
' Connection
g_ctrl = cao.AddController("RC", "CaoProv.DENSO.NetwoRC",
"", "conn=eth:10.6.235.60")
' Robot generation
g_Robot = g_ctrl.AddRobot("Arm", "")
' Move
g_Robot.Move 1, "@P P10", "NEXT"
' Disconnection
g_ctrl.Robots.Remove g_Robot.Index
g_Robot = Nothing
cao.Controllers.Remove g_ctrl.Index
g_ctrl = Nothing
End Sub
Explanation
The procedure for connection and disconnection is the same as in the case involving RC7M controller variable value acquisition and settings.
To operate the robot, first generate a CaoRobot
object with the CaoController
object AddRobot method, and then use the CaoRobo
object Move method.
The above example instructs the robot to pass to the P10 variable position with a PTP operation.
Refer to item "4.2.4. CaoController:: AddRobt Method" in the "NetwoRC Provider User's Guide" for details on the AddRobot method.
Refer to item "4.2.36.CaoRobot:: Move Method" in the "NetwoRC Provider User's Guide" for details on the Move method.
ID : 1514