TwinCAT HMI - changing part of variable names

201 Views Asked by At

I have refactored some PLC code that had binding to a TwinCAT HMI project, does anyone know of a way to change the names of my already mapped variables in a one shot?

below shows the part of the variable names I need to change;

PLC1.MAIN.fbOcp.fbHmiDriver._TwoTrackStarted

"fbOcp" is now called "fbTupo"

2

There are 2 best solutions below

0
On

Do a search/replace operation over the whole HMI-Project with an editor like VS-Code. That's currently the best way to do something like this. Actual renaming/refactoring does not work properly yet in the IDE.

0
On

Server/TcHmiSrv/TcHmiSrv.Config.Default.json file stores the information regarding symbols, in this file you can find the symbols, their mapping names and mapped paths. With changes in this file you can see that mapping names are changed.

This does not automatically update all the contents, usercontrol files that are using this mapping name as binding to different controls.You need to do find and replace in all those files again.