RS 500 Pro Macro/VBA code generating examples?

theColonel26

Lifetime Supporting Member
Join Date
Feb 2014
Location
West Michigan
Posts
785
So basically


I want to copy Ladders 10-19 to 20-29, 30-39 etc. All the way up to Lad 180-189 For a total of 18 copies.



LAD 10-19 use Datafiles, B10,N13,F15, I want LAD 20-29 to use B20,N23,F25, then LAD 30-29 would use B30,N33,F35, etc

So it would be a script that does the ladder copy and then replaces the Datafile part of the Address in for all the instructions, in the copies

Does anyone have an example doing something even remotely like this?

I found the Macro Reference manual but I was hoping I didn't have to start from absolute zero.

This isn't just to create the logic the first go around, this would be to update changes too. To keep all of the Logical Units Identical.

There would be several better ways to handle this in RS 5000, but I am stuck stuck with MicroLogix PLCs for this product line. (even better would be codesys but again not my choice)
 
I simply convert the logic to mnemonics and import into Excel with columns separated by spaces. Then I replace each address with a place holder. Then use another sheet to list all of the addresses for the place holders and then another sheet to link them. Then take those mnemonics and paste them into SLC rung editor and like magic hundreds of lines of logic.
 
Sweet!!!!


Note: I got the following error when trying to import frmMain "Line 2: Property OleObjectBlob in frmMain could not be set."

I opened frmMain.frm in NotePad++ and got the code behind thought. I will probably make a new UI that is relvent to my situation.

I like you comment in the Module1 file lol

Still going through the code, might post back later with some questions.


Second Note: I was in high school when you first wrote this, LOL. Makes me feel like an infant. Really kind sad though that RS 500, hasn't really had much feature enhancements in 13 years though.
 
Last edited:
I simply copy the rungs to a library file and save it as master file for example.

create a dummy subroutine and insert the code and import the library file and use the edit index function. that way you replace the b10 files with b20 and so on. then do a local search and replace for the text descriptions, timers, counters....

the last step is to copy and paste the rungs into the place where you want them. it takes a while to get the hang of it, but when you learn it, it goes fast.


james
 

Similar Topics

SELECTED NEW FILE SELECTED PROCESSOR TYPE SELECTED I/O CONFIGURATIONS IM UNABLE TO CONFIGURE MY I/O’S. I HAVE A PAPER COPY OF A PROGRAM AND I...
Replies
0
Views
79
Hello, I used TIA Portal v15.0 to create a project with s7 1511 and wincc rt professional and an IO Controller. using profinet to connect all 3...
Replies
3
Views
3,014
I have a Siemens 1511C that I programmed, I have V16 Pro, anyone know if you can program them with TIA Basic or do you need Pro? I saw a bunch of...
Replies
6
Views
2,293
Hi, I’m looking at the difference between standard and pro versions of RSLogix 500. I know the pro version lets you edit the database in excel...
Replies
11
Views
2,746
So once again i am trying to create a program in unity pro from an Ab program. i have an FFL and FFU in rslogix 500 and need to use something like...
Replies
2
Views
2,213
Back
Top Bottom