question

ahmedmedhat avatar image
0 Likes"
ahmedmedhat asked ahmedmedhat commented

Delay time using global table

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

FlexSim 23.0.1
global tabledelaydelaytimedelay activity
1678145307361.png (23.1 KiB)
1678145394575.png (28.2 KiB)
1678145546940.png (77.5 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

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered ahmedmedhat commented

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)

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

ahmedmedhat avatar image ahmedmedhat commented ·
no it doesn't work. it says: label Code doesn't exist on token id: ...


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

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 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ ahmedmedhat commented ·
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.
0 Likes 0 ·
ahmedmedhat avatar image ahmedmedhat Matthew Gillespie ♦♦ commented ·

@Matthew Gillespie yes sure here is the model

delay time.fsm

0 Likes 0 ·
delay-time.fsm (45.2 KiB)
Show more comments