question

Ashmita G avatar image
0 Likes"
Ashmita G asked Ashmita G commented

Integer values and label not recognized in the custom code

I am trying to collect some information in my model at the decision box.

I want to run a loop through the global table to identify the Queues corresponding to the "station" upon which the pallets arrive. I have used a label to identify the station the pallet arrives at. After that I run a loop to check all the rows for the same station value. And thereafter I need the label "curInv" to decide the path to be taken after the decision box. However, it seems the code fails to create the label curInv, and goes down the wrong path.

I tried to check if it was registering the integer values feeding the curInv label information, it seems the values are read as '0' from the global table there, despite having been assigned proper numeric values in the table.

Kindly advice.Doubt_Rep.fsm

FlexSim 20.1.1
labelsflexsim 20.1.1tokenscustom code
doubt-rep.fsm (45.8 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

Aida Chaikh avatar image
1 Like"
Aida Chaikh answered Ashmita G commented

Hi @Ashmita G,

In your model you have a table named "Restore Table" and this table has 3 columns (Total, Pkg and curInv) as string data and the table "Working Table" is a copy of this. But, in the activity Decide you get the values of the table and the variables f = Table("Working Table")[i][3] and k =Table("Working Table")[i][4] are integers. If you change the Restore Table and assign number data to this columns, the code works.

I hope it helps!


assign-data.png (23.6 KiB)
· 4
5 |100000

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