question

Anis MB avatar image
1 Like"
Anis MB asked Ben Wilson commented

Using OPC UA variables

Good morning FlexSim community.

I'm using FlexSim as an emulator via OPC UA. I would like to know if there is a way to use OPC UA Controls variables in a trigger code of some Objects in my model?

(for example: if(OPC UA variable1 == 1) {//do the rest} )

I would like also to reset OPC UA Sensors variables to 0 each time I reset the model.

(In OnReset: OPC UA variable2=0)

Thanks in advance.


FlexSim 20.1.3
plc emulationopc ua
· 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.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @anis.mb, was anthony.johnson's answer helpful? If so, please click the red "Accept" button on their answer. 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 or comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
anthony.johnson avatar image
0 Likes"
anthony.johnson answered anthony.johnson edited

https://docs.flexsim.com/en/20.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Emulation/Emulation.Variable.html#Property-value

You can get the value using the Emulation.Variable's value property.

Also, in process flow, you can use a Variable shared asset, along with the Get Variable and Set Variable activities, to get and set the variables.

https://docs.flexsim.com/en/20.2/Reference/ProcessFlowObjects/SharedAssets/Variable/


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.