question

trushita patil avatar image
0 Likes"
trushita patil asked Sam Stubbs answered

Priority for re-entering token in the zone

Hello All,

I want to give priority for the re-entering token after 1st pass if it requires 2nd pass for processing. I have a label (NP_Pass) for no of passes required and a decide which tells the token to go forward to the next zone(Zone2) or perform 2nd pass in the same machine.

But when my token re-enters the zone for 2nd pass it goes last in the queue.

Choose One
priority for token
· 1
5 |100000

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

trushita patil avatar image trushita patil commented ·

i am attaching my model as wellmodel.fsm

0 Likes 0 ·
model.fsm (24.2 KiB)

1 Answer

Sam Stubbs avatar image
0 Likes"
Sam Stubbs answered

I found a solution that works, based on the additional criteria we spoke over the phone about. It's a little tricky, but here's the solution.

First I created a Priority label on the tokens, which initially is just based on the row number. (First in first out kind of thing.) Then the Zone, the More Properties, under the Advanced tab I created a queue strategy, which is just a query to order in ascension the tokens by the Priority label.

ORDER BY Priority ASC


Now to get the repeats to supersede the Priority of the next component type, but to also to be placed AFTER the other components of its Type that have not yet passed through their first time, I wrote a script that will calculate where the priority should go. Basically it's a "while loop" that determines how many parts are left to process of the same type as the current part, and adds that number to it's priority, and calculates where it should be to sit after the last of it's batch but before going on to the next part type.

Here is your sample model reattached:

10331-model.fsm


10331-model.fsm (24.6 KiB)
5 |100000

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