How to Display Partial Values of String Tags in FactoryTalk View SE V10

Question:

While trying to display only part of a string tag's value, I am unable to find a straightforward solution using text or string objects. It seems that the only option available is to concatenate strings together. For example, if the string in {#100} is "Sump Pump 23", I can add text like {#100} + " Running" to get "Sump Pump 23 Running". However, there doesn't appear to be a direct way to display just "Pump 23 Running" without additional functions like MID in Excel.

Top Replies

If you're not comfortable with VBA, it may seem like the only option is to concatenate strings. However, I discovered a workaround using the string variable "Fixed number of characters" and "Right-most characters in string are displayed" options. By utilizing this method, I was able to display the last 5 characters that I required. It's possible to remove characters from the front but not from the middle or left. This raises the question: why include a right option but not a mid or left option?

If you are new to Rockwell HMIs, be aware that their HMI products may not meet your expectations. There are numerous instances where they fall short of what is expected.

Looking for a new mouse with a scroll wheel?

LoganB inquired about the functionality of a mouse scroll wheel. Visit this discussion thread for more information: http://www.plctalk.net/qanda/showthread.php?p=753587#post753587. @Tanquen suggested using VBA to easily extract substrings. Utilizing VBA wisely in FactoryTalk View (FTV) can help avoid potential issues.

Why should I consider using VBA in my software development process? Although it may seem complicated at first, there are numerous benefits to using VBA. While it may require additional objects and precautionary measures to prevent slowdowns, VBA offers a range of functionalities that can streamline tasks. Despite its historical use and longevity, there are still unresolved issues such as disappearing handles when selecting objects, which can be frustrating for users. Additionally, the high cost of certain software packages and difficulties with implementing protocols like OPC-UA can be barriers to efficient workflow. In my experience, incorporating VBA with global objects has presented challenges, leading to crashes and corrupted screens. Despite these obstacles, VBA remains a valuable tool with the potential to enhance productivity and streamline processes in software development projects.

Absolutely, you're right that it can seem a bit convoluted. However, instead of directly using text or string objects, you might want to consider using string methods or string slicing. These allow you to extract specific substrings from a larger string without concatenation. If your programming language supports it, find and utilize a method like "substring" or "split." These functions allow you to divide the string at specific indices, or at certain characters, respectively. That way, you can directly target and display "Pump 23 Running" with a more precise approach.

It seems like you're looking to manipulate strings here. While concatenation is one of the easier methods to use, you can also take advantage of substring methods available in many programming languages. These allow you to specify the part of the string you want to display. For example, in Python, you can do something like 'Sump Pump 23'[5:] to start at the sixth character and go to the end, resulting in "Pump 23". Then you could concatenate this substring with " Running" to achieve your desired output. Depending on your software or programming language, there should be similar functionality available, so no need for Excel's MID.

I understand the challenge you're having. It seems like you want to manipulate the string more dynamically than just gluing pieces together, similar to how functions like MID() operate in Excel. One way to achieve this is through the use of scripting languages such as JavaScript or Python, that offer powerful built-in string manipulation functions. You might use the "split()" function to separate your string by spaces, resulting in ["Sump", "Pump", "23"]. Then, you'd just need to join the elements you want. Concatenation still happens, but the key is that you're breaking your string into manipulable parts first. Your PLC/SCADA software might support integrated scripting or there may be APIs available. Keep in mind to check for any security implications before proceeding.

It sounds like you're running into some limitations with string manipulation. If you're looking to modify the displayed output without concatenating, have you considered using regular expressions or similar functions if they’re supported in your environment? They can help you extract just the part of the string you need, like "Pump 23" from "Sump Pump 23". It might take a bit of extra work to set up but could be worth it for cleaner output in the long run!

I totally get your frustration! It can be tricky when you're trying to manipulate strings without a lot of built-in functionality. If you're looking to just extract part of a string and combine it with something else, it might help to look into regex (if supported) or even writing a small function to handle the extraction for you. That way, you could specify exactly what part of the string you want to keep without relying heavily on concatenation.

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.

You must be a registered user to add a comment. If you've already registered,
sign in. Otherwise, register and sign in.

Frequently Asked Questions (FAQ)

FAQ: FAQs:

Answer: 1. How can I display only part of a string tag's value in FactoryTalk View SE V10? - To display only part of a string tag's value in FactoryTalk View SE V10, you can concatenate strings together to achieve the desired output. For example, by using the expression {100} + " Running", you can display a modified version of the string tag's value.

FAQ: 2. Is there a direct way to display a specific portion of a string tag's value without using additional functions like MID?

Answer: - In FactoryTalk View SE V10, there isn't a direct built-in function to display a specific portion of a string tag's value without using additional functions like MID. You can achieve this by concatenating strings and manipulating the output to display the desired partial value.

FAQ: 3. Can I display a substring of a string tag's value in FactoryTalk View SE V10 without complex Excel-like functions?

Answer: - While FactoryTalk View SE V10 may not offer a direct method to display a substring of a string tag's value without complex functions, you can still achieve partial value display by creatively using string concatenation and manipulation within the software.

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