question

attempting-to-automate avatar image
0 Likes"
attempting-to-automate asked attempting-to-automate answered

How do I confirm the connection to an OPC DA server?

I have added an Emulation, OPC DA Connection, browsed on my local host for the server and selected it. Then I have gone into the variables tab and created an OPC DA Sensor Tag and linked it to the variable I want to update from FlexSIM and associated it to a PhotoEye to update the value on cover and uncover.

However, the value does not update on the server.

I have even tried writing a script to help debug this but not had success. I can write the value locally to the Emulation.Variable("MyVariable").value = 2. But it only remains that value whilst that script is running then defaults back to zero. Not in agreement to the actual value on the server of 4.

Is there a way to check the FlexSIM connection to the server? As it can find the server, see the data structure but it is not reading from or writing to the server.

Finally, is there any restrictions on this for the free download? As this piece of work is a capability check.

Many thanks



FlexSim 24.0.2
opc da connection
· 7
5 |100000

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

Logan Gold avatar image Logan Gold ♦♦ commented ·

Hey @attempting_to-automate, while I do not have a good solution for your issue, I did want to give you some information.

First, according to the FlexSim Feature Limitations by License Type article, you should be fine to use an OPC DA connection with the express/free version (no license) of the software.

Second, there is a part of the documentation about Validating PLC Logic. Have you gone through these steps? I know it mentions some things about tag IDs, making sure to run the simulation with a run speed of 1.00, and making sure the ladder logic in the simulation is not used during an active connection.

If you are still unable to resolve the issue, let me know, and I'll see about getting someone more experienced with the Emulation module to take a look.

1 Like 1 ·
attempting-to-automate avatar image attempting-to-automate Logan Gold ♦♦ commented ·

Hi @Logan Gold, thanks for your reply.

I have had a look at the Validating PLC Logic part of the documentation and gone through the steps. Going through that route, I again can browse and find my OPC DA Server, but this time I get stuck on the browsing tag IDs as the program throws an Exception when loading them.

exception: FlexScript exception: VIEW:/active/MainPanel/BackPanel/SplitterXPane/ToolPane/QuickProperties/ContentPanel/ToolPanel/ActivityProperties/Activity Properties/ActivityPropsTemplate/Variable/VariableData/"Emulation/OPCDATagSensor"/Tags/Browse/BrowseTags539286352>eventfunctions/OnOpen c: VIEW:/active/MainPanel/BackPanel/SplitterXPane/ToolPane/QuickProperties/ContentPanel/ToolPanel/ActivityProperties/Activity Properties/ActivityPropsTemplate/Variable/VariableData/"Emulation/OPCDATagSensor"/Tags/Browse/BrowseTags539286352

And if I enter the tag ID manually it does not work. I get the same error that I get when using the Emulation as outlined before.

time: 7.200000 exception: OPC item write failed. OPC VARTYPE: 0 FlexSim Value: 1 on OPCDAConnection. Error code 0x80004005 E_FAIL

Again I am unsure why this would be an issue as I have downloaded an OPC DA Client and can connect to and read/write to these tag IDs without issue.

0 Likes 0 ·
Arun Kr avatar image Arun Kr commented ·

1710999504334.png

Have you checked the connection as active?

1 Like 1 ·
1710999504334.png (19.1 KiB)
attempting-to-automate avatar image attempting-to-automate Arun Kr commented ·

Yes I have.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel commented ·

@attempting_to-automate There are restrictions depending on an interface to a PLC. Some commercial PLCs are requiring a licensed version of a distributor.

https://docs.flexsim.com/en/24.1/Reference/Tools/Emulation/EmulationOverview/EmulationOverview.html#overview

In toolbox I get a warning, if I try to add some emulation tools to a model:emulation-license-not-found.jpg

0 Likes 0 ·
attempting-to-automate avatar image attempting-to-automate Joerg Vogel commented ·

@Joerg Vogel thanks for replying. Yes, I had noticed that warning so was specifically using the OPC DA Connection type which is freely available so this should not be an issue.

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

@Luciano Cavallero, @Tancredi Canonico, @Fiorenzo A, can you please take a look at this emulation-related question?

0 Likes 0 ·

1 Answer

·
attempting-to-automate avatar image
0 Likes"
attempting-to-automate answered

This problem was solved by changing OPC DA Server. This appeared to be an issue with the UAGateway provided by Beckhoff for TwinCAT. Changing to using KEPServerEX has worked. Now FlexSIM can read and write to variables as expected. Not sure what this specific issue was, and unlikely to have time/resource/reason to find out.

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.