question

Rober G avatar image
0 Likes"
Rober G asked Rober G commented

Increment Value Of Token On Global List

Good Day! I have tried various coding practices and other global table referencing techniques

I wish to increment the value of my tokens (From "Warehouse Trucks") by type (On my "Bunker Bulk Inventory" global table), I have a Global table called "Material Quantity" which has the quantity of increment by type.


What customer code is necessary as seen below to increment it as such, by using the "Material Quantity" global table? It's as if the increment value operation doesn't happen with my incoming tokens and therefore doesn't update on my global table.

testing.fsm

1691572803325.png

Thank you in advance!



FlexSim 23.0.10
process flowwrite to global tableincrement value
1691572803325.png (8.9 KiB)
testing.fsm (74.3 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.

1 Answer

Paula LG avatar image
1 Like"
Paula LG answered Rober G commented

Hi,

The value in your global table wasn't changing because you were accessing it in a way you could only read it, not change it.

To solve that the easiest way, I have used the "Write to GlobalTable" predefined custom code. I also added a label to the tokens called "index" which represents the index of each token created (the first one will have index=1, and the last one index=68), in order to access the correct row in the "MaterialQuantity" table.

1691589443880.png1691589396768.png












I also attach a new version of the model that includes this changes: testing.fsm

Let me know if you have any further questions. I hope it helps!


1691589396768.png (38.1 KiB)
1691589443880.png (96.6 KiB)
testing.fsm (73.5 KiB)
· 6
5 |100000

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