0
Answered

[Help Needed] OPC UA Signal Direction Imported Incorrectly (Inputs recognized as Outputs and vice versa)

王海星 yesterday at 9:49 a.m. updated by Support 1 hour ago 1

Hi everyone,

I'm working with the OPCUAInterface component in realvirtual.io to connect Unity to a Siemens S7-1500 PLC via OPC UA, and I'm running into a frustrating issue with signal direction mapping.

Setup:

  • PLC: Siemens S7-1500

  • Unity side: Using OPCUAInterface from realvirtual.io

  • In the PLC (TIA Portal), I've configured:

    • .inputs variables as Read-Only (HMI accessible: Read only)

    • .outputs variables as Read/Write

  • In Unity:

    • I've tried enabling/disabling Automatically Input On Write Signals

    • I've set Regex Write Nodes = (?i)\.outputs to match output variables

However, no matter what combination I try, the imported signal directions are reversed:

  • .outputs are imported as Input ❌ (they should be Output)

  • .inputs are imported as Output ❌ (they should be Input)

 What I Expect:

Based on my understanding of realvirtual.io's signal model:

  • Input = Unity reads from the PLC (e.g., sensors, status)

  • Output = Unity writes to the PLC (e.g., buttons, control commands)

I expect .inputs to be imported as Input, and .outputs as Output.

 Temporary Workaround:

I'm currently using a custom Unity script that runs after import and forcibly sets the signal direction based on the variable name (.inputs → Input, .outputs → Output).

This works, but feels like a hack and not a long-term or scalable solution.

What I'm Asking:

  1. Is this a known limitation of Siemens OPC UA Server? (Does it misreport variable access rights?)

  2. Is there a way to fully customize signal direction logic during import in OPCUAInterface?

  3. What’s the recommended best practice for Siemens OPC UA + Unity signal mapping?

Answered

Hi,


our naming convention is always from the point of view of a plc so “PLCInputBool” is a bool input of a PLC – what means a Bool output of Unity.

This hopefully already answers your full question.

Best regards
Thomas