question

sara S2 avatar image
0 Likes"
sara S2 asked sara S2 commented

How could I write instantly information in global table via process flow?

Hello @Matthew Gillespie,

I am trying to create an interactive database (in the global table DataBase) where we record some information (each information in one column) about the modeled process. I could add information about consumption amount, current stock level and eventual stock outs. But, I could not record the current number of the totes in the rack (information in column 2) despite several try.

Precisely, I want to record instantly the number of totes on the rack in column 2 of the global table 'DataBase'.

I would be grateful for your help.

24061-model1-true.fsm

FlexSim 19.0.0
globale table and process flow
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

Matt Long avatar image
0 Likes"
Matt Long answered sara S2 commented

If you're wanting to update the current quantities of all totes by bay # in the Rack, you'll need to execute some code in the On Entry and On Exit events of the Rack. You'll just need to increase the table cell value for the associated type by one when a tote enters the rack, and decrease it by one when it leaves the rack.

You can either accomplish this by adding the On Entry and On Exit triggers in the Rack properties window or you can use Process Flow and listen for those events using a Event Triggered Source. The On Entry trigger passes in the assigned bay. So if you add the Write To Global Table picklist option to the On Entry trigger then set your Row field to 'bay' and your Column field to '2' then that just leaves the Value field. Jumping into the code for that picklist option (click on the scroll next to the trigger), the global table is declared as a variable called table. So we can get the current value of that table cell by

table[bay][2] + 1

with the + 1 incrementing the cell value. Your final result looks like this:

Because the On Exit trigger doesn't give us access to the assigned bay, we'll need to save that off in the On Entry trigger. You can use the Set Label picklist to assign 'bay' to a label on your item

Lastly, you'll need to decrement the cell value whenever an item leaves. Add an On Exit trigger with a Write to Global Table picklist that looks like this:

That should do it!


rack.png (19.4 KiB)
rack3.png (7.8 KiB)
rack2.png (11.6 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.

sara S2 avatar image sara S2 commented ·

Hi @Matt Long

Thank you so much for your help. It works perfectly.

0 Likes 0 ·