question

Cheng Wei N avatar image
0 Likes"
Cheng Wei N asked Cheng Wei N commented

Unable to read OPC UA variables from server


I am able to detect the variable under Node ID and I tried to use the code below to read the variable value but unable to do so. In another OPC UA client that I tested, it is able to read the value just fine. The server is a python script running locally attached below. Would appreciate the help.

New Python File.py

double value = Emulation.Variable("myvar").value;
return value;
FlexSim 21.0.2
flexsim 21.0.2opc uavariables
1614268692094.png (14.8 KiB)
1614268743058.png (2.8 KiB)
1614269138431.png (11.6 KiB)
new-python-file.py (1.1 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.

1 Answer

·
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Cheng Wei N commented

It works for me on a local host :

Can you try that? If that works I wonder if it could be a security issue.


1614275357862.png (5.7 KiB)
1614275389879.png (8.3 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.

Cheng Wei N avatar image Cheng Wei N commented ·

Ok the issue is resolved. I think I did not reset and run my model, that could be the reason why the variable value did not update. Thanks for your time!

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.