Jump to content



Photo
- - - - -

How to export Logix5000 taglist including string array

  • Please log in to reply
22 replies to this topic

#1 kaiser_will

kaiser_will

    Sparky

  • MrPLC Member
  • PipPipPip
  • 233 posts
  • Country:United States
    United States

Posted 10 September 2008 - 10:11 AM

We have a project with many messages passed to the PanelViewPlus via an array of string messages. My dilmena is that the list within the PLC is very long (300+) and I want to pump it out to an Excel file (or similar) to add to documentation. However, exporting the tag list in Logix5000 just moves the string array name and not the contents of the array (all of the darned messages). Any ideas?

#2 BobLfoot

BobLfoot

    The Wizard

  • MrPLC Admin
  • 3160 posts
  • Gender:Male
  • Location:Southern Indiana
  • Country:United States
    United States

Posted 10 September 2008 - 10:12 AM

We have a project with many messages passed to the PanelViewPlus via an array of string messages. My dilmena is that the list within the PLC is very long (300+) and I want to pump it out to an Excel file (or similar) to add to documentation. However, exporting the tag list in Logix5000 just moves the string array name and not the contents of the array (all of the darned messages). Any ideas?


If you have RSlinx otehr than Lite you should be able to use the Data Monitor function and the clipboard to copy and paste "live" values into an excel sheet.
BobLfoot

"Poor Planning on your part does not a crisis on my part make"

#3 kaiser_will

kaiser_will

    Sparky

  • MrPLC Member
  • PipPipPip
  • 233 posts
  • Country:United States
    United States

Posted 10 September 2008 - 11:15 AM

If you have RSlinx otehr than Lite you should be able to use the Data Monitor function and the clipboard to copy and paste "live" values into an excel sheet.


That would work for getting the value of the string at the time, but what I am trying to do is port out all of the 300+ string content messages of a message string array, preferably into an Excel worksheet, so that I can cut-and-paste into the machine documentation. There is PLC logic to energize bits of the message array to send the "system condition" message string to the HMI, which will display the text string instruction at the top of every screen via the screen template. Such as, if MessageBit(1) is energized, "Msg 1: Control Power must be ON" is displayed on the HMI, letting the operator know that they need to press the control power on button to advance to the next startup task. With this setup, all of the message contents are kept in the PLC and not the HMI, leading to an easy way to keep house. As a new machine is developed and implemented for a customer, many custom messages are added to inform machine opeartors. The goal we shoot for is if an operator presses any button, the machine performs that function or informs the operator as to what conditions are lacking.

#4 BobLfoot

BobLfoot

    The Wizard

  • MrPLC Admin
  • 3160 posts
  • Gender:Male
  • Location:Southern Indiana
  • Country:United States
    United States

Posted 10 September 2008 - 05:49 PM

Will, we need to define some terms.

I am assuming you have a tag MSG_STRING of type string which is displayed on the HMI.

You also have a tag MSG_ARRAY[300] of type string.

You are copying MSG_ARRAY[CHOSEN_NUMBER] TO MSG_STRING.

You want all 300 values contained in MSG_ARRAY in an excel sheet.

If that is the case and MSG_ARRAY is a controller scoped tag then my suggestion will give you all 300 values.

If you can post a sample ACD file I can elaborate.
BobLfoot

"Poor Planning on your part does not a crisis on my part make"

#5 KidPLC

KidPLC

    Sparky

  • MrPLC Member
  • PipPipPip
  • 108 posts
  • Location:NSW
  • Country:Australia
    Australia

Posted 10 September 2008 - 10:10 PM

Would the RSLogix5000 upload/download utility be useful here?

The knowledge base has a topic on it ID37852.

Have not used this utility myself but it appears to be able to upload and download the tags and their values.

Oh it appears that you need a licensed copy of RSLinx as well.
A Truly Wise Man Has More Questions Than Answers

#6 KidPLC

KidPLC

    Sparky

  • MrPLC Member
  • PipPipPip
  • 108 posts
  • Location:NSW
  • Country:Australia
    Australia

Posted 11 September 2008 - 01:38 AM

Update -

I just tried the upload/download tool and it works great!!!! only problem is that the value of the string is uploaded as the ASCII decimal value.

