Unity Pro XL: Giving variable names to addresses

jarsan

Member
Join Date
May 2017
Location
West
Posts
2
Hello,

I am working with Schneider Electric Unity Pro XL 11, and have a PLC program which was converted from an old version (25 years or so). It is programmed in ST.
In the old version, they have used the addresses only (%Mxxxx), and not variable names. In order to make the program easier to read, I would like to add variable names to all the addresses, but I can't figure out how to do it.
I thought creating a variable with the same address would solve it, but apparently that's not the way to go.
Search/Replace might be a way, but there are a lot of variables, so that would be time consuming.

Any ideas?

Thanks!
 
Welcome to forum

You configure variable on elementary variables.
But this won't change old %MW addressed gived on plc program as you have noticed. Only if there is symbol allready and you change it, then it will convert.
You need to search/replace them, which is time consuming.

Not sure if this works, but you can export your PLC program to XEF-format. (It is XML formatted file, which can opened any text editor)
Then if you serch/replace on txt editor, it will change all %M addresses with gived symbol.
(If you have several sections on program, then you can change all with one search/replace command. On Unity you need to do it separetly for all sections.)

Then on lastly import edited XEF-file back and give %M addresses for symbols on elementary variables window.

Also taking ST out of program and changing on txt editor would work.

3rd method could be to import ST-code back to old PL7 program, adding symbols on PL7 and converting back to Unity, then new "convert" at Unity will have symbols instead of %M and %MW addresses on ST-code.
 
Last edited:
Thanks Lare!

I'm working with the new M580 platform, and instead of exporting to a XEF-file, you export to ZEF. The ZEF file is not a editable text file like the XEF, so I didn't get anywhere with that file.

What I did was to export the ST sections to text files, and write an excel macro which open the files and replaces all the addresses with variables. (First I had to create a lookup table with all addresses and corresponding variable name).
Then I created a text file containing all the new variables needed, with the addresses assigned.

After importing the variable definitions and the modified ST sections, I now have what I was looking for.
 
That is impressive solution.

I would have forced to use Notepad++ or similar txt editor, which can modify several files same time, because excel macros are hard for me. I Like more PLCs coding than excel ;)
 

Similar Topics

Hello, I am using Unity pro V15. I have Quantum CPU 671 and Ethernet NOE 77101 configured. I have configured IO scanning on NOE. I have attached...
Replies
5
Views
175
HELLO MY FRİENDS ı have problem. ı tought you can solved thıs problem for me. First of all When I checked all the cable connections of the...
Replies
0
Views
401
Hi All, I haven't installed Unity Pro in years and needed to install it recently. I initially tried installing Version 11.1 and the whole...
Replies
3
Views
709
Hello i want to implement a Read_var / Write_var functions to communicate with a modbus tcp device at the moment i use the unity simulator at the...
Replies
4
Views
1,924
Hi, I've exported a PL7 application to the .FEF file succesfully. Imported the .FEF file in my Unity Pro project, but two of the five sections in...
Replies
0
Views
771
Back
Top Bottom