Delay time using global table

Delay time using global table

ahmedmedhat
Not applicable
323 Views
7 Replies
Message 1 of 8

Delay time using global table

ahmedmedhat
Not applicable

[ FlexSim 23.0.1 ]

please help me link the delay activity with the global table "C1", I want it to look for the label "Code" assigned to each flow item and return the value in column "Time".

I used the global table lookup function as shown below and it gives me the errors shown below.

NB. this process flow is linked to a 3D model processor.

1678145307361.png 1678145546940.png 1678145394575.png

0 Likes
Accepted solutions (1)
324 Views
7 Replies
Replies (7)
Message 2 of 8

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

The global table lookup looks in the row headers (the gray boxes on the left side) for the specified row value. So that lookup will only work if you move the Code column into the row headers.

Otherwise you need to use the Table.getValueByKey() method:

Table("C1").getValueByKey(token.Code, 3, 2)



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 3 of 8

ahmedmedhat
Not applicable
no it doesn't work. it says: label Code doesn't exist on token id: ...


0 Likes
Message 4 of 8

jason_lightfoot_adsk
Autodesk
Autodesk

There are many examples of how to create tokens based on table values here on Answers.

Often within the token source you will create as many tokens as there are table rows and use the token index to read the correct row for the token.

0 Likes
Message 5 of 8

Matthew_Gillespie
Autodesk
Autodesk
It's hard to give you the right answer just looking at an image. Can you attach your model?


If the Code label is on an item then you'd want to assign the item to a label in the source activity and then use token.item.Code.


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 6 of 8

ahmedmedhat
Not applicable

@Matthew Gillespie yes sure here is the model

delay time.fsm

0 Likes
Message 7 of 8

Matthew_Gillespie
Autodesk
Autodesk

delay-time_1.fsm

In this version of your model, the Event-triggered Source is listening to the processor's OnExit and it assigns the exiting item to token.item. Then in the delay activity it uses

Table("C1").getValueByKey(token.item.Code, 3, 2)


Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 8 of 8

ahmedmedhat
Not applicable
yes it worked thx alot
0 Likes