0

I'm working on twincat-HMI (I'm relatively new to it). In my installation I have several PLCs with the same code and I'd like to switch from one to another in the HMI. I configured my server with the PLCs and I found a way to list the runtimes in a combobox.

enter image description here

What I want : If I select PLC1, my bindings will be on the variable PLC1.GVL1.bool1 and if PLC2 is selected, I'll have PLC2.GVL1.bool1. But I can't find a way to do it.

An other problems : Binding maps directly to variables, so I can't make a link from a string that corresponds to the variable name (I tried with the "Concatenate" function, but it didn't work).

This can be achieved by playing with visibility and superimposing elements from different PLC. But I find this solution dirty and not scalable if I wanted to add a PLC3, for example.

Thanks for any help and research leads !

fadam
  • 11
  • 3
  • I tried with a switchcase, but that's not scalable either. If I add a PLC, I'm obliged to add Case PLC3 to all my bindings. – fadam Aug 01 '23 at 07:33
  • I do not think that is possible, your visualization will crash or not work correctly if the variable does not exist, there is no "contract" to ensure that these variables are available on the plc side, in your case if you want to do it in that way i would configure an extra project where you have consistent variables and after that communicate from this plc project through ADS to the "Slave" projects or ipcs – DonMiguelSanchez Aug 02 '23 at 06:31
  • You could achieve that with some other solution, like a Winforms app that uses ADS library, whenever your selection would change, you would create the variable names with a prefix based on the selection and connect to the target. But if you are bound to HMI, I am not sure, I only worked on it once a few years ago. – ziga Aug 04 '23 at 07:05

0 Answers0