Checking object status, flex script

Checking object status, flex script

sandeep_kumar_i
Not applicable
35 Views
3 Replies
Message 1 of 4

Checking object status, flex script

sandeep_kumar_i
Not applicable

[ FlexSim 19.2.4 ]

Hello FlexSIM users

I am looking for the command to check object status as breakdown or not in Decide command to proceed to next operation in process flow.

For example, to check if my machine is down, before moving item to my machine.

Best,

Sandeep

Accepted solutions (1)
36 Views
3 Replies
Replies (3)
Message 2 of 4

sandeep_kumar_i
Not applicable
0 Likes
Message 3 of 4

Jacob_Gillespie
Autodesk
Autodesk
Accepted solution

The state of the machine could be checked using this:

Model.find("Processor1").as(Object).stats.state().value

That gives you a number or you can get the string version of the state:

Model.find("Processor1").as(Object).stats.state().valueString
Message 4 of 4

philboboADSK
Autodesk
Autodesk

You can stop an object in any state.

If you want to see whether an object is stopped, you should check its "nrofstops" variable:

Object obj = Model.find("Processor1");
int isStopped = (getvarnum(obj, "nrofstops") > 0);
return isStopped;


Phil BoBo
Sr. Manager, Software Development