Unity Pro fundamentals

glnassaf

Member
Join Date
Dec 2008
Location
Rehovot
Posts
30
Hi,
I have a project in Unity Pro 5.0 and can't seem to find a way to perform a simple task - Search/Replace.
I have a list of variables and would like to Replace a specific string inside each of the vars but can't seem to find the way to do that.
Can someone help me with some instructions (it's quite embarrassing, I know...)
BTW - I know I can export the vars, change it in an editor and import it back, but search/replace seems like a basic feature I cannot believe is missing from the software.

Regards,
Assaf
 
Thanks for your answer.
I am familiar with that feature but I don't want to change the variables in the logic.
I have a list of variables (in var table) and would like to change their prefix (say their prefix is 200_100 and I want to change it to 200_200).
I cannot find a way to do that other than exporting and importing the variables. even then, I will have to delete the old ones (because they have a different name) and go over the logic as you suggested and change each and every function.
That's a lot of work!
In Step7 for example, I can simply find and replace whatever I like, whether its in the code or in the variable table. its basic!

Anyone with a solution?
 
I don't know of any way to do a pattern match and replace on tag names to rename them within unity.

I would export the program as XEF format and then do the search and replace in a text editor. Then you wouldn't have to delete the old ones or go over the logic.
 
Thanks Chud,
But again, this search/replace enables you to replace one variable with another inside the code, not inside the variable table.
I am coming to the understanding that as odd as it is, this is just not possible in Unity.
The easiest option if you have hundreds and thousands of variables, I guess, would be to save the entire project as a text file and use an editor to search/replace.

Bummer, I kind of liked Unity :(
I guess every PLC software has it's downsides...

Thank you all for replying.

Assaf
 
glnassaf I never have to rename thousands of tags. Do you not like the names you have chosen or what is it about your project or workflow that requires thousands of tags to be renamed?
 
V0N_hydro,
I actually don't have thousands of tags in this specific project, only several hundreds.
I have 2 M340 PLCs communicating with each other.
Each PLC controls a set of motorized valves.
I built one of the PLCs where the valves are called MOV_200XXXX.
Now I want to copy the software to the other PLC, change the name of the tags to MOV_100XXXX and change the addresses from say MW1XXX to MW3XXX.
Very simple task to do if I'd have to search and replace.
Because I lack this function, I have to export to text and do it in an editor.

Assaf
 
if each valve is using the same function block, you should be able to select all of the valve blocks at once and use the replace variables function, and then use the text editor to generate the new elementary variables and import them, then use the purge unused variables function to delete the old ones.

i do see your point but this shouldnt take more than 10 minutes even with the longwinded work around.
 
You are correct Brendon. that is if you have a small amount of functions to replace.
In my specific project - it's no biggy.
I am thinking of greater projects where you have dozens of functions to replace vars on. Wouldn't it be nice to be able to simply change the variables instead?

Something to think about for the next software version...

Assaf
 
I dont have v7 loaded yet and might be on that version already.
And a picture is attached to what brendon is referring to.

search_replace.jpg
 
You can do this by copying program (export/import section) to other PLC. Then you can use replace variables on new PLC and change names 100 -> 200.

But variable memory addresses you need change by hand afterwards.

(or you can also export variables from new PLC, then use excel to change memory address to different and import variables back to PLC.)
 

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
171
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
705
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,919
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
770
Back
Top Bottom