Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: MBAutomation on March 13, 2023, 06:46:24 PM

Title: Programing a Queue
Post by: MBAutomation on March 13, 2023, 06:46:24 PM
I need some assistance on figuring out how to queue up an order.

For example:

Lets say I want to order 3 hamburgers.

1st burger is plain
2nd has ketchup only
3rd has ketchup and mustard

Currently its only set up to make one at at time.  I need to be able to shove the other two in the queue while the first is being made, and i'm not sure how to handle this.

Its on a BRX plc and using a cmore to pick options.

Thanks for the input
Title: Re: Programing a Queue
Post by: Bolt on March 14, 2023, 12:38:30 PM
Create a user structure with a few fields: Burger.Patties, .Ketchup, .Mustard. You can make them boolean or integer, depending on your process.
Create a block of your structure, along with a few extra for in and output b instructions. Use the FIFOLOAD  instruction to queue them up when ordered, and use a Queue.Empty is false instruction to trigger a FIFO UNLOAD and start the burger building process