Using Replace to modify operand

KevinO

Lifetime Supporting Member
Join Date
Mar 2015
Location
BC
Posts
32
I am converting a substantial PLC5 program to ControlLogix and to save time and try to avoid making mistakes, I have copied and pasted all the rungs in each ladder from RSLogix 5 into RSLogix 5000 and was going to use the Replace All feature to change each operand.

All that being said, I am having a small issue. For example, I have 300+ bits labeled B3/***, so I created a boolean aray called system_bits with corresponding number of elements and imported PLC5 descriptions. I can't seem to find an automated way of converting, let's say, B3/100 to system_bits[100]. If I replace all B3/ with system_bits[, it doesn't like the outcome and puts quotes around each operand, creating "system_bits[100".

It is going to take forever to replace each one individually otherwise. Any ideas?
 
Did you try converting the PLC5 program using the utility in the Tools menu? It isn't perfect, but it may be faster.
 
@JRoss - I've tried that before and it just makes a mess of the tag names and stuff. Thanks though.

@cwal61 - I did try that already and unfortunately if doesn't work. If I replace the last " first, it turns the whole operand into a ?. If I start with the "s, it just puts the " back in after the replace is done. I need to replace both quotation marks at the same time. Thanks for the conversion step-by-step. I was hoping to use an array of bits to keep my controller tags window organized, if possible.

Does anyone know how to use wildcards in the Replace function? If so, I could easily change B3/* into system_bits[*]
 
Last edited:
In my experience, you end up with a bunch of arrays that match the data files in the PLC5. Like an array "B3" that you could then rename "system_bits"... But I understand it isn't ideal.

Another option is to export the program into L5K format. You can then open it in a text editor, which might give you more options as far as search and replace.
 
I'm with JRoss

Use the PLC5 conversion utility
Fix up any obvious errors
Then save as L5K

Depending on how good you are in excel or another editor do global substitutions for tag names

Did you think of copy from PLC5
Paste into excel
Perform the substitutions in excel
Copy from excel
Paste into RX5000
 
Thanks again guys for the help. It's really only modifying the ladder rungs that I'm trying to figure out. I have all my controller tags set up nicely, but when the logic got pasted into rsl5000, all the operands have PLC5 format, as in B3/100 vs B3[100]. I'm trying to go through the program and modify the operands to correspond to valid tags. Might see what conversion tool looks like again, been a while
 
If you change / to _ and import the tags to match then your done. you will just have bool tags instead of an Array.
 
Hey guys. Sorry for lack of response. I was able to figure it out by writing a script. I save program as L5K, then copy routine portion of it to text file, run my script to modify everything, then copy that back into L5K file, then open it back up in RSLogix 5000. Really massive work around, but allowed me to modify a few other things too.

Thanks again. If anyone is interested in seeing/using the script, let me know.
 

Similar Topics

Hi to all, We had a machine down with a bad RsLogix 5000 processor. There is a red light on the processor for ok. The bad processor is a Logix...
Replies
3
Views
1,775
Hi, I'm trying to use the IO Device Library (Product Versions) which is configured to work with the 1756-EN4TR & 1756-EN2TR but my system uses...
Replies
0
Views
28
Hello, As part of our project, we are using an M241 controller. This controller interfaces with an industrial computer and a router via a switch...
Replies
2
Views
54
I'm trying to write a data in Arduino using MODWR function block .I used the code I got from online for both PLC and Arduino. I made the wiring...
Replies
4
Views
71
Hey all, i have a panelview screen (image attached), with 4 items on it. Program 1, Program 2, ...3, ...4. The PLC i am using is a compactlogix...
Replies
5
Views
151
Back
Top Bottom