0
Answered

OPCUA update variables on connect

Edu 2 months ago in OPCUA4Unity updated by Support 2 months ago 3

Hello

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

Hi,

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. 

Thanks

Thomas

hello

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

Answered

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.