Sign in to follow this  
Followers 0
Hardatwork

PLC5 Read String data file via OPC to Excel

3 posts in this topic

Hi all, I need a bit of help if anyone has some hard knowledge on how to get this done, I would be really happy. Task: Retrieve x number of Data Files [string Type] each Data file contains 100 elements (beginning to sound like a recipe manager yet???) and put the strings into excel. Objective: Compare PLC parameters with Master BOM, Write new variants to PLC if Master BOM changes. Problem: How do I read a String from the PLC with OPC? Software: RSLogix 5 V5.2.1, RSLinx Gateway Edition V2.5 Hardware: PLC5/80C 1.5, DH+ to PC Running RSLinx Gateway. I have set up the OPC topic. When I go to Edit>Copy OPC/DDE Link in RSLinx I can navigate to a String Data File, Expand the Data File and Select an Element but Linx only produces a link to element .LEN. When I change the Data Type to anything other than native RSLinx will not produce an OPC link to the String at all. I am willing to accept that this might not work, if so, some alternative would suffice as long as it won't cost any money . I do have access to a RSSQL/Transaction Manager system but no one here knows how to add new data to it right now. That's all i can think of right now. Once again, any help would be greatly appreciated. Cheers....

Share this post


Link to post
Share on other sites
I just tried this with a SLC 5/04: Using RSLinx Edit menu to copy the link as you normally would, selecting the .LEN element then paste the link into excel as a link. Then edit the contents of the cell, removing the .LEN, and the length and columns stuff from the end of it. When I did this, the contents of the string itself appeared...Looks like a weakness within the Copy Link browse window that it doesn't populate with string data...DDE/OPC still seems to work with them though. I would expect this to also work with a PLC-5 Topic. Now where you are going to get into serious trouble is if you try to have a hot link to a bunch of strings like this...you'll overload the comms...Each string can be 82 characters (41 bytes) long...If you need to read a whole bunch of them, then use the VBA editor to open and close the connection and read the data rather than have a hot link running as fast as the topic update rate. On my SLC connected via a NET-ENI, about three strings is all she'll handle before I start getting "#N/A" in all the cells. Your application sounds like it would be better suited for a VBA script to read the strings one time, then make the comparison, and then do the writing...just be aware of the potential to overwhelm the communication channel if you try to read too many too fast... Hope this helps, Paul Edited by OkiePC

Share this post


Link to post
Share on other sites
Brilliant, Thanks so much Paul. That worked fine. Strange bug, had me scratching my head for a day... Thank you.

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