0
Not a bug

Override values (Unity to PLC) does not work as expected

Gonçalo Nascimento 4 months ago in realvirtual.io Community updated by Support 1 month ago 6

Greetings.

I am using S7 TCP/IP connection on a Unity project and I am physically connected to an S7-1200.

I am using various PLC Inputs and Outputs (created automatically from the .sdf file).

The PLC outputs are being read correctly on Unity, but when I force (overrite) a BOOL input value, the PLC detects the change but does not hold the new value. For example, I can see on the TIA Portal monitor window that the value is FALSE. I press write to True on Unity but the monitor on TIA Portal still shows False, although it did acknowledge the pulse (mabye it was a very short pulse)? Is this the way writing to PLC inputs works? By pulses? Because I would like to change a boolean (or any other type) value and hold that state for long periods of time.

These are my settings for the S7 Interface

Image 1101

And this is an example of a PLC Input component (Is it normal that the component is deactivated during runtime??):

Image 1103


This is the correspondent GameObject during runtime:

Image 1102

Thanks for your time!

Answer

Answer

Hi Andreas,


here are my answers:

  1. This behavior is by design from Siemens. It's not possible to change this. If a hardware value is at a certain level, you can't overwrite it with software.
  2. This is not a bug; it's a common characteristic of all software solutions utilizing real Siemens PLC hardware. To avoid values being overwritten, you can modify your hardware configuration or use a simulated PLC.

To the best of my knowledge, you don't need to change the program itself. However, you do need to adjust the hardware configuration to ensure the symbol you are using does not conflict with a real hardware input.

Solutions that Work Without Changing Hardware Configuration for Siemens Controllers:

  • Use PLCSimAdvanced
  • Use Simit in Combination with a Simulation Unit

 

Under review

Hi, the deactivated components are in this case correct. We want to prevent the signal update method, which is not needed in this case. Are you maybe writing on PLC inputs which are also available in hardware. In this case you can't force or even set it from realvirtual because the real physical input value can't be changed.

Hi Thomas,

I would like to bring up this old thread again.

1. Do you know why the hardware configured signals can't be changed by realvirtual?

2. Do you know if other simulation software tools have the same problem?

I'm asking because I'm interested in the suggested way how to solve this in the PLC program. The real machine works with the configured Inputs/Outputs.

This means that there is some additional program work necessary in the PLC program. for e.g. mapping to markers and use markers in the simulation.

At the same time I think no machine builder is happy about more coding at the PLC program to make a simulation possible.

Answer

Hi Andreas,


here are my answers:

  1. This behavior is by design from Siemens. It's not possible to change this. If a hardware value is at a certain level, you can't overwrite it with software.
  2. This is not a bug; it's a common characteristic of all software solutions utilizing real Siemens PLC hardware. To avoid values being overwritten, you can modify your hardware configuration or use a simulated PLC.

To the best of my knowledge, you don't need to change the program itself. However, you do need to adjust the hardware configuration to ensure the symbol you are using does not conflict with a real hardware input.

Solutions that Work Without Changing Hardware Configuration for Siemens Controllers:

  • Use PLCSimAdvanced
  • Use Simit in Combination with a Simulation Unit

 

Hello,


if I use PLCSim Advanced I can read/write signals which are used in hardware configuration? I don't understand where the difference is between PLCSim and PLCSimAdvanced.

How is the behaviour if I use a real PLC. Is there also the problem that signals used in hardware configuration can't be changed?

Thank you!

PLCSim is not supported officially from our side - even if there are some TCP to PLCSIM software.

All I described is true for a real PLC. If you would need to write to a "real" input which is available in the Hardware Config you would need to use our PLCSIMAdvanced Interface. PLCSimAdvanced is another product of Siemens and totally different to PLCSIM. 

This is really a little bit complicated with Siemens - With Beckhoff for example there is one "software" and "hardware" PLC and they are totally the same. But it is like it is.