Sign in to follow this  
Followers 0
manav

Convert ladder to text and vice versa.

37 posts in this topic

Hi, Is there any method to convert ladder programs in RSLogix500 to text files and back? Or to CSV format. Any text based format would be fine. I dont know if other people have not had this requirement till now. Basically I use this facility in structured text programming, where if I have to program a lot of similar lines then I use edit / copy / paste features from Excel etc. and program a lot of lines at one go saving donkey work time. I have been searching around for any method to convert ladder files in RSLogix500 to text and vice versa. I already use RSLogix500's edit with Excel facility to save donkey work time for address mapping. I need a similar saving of time with ladder programming. Can any one help with this?

Share this post


Link to post
Share on other sites
There is no such conversion avaliable with RSL500 but you do with RSL5K you can convert to L5k file its text file you can modify the text file with Notepad and convert back to ACD file using RSL5K may be try this select the rungs in a ladder & export it to *.slc file open it in notepad modify & save try to Import the modified *.slc in ladder I hope this will fullfil your requirement I never tryed this

Share this post


Link to post
Share on other sites
With RSLogix5k, I use ST when I find repetitive rungs so no problem there with text conversion. I need a text conversion method for RSLogix500 ladder. Thanks anyway. Maybe someone else might have a need to save time spent on repetitive rungs. Still waiting for any suggestions. Will try the way you suggested praveen.

Share this post


Link to post
Share on other sites
I think this the only go

Share this post


Link to post
Share on other sites
Tried and it worked. Thanks.

Share this post


Link to post
Share on other sites
Things are working as we think

Share this post


Link to post
Share on other sites
If you have a block of text or an entire program you want to edit with excel it can be done from RS500. 1. Export the ladder file portion or entire file as a library file. 2. I can't recall the extension the library file will have but find it and change the extension to .csv 3. Now you can import the file into excel and edit it. Note it may be necessary to open with wordpad first and convert commas to ampersands or some other unused symbol and insert commas where you want to speed up editing. I had an Excel VBA macro which wrote all my overload, product flow jams and start stop logic for a very large amterial handling machine. 2 weeks of donkey work reduced to 2 hours. not bad.

Share this post


Link to post
Share on other sites
BobL, How can a macro write the code for you? I am interested to learn something about this. Thanks, Bob

Share this post


Link to post
Share on other sites
I export the file to the SLC format, edit the .slc with a text editor, then reopen the .slc file. Been doing this for years, works great for repitive rungs that only have address changes, like faults.

Share this post


Link to post
Share on other sites
For Example try the following Sheet 1 contins the following information Column A is Motor Name Column B is Start PB Input Address {I:0/0 - I:4/15 for 80 motors} Column C is Stop PB Input Address {I:5/0 - I:9/15 for 80 motors} Column D is Motor Starter Coil Output {O:10/0 - O:14/15 for 80 motors} Column E is the Motor Starter Aux Inuput {I:15/0 - I:19/15 for 80 motors} Column F is the Motor Starter Overload Input {I:20/0 - I:24/15 for 80 motors} Column G is the Motor Local Disconnect {I:25/0 - I:29/15 for 80 motors} Column H is the Motor Failed to Start Bit {B3:0/0 - B3:4/15 for 80 motors} Column I is the Motor Fail to Start Timer {T4:0 - T4:79 for 80 motors} Column J is the Motor has Overload Bit {B3:5/0 - B3:9/15 for 80 motors} Column K is the Motor is Dicsonnected Bit {B3:10/0 - B3:14/15 for 80 motors} Column L is the Motor has a fault bit for HMI {B3:15/0 - B3:19/15 for 80 motors} Each motor will need the following code: 'Motor Start / Stop Rung SOR BST XIC I:0/0 NXB XIC O:10/0 BND XIO I:5/0 XIO I:20/0 OTE O:10/0 EOR 'Motor Failed to Start Error Rungs SOR XIC O:10/0 XIO I:15/0 TON T4:0 0.01 500 0 EOR SOR XIC T4:0/DN OTE B3:0/0 EOR 'Motor is Overload Error Rung SOR XIC I:20/0 OTE B3:5/0 EOR 'Motor is Disconnect Error Rung SOR XIC I:25/0 OTE B3:10/0 EOR 'Motor has an Error Sumamtion Rung SOR BST XIC B3:0/0 NXB XIC B3:5/0 NXB XIC B3:10/0 BND OTE B3:15/0 BND Since all Inputs/Outputs and Errors can be indexed from 1 to 80 the macro creates the rungs as text strings. It runs a for next loop from 1 to 80 drawing the data from Sheet 1 and placing the result on sheet 2. Sheet 2 contains the following. Cell A1 is SOR BST XIC I:0/0 NXB XIC O:10/0 BND XIO I:5/0 XIO I:20/0 OTE O:10/0 EOR Cell A2 is SOR XIC O:10/0 XIO I:15/0 TON T4:0 0.01 500 0 EOR Cell A3 is SOR XIC T4:0/DN OTE B3:0/0 EOR Cell A4 is SOR XIC I:20/0 OTE B3:5/0 EOR Cell A5 is SOR XIC I:25/0 OTE B3:10/0 EOR Cell A6 is SOR BST XIC B3:0/0 NXB XIC B3:5/0 NXB XIC B3:10/0 BND OTE B3:15/0 BND Cell A7 is then SOR BST XIC I:0/1 NXB XIC O:10/1 BND XIO I:5/1 XIO I:20/1 OTE O:10/1 EOR Cell A8 is then SOR XIC O:10/1 XIO I:15/1 TON T4:1 0.01 500 0 EOR You get the idea I hope - Don't have any macros laying around right now, I kinduh write them as I need em. Sheet 3 will contain symbol and description list that I can save seperately and import to do my documentation.

