Name change Variables inside plcnext engineer

Hello, What is the easiest way to change a name of a variable without losing al the connections? If I change the name inside the data list of the PLC it just makes a new variable. And if I Change it inside the program variable list all connections are lost. I tried to us refactoring but this does not work.

When you say refactoring does not work, do you mean that the refactoring function does not work at all in your project? Or does it only partly work (in which case - what part did not work)?

image.png
image.png

I’ve experienced this aswell. If I want to change the name of a global variable, the IEC -variables like code, plc/Datalist will change. But i’m unable to change everything connected to the HMI-Tags.

[quote]When you say refactoring does not work, do you mean that the refactoring function does not work at all in your project? Or does it only partly work (in which case - what part did not work)? [/quote] For example I want to change the name of a struct named: CV_ioData to ControlValve_ioData With Refactoring everything that uses this struct will change to ControlValve_ioData. „CV_ioData.Control.Position“ will be changed to „ControlValve_ioData“ the „.Control.Position“ is deleted. And once the changes have been made the next time I want to refactor the old name is still active. This means I cant use it anymore. It would be very easy if you could change the source name and everything that is connected would automatically change with it.

Capture.JPG
image.png
image.png
image.png
image.png
image.png
image.png

OK, I will report this as a possible bug, and also ask what the simplest alternative is to achieve what you want. ~ Martin.

The advice from the PLCnext Engineer support team is to use the „Global Search and Replace“ function in PLCnext Engineer, instead of the „refactor“ function, to rename the variables in the cases described above. I hope this helps. ~ Martin.

Refactoring does not work for me also, and Global Find and Replace doesn’t work properly either. For instance, I changed the name of a data type but putting a prefix on it. If I search „OldName“ and replace with „abc_OldName“, for some reason it only replaces a few of the many. There is no error saying why it couldn’t replace the others. Unfortunately, it always succeeds in renaming the data type definition, so now it is „abc_abc_OldName“. Refactoring is similar. I select „Refactoring“ from context menu in the Type cell of a variable in the Variable worksheet. The Refactoring window opens with all of the locations of that data type. I enter my new name in the Type cell in the New Values section. I then select „Refactor all selected locations“. The Type then updates in the list to the new name, but even though there are many changes, my error list isn’t reduced or is only reduced by one or two. After a Rebuild I still have many errors that show the old name. I attempt to do the same Refactoring for the same Type, and the Refactoring function doesn’t make the changes. The Type never changes in the list.

I have a head ache with refactoring too. I meet all troubles described by sparky66.