Product and pallet

The pattern JSON files are managed by a background process called “pallet manager daemon” which provides many essential functions for the rest of the program.

The functions should be called from URScript code in the following format:

result = palletmanager_daemon.any_function(parameters)

How to get and use Pallet or Product data during palletizing project

Name

Description

Variables from request

Callback Placement

palletDim = palletmanager_daemon.get_pallet_dimensions(0)

Get Pallet data from selected Pattern

pallet_width = palletDim[0] / 1000

pallet_length = palletDim[1] / 1000

pallet_height = palletDim[2] / 1000

beforePallet

productDim = palletmanager_daemon.get_product_dimensions(0)

Get Product data from selected Pattern

product_width = productDim[0] / 1000

product_length = productDim[1] / 1000

product_height = productDim[2] / 1000

product_weight = productDim[3] / 1000

beforePallet

global variables created

MoveJ

 

Define global variable with same name to get data

Example:

Place code for getting Pallet or Product data in beforePallet Callback

Getting product or pallet data after pallet is selected in Pattern Selector

Define variable(s) you would like to access under MoveJ(must be global)

global variable created under MoveJ

Note: name of variable you would like to access must be identical to variable from request(see top)

 

Get information about the current pallet state:

Name

Description

Variables from request

Callback Placement

palletState = palletmanager_daemon.get_pallet_state(0)

Get Pallet completion state during palletizing.

The function returns an array with 3 elements, in this order:

  • total number of boxes in the pattern

  • number of boxes already completed*

  • number of boxes remaining*

*The boxes currently being picked are not counted as completed or remaining.

nr_total = palletState[0]
nr_done = palletState[1]
nr_not_done = palletState[2]

  • onNextTask

  • beforeGrab

  • afterGrab

  • beforeRelease

  • afterRelease

Example:

Get the number of boxes being picked:

palletState = palletmanager_daemon.get_pallet_state(0)

next_boxes = palletState[0] - palletState[1] - palletState[2]

is_single_pick = (next_boxes == 1)