1

My goal is to set a string variable in my PLC code via my Twincat Hmi project. Setting a Textbox in the Twincat Hmi is no problem, however setting the string variable in my Plc code via the textbox in the Hmi does not seem to work.

  • First I created a textbox in my Hmi project
  • Then I created a string variable in my Plc project
  • I used binding to couple the Textbox and the string variable

When I tested this, the string variable in my Plc code would not change when I changed the value in the textbox of the Hmi. However, the other way around, when I changed the value in the Plc the value of the textbox would change. But I also hoped that I could change the Plc variable via the Hmi.

Does anyone know what I should be doing differently, in order to realize this goal?

  • What do you have set for the [binding mode](https://infosys.beckhoff.com/content/1033/te2000_tc3_hmi_engineering/4995383179.html?id=5958415696114998347)? It needs to be two way. – Roald Apr 21 '23 at 11:32
  • Ah two way binding is what solves the issue. Thanks Roald – Niek Morsinkhof Apr 21 '23 at 13:31

1 Answers1

1

You need to change the binding mode to two-way as explained on InfoSyS:

1 Binding mode: Binding mode determines whether the binding acts in one direction or in both directions.

  • One-way binding (read-only): The value of the symbol is read.

  • Two-way binding (read and write access): The value of the symbol is read and the symbol is written when a specific event is triggered.

Roald
  • 2,459
  • 16
  • 43