I made a UDT called UDT_MSG and made an element called MSG of type string with an array dimension of 300.

I then made a controller scoped tag called Panelview of type UDT_MSG and then populated the first two locations like so:-

PanelView.MSG[0] = Message1
PanelView.MSG[0] = Message2

When I uploaded this I got

"PanelView.MSG[0].LEN","8"
"PanelView.MSG[0].Data[0]","77"
"PanelView.MSG[0].Data[1]","101"
"PanelView.MSG[0].Data[2]","115"
"PanelView.MSG[0].Data[3]","115"
"PanelView.MSG[0].Data[4]","97"
"PanelView.MSG[0].Data[5]","103"
"PanelView.MSG[0].Data[6]","101"
"PanelView.MSG[0].Data[7]","49"
"PanelView.MSG[0].Data[8]","0"
"PanelView.MSG[0].Data[9]","0"
"PanelView.MSG[0].Data[10]","0"

etc etc.........I haven't included the second message as it is the same only the last character is different it is a 50 which is 2.

Edited by KidPLC, 11 September 2008 - 01:41 AM.

A Truly Wise Man Has More Questions Than Answers

#7 TConnolly

TConnolly

    Guru

  • MrPLC Member
  • PipPipPipPipPip
  • 942 posts
  • Gender:Male
  • Location:Salt Lake City
  • Country:United States
    United States

Posted 11 September 2008 - 01:50 AM

Any ideas?


Export your program to an L5K file. Open the L5K file in notepad or wordpad. Find the string tags and you'll also find the string contents.


#8 KidPLC

KidPLC

    Sparky

  • MrPLC Member
  • PipPipPip
  • 108 posts
  • Location:NSW
  • Country:Australia
    Australia

Posted 11 September 2008 - 06:17 AM

The L5K file does work but boy the strings are buried deep in amounst alot of other stuff.....not user friendly to manipulate or transfer to excel.

Shame the Upload/Download utility doesn't quite do it, it has such potential.
A Truly Wise Man Has More Questions Than Answers

#9 OkiePC

OkiePC

    Boat Rocker/Trouble Breaker

  • MrPLC Member
  • PipPipPipPipPip
  • 934 posts
  • Gender:Male
  • Location:Oklahoma
  • Interests:Kids, Outdoors, Animals, Sports, Science, Math, Music, Puzzles, Video Games, Food, Watersports, Paintball, Jeeps, Pit Bulldogs, Chevy, OU Football, Hiking, Piddling, more ...
  • Country:United States
    United States

Posted 11 September 2008 - 05:09 PM

I have not worked with L5K files, but I would give this advice:

Save a working copy of the export as .txt and edit it to remove unnecessary items, so that when you are done, it is just a list of tags and their contents. If there is extra data with each tag, just leave it there for now.

Open the file with Excel and you should get a dialog box that will allow you to decide which character(s) to use as field delimiters. This may require some trial and error. You may need to select the check boxes for Tab and Comma.

Once imported into a workbook, you can delete any unwanted columns, and use the very powerful search and replace features within excel to get a report that you desire.

Paul

Edited by OkiePC, 11 September 2008 - 05:11 PM.


#10 BobLfoot

BobLfoot

    The Wizard

  • MrPLC Admin
  • 3160 posts
  • Gender:Male
  • Location:Southern Indiana
  • Country:United States
    United States

Posted 11 September 2008 - 08:19 PM

The attached Excel File and it's macros are untested, but should read strings from the ControlLogix into Excel.

Attached File  String_Read_Write.zip   30.41KB   372 downloads
BobLfoot

"Poor Planning on your part does not a crisis on my part make"

#11 pandersen

pandersen

    Sparky

  • MrPLC Member
  • PipPipPip
  • 107 posts
  • Country:United States
    United States

Posted 11 September 2008 - 10:51 PM

For future reference - I would use a Local Message Display element in your HMI rather than a string array in the PLC. It is a much better way to manage messages. The PLC just provides a DINT pointer and then the corresponding message shows up in the HMI. It is also very easy to copy/paste via excel. Some machines I've worked on have 3000+ messages to display, which would be an extreme waste of processor memory to store as a string array, not to mention a nightmare to update messages.

