question

Kadircan T avatar image
0 Likes"
Kadircan T asked Jeanette F commented

How can i get current state of an operator?

Hello, I want to assign the current state of the operator (ex: 1, 2, 3 ... ) as a label using assign label, how can I do this?


get_state.fsm

FlexSim 22.2.2
stategetstate
get-state.fsm (112.6 KiB)
· 3
5 |100000

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

Felix Möhlmann avatar image Felix Möhlmann commented ·
Do you mean the actual state, as in "idle/travel/loading/etc" or some number that is supposed to represent a different status, like you do with the "ChuteStatus" label?

And what object/token do you want to assign the label to?

0 Likes 0 ·
Kadircan T avatar image Kadircan T Felix Möhlmann commented ·

I mean the representation of status in numbers form such as "Idle == 1". I will add a new label to assign a helper operator to the token which has PersonelID label.

token.PersonelID.helper
0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Kadircan T, was one of Jason Lightfoot's or Felix Möhlmann's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

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

You can read the status of a fixed resource or task executer with the following expression:

// Get state number
object.stats.state(profileNum).value
// Get state name
object.stats.state(profileNum).valueString

object is a reference to the object you want to read the state from. The profileNum of the default state profile is 0 (you can also leave the argument blank in that case).

5 |100000

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

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

Are you asking about the state of the helper in order to determine if they can help? You can acquire the helper explicitly so don't need to check if they are idle.

Model attached with the code from your other post to have the helper travel to the same location and with helper labels added to each operator.

get-state_jl.fsm


get-state-jl.fsm (113.8 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.