question

ling avatar image
0 Likes"
ling asked ling commented

how to get globaltable data into schedule source

how to get data from globaltable3 into schedule source.

without using excel to input.thank you!

1690295096066.png

7.26.zip


FlexSim 22.2.0
globaltableschedule source
1690295096066.png (90.8 KiB)
726.zip (75.1 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

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered ling commented

There are examples of this in the forum. Use a Table query on the GlobalTable data to cloneTo the schedule table. The arrival schedule of the source can be accessed with an expression like this:

getvarnode(Model.find("Tools/ProcessFlow/ProcessFlow/Source"), "arrivals")

Make sure the format is correct for the Scheduled Source activity to recognise it.

· 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.

ling avatar image ling commented ·

Thank you for answering the question, but where am I supposed to open that I can enter that code?

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ ling commented ·

That expression just gets the node to which you will clone the table and will be just part of the code needed.

You can trigger your complete code as the model resets or you can run a script manually using the script editor.

The two lines of code might be:

treenode arrivals=getvarnode(Model.find("Tools/ProcessFlow/ProcessFlow/Source"), "arrivals");
Table.query("SELECT Time,'' AS Name, Quantity, Mylabel FROM GlobalTable1 ORDER BY Time ASC").cloneTo(arrivals);


Example with that in a script window attached.


GlobalTable_to_PFarrivalSchedule.fsm

0 Likes 0 ·
ling avatar image ling Jason Lightfoot ♦♦ commented ·

Thanks for your help!

0 Likes 0 ·