question

Theresa B avatar image
0 Likes"
Theresa B asked Theresa B commented

Correctly indexing FlowItems loaded on a Task Executer for SubFlows

Happy New Year, brains trust!

I've started learning how to use subflows (better late than never!) and was hoping someone could explain what's going wrong in my implementation.

In my Unload Subflow, I'm using </transporter>.subnodes to index each object on the AGV, so that the subflow can use those pointers to unload. Is this the correct way? Is this even possible? Instead of unloading all boxes, it unloads what looks like every second box and then returns NULL when the subflow tries to access the index 5.

I've attached the model for illustration. Excuse the mess, I'm building up to having 4 different origin queues and combiners that a person with an AGV will deliver to and am currently in the process of replacing repetitive sections with subflows.

subflowIndexingError.fsm

Please let me know where I've gone wrong.

Thanks in advance!

FlexSim 22.2.0
subflowindexingsubnodes array
5 |100000

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

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Theresa B commented

It looks like the syntax is wrong here:

1673016867316.png

token.resource.subnodes

should be

token.resource.subnodes.toArray()

Then the problem can arise since you run the subflow 'one at a time' and don't use the boxedOnBoard array. Change to refer to the boxesOnBoard array in the subflow and it should work correctly.

Then you have exceptions complaining about the Synchronize activities not having matching connections in and out.


1673016867316.png (37.0 KiB)
· 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.

Theresa B avatar image Theresa B commented ·
Thanks, Jason, this is of great help! You're right, I guess I'd believed I'd found a one-size-fits-all referencing solution for subflows and filled it in on autopilot.
0 Likes 0 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel edited

I didn’t look into your model. Probably you set an absolute index of your full loaded transporter. While unloading the index of available items shifts by each unloaded item. You can better unload in each loop step any first or last item instead.
If you unload in a loop second step the indexed second item, then this references the current available subnodes. But in your first step of your loop you have unloaded the first item already. In 2nd step your second indexed item is in your initial index order of first step the 3rd item.

5 |100000

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