Red Lion Crimson 3 and ControlLogix String tags

Ken Roach

Lifetime Supporting Member + Moderator
Join Date
Apr 2002
Location
Seattle, WA
Posts
17,442
I consider myself an expert programmer with ControlLogix, but yesterday I started my first application with Red Lion Crimson 3 using String tags in ControlLogix.

As with many things in Crimson 3, it's clear once you know what to look for, but the learning curve can be steep. It took me a few hours to get my head around how this works.

I learned that only the 'Native Tags via L5K' driver supports String datatypes in ControlLogix, and I experimented my way into understanding how Crimson 3 handles padding, text justification, and writing the Length element.

The most important thing to understand is that a Crimson 3 String Tag is associated only with the ControlLogix StringTag.DATA sub-element array, which is a SINT[82] byte array. Don't attempt to point the String Tag at the whole String datatype, because it handles the length based on your definition in Crimson 3, not by the value of the .LEN sub-element.

I wrote up the results and am attaching them for my own future reference, and so they can be helpful to users searching this Forum.
 
Last edited:
Thank you for the useful information Ken. C uses a null terminator to delineate the end of a string and since Crimson programming language is C like I assume its strings are also null terminated. I haven't had to use CLX strings with Crimson before, however I have had an app that wrote null terminated strings to the CLX. To handle the length problem in the CLX I would first search FSC the string.data for the first null character and then set the .LEN from the null character position before doing any string operations with it.

FSC FSCCtrl 82 0 ALL MyString.DATA[FSCCtrl.POS]=0 ADD FSCCtrl.POS 1 MyString.LEN

This same could be used to determine the length of a string coming from Crimson should someone decide to do it in the PLC rather than Crimson. Since Crimson writes are asynchronous to the PLC scan there may be some circumstances where this is desirable, however your Crimson method is more elegant.
 
I did the same sort of file-search-compare thing in a MicroLogix to work around the way Crimson adds an extra pad character to strings with an odd number of characters.

As with so many things in Crimson, there are a lot of different ways to do it.
 
Thanks Ken! I looked everywhere for that Padding option! I think a better place would have been to put it in the Page Options under Data Entry.
 
How about string arrays?

Has anyone successfully used a string array in Crimson 3 to access a string array from a Logix controller? This could be done with individual string tags, but would save some time if I could figure out how to get the entire array at once.
 
I don't think there is an other way to do it. I have been requesting Redlion to improve the RS5000 native tag driver. Maybe more people need to do so.
 
Any updates on mapping string arrays?

I have to map an array of 500 recipe name strings from a CompactLogix to a CR1000 using Crimson 3.1. I am using the "Allen-Bradley Native Tags via L5K file Enhanced" driver. I investigated doing this programmatically and ran into several dead ends. So I bit the bullet and started doing it all manually.

First step was to make each individual tag address within the array 'available' to the HMI since I cannot map the whole array at once. Now I get the error "Maximum number of table tags reached for this device" when I get to about the 200th tag in L5K import window.

Any way around this? I thought about "add device" with a duplicate PLC with the exact same IP address. The program lets me do this, but I am skeptical this would work to get around the limit.

Surely there is a better way?
 
Surely there is a better way?

So I found a solution that should work for my particular limited use case. I just need the recipe names to be displayed on a selection screen. I only need to display 20 of these at a time. So I can create a buffer array with twenty elements and let the PLC fill them. When the operator chooses a different "page", the HMI will tell the PLC to fill the array appropriately.

Most of that was already built, I just need to implement the buffer array on both ends.
 
I'm glad I searched the forum because this is my exact issue as well. I've tried using the original L5K driver as well as the enhanced one and neither can directly handle string arrays. Arrays of other single-element data types (DINT,INT,etc) work fine, but data types that are structures don't work well. I wrote some code inside Crimson to read the strings from the PLC into an internal string array tag but it took a lot of brute force and writing them back will be just as brute-forcey. I'd REALLY like a more elegant solution. Once the information is copied into the internal string array, my programs and widgets can access it no problem. Thankfully, my widget only has to read the strings and not change them as well. That'll be handled elsewhere.
 

Similar Topics

Hi, I am trying to increase the size of the user login pop up using a Red Lion CR1000 7” HMI with Crimson 3.1 software. The login pop up is very...
Replies
2
Views
654
Hello, We are currently running a bunch of g310's connected to their SLC5 PLCs through ethernet. I've attempted to upgrade the program from 2.0...
Replies
1
Views
1,069
Hi I have been using Red Lion products for some time, I had a thought over the bank holiday weekend, As you do. It would be nice if whenever a...
Replies
4
Views
976
Well, I have yet another question for the great minds on this forum! We have a red lion HMI for one of our machines and every time I hook my...
Replies
11
Views
1,600
Yes it's very legacy.. but sometimes it's necessary to use old stuff for fun.. and because it's so much cheaper. Crimson 3.0 had the ability to...
Replies
4
Views
1,573
Back
Top Bottom