The user-defined commands can utilize the values of the following global variables:
LayerAlt: The altitude, measured from the top of the empty pallet (for shim papers).
LayerNr: Indicates which layer is being palletized, starting from 0.
MountPosition: variable to use with custom path as dynamic position is activated
MovePerformed: this is a user writable variable to indicate that the robot has been moved to the MoveTarget position and the program should skip the movement. With this variable it is possible to implement custom movement from the pickup to the target position, or back from the target position to the waiting position. Set this variable to True in either afterGrab or afterRelease, depending on the direction of the movement that has been performed by user code.
MoveTarget: target position. In the beforeGrab callback, this value contains the pose of the pick position for the next box(es) including gripper rotation and offset corrections. In the afterGrab callback, it contains the target pose of the box on the pallet where the robot should move. In the afterRelease callback it contains the pose of the default waiting position, transformed by the lifting column position.
PalletCenter: A pose that defines the position and orientation of the pallet top center.
PalletNr: 1=right pallet, 2=left pallet.
ProductCount: The number of boxes on the pallet, starting from 0. Please note the value is updated between beforeRelease and afterRelease.
ProductHeight: Height of the box that is being palletized.
ProductName: Name of the product that is being palletized.
TaskCompleted: this is a read-write boolean variable to indicate that the box(es) are successfully palletized and the box counter can be incremented. The default value is normally True, but can be False when a vacuum sensor is installed and vacuum is not detected at the target position before releasing the boxes. Set this variable to False to repeat the same box position, e.g. when a project-specific quality check is implemented and some boxes are moved from the pickup position to a waste bin instead of being palletized.
WorldPosition: A pose that defines an extra transformation for elevated lifting columns.
ZoneNr: Indicates which part of the pallet is being palletized (when using zones of lifting columns).
List of global variables in Pally
Some typical examples of uses for user-defined commands are to insert a shim paper, start and stop the conveyor, sort out inappropriate boxes to a waste bin, perform custom motion in very special layouts, control light signals and signal external machines, etc
1. Full pallet timer
Timer for counting how long a full pallet would take. The value is presented in the RUN screen
2. Shim paper routine
URP’s is added outside the program and called on from the onSheet Callback
PutShimPaperToLeftPallet.URP: Customize your own movements for placing paper onto the pallet
GetShimPaperFromStative: If palletizing on two pallets one common move down to the stative could be used
3. Change optimizer parameters for the next box
Changing the Pally rf_variables before the next calculation starts
4. Custom path
Control the robot motion directly when specfic events occur.
Please note: due to the parallel processing architecture in Pally, it is not possible to move the robot directly in the onNextTask callback: the robot may be still moving back from the previous target position when the new calculations start. Trying to move the robot would cause “Another thread is controlling the robot” error followed by protective stop. When using custom path towards the pick position follow these steps:
set MovePerformed = True in the onNextTask callback in advance, but
move the robot to the MoveTarget position only in beforeGrab
The MoveTarget variable is not yet valid in the onNextTask callback.
Custom move to the pick position
Custom move to the target position on the pallet
Custom move back from the target position to the waiting position