Order management API

In order to fully utilize the order management capabilities of Pally, it is recommended to set the variable rf_order_mode=2 in the initial MoveJ node. This will enable automatic order processing.

The program will wait for orders and process orders, without terminating the program. New orders can have a new pattern name, but each order can only have one specific pattern name.

In Dual Product Mode, each production line can have its own orders that will run simultaneously.

Insert Order

palletmanager_daemon.insert_order(instance, order_number, order_id, order_description, pattern_name, loads)

Creates a new order and inserts it into the list of existing orders at the specified position.

Parameters

instance: pallet manager instance to be used

order_number: a number between 0 and nr_orders-1 that depends on the total number of orders

order_id: order ID that can be used as a foreign key in external systems

order_description: description for the operator

pattern_name: name of the pattern json file to be loaded

loads: an array of integers that should be interpreted as follows:

  • element 0: the number of pallets to be done

  • elements 1…number of pallets: requested number of products on the N-th. pallet, or 0 means a full pallet

Example

palletmanager_daemon.insert_order(0, 0, 1234, "Shipment to Sogndal", "Salmon", [1, 0])

This will create an order in the first place with name “Shipment to Sogndal”, and palletize 1 full pallet of the pattern “Salmon”. The value 1234 is not used by the program, but can be a foreign key reference to an external production management system in the factory.

Example

palletmanager_daemon.insert_order(0, 1, 2345, "Shipment to Oslo", "Salmon", [5, 10, 10, 10, 10, 3])

This will create a second order with name “Shipment to Oslo”, and palletize 5 pallets, from which 4 will contain 10 boxes and the 5th will only contain 3 boxes of the pattern “Salmon”. The value 2345 is not used by the program, but can be a foreign key reference to an external production management system in the factory.

Update existing Order

palletmanager_daemon.update_order(instance, order_number, loads)

Updates loads of the specified order. Typical use is after completing a pallet. (Set nr. pallets = nr. pallets -1, and remove the first element from the list)

Parameters

instance: pallet manager instance to be used

order_number: a number between 0 and nr_orders-1 that depends on the total number of orders

loads: an array of integers that should be interpreted as follows:

  • element 0: the number of pallets to be done

  • elements 1…number of pallets: the number of products on the N-th. pallet, or 0 for full pallet

Delete existing Order

palletmanager_daemon.delete_order(instance, order_number)

Removes the specified order from the order list. Typical use of this function is when all pallets of the specified order are completed and the 'empty' order can be safely deleted. 

Parameters

instance: pallet manager instance to be used

order_number: a number between 0 and nr_orders-1 that depends on the total number of orders

Delete all Orders

palletmanager_daemon.clear_orders(instance)

Deletes all orders regardless of their completion state. The order list becomes empty.

Parameters

instance: pallet manager instance to be used

Get number of Orders

palletmanager_daemon.get_nr_orders(instance)

Returns the number of orders in the system. This function is useful when creating a new order and adding it to the end of the order list.

Resume after program stop

Orders remain persistent in memory after program stop, and can continue when restarting the program.

The program will continue existing unfinished pallet(s) unless specified otherwise by the rf_P1_terminate and rf_P2_terminate variables. After finishing the current pallet, the program will proceed to the next order entries.

Order data will be lost after reboot and poweroff.

Want to know more?

For further information, see the Pallet Manager Daemon reference manual.