Logix5K: Multiple Rungs in ASCII

kdcui

Lifetime Supporting Member
Join Date
Dec 2007
Location
USA
Posts
386
I am buffering IO and I wrote a C script to generate multiple rungs of repetitive instruction in ASCII form. For example I have two rungs that look like this:

BST MOV DNET_MCP_10A:I.Data[41] VFD_302_01.DNet_Raw_Data NXB MOV DNET_MCP_10A:I.Data[42] VFD_302_01.DNet_Raw_Data_1 NXB JSR SUB_VFD_IN_DNET 2 VFD_302_01 477 VFD_302_01 BND

BST MOV DNET_MCP_10A:I.Data[43] VFD_301_102.DNet_Raw_Data NXB MOV DNET_MCP_10A:I.Data[44] VFD_301_102.DNet_Raw_Data_1 NXB JSR SUB_VFD_IN_DNET 2 VFD_301_102 478 VFD_301_102 BND

I am copy and pasting each individual rung, however it gets tedious when I am generating 20 rungs or so.

Is there any ASCII instruction to instruct L5K to put subsequent instructions on a new rung? I tried selecting the aforementioned rungs together, pasted into notepad, and back into L5K and I came up with the following, which clumps together as an unknown instruction on a single rung:

[MOV(DNET_MCP_10A:I.Data[41],VFD_302_01.DNet_Raw_Data),MOV(DNET_MCP_10A:I.Data[42],VFD_302_01.DNet_Raw_Data_1),JSR(SUB_VFD_IN_DNET,2,VFD_302_01,477,VFD_302_01)]; [MOV(DNET_MCP_10A:I.Data[43],VFD_301_102.DNet_Raw_Data),MOV(DNET_MCP_10A:I.Data[44],VFD_301_102.DNet_Raw_Data_1),JSR(SUB_VFD_IN_DNET,2,VFD_301_102,478,VFD_301_102)];

I have a feeling there might be an easier way to do this using an L5K file to import code, but it would force me to go back and spend time I don't have re writing my scripts (I have one each for AO, AI, DI, DO, VFD, etc..)

Thanks.
 
This is actually very easy to do in Excel. Just enter the rung you want to duplicate in Logix, then double click on the rung to bring it up in the Logix ASCII editor at the top of the ladder window. Just to the left of the editor there is a drop down box which is probably set to "In ASCII Text". Change that to "In Neutral Text". Then copy the contents of the editor window and paste it into a cell in Excel. In another column(s), set up a list of tag names, etc, that you want to use in subsequent rungs. Then edit the cell where you pasted the rung into a formula using the CONCATENATE function to put the variable data into the text string. Once that is done, you can drag down the formula to generate a column of rung texts that contain the variable data in "neutral text" format.

Next, highlight the cells that contain the CONCATENATE formulas and use ctrl-C to copy. Go back to Logix, open the ASCII editor for the first rung, delete out all of the text in the editor window, and use ctrl-V to paste in the data from Excel. Nothing will appear in the editor window, so you're going to think it didn't work. Don't worry, just press ENTER and all of your rungs will appear. I've pasted over 1000 rungs at once using this method.
 
Thanks, I'll give that a try.

Out of curiousity, is this documented anywhere in some AB file, about using neutral text to post multiple rungs?
 
I'm not up to speed on CLX but on the PLC-5s there are two mnemonics which don't show up on the instruction help list.

They are for 'start of rung' (SOR, I believe) and 'end of rung' (EOR). Maybe these will work for you.
 
Thanks Doug, yeah, I am running on CLX, so I'm not sure the SOR or EOR work. However, I managed to change my scripts to generate in Neutral Text as opposed to ASCII. After looking at the syntax:

; is an end of rung
[ and ] start and end branches
( and ) contain parameters of an instruction
, separates parameters in an instruction, or multiple branches when contained in brackets.

No spaces or commas separate adjacent instructions:

GRT(sourcea,sourceb)OTE(output);

or for a branched ouput:

GRT(sourcea,sourceb)[OTE(output1),OTE(output2)];
 
FYI - the SOR and EOR do work in 5000.

For years, I've used an excel spreadsheet for this. I do all the documentation before I ever start writing code -- I/O assignments, etc. Then I can build alot of the "template logic" (e.g., all of your alarm rungs typically look alike, only the i/o changes). If I intentionally layout my I/O to match input and output order, then it's easy to just drag new addresses into the template, then copy/paste the resulting cells (each starting and ending with SOR and EOR) into logix.
 
Yeah, this thread is old as f#!*, but it's on topic of my question.

Is there a way in Logix 5000 to copy and paste multiple rungs at once in ASCII, (or export .csv) so I can edit the rungs in excel or notepad. Not as L5K format.
 
Sorry...Double click your rung and then copy and paste that into excel


Example of one rung I just tested...
XIC LO_Unload_Start_Req ONS ONS.16 MOV 6000 LO_Unload_Pump_VFD_Speed_Ref_Hz
 
I just tried it (select ten rungs and CTRL+C) and it seems to only paste one rung when I paste into excel.

I can paste into another ladder file and get all the rungs I had selected before the copy operation.

In RSLogix500 it seems to work fine when multiple rungs are selected. It does slap all the rungs into one long string of text.
 
You can use the excel function Text to Columns, delimit with a semicolon to get each rung in a separate cell horizontally, highlight all the cells, copy then do a PasteSpecial transpose to get them into a column.
 
it pastes them all into one cell but the rungs are separated by semicolons.

you can make a VBA macro to separate them into cells if you need.
 

Similar Topics

Hi all, I'm starting work on a system and the processor for said project is a Control Logix 1756-L82. When I open Logix, however, that CPU is...
Replies
9
Views
2,938
Hello, I have been working on an alarm tracking routine. I take several bits to get a status of a device and load then into an INT Dev_Stat. When...
Replies
0
Views
1,007
Hi all, I'm working on some Control and Compact Logix A&B PLCs, running Logix5K version 24. I've been doing online edits just fine, but I've...
Replies
6
Views
2,410
From what I can tell, AB's Connected Component Workbench (CCW) does not support CompactLogix L43 with RsLogix v20.xx Software. What are my...
Replies
6
Views
2,677
Hello PLCs.Net! I am trying to use RSLogix5k via windows command line. I would like there to be a script which automatically opens a project...
Replies
1
Views
1,241
Back
Top Bottom