You will want to look at the FRCPrograms, FRCProgram, FRCTasks and FRCTasks objects within the FRCRobot object. These will allow you to run, pause and abort tasks directly. You will need a reference in your project to "FANUC Robotics Controller Interface".
PCDK comes with good examples of how to use these objects. Look for it in the folder where PCDK was installed. I think they are in VB6, but should get you started.
Below is a snippet of old (VB6) code that I used to start a task. I cleaned it up and consolidated some stuff to post here so I cannot guarantee it works as posted, but it gives an example of some of the prerequisites to starting a task.
Code
Private WithEvents mobjRobot As FRCRobot
Private mstrLastError As String
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Private Sub cmdRun_Click()
If Not StartTask("MAIN") Then
MsgBox mstrLastError
End If
End Sub
Public Function StartTask(ByVal vstrTaskName As String) As Boolean
Dim objPrograms As FRCPrograms
Dim objProgram As FRCProgram
Dim objTPProgram As FRCTPProgram
Dim objKARELProgram As FRCKARELProgram
Dim objTasks As FRCTasks
Dim objTask As FRCTask
Dim intGroupCounter As Integer
On Error Resume Next
'Is the robot object ok?
If mobjRobot Is Nothing Then
Set mobjRobot = New FRCRobot
If mobjRobot Is Nothing Then
mstrLastError = "No robot object"
Exit Function
End If
End If
'Is the server connection OK?
If Not mobjRobot.IsConnected Then
mobjRobot.ConnectEx "192.168.1.97", False, 0, 1 ' WARNING: hardcoded variable
If Not mobjRobot.IsConnected Then
mstrLastError = "No robot connected"
Exit Function
End If
End If
Set objPrograms = mobjRobot.Programs
objPrograms.Selected = vstrTaskName
Sleep 100
If objPrograms.Selected <> vstrTaskName Then
mstrLastError = "Could not select program " & UCase(vstrTaskName)
StartTask = False
Exit Function
End If
'determine what groups are already locked - what to do?
Set objTasks = mobjRobot.Tasks
For Each objTask In objTasks
For intGroupCounter = 1 To 9 'WARNING: hardcoded variable
If objTask.LockedArm(intGroupCounter) Then
If objProgram.DefaultGroup(intGroupCounter) Then
If objProgram.Name <> objTask.Name Then
'mstrLastError = objTask.Name & " already has Group " & intGroupCounter & " locked."
'StartTask = False
'Set objTasks = Nothing
'Exit Function
End If
End If
End If
Next intGroupCounter
Next objTask
' Check that program is Karel or TPP
If TypeOf objProgram Is FRCTPProgram Then
'TPP
Set objTPProgram = objProgram
objTPProgram.Run 'this raises error if already running
If InStr(Err.Description, " already running") <> 0 Then 'already running
Err.Clear
End If
Else
'Karel
If TypeOf objProgram Is FRCKARELProgram Then
objKARELProgram.Run 'this raises error if already running
If InStr(Err.Description, " already running") <> 0 Then 'already running
Err.Clear
End If
Else
Exit Function
End If
End If
If Err.Number <> 0 Then
mstrLastError = Err.Description
Else
StartTask = True
End If
End Function
Display More