Get information from Pallet Manager daemon
The Pallet Manager daemon is a process that runs in the background, making it possible to keep the pallet completion state when the robot program is stopped and continue from the same position when the program is started again.
In this chapter you will find the most common functions of the daemon that are useful for advanced palletizing solutions. However, not all functions are listed here. For a complete list of functions please read the Pallet Manager daemon reference.
Using the PalletManager daemon
A variable called Pally_daemon
is automatically created on startup, and is available in the entire program scope. For compatibility reasons, the variable palletmanager_daemon
is provided locally under the callbacks and in the initial MoveJ program node under the Pally program node.
Methods of the daemon can be invoked from URScript code in the following format:
result = palletmanager_daemon.method_name(param1, param2…)
Where method_name is one of the following methods listed below.
Pallet dimensions
To obtain the pallet dimensions from the currently loaded JSON pattern file, use the following method:
palletDim = palletmanager_daemon.get_pallet_dimensions(0)
The method has one input parameter that is reserved and must be 0 in typical setups.
The result is an array with 3 elements: width, length, and height, in millimeters. The following example converts each value to meters and stores them in 3 separate variables:
palletWidth = palletDim[0] / 1000
palletLength = palletDim[1] / 1000
palletHeight = palletDim[2] / 1000
Product dimensions
To obtain the product dimensions from the currently loaded JSON pattern file, use the following method:
productDim = palletmanager_daemon.get_product_dimensions(0)
The method has one input parameter that is reserved and must be 0 in typical setups.
The result is an array with 4 elements: width, length, and height, in millimeters, and weight in grams. The following example converts each value to meters and kilogram, and stores them in 4 separate variables:
productWidth = productDim[0] / 1000
productLength = productDim[1] / 1000
productHeight = productDim[2] / 1000
productWeight = productDim[3] / 1000
Pallet completion state
To obtain the current pallet completion state (progress indicator) use the following method:
palletState = palletmanager_daemon.get_pallet_state(0)
The method has one input parameter that is reserved and must be 0 in typical setups.
The result is an array with 3 elements: total number of boxes, number of boxes completed, number of boxes not completed.
Please note that boxes in the current task are not included in the completed and the uncompleted boxes.
Use the following example to get detailed status of the pallet:
palletState = palletmanager_daemon.get_pallet_state(0)
nrTotal = palletState[0] # total number of boxes
nrDone = palletState[1] # completed
nrNotDone = palletState[2] # not completed
nrCurrent = nrTotal - nrDone - nrNotDone # being completed now
isSinglePick = (1==nrCurrent) # boolean value, True for single pick
Instance parameter in Dual Product mode
In Dual Product mode, the program keeps track of two separate pallet completion states in memory, called 'instances'. That introduces a parameter 'instance' in several Pallet Manager daemon functions. Instance is usually the first parameter and is always 0 in the previous examples.
palletStatePrimaryLine = palletmanager_daemon.get_pallet_state(0)
palletStateSecondaryLine = palletmanager_daemon.get_pallet_state(1)
Instances are assigned to pick positions, not pallet positions: the primary line belongs to instance 0 and the secondary to 1. Which instance belongs to the left and right pallet can be derived from which pallet is assigned to each pick position (shortest distance from the corresponding conveyor).
Since Pally release v3.3 there is a new global variable InstanceId
that indicates the current instance in use. It is safe to replace 0 and 1 to InstanceId in all callbacks.