Sign in to follow this  
Followers 0
ianbuckley

String constant in RSLogix5000

5 posts in this topic

I have a 1769-L23E-QBFC1B. I am programming with RSLogix 5000 Mini. I am trying to set up a simple messaging scheme between Ch0 RS232 to a controller with an RS232 port (small manufacturer). I was thinking of setting up a scheme such as "1=<Data><CR>" for parameter 1, "2=<Data><CR>" for parameter 2, etc. where <data> is the ASCII representation of the value of the parameter. I would use a simple echo from the other controller to verify the data transmission. I can get the data loaded into the message and get it sent out of Ch0 with no problem. My problem is inserting the string constant "=" into the string tag. Of course, any delimiter would work, it does not have to be "=", but I can't seem to figure out how to be able to insert a constant of any kind into the string. All of the examples in the Logix 5000 ASCII Programming manual are using string tags that already have values. It seems like it should be simple to do, but nothing I try is working and it is starting to remind me why A-B uses an octagon for their symbol (the universal symbol for stop). I can use DF1 if I have to, but I'd rather avoid all the overhead and resource usage of a DF1 driver in the other controller if I can. Can anyone tell me the format for a string constant in RSLogix 5000? Thank you for your help. Ian

Share this post


Link to post
Share on other sites
Set up a string with the ASCII constant already in it then append that string.

Share this post


Link to post
Share on other sites
That's just it. How do I set up a string with an ASCII constant in it? How do I load the ASCII constant into the string tag? Ian

Share this post


Link to post
Share on other sites
Maybe I'm misunderstanding your question; you place a constant value into a string tag the same way you place any value into any tag; look at the Tag in the RSLogix 5000 tag database in "View" mode, and click the ellipsis button that shows up in the tag value field. Sometimes instead of relying on a static tag entry to define a string constant (since that can be modified by accident), I write rungs that manually place the ASCII bytes into Stringname.Data[x] elements, and manually set the Stringname.LEN value. To compose your ASCII string, I would perform an Integer to ASCII conversion to get the Parameter Number and the Value in ASCII string format. Then I'd add 1 to the Parameter Number's string length and move an ASCII "=" (decimal 61) into the last character slot. Then concatenate the Value string onto the Parameter Number String. Finish by transmitting with a Carriage Return as the termination value.

Share this post


Link to post
Share on other sites
I knew it had to be something simple. I am used to needing the program to explicitly load a value into a variable. (Move "=" to Msg_Delimiter). It did not occur to me to just enter the value in the value field of a tag used in the program offline and the value would be used online when downloaded. Most controllers I use do not work that way. I am used to the value field simply showing the value when online and not being applicable offline. Thanks for your help. Ian

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