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.
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.
11-06-2018 03:18 PM
I feel this should be simple but I can't figure it out. I perform three tests. For each test I output either 'Test x Passed' or 'Test x Failed' as a text string. I concatenate the three strings with a carriage return and display them in a status box (a string indicator.)
I want to turn each line of text red or green depending on whether it passed or failed. So I could have:
test 1 passed
test 2 failed
test 3 passed
I can't see a way of doing this. Help me out please, experts of LabVIEW!
11-06-2018 04:00 PM
Hi novice,
you can select parts of the text using property nodes, then change their font settings (including colour) using other property nodes...
I recommend to use a table or a listbox as this will simplify the text colour settings a lot!
11-06-2018 04:12 PM - edited 11-06-2018 04:13 PM
I agree a table would be much easier. Here is an example of how you could do it in a single string
11-07-2018 11:02 AM
That works great! Thank you!
Just one follow up question if I may ... when I feed the output string into a local variable the colors are lost. I'm using a local because I write to the 'status' text box from various places in the program.
I don't want to take up any more of your time, but if you have any suggestions I'd be grateful
11-07-2018 11:13 AM
@another_novice wrote:
That works great! Thank you!
Just one follow up question if I may ... when I feed the output string into a local variable the colors are lost. I'm using a local because I write to the 'status' text box from various places in the program.
I don't want to take up any more of your time, but if you have any suggestions I'd be grateful
Without seeing your code we can't really say. However giving basic advise would be to structure your code so that UI handling and updates are centralized so you eliminate the need to use the local variables.
11-07-2018 11:19 AM
You have to make sure the value of the string is updated before you start selecting parts of it. You could do this with a local variable and a sequence structure, or with a property node. The error wire below makes sure the For Loop doesn't run until the value of String has been updated. Property nodes are a bit slower, but if this is something you write once after a couple of tests, you won't notice.
Disclaimer time: if you find yourself having to use local variables and value properties a lot, then you are probably just "programming as you go" and not planning out the application enough. Once you plan it out and use a reasonable design pattern, you will be writing to the terminals most of the time.
11-07-2018 12:48 PM
Appreciate all the suggestions and feedback. Thanks guys!