News:

  • August 14, 2026, 07:22:01 PM

Login with username, password and session length

Author Topic: Programing a Queue  (Read 5823 times)

MBAutomation

  • Sr. Member
  • ****
  • Posts: 60
Programing a Queue
« 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

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: Programing a Queue
« Reply #1 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