PF_ActivePart
Switch the active part during multi-part operation. The PF_ActivePart Statement tells the system what part is currently desired. The system will vibrate or supply parts so that the PF_ActivePart is available for the robot to pick up.
Syntax
PF_ActivePart part ID
Parameters
- Part ID
Specify the part ID. (Use an integer from 1 to 32.)
Return values
None
Description
In the case of multi-part operation, the first Part ID in PF_Start Statement is the initial Active Part. When a different part is desired, you can use this command to switch the Active Part. The system will feed (use the correct vibration settings, supply parts from the hopper etc…) for the Part ID that was specified in the PF_ActivePart Statement.
The ActivePart is normally set prior to exiting the PF_Robot callback so that the feeding action will be specific to the desired part.
If no Part Feeding operation has started, this command has no effect.
When it is not a multi-part operation (i.e., when only one ID is specified at the time of PF_Start execution), this command has no effect.
When you specify a Part ID that was not used in the multi-part operation, this command has no effect.
Cannot be executed from a virtual controller or command window.
Examples
This example illustrates how to alternate between Parts 1 and 2 using the PF_ActivePart statement.
Function PF_Robot(PartID As Integer) As Integer
Select PartID
Case 1
If PF_QueLen(1) > 0 Then
MemOn PartsToPick1
Wait MemSw(PartsToPick1) = Off
PF_ActivePart 2 'Switch to Part 2
Else
PF_ActivePart 1 'Part 1 is still needed
EndIf
Case 2
If PF_QueLen(2) > 0 Then
MemOn PartsToPick2
Wait MemSw(PartsToPick2) = Off
PF_ActivePart 1 'Switch to Part 1
Else
PF_ActivePart 2 'Part 2 is still needed
EndIf
Send
PF_Robot = PF_CALLBACK_SUCCESS
Fend