question

Sandeep Kumar I avatar image
2 Likes"
Sandeep Kumar I asked Phil BoBo commented

Checking object status, flex script

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

FlexSim 19.2.4
flexscriptobject status
· 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.

Sandeep Kumar I avatar image Sandeep Kumar I commented ·
0 Likes 0 ·

1 Answer

Jacob Gillespie avatar image
2 Likes"
Jacob Gillespie answered Phil BoBo commented

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

Phil BoBo avatar image Phil BoBo ♦♦ commented ·

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;
1 Like 1 ·