question

Alex H4 avatar image
0 Likes"
Alex H4 asked tannerp answered

Reference flow item label inside a queue in process flow

I need to check the item type of a flow item that is in a queue. In the process flow if that item is a specific type the conveyor is stopped, as well as if there is an item inside of multiple different objects.

I also have an issue where a flow item is stopped in my "Stand2" queue that uses the same custom code as "Stand1" which does not have any issues. I do not know why the flow item is stopped because when the model runs to that point the Queue4 and OP20_Load are empty.

FlexSim 18.2.0
process flowlabelsqueue contentflow item
fsq.fsm (93.8 KiB)
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

tannerp avatar image tannerp commented ·

I'm not sure if this is what you're looking for, but you might try checking the label using a Conditional Decide in Process Flow.

You can then send the token to a Stop Conveyor custom code activity.

As for the second part of your question, I parsed through the code in Stand1 and Stand2 and there doesn't seem to be an outstanding issue. My best guess is that it's a timing problem. The code is likely checking the queues' content once when the item arrives and if the conditions are not met upon arrival of the item, that item will not re-check the conditions. Is there a specific time that you're concerned about your model stopping? If so, let us know and we can more closely examine your model.

Have you considered Process Flow as an alternative method to the string of code in the processor? A series of listening and decide activities would break down the timing and allow you to re-check conditions until they are met, thus allowing the flow to continue uninterrupted.

0 Likes 0 ·
Alex H4 avatar image Alex H4 tannerp commented ·

I converted to a process flow approach for stopping the items at the stands but it is not working correctly. The items are not being stopped when the conditions are met and there is a flexscript exception error that is coming up also.

Is there a reason to switch to process flow for the processors as well? I have the destinations set by the labels and output flow port by cases.

---

How can I alternate the release of conveyor 1 and conveyor 2 using the process flow that I have? Currently when the conditions are met both conveyor 1 and conveyor 2 both release causing a backup in OP10_Load due to max queue content restriction.

Sorry for the amount of questions.

fsq.fsm

0 Likes 0 ·
fsq.fsm (160.4 KiB)
tannerp avatar image tannerp Alex H4 commented ·

Additionally, you can always use the round robin option in a decide activity to alternate between Conveyor 1 and Conveyor 2 in your model. Simply place two move objects after the decide activity as follows:

0 Likes 0 ·

1 Answer

·
tannerp avatar image
0 Likes"
tannerp answered

I have been examining your code and can hopefully address that part of the issue you are having.

In your code, I assume you are checking the content of the AGV and the Robot to make sure that they are available to pass a part through the system. If this is the case, I would recommend using the "Acquire Resource" feature for the Robot and AGV. What an Acquire activity does is checks to see if the task executor is in use or assigned to other tasks. If it is, it will wait til it's completed those tasks. If not, it will assign the current task to the available task executor.

If you were to use the Acquire activity for these elements in your model, it would likely save you a lot of coding because the task executors will only work on one task at a time.

I've attached an example of using the Acquire activity with a robot/AGV system. Let me know if this helps simplify your process flow.

Model: acquire-resources-demo.fsm


5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.