Problems to read data from PLC with OPC UA

Problems to read data from PLC with OPC UA

adna_l2
Not applicable
11 Views
25 Replies
Message 1 of 26

Problems to read data from PLC with OPC UA

adna_l2
Not applicable

[ FlexSim 22.2.0 ]

Hello, I am trying to set up and opc ua connection with and Advantech Module ADAM-6317 to read data from a PLC. I am using FlexSim 22.2.0.

When I put the credentials, it tells me that the conecction is succesful.


When I try to read the variables from a Digital Input of the module, I get this error:

exception: FlexScript exception: VIEW:/active/EmulationProperties2688925552/TabControl/Variables/SplitterX/RightPanel/PropertiesPanel/OPCUAVariableSensor/Browse/BrowseUAConfiguration3206015304/Tags>eventfunctions/OnSelect c: VIEW:/active/EmulationProperties2688925552/TabControl/Variables/SplitterX/RightPanel/PropertiesPanel/OPCUAVariableSensor/Browse/BrowseUAConfiguration3206015304/Tags i: VIEW:/active/EmulationProperties2688925552/TabControl/Variables/SplitterX/RightPanel/PropertiesPanel/OPCUAVariableSensor/Browse/BrowseUAConfiguration3206015304/Tags>items/Objects/Digital_Input


To write data on PLC I don't have any problems. As you can see in this video, I send values to turn on and turn off the light and it's sucessful.


Someone can help me?


Thanks in advance.

Replies (25)
Message 2 of 26

jason_lightfootVL7B4
Autodesk
Autodesk
Can you read it using UAExpert?
0 Likes
Message 3 of 26

adna_l2
Not applicable

Hello Jason!


Yes, when I use other clients (UA EXPERT, Prosys OPC e OPC EXPERT) I don't have problems, just when I try read data using Flexsim to get Digital Input, the options window doesn't even open.

1665077066795.png

I tried in the 22.1.4 version too.

0 Likes
Message 4 of 26

jason_lightfootVL7B4
Autodesk
Autodesk
Does the error appear when you try to browse to the structure to select a nodeID?
0 Likes
Message 5 of 26

adna_l2
Not applicable

Yes, it is.


We managed to reverse the problem using a python script that has a function for reading and writing a server variable. Both functions receive as a parameter the node where a variable is located and then connect with the server to perform an operation respectively. Upon reading, after establishing a functional connection, the value of the node is returned as a parameter. Through flexsim it is possible to integrate the script and obtain its return for the end of use or value to insert in a label or to serve as decision making according to the modeling logic.


0 Likes
Message 6 of 26

jason_lightfootVL7B4
Autodesk
Autodesk

It sounds like you have a workaround - is that the case?

0 Likes
Message 7 of 26

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Adna Lima,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes
Message 8 of 26

adna_l2
Not applicable

Yes, it's really this.


We call "gambiarra" here. It works with Adam module, but we tried the same with a Delta PLC and doens't works.




0 Likes
Message 9 of 26

lcavallero
Explorer
Explorer
Could you share the model?
0 Likes
Message 10 of 26

adna_l2
Not applicable

Hi Luciano!


Here's the file.


I stopped to test this model a few months ago, we decided to use a Siemens PLC and worked very well.


04_10_teste_advantech_DI_problem.fsm

0 Likes
Message 11 of 26

Jeanette_Fullmer
Community Manager
Community Manager
Hello @Luciano Cavaller, Can you provide support for @Adna Lima?
0 Likes
Message 12 of 26

lcavallero
Explorer
Explorer

Hi Adna,


thanks for the file.

If I correctly understand using a "Siemens PLC" instead of the "Advantech Module ADAM-6317" you do not have problem with connect Flexsim using the OPC UA?

0 Likes
Message 13 of 26

adna_l2
Not applicable

Yes, it is. Here's some pictures of the test.



0 Likes
Message 14 of 26

jason_lightfootVL7B4
Autodesk
Autodesk
Could you re-upload the images - they don't seem to be linked correctly.
0 Likes
Message 15 of 26

Jeanette_Fullmer
Community Manager
Community Manager
Hello @Adna Lima,

The photos did not upload properly. Could you try uploading them again?

0 Likes
Message 16 of 26

adna_l2
Not applicable

Sorry, here is the files. I emphasize that they are related to communication with PLC Siemens, the problems initially presented were with the PLC Delta, with the IoT Advantech module being a gateway.

teste-siemens.pngteste-08-02-read-write.pngcaptura-de-tela-2023-02-08-120708.png

But with Siemens PLC, I couldn't write on the variable of the type "word" as seen in the image below. I have to change the PLC data configuration to Int.

problem-with-word.png

0 Likes
Message 17 of 26

Jeanette_Fullmer
Community Manager
Community Manager
Hello @Luciano Cavallero

@Adna Lima photos loaded properly this time. Can you take a look?

0 Likes
Message 18 of 26

lcavallero
Explorer
Explorer

Hi Adna,

In order to try to reproduce your problem I have some question:

- you are connecting your Siemens PLC via OPC UA: are your using the UA Server of the PLC or a third part UA Server?

- the tags FlexSim_ftOK and FlexSim_ictOK are now BOOL (as I can see in the picture): in this configuration you are able to read and write correctly, right? But when they was of type WORD in that case you weren't able to write. Correct?

0 Likes
Message 19 of 26

adna_l2
Not applicable

Hi @Luciano Cavallero ,

- First: I'm using the UA Server of the PLC


- the tags FlexSim_ftOK and FlexSim_ictOK are now BOOL (as I can see in the picture): in this configuration you are able to read and write correctly, right? Right


But when they was of type WORD in that case you weren't able to write. Correct? Yes, it's correct.

0 Likes
Message 20 of 26

Jeanette_Fullmer
Community Manager
Community Manager
@Luciano Cavallero, Are you able to provide support?
0 Likes