How to Assign a String Tag to Specific Characters in RsLogix 5000 Without Using ASCII Values

Question:

Greetings, I have encountered difficulties assigning a string tag to specific characters in RsLogix 5000. Initially, I attempted to assign the string using the syntax String := 'Y'; However, upon consulting the manual, I learned that it can also be assigned to an ASCII value. Are there any other methods for assigning a string tag without relying on ASCII values?

Top Replies

If you're unsure about the meaning of ASCII values, it's essentially what you see on a computer screen. For example, the ASCII value for 'U' is represented as 0x55 in Programmable Logic Controllers (PLC) coding. You can set this value using the code: TestString.Data[0] := 16#55. This action is permitted within PLC programming.

It appears that you are assigning a literal value to a string in a PLC program. This feature was likely added at a certain version, with a minimum requirement for 5380/5580 controllers. While I am unable to test this myself with an actual PLC, it seems that a 5069 v32 controller can accept string assignments like: Code: MyString :- 'I am a string'. Please note that I have not tested this on a physical controller.

According to dmroeder, a minimum version is required and only 5380/5580 controllers can support it. However, theLogix 5000 Controllers Structured Text manual also mentions support for CompactLogix 5480 controllers with no specified version requirement. Additionally, support for the technote QA5896 at the access level "everyone" was introduced in version 29.

In RsLogix 5000, you can also assign a string tag by concatenating individual characters. Let's say you want to assign the string tag with the value "YES". You can assign it like this: String := 'Y' + 'E' + 'S';. This way, you're constructing the string without using ASCII values, but with direct character assignments. It's extremely helpful in cases where the string length changes, or you need to combine different strings or characters.

Hey there, in RSLogix 5000 you actually have quite a few options. One thing you could do is use a string literal to assign a string tag. It would look something like this: MyStringTag := 'Your String Here'; Another method would be using a STRING data type and initializing it like STR[0]:='Y'; Just remember, the first element of a STRING in RSLogix5000 is the length of the string, so don't forget to initialize it as well!

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

To add a comment, please sign in or register if you haven't already..   

Frequently Asked Questions (FAQ)

FAQ: 1. How can I assign a specific character to a string tag in RsLogix 5000 without using ASCII values?

Answer: - You can assign a specific character to a string tag in RsLogix 5000 by directly providing the character within single quotes. For example: String := 'Y'.

FAQ: 2. Are there alternative methods to assign a string tag in RsLogix 5000 without relying on ASCII values?

Answer: - Yes, apart from assigning characters directly, you can also use string concatenation or conversion instructions to assign values to string tags without using ASCII values.

FAQ: 3. What should I do if I encounter difficulties assigning a string tag to specific characters in RsLogix 5000?

Answer: - If you are facing challenges with assigning a string tag in RsLogix 5000, refer to the manual for syntax guidelines and explore different methods such as direct assignment, concatenation, or conversion instructions.

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  â†’