Share this post


Link to post
Share on other sites
Not a problem - the good tricks are worth sharing in my book. Home awake today , due to a sick kid yesterday so I put together a sample macro code writer. MacroSample.zip Please note Sheet2 and sheet3 while it contains good values is not in the correct format {header, footer, etc} to imported immediately. To actually work you'll need to look at exported library files in excel and match this format.

Share this post


Link to post
Share on other sites
Good to know there are a lot of people like me who want to avoid donkey work as much as possible. Lots of responses here. Basically how I figure it out is to export first rung of repetitive logic to .slc library file, open it with notepad, paste into excel, do what bob longfoot is doing in vba, by making aprropriate cells, copying into Word, converting table to text, copying to notepad, and importing this file into ladder, this and editing descriptions in excel eliminates donkey work totally. Thanks for all the help though guys, set me on the right track.

Share this post


Link to post
Share on other sites
This Ascii edit not only compatibility with in Rockwell software & also software from different vendors See notes for details One of the goals of end-users creating programs in an IEC61131-3 compliant environment is the movement or portability of programs between controllers developed by different vendors. This area is a weakness of IEC61131-3 because no file exchange format is defined by the specification. This means that if any program created in one vendor’s environment will require manipulation to move it to another vendor’s system. In order to minimize the effort involved in performing cross-vendor portability, the RSLogix 5000 programming software for the controllers includes a full ASCII export and import utility. Additionally, the file format that is utilized by this tool is based on a hybrid of the IEC61131-3 Structured Text language definition. Controller operating system and data definitions follow the appropriate IEC61131-3 formats. Extensions were implemented in order to convert Ladder Diagram logic into ASCII text since this is not defined by IEC61131-3. For more information on the ASCII export and import utility of RSLogix 5000 programming software, see the Logix5000 Controllers Import/Export Reference Manual, publication 1756-RM084.

Share this post


Link to post
Share on other sites
Please note Ascii import and export with the RS5000 took one major step back. While the PLC 5 and SLC support library files and partial ascii exports and imports, RS5000 must always export the entire program and imports the entire program. This makes for another level of headache when editing in text. Just beware.

Share this post


Link to post
Share on other sites
This sample file does the same work that Bob's file does, without VBA. PS: Can anyone tell me how to get rid of and change the sparky thing in my profile?? Sample.xls

Share this post


Link to post
Share on other sites
you can partial ascii exports and imports in rsl5k see pic

Share this post


Link to post
Share on other sites
I Stand Corrected it does appear in Version 13.25 and beyond. Too bad most of my work has to be in Version 12. Corporate Standards don't you know.

Share this post


Link to post
Share on other sites
still you can use Notepad select multiple rungs then copy & paste it to a notepad edit then copy & paste back to rsl5K

Share this post


Link to post
Share on other sites
Not to disagree, but it does do the logic combination, but it does not create the address/symbol/description database found on sheet 3 that mine did. If you look on your control panel and edit your profile you'll find a thing called custom member title. Whatever you enter here will replace the generated title which changes after every so many posts. That is how mine became The Wizard.

Share this post


Link to post
Share on other sites
sorry it cann't be done

Share this post


Link to post
Share on other sites
Praveen to what are you referring when you say "IT"

Share this post


Link to post
Share on other sites
Editing the address/symbol/description database can be done by using Excel option in the RSL500 address/symbol/description database no need to export & Import

Share this post


Link to post
Share on other sites
Yes I agree you can edit with the Excel Function but if Excel VBA creates your code and your Symbols and Descriptions from the table layout you give the macro then Importing is the fastest way to create a large block of code. I know because I wrote a three story warehouse sorting and storage control routine in 2 days using excel macros and this approach. The team on a similiar earlier project took 2 weeks to write their code using the methods you describe. Macros for repetitive code are the way to go IMHO.

Share this post


Link to post
Share on other sites
You are right, my sample was just showing an approach, I did not extend it to the address descriptions. I export directly using Excel to RSLogix500 for descriptions. I like what you have done with the macro, just offering my two bits here. I am not getting any custom member title in my profile

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0