From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing text colors in string indicator (on Operator Interface) passed from UIMessage

Solved!
Go to solution

Hi,

I have an Operator Interface built based on the Simpler Operator example found here in this forum. I modified it to have a "Test Result" box which is a string indicator to display the test result (Pass/Fail/Terminated/Error etc..)

I was able to have Test stand output the right test result to that String Indicator box, but I would like to know if I can change the color of the texts that show up inside the String indicator. For example, green color for "Pass", red for "Failed" etc...

I tried using the Case structure, but not sure how I can have the cases to check when the "Test Result" string indicator output "Pass" or "Fail" or "Terminated" etc...

 

Any advice would be appreciated. Thanks!

0 Kudos
Message 1 of 8
(3,651 Views)

Wire the string value you are checking directly to the case selector of the case structure, then create a case for each value you are checking against to set a text color for the indicator (making sure to also have a 'Default' case).

0 Kudos
Message 2 of 8
(3,630 Views)

Thanks for replying. I am not sure where is the wire connection when Test stand output the string to "Test result" string indicator to be able to do what you suggest. 

 

Let me explain more. In my top level Operator interface VI, the "Test result" was only a string indicator box, then I have a VI Server Reference connected to a Configure My Events callback. Then in another event VI, there are case structure for UIMessages, and one of those is for this "Test result" string indicator. In my Test Stand, I can have an expression to output what I want to that "Test result" String Indicator using the UIMessage event number.

So I guess this string checking has to be done in the Event callbacks case structure instead of the top level Operator interface VI right?

0 Kudos
Message 3 of 8
(3,609 Views)

Attached is the screen shot of the top level VI of my operator interface which contains the "test result" string indicator, and the event callbacks for UIMessage passed from Test stand

Download All
0 Kudos
Message 4 of 8
(3,604 Views)

Yes, in the callback, at the same time as you assign the value to the indicator, also check the value (using a case structure) and change the text color property.  To get the text color property, you may need to change the reference to a more specific type

0 Kudos
Message 5 of 8
(3,596 Views)

Thanks.

I tried to do what you suggested. However in my event callbacks, the string was passed from "StringData" in UIMessage PropertyNode. I tried to create a Property Node for that string but there was no such option. I could only create a property node if I created an another string indicator but then that would only display on the front panel of the event callbacks, not my top level OI.

0 Kudos
Message 6 of 8
(3,582 Views)
Solution
Accepted by topic author dqn_flex

This is simplified slightly, but

 

get param.PNG

0 Kudos
Message 7 of 8
(3,570 Views)

thank you!! got it working!

0 Kudos
Message 8 of 8
(3,560 Views)