question

Kim Jh avatar image
0 Likes"
Kim Jh asked Jeff Nordgren commented

How to obtain Load Time and Unload Time of the operator by using flexscript?

How to obtain Load Time and Unload Time of the operator by using flexscript?
if I entered 10 for operator's Load Time, how to obtain the value 10 by using flexscript?

ver.16.0.9

Choose One
operatorsloadtimeunloadtime
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

·
Jeff Nordgren avatar image
2 Likes"
Jeff Nordgren answered Jeff Nordgren commented
@kim Jh

The way I would do it would be to add a label(s) to the task executer. Go in and modify the Load/Unload code to save the time to the label(s). And then you could reference the label(s). Because those times are "calculated" fields, even if you just put in a single number, they are not accessible to "read" during the model run.

· 5
5 |100000

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

Kim Jh avatar image Kim Jh commented ·

How about this?
double loadtime = nodefunction(getvarnode(the_operator,"loadtime"));

0 Likes 0 ·
Jeff Nordgren avatar image Jeff Nordgren Kim Jh commented ·
@kim Jh

Only problem is, is if it's a distribution, it's going to give a different answer than the actual Load/Unload time. And I'm not convinced with all the formatting code in the trigger that it would work anyway. Did you happen to try it?

2 Likes 2 ·
Joerg Vogel avatar image Joerg Vogel Jeff Nordgren commented ·

@Jeff Nordgren , not exactly this variable node but with the node placeinbay of the rack I get a good result. Then I didn't use a statistical distribution neither.

0 Likes 0 ·
Kim Jh avatar image Kim Jh commented ·

@Jeff Nordgren

in my case, number of loading parts are various for the same load time (time is constant).
and I must use task sequence. so instead of using TASKTYPE_LOAD, I have used TASKTYPE_DELAY, STATE_LOADING. as a result I got the right result.

Unlike the subject of this article, I have experienced that different result between the following approaches.
One thing is that changing load time during simulation run in Quick Properties is not applied.
But, the other thing that changing load time in operator's Properties is applied.
(my flexsim version : 16.0.9)

0 Likes 0 ·
Jeff Nordgren avatar image Jeff Nordgren Kim Jh commented ·
@kim Jh

If all your load/unload times are constant based on type of flowitem being loaded/unloaded, why go to the trouble to create a manual task sequence using the Delay task? You could use the standard drop down menu option " By Global Table Lookup" and put your times in a Global Table. Then you could easily reference them from anywhere, if desired, without having to write manual task sequence code to do the same thing.

1 Like 1 ·

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.