Sign in to follow this  
Followers 0
kaiser_will

How to export Logix5000 taglist including string array

24 posts in this topic

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
The attached Excel File and it's macros are untested, but should read strings from the ControlLogix into Excel. String_Read_Write.zip

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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??

Share this post


Link to post
Share on other sites
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. Strign_Trial.zip

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Bob, why don't you stick that in the downloads section if you haven't already.

Share this post


Link to post
Share on other sites
Duh! Thanks Alaric. The bug fixed 2003 sheet and full zip is now in the downloads section. http://forums.mrplc.com/index.php?autocom=downloads&showfile=820

Share this post


Link to post
Share on other sites
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. J5128_093108.ACD

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Hi Bob, where can I download your zipped excel file attachment?

Thanks in advance.

Edited by Ragnar
1 person likes this

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