question

Ignasi P avatar image
0 Likes"
Ignasi P asked Matthew Gillespie edited

How to choose between global tables in a single processor by a label?

Hi community,

I am trying to implement a simple simulation, but I have to use different process times of a processor based on a label. This process time is taken from a Global Table, which is a different one depending on that label. (I know I could do it in one table but the table would be way too big for me to work for).

I tried a code like this:

But doesn't seem to be working, it never goes into the item.Desti==7 condition even though the label item.Desti is 7. The Variant col doesn't go to 11 either. Do you know how I could make it so I can choose the Global Table I want to use? I know that it is not working because of the error saying that there is no row 126, which it's not on the "TablaGlobalTramoE_D_CC" but it is on the other one.

I attach a simplified model of it, so you can use the Global tables or anything that you might need. If you need further information please let me know.

Thanks a lot in advance,

pregunta.fsm

FlexSim 18.1.2
global table
code.jpg (76.6 KiB)
pregunta.fsm (97.8 KiB)
· 2
5 |100000

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

Sebastian Hemmann avatar image Sebastian Hemmann commented ·

Do you have any hint for us, on what Processor in your model we can find the shown code?

0 Likes 0 ·
Ignasi P avatar image Ignasi P Sebastian Hemmann commented ·

Of course sorry, should have said it on the descripiton. It is on several processors, but one you can look at is "BocS A Paso Torre o Atraque". Thanks for your help.

0 Likes 0 ·

1 Answer

·
Raja Sekaran avatar image
1 Like"
Raja Sekaran answered Ignasi P commented

@Ignasi P

You have initialized the col variable two times, one in line 19 and another one in line 22. You don't need to initialize again in line 22, you can just assign the value to the col variable like below

I have attached the model with changes. Hope this helps.

support-vardeclaration-1.fsm

Thanks


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

Ignasi P avatar image Ignasi P commented ·
@Raja Sekaran

Thanks for the help mate, I am going to try it right now.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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