PF_MobileCam
Describe the process used to move the robot to the image capture position, and to retreat back after image capturing, when using a mobile camera. This function will always run, regardless of whether or not a mobile camera is in use.
Syntax
Function PF_MobileCam(part ID As Integer, Action As Integer) As Integer
' (Move the robot to image capture position)
' (Retract the robot)
Fend
Parameters
- Part ID
The part ID (integer number from 1 to 32) goes here.
When multi-part operation, the active part goes here. - Action
The type of movement goes here.Type of movement Constant (defined in PartFeeding.inc) Move robot to the image capture position
(and perform vision imaging and feeder operations after this)
PF_MOBILECAM_BEFORE Retract the robot
(and run the PF_Robot callback function after this)
PF_MOBILECAM_AFTER
Return values
Under normal circumstances, set the PF_CALLBACK_CALLBACK_SUCCESS constant (defined in PartFeeding.inc). To end this function to perform error processing, set a user-defined error number (8000 - 8999). This value is passed back as a PF_Status callback function parameter.
Description
This function runs before image capturing, and before the PF_Robot callback function is called.
After describing this function, test whether the robot can travel to the assigned destination points safely.
Program Example The following example describes a program used to move a mobile camera to the image capture position and retract it. Positions are defined as point data. Labeled as VisionPos for the image capture position, and HomePos for the retraction position.
' ** Point **
' VisionPos Mobile camera image capture position
' HomePos Mobile camera retraction position
'
Function PF_MobileCam(partID As Integer, Action As Integer) As Integer
Select Action
Case PF_MOBILECAM_BEFORE ' Move the robot to image capture position
Jump VisionPos
Case PF_MOBILECAM_AFTER ' Retract the robot
Jump HomePos
Send
MobileCam = PF_CALLBACK_SUCCESS
Fend