Importing String Length into Excel from Controllogix

downey18

Member
Join Date
Feb 2008
Location
Chicago
Posts
37
Hello,
I am trying to import machine data from a Controllogix PLC (L71) into an excel spreadsheet for my operations people to view from their cozy desk. I am using the Copy DDE/OPC Link method in RSLinx from my online processor topic. I can import most of the data easy-peasy as they are just decimal imports, but I am struggling with importing strings.
I have found previous threads that describe how to import strings and convert the data from decimal to ascii, which was very helpful. But the string I am trying to import has data of varying length. So the first import it may be 9 characters long and the next may be 5. How can I control the length of the string to import in Excel? I know there's a block size option in the RSLinx copy part, but is there a way to have that read the length of the string and adjust accordingly? I guess what I'm asking is there a way to cut off the imported string data based on it's length? Thank you in advance!!
 
If the strings in the logix were defined with custom length, you can try to copy them to a string array with standard length.
Or on the Excel side, you can use LEN & MID function to cut to the length you need
 
This is an example of the DDERequest I use all the time to pull a recipe name from the PLC. It doesn't seem to care what the string length is, so I suspect it covers what you're after.

Cells(1, 4) = DDERequest(rslink, "Recipe.Name,L1,C1")

Hope it helps.
 

Similar Topics

As the title says, I'm trying to figure out a way to import and export recipe files from an external CF card to a USB drive and vice versa. I've...
Replies
1
Views
437
I'm importing an RSView32 project into FTView SE. I'm using Legacy Tag Database Conversion on a virtual machine with Windows XP, I did the first...
Replies
0
Views
349
I am working on trying to send and receive lists of BadgeIDs and User Access levels from a windows application to my system. My current theory is...
Replies
0
Views
608
Hi all, I am doing a side project where the HMI will play an mp4 file when a certain bit turns on when I toggle it from the PLC(384kb dig I/O)...
Replies
4
Views
1,204
Long time member, first time poster. Last night our plants wireless network died, shutting the whole plant down. As a result, I have been tasked...
Replies
3
Views
1,495
Back
Top Bottom