question

Cetim C avatar image
0 Likes"
Cetim C asked Jeanette F commented

Event when emulation variable changes

Hello,
I am making an emulation model, and I would like to do a series of actions only when a variable is set to 1, but I don´t find the way.
Wheter I use an element of type "Wait for event" or "Event-triggered source", the options are the same:
1661326224915.png

If I select any of them, I don´t have the option of "exact value" or something like that.

Any ideas?

Thanks in advance.

FlexSim 22.1.3
emulation
1661326224915.png (1.9 KiB)
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Cetim C, was one of Felix Möhlmann's or Iago MF'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 ·

1 Answer

·
Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Felix Möhlmann commented

If you are talking about the variables of an emulation connection.

The events for those are generally inside the emulation GUI. If you want to trigger a process flow, you could use a message for that.

1661334691811.png


If you mean the emulation variables from process flow, then you can use either the "On Set" or "On Change" event.

1661334746089.png

With "On Change" you can use the option "Arrive at Value" to only trigger for a specific new value.

1661334858138.png

For "On Set", you can specify that the "New Value" event parameter has to match a given value.

1661334875226.png


1661334691811.png (28.4 KiB)
1661334746089.png (1.6 KiB)
1661334858138.png (17.6 KiB)
1661334875226.png (16.4 KiB)
· 2
5 |100000

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

Cetim C avatar image Cetim C commented ·

Thanks Felix.

With the first option I can fix this section but two things:

-Option 2:

with "On Change" there are not the same possibilities.
1661340306558.png


-Option 3:
with "On set" it does not work for me. I tried that and a token is not created when the variable is to 1.

0 Likes 0 ·
1661340306558.png (18.6 KiB)
Felix Möhlmann avatar image Felix Möhlmann Cetim C commented ·

I see. I only checked the process flow variables events while they are not connected to an emulation variable.

Sadly I don't have a testbed available right now to check why the "On Set" event isn't firing. Does the "On Change" event work if you set the "New Value" to match 1?

0 Likes 0 ·

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.