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
  • Index
  • » Users
  • » mueggge
  • » Profile

Posts

Posts

Feb-22-22 09:13:02
I can not change the value of the variables via a OPC UA connection

I have started a OPC UA Server in the OMShell with  simulate(test, startTime = 0.0, stopTime = 120.0, simflags = "-rt 1.0 -embeddedServer opc-ua"). Then I wanted to test it with the OPC UA client UA Expert. Unfortunatly I cannot write any variables other than boolean like the variable run to start the simulation.
When I try to change a value I get an error that the value could not be converted to variant type OpcUaType_Double. When I tried using a different client it said that non of the variables were readable nor writable.

My model is:

model test
  input Real x;
  Real y;
equation
  y = x;
end test;

EDIT: Aparrently the OPC UA functionality is not yet fully implemented. I found several bugs from this month on their github that describe my problem. That is why I won't be able to use Openmodelica for my project.

Feb-01-22 17:34:20
Want to connect to simulation via opc ua

As always I have already tried to find the solution for several days but after posting the question I found the solution to my first question myself.

I didn't realise: I have to start the simulation via the OPC UA interface after starting the server. I changed the node "Run" to true and the simulation of my model started. This is probably the same as pressing the play button in OMEdit (as described above).

Feb-01-22 16:53:12
Want to connect to simulation via opc ua

I want to run an OpenModelica simulation on an pc running Linux and then connect via opc ua to the simulation. I tried simulating my model in OMShell with simulate(MyTestModel). This worked.

When I add the simulation flags simulate(MyTestModel,simflags ="-rt 1.0 -embeddedServer opc-ua") to start a OPC UA Server OMShell crashes and nothing happens. I tried this in Linux and Windows.

When using OMEdit and setting the flags in the simulation setup it seems to work. However I also have to press the Play Button in the Interactive Plot view to start the simulation. I tested this by connecting to the server with UAExpert.

My first question is: Does anybody know why OMShell crashes (doesn't react anymore) when trying to start the OPC UA Server? Or does anybody have any other suggestions on how to achieve my goal of establishing a opc ua connection with an open modelica simulation running on Linux?



Another question I have regarding the OPC UA Server is: What do I have to do to be able to change the parameters in the running simulation? When starting the server with OMEdit I can see the parameters but I do not have the right to edit them.


My test model is somthing simple like:

model MyTestModel
  input Real x;
  Real y;
equation
  y = x;
end MyTestModel;

  • Index
  • » Users
  • » mueggge
  • » Profile
You are here: