PF_Feeder

Describes what actions are recommended with feeder control commands (PF_CenterByShift, PF_Center, PF_Flip, PF_Shift commands) if the user processes the feeder vibration rather than the system.

Syntax
Function PF_Feeder(PartID As Integer, NumFrontParts As Integer, NumBackParts As Integer, state As Integer) As Integer
‘(Part Judgement)
'(Vibration Action)
Fend

Parameters

  • Part ID
    The part ID (integer number from 1 to 32) goes here.
    When multi-part operation, the active part goes here.
  • Number of parts that are facing up
    The number of Front parts that were found by vision and loaded into the part queue.
  • Number of parts that are facing down
    The number of Back parts that were found by vision.
  • State
    The state of parts, or the recommended action that has been determined by the System goes here.
    One of the values from the table below will be provided.
    State / Recommended action Constant (defined in PartFeeding.inc) Notes
    OK to pick PF_FEEDER_PICKOK Parts are available to pick
    Supply more parts PF_FEEDER_SUPPLY Hopper needs to supply more parts when the Supply method is [supply parts during pick and place].

    Refer to the following section for further details.

    Part Supply

    Parts are spread out but need to be flipped PF_FEEDER_FLIP Flip the parts
    Shift parts into pick region PF_FEEDER_SHIFT Shift forward into region
    Center, Flip and Separate PF_FEEDER_CENTER_FLIP Center, Flip and Separate
    Hopper is empty PF_FEEDER_HOPPER_EMPTY No part in the hopper. Notify the operator and supply parts in the hopper
    Parts have gathered against the platform wall PF_FEEDER_SHIFT_BACKWARDS Shift parts back into pick region
    Hopper Supply, Center, Flip and Separate PF_FEEDER_SUPPLY_CENTER_FLIP Hopper needs to supply more parts and the parts need to be centered, flipped and separated
    Too many parts PF_FEEDER_TOO_MANY There are too many parts on the tray. Notify the operator.
    Wrong part PF_FEEDER_WRONGPART There may be a wrong part on the feeder platform. Notify the operator.
    Plate Type is Structured PF_FEEDER_UNKNOWN

    The system does not know how to handle vibration for a custom, structured plate

    Refer to the following for further details.

    Vibration

Return values
Specify the following values based on processes you want the system to perform after PF_Feeder ends.

Constant (defined in PartFeeding.inc) Part Feeding process operations
PF_CALLBACK_SUCCESS Specify this when the part is ready to be picked and no more feeder operations are necessary. The system will call the PF_Robot callback function. Note: The part coordinate queue will not be regenerated. If you return this value after a feeder operation, there will be a difference between the part coordinates on the feeder and the data in the part coordinate queue.
PF_CALLBACK_RESTART Specify this after the feeder operation has been performed. The system will regenerate all the part coordinate queues and call the PF_Feeder callback function again.
PF_CALLBACK_RESTART_ACTIVEPART Specify this after the feeder operation has been performed. The system will regenerate the part coordinate queue for the active part only and call the PF_Feeder callback function again.

Description
This function allows the user to handle the feeding judgement and action. Normally, the system will process the vibration for parts. When "User processes vibration for part via PF_Feeder callback" in [PartFeeding] - [Part] - [Vibration] is selected, the user decides how to feed the parts. The PF_Feeder callback can be used to solve difficult applications where the system vibration method is not performing well.
For example, PF_Feeder cannot determine what to do with a custom platform (a special platform with Holes, Slots or Pockets). Instead, you can write your own feeder processing in the PF_Feeder callback function.

The NumFrontParts and NumBackParts parameters can be used to help determine the appropriate vibration action. For example, if NumFrontParts > 0 then parts are available to be picked and the system can continue without any vibration.
The State parameter is the system’s recommended action or the state of parts. It may be helpful in determining how to best vibrate the feeder.

The PF_Feeder callback must return one of the values shown in the table above. The return value tells the system how to proceed.

Program Example 1:
The following example illustrates how to perform part judgement and vibration action via the PF_Feeder callback using the System’s recommended State parameter.

Function PF_Feeder(PartID As Integer, NumFrontParts As Integer, NumBackParts As Integer, state As Integer) As Integer

    Select state

        Case PF_FEEDER_PICKOK
            ' Call PF_Robot because there are parts ready to pick
            PF_Feeder = PF_CALLBACK_SUCCESS

        Case PF_FEEDER_SUPPLY
            ' Need to supply more parts
            PFControlReturnVal = PF_Control(PartID, PF_CONTROL_SUPPLY_FIRST)
            ' Shift forward and then Flip
            PF_Shift PartID, PF_SHIFT_FORWARD, 500
            PF_Flip PartID
            ' Restart and re-acquire images
            PF_Feeder = PF_CALLBACK_RESTART

        Case PF_FEEDER_FLIP
            ' Flip the parts
            PF_Flip PartID
            ' Restart and re-acquire images
            PF_Feeder = PF_CALLBACK_RESTART

        Case PF_FEEDER_CENTER_FLIP
            ' Center, Flip and Separate the parts
            PF_Center PartID, PF_CENTER_LONG_AXIS, 900
            PF_Center PartID, PF_CENTER_SHORT_AXIS
            PF_Flip PartID
            ' Restart and re-acquire images
            PF_Feeder = PF_CALLBACK_RESTART

        Case PF_FEEDER_TOO_MANY
            ' Notify operator that there are too many parts on the feeder
            PFStatusReturnVal = PF_Status(PartID, PF_STATUS_TOOMANYPART)
            ' Restart and re-acquire images
            PF_Feeder = PF_CALLBACK_RESTART
    Send

Fend

Program Example 2:
The following example illustrates how to perform part judgement and vibration action via the PF_Feeder callback using the NumFrontParts and NumBackParts parameters.

Function PF_Feeder(PartID As Integer, NumFrontParts As Integer, NumBackParts As Integer, state As Integer) As Integer
    Integer PFControlReturnVal

    Select True

        Case NumFrontParts = 0 And NumBackParts <> 0
            PF_CenterByShift PartID
            PF_Flip PartID
            ' Restart and re-acquire images
            PF_Feeder = PF_CALLBACK_RESTART

        Case NumFrontParts = 0 And NumBackParts = 0
            PFControlReturnVal = PF_Control(PartID, PF_CONTROL_SUPPLY_FIRST)
            ' Center, Flip and Separate
            PF_Center 1, PF_CENTER_LONG_AXIS, 900
            PF_Center 1, PF_CENTER_SHORT_AXIS, 700
            PF_Flip 1, 600
            PF_Feeder = PF_CALLBACK_RESTART 're-acquire images

        Default
            ' Call PF_Robot because there are parts ready to pick
            PF_Feeder = PF_CALLBACK_SUCCESS

    Send

Fend