question

IT Asset avatar image
1 Like"
IT Asset asked Brandon Peterson edited

State Values

I've noticed a lot of objects have states that change values as events occur. I can not seem to find in the user manual which states the values correspond to. The latest one I was trying to find was for the photoeyes so I could determine if it was blocked or not and make a decision based on that. Can someone tell me where I can find the documentation on these?

photo eyestatesmacrosstate values
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

Ben Wilson avatar image
3 Likes"
Ben Wilson answered Brandon Peterson commented

updated answer

Looking in the conveyor's source code we found the following:

  1. InClearTime = 1,
  2. Cleared = 2,
  3. InBlockTime = 3,
  4. Blocked = 4

As of FlexSim 16.0 there are no macros defined to correspond to the above values. Macros would be great, allowing you to use something human readable like PHOTOEYE_STATE_CLEARED instead of just the number 2. I'll send that over to the dev team to consider adding into the software - it seems like something that we should have and that should be documented.

original answer

The state numbers each correspond to a macro value like STATE_IDLE, STATE_PROCESSING, etc, the complete list of which you can find in the Help > User Manual, Under Miscellaneous Concepts > State List. You can use those macros in your FlexScript code if you ever need to check state on an object. For instance:

  1. if (getstate(current)==STATE_IDLE) {
  2. // do something
  3. }

Let me know if you have any questions or if I misunderstood the question.

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