How to Create a Constant String Tag in Studio 5000 CompactLogix 5380

Question:

Greetings,I am programming a CompactLogix 5380 using Studio 5000. My goal is to create a constant string tag named strDefault and populate it with the text "Default". When attempting to add this tag to the Controller Tags, I encounter an issue where I am unable to input any text (Default) in the Data -> Value field. Additionally, I am unable to fill in values for strDefault.LEN and strDefault.DATA[x]. While I can work around this by using a MOVE instruction in a routine on the first scan bit, I am curious as to why I cannot create a constant string tag directly. If anyone has insight on how to accomplish this, I would greatly appreciate it. Thank you for your help. - Maurits

Top Replies

I have successfully resolved the issue. Initially, I mistakenly created the tag while in Edit Tags mode instead of Monitor Tags. By entering the string 'Default' in Monitor Tags, I was able to resolve the issue. In Edit Tags, remember to select Constant Yes to ensure the tag remains constant. This simple adjustment will help streamline your tagging process and ensure consistency in your work.

Hi Maurits, the difficulty you're facing may stem from stringent restrictions in Studio 5000 concerning setting values for String Array tags directly. Unfortunately, it currently doesn't support direct assignation of values to string tags at runtime, let alone initialization. Your work around with the MOVE instruction is a savvy solution. Hopefully, Rockwell adds this feature in future versions as this would definitely be a useful option to have and also save some runtime program space. Keep troubleshooting and innovating!

Hey Maurits! It sounds like you're hitting a common issue with how strings are handled in CompactLogix. Unlike simple data types, strings in Rockwell's environment require initialization in a different way. Normally, you can't directly assign string literals to tags in the Controller Tags section; instead, you can create a string tag in a routine and use the MOVE instruction like you mentioned. Alternatively, you can use a "String Constant" data type if you want to utilize a constant within your program logic. This allows you to define a constant value for your strings more efficiently. Hope that helps clarify things a bit!

Hi Maurits! I totally understand your frustration; creating constant string tags can be tricky in Studio 5000. The limitation you're seeing with not being able to enter a value directly for a string tag in the controller tags likely stems from how CompactLogix handles string attributes. Unfortunately, string tags can’t be declared as constants in the same way that numeric or boolean tags can. The workaround you mentioned using the MOVE instruction on a first scan bit is a solid approach. Alternatively, you might consider creating a string user-defined type or look into using a static routine to initialize your tags. Hopefully, that helps clarify things a bit!

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. Can I create a constant string tag directly in Studio 5000 for CompactLogix 5380?

Answer: - Currently, creating a constant string tag directly in Studio 5000 for CompactLogix 5380 might not be straightforward due to limitations in the software. However, there are workarounds like using a MOVE instruction in a routine on the first scan bit to achieve this.

FAQ: 2. Why am I unable to input text in the Data -> Value field when creating a constant string tag in Studio 5000 for CompactLogix 5380?

Answer: - The issue you are experiencing with not being able to input text in the Value field for a constant string tag in Studio 5000 for CompactLogix 5380 could be due to software constraints or settings. Using alternative methods like the MOVE instruction may be needed in this scenario.

FAQ: 3. How can I populate a constant string tag with specific text like "Default" in Studio 5000 for CompactLogix 5380?

Answer: - To populate a constant string tag with specific text like "Default" in Studio 5000 for CompactLogix 5380, consider utilizing workarounds such as employing a MOVE instruction in a routine on the first scan bit as a solution, given the current limitations you are facing.

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  β†’