#12 KidPLC

KidPLC

    Sparky

  • MrPLC Member
  • PipPipPip
  • 108 posts
  • Location:NSW
  • Country:Australia
    Australia

Posted 11 September 2008 - 11:02 PM

I agree with you comments pandersen.

I am still interested in solving this one though.

BobL I have down loaded you zip file but it unzips to an .xlsm file and excel won't have a bar of it??
A Truly Wise Man Has More Questions Than Answers

#13 BobLfoot

BobLfoot

    The Wizard

  • MrPLC Admin
  • 3160 posts
  • Gender:Male
  • Location:Southern Indiana
  • Country:United States
    United States

Posted 12 September 2008 - 02:21 PM

I've updated the files after testing them.

THe new zip has three files.

*.xlsm an Excel 2007 version of the sheet.

*.xls an Excel 2003 version of the sheet.

*.ACD the version 15 file for RS5000 I tested with.

read and write strings worked for me.

Attached File  Strign_Trial.zip   145.45KB   361 downloads
BobLfoot

"Poor Planning on your part does not a crisis on my part make"

#14 KidPLC

KidPLC

    Sparky

  • MrPLC Member
  • PipPipPip
  • 108 posts
  • Location:NSW
  • Country:Australia
    Australia

Posted 12 September 2008 - 04:59 PM

aahhhhhhhhhhhhh....xlsm is excel 2007 I see.

I have excel 2003 that's what threw me.

Thanks for the spread sheet BobL it looks great I will try it out later today.
A Truly Wise Man Has More Questions Than Answers

#15 BobLfoot

BobLfoot

    The Wizard

  • MrPLC Admin
  • 3160 posts
  • Gender:Male
  • Location:Southern Indiana
  • Country:United States
    United States

Posted 12 September 2008 - 08:20 PM

aahhhhhhhhhhhhh....xlsm is excel 2007 I see.

Thanks for the spread sheet BobL it looks great I will try it out later today.


xlsx is also Excel 2007 with macro security disabled.

xlsm is macro enable spreadsheet.

Hey Kid - Let me know how the sheet works and if you comprehend Excel Macro Visual Basic take a look under the hood as well.
BobLfoot

"Poor Planning on your part does not a crisis on my part make"

#16 KidPLC

KidPLC

    Sparky

  • MrPLC Member
  • PipPipPip
  • 108 posts
  • Location:NSW
  • Country:Australia
    Australia

Posted 14 September 2008 - 04:31 AM

Hi BobL,

I tried the spread sheet at home but unfortunately I only have classic lite and it requires classic professional.

I have dabbled with vb code in the past but haven't done anything lately so it was a fantastic refresher to have a look through the code you wrote....thanks a bunch.

This has also been a brilliant exercise in appreciating different methods of solving a particular problem thanks to all involved.

I will try it at work tomorrow.

Cheers
A Truly Wise Man Has More Questions Than Answers

#17 KidPLC

KidPLC

    Sparky

  • MrPLC Member
  • PipPipPip
  • 108 posts
  • Location:NSW
  • Country:Australia
    Australia

Posted 15 September 2008 - 06:21 PM

Hi BobL,

Sorry for the delay getting back to you.

I have tried the XLS here at work and it works a treat!!

I had one minor hickup with the "Establish Initial Values" in the subroutine it was FileName = "[String_Read_Write.XLSM]" I had to change it from XLSM to XLS and then it worked no worries.

Took me a little while to find so I used the Rockwell OPC utility that ships with linx to prove I could actually get an OPC connection then I went back through and read your code line by line.

This is a real handy bit of code and I will definately be saving it in my utilities toolbox for future use.

Thanks Bob
A Truly Wise Man Has More Questions Than Answers

#18 BobLfoot

BobLfoot

    The Wizard

  • MrPLC Admin
  • 3160 posts
  • Gender:Male
  • Location:Southern Indiana
  • Country:United States
    United States

Posted 16 September 2008 - 08:22 PM

This is a real handy bit of code and I will definately be saving it in my utilities toolbox for future use.

Thanks Bob


No problem Kid. This is a kernel snippet I crafted from the RSlinx Help Files in 2000 and have kept around and reused since then. Just updated it with each new excel.

Good catch on the filename in the xls version -- warning to all. Credit to KidPLC.
BobLfoot

"Poor Planning on your part does not a crisis on my part make"

#19 TConnolly

TConnolly

    Guru

  • MrPLC Member
  • PipPipPipPipPip
  • 942 posts
  • Gender:Male
  • Location:Salt Lake City
  • Country:United States
    United States

Posted 16 September 2008 - 09:54 PM

Bob, why don't you stick that in the downloads section if you haven't already.


#20 BobLfoot

BobLfoot

    The Wizard

  • MrPLC Admin
  • 3160 posts
  • Gender:Male
  • Location:Southern Indiana
  • Country:United States
    United States

Posted 17 September 2008 - 04:47 PM

Bob, why don't you stick that in the downloads section if you haven't already.

Duh! Thanks Alaric.

The bug fixed 2003 sheet and full zip is now in the downloads section.
http://forums.mrplc....ds&showfile=820
BobLfoot

"Poor Planning on your part does not a crisis on my part make"

#21 kaiser_will

kaiser_will

    Sparky

  • MrPLC Member
  • PipPipPip
  • 233 posts
  • Country:United States
    United States

Posted 02 October 2008 - 11:40 AM

I've updated the files after testing them.

THe new zip has three files.

*.xlsm an Excel 2007 version of the sheet.

*.xls an Excel 2003 version of the sheet.

*.ACD the version 15 file for RS5000 I tested with.

read and write strings worked for me.

Attached File  Strign_Trial.zip   145.45KB   361 downloads


Thank you to everyone for their support on this issue. We tried Bob's nifty Excel solution, and that works wonders for his RSLogix file. However, I have not done VB programming to be able to go in and edit Bob's Excel solution. If it is of little trouble to modify his source for my program, have at it. I am still fumbling around to figure out his solution with what tools I have available. The tag I am interested in with my program is MessageList and MessageListB (same thing).

Thank you.

Attached Files



#22 KidPLC

KidPLC

    Sparky

  • MrPLC Member
  • PipPipPip
  • 108 posts
  • Location:NSW
  • Country:Australia
    Australia

Posted 02 October 2008 - 06:40 PM

Hi Kaiser_will,

Bob's excel spreadsheet does work great doesn't it.

If you have already done the trial program in Bob's zip file you are 99% there already and you shouldn't need to modify the vb code at all (Alt + F11 in Excel will open the vb editor if you did want to have a look at the code).

You need to do the following to get your program reading and writing.

1. Create a DDE/OPC topic in RsLinx.

1a. First check if one already exists for your PLC open RsLinx and goto the DDE/OPC tab at the top and select "Topic Configuration" have look at the topics. If one already exists it will have the same name as your controller name if not go to 1b.

1b Creat a topic, goto the RsWho button in RsLinx and expand your network until your target PLC is visible. Right mouse click on the processor and select "Configure new DDE/OPC topic" when the window opens click on done and then yes.

2. Open the excel spread sheet and modify the values in the three "Value" cells F1 to F3. The RsLinx Topic Name will be the one you just created (the name spelling has to be exact). The string tag will be "MessageList" and the number of tags will be 352.


I only had to modify the code because I don't have excel 2007 and one of the references in the vb code is to the file itself which was "String_Read_Write.xlsm" so I changed it from xlsm to xls as I was working with excel 2003.


RsLinx ships with an opc utility called OPC test client if you go Programs then RsLinx then tools you will find it there. If you follow step 1 in the above you can have a play using the RsLinx Test Client to get a connection.

Hope this helps
A Truly Wise Man Has More Questions Than Answers

#23 BobLfoot

BobLfoot

    The Wizard

  • MrPLC Admin
  • 3160 posts
  • Gender:Male
  • Location:Southern Indiana
  • Country:United States
    United States

Posted 02 October 2008 - 08:22 PM

Kaiser_will - KidPLC hit the nailsquarely on the head. Unless the Compactlogix poses some "strange" unknown issue if you configure your topic and change the cells F1, F2 & F3 it should work for your situatrion.

BTW the downloads section has a zip file with an excel 2003 and excel 2007 versions.
BobLfoot

"Poor Planning on your part does not a crisis on my part make"




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users