question

Ayman Labib avatar image
0 Likes"
Ayman Labib asked Felix Möhlmann answered

While Loop

Hello, I'm a very low experience FlexSim User and I would like to ask you how to write properly a while loop for this expression, please. I don't have any idea about how to write it... I would like to read this code every second.


Object current = param(1);

treenode activity = param(2);

Token token = param(3);

treenode processFlow = ownerobject(activity);



int iFound = 0;


int iNumberOfTotes = Table("tableLane10").numRows;


for (int iTote = 1; iTote<= iNumberOfTotes; iTote ++)

{

if (Table("tableLane10")[iTote][1]==Model.find("DP1").labelOrderID)

{

Table("ResumeLanes")[10][1]=1;

break;

}

else

{

Table("ResumeLanes")[10][1]=0;

}

}


FlexSim 21.2.3
while loop
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

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

There is no way to put a delay inside code in FlexSim. If you want to execute the code every second, I'd suggest to use a custom code process flow activity and simply create a token every second to run it.

1638947370092.png


1638947370092.png (2.4 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.

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.