OPCUA update variables on connect

Edu 1 year ago in OPCUA4Unity updated by Support 1 year ago 3


I am working on a project to work with realvirtual as HMI with OPCUA4Unity communicating with plc omron.

Reading and writing work perfectly while everything is connected.

The problem is that whenever the unity application connects the values used to write from unity to the plc are overwritten by 0 instead of being updated with the values from the plc in the first place.

Under review


do I understand it correctly - you want to have values (PLCInputs) which should be written by Unity to the PLC. Before writing them and on startup, Unity should read the values (like PLCOutputs) and use this values for writing. Am I right?

If I am right I even don't know if that makes sense. PLCInputs are always written to the PLC (and old values on the PLC will be overwritten). PLCOutputs are always read from the PLC. 




I give you an example:

- I start the machine

- through opcua I program a product injection time of 5 seconds for example

- I want that time to never change until I personally change it again

-I work all day with the machine

- I turn off the machine

- The next day I turn the machine back on and opcua overwrites that value with 0

- I want it to read the value that the plc has when starting and not modify it


Hi, currently we have only have Inputs and Ouputs and not a combination of both. You could define a PLCOutput with the current value and one PLCInput with a Set Value. So if you start Unity you can read the PLCOutput.