Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Up-to-date Documentation for OPC

Up-to-date Documentation for OPC

I'm attempting to learn how to use OPC with OM (specifically OPC-UA). From the forums, I've gleaned:

1) Compile with omc, not OMEdit because OMEdit doesn't support OPC yet.
2) When running the compiled simulation, use `-embeddedServer=opc-ua -rt=1`
3) Perhaps you should also use the option, `-clock=RT`

From the official documentation (OpenModelicaSystem.pdf section 6.3.3) I've learned that:
1) OPC isn't supported in the official release of OM and needs to be manually merged in, "To utilize either of the OPC interfaces, the OPC branch needs to be merged to c_runtime."
2) You must modify the generated makefile to include the OPC libraries, "UA Server is linked to the simulation executable by adding -lOPCregistry -lua_server at the end of the compiling script."

From my own experimentation, I've found that:
1) The compiled simulation will give you no errors if you get these options wrong, i.e. a typo such as `-embleddedSerber=opc-uae` won't give an error
2) The instructions in OpenModelicaSystem.pdf section 6.3.3 are wrong. There are no OPCregistry and ua_server libraries. The only library available to be linked in is omopcua (libomopcua.dll in C:\OpenModelica1.11.0-32bit\lib\omc)

I'm guessing that the section on OPC in the official system documentation (under Users->User Documentation) on the OpenModelica web site is out of date (since it references a version built 3 years ago). Is the up-to-date system documentation in another location?

Re: Up-to-date Documentation for OPC

I was using the C++ as my target code. I didn't realize this generates an executable with entirely different capabilities and command-line options. I tried again using C instead. I didn't have to modify my makefile in any way--it appears that the official documentation is still out of date. I can run my simulation with the -embeddedServer=opc-ua option. Then I can connect with FreeOpcUa Client, subscribe to my variables, and write "true" to the step object to step the simulation along.

Now my problem is that I can't set the command-line option rt=1 or set the realTimeScalingFactor object via OPC since my simulation is running on a Mac. I get a "rt_ext_tp_sync_nanosec not implemented for OSX" error.

There are 0 guests and 0 other users also viewing this topic
You are here: