LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different fonts in string indicator

Solved!
Go to solution

Hello,

i have a string indicator that is limited to a special nuber of lines that can be changed during runtime.

In this indicator i show logging-infomations what is currentyl send and read on the comport.

Now i want to display the lines in different colors dpending on the comport. The lines can be separated with ">" (for send data) and "<" (for recived data).

 

I already found this article in the forum:

http://digital.ni.com/public.nsf/allkb/6BD344ACA4DEE20A8625692700737E16

 

Does someone have an idea how to bring this into my form? The problem is that the Start and Stop index is different because line2 becomes line1 if the MaxNumerOfLines is reached in the string-indicator.

So i need something like a subvi where the whole content of the indicator, a character and a color is input....

But how to do this?

 

The string indicator should look like this (there is one line for each telegram)

2011.02.02 : COM7 > hello

2011.02.02 : COM8 < hello

2011.02.02 : COM7 > hello

2011.02.02 : COM8 < hello

2011.02.02 : COM7 > hello

2011.02.02 : COM8 < hello

2011.02.02 : COM7 > hello

2011.02.02 : COM8 < hello

 

Or any other ideas how to make the log more readable. Currently you have to look for the > or < to see if it is a send or read data.

 

Thanks for help

 

0 Kudos
Message 1 of 10
(8,168 Views)
Solution
Accepted by topic author OnlyOne

Try this and ask any questions that arise.

 

stringColor.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2 of 10
(8,152 Views)

Hi Jim,

thanks for your solution. Works perfect but its to solow to use it 😞

The String-field gets too fast new values and with each new line i have to rebuild all colors because the lines are switching.

And then it begins to blink and looks strange because the color upate is from top to down and not all at the same time.

 

0 Kudos
Message 3 of 10
(8,140 Views)

Use a producer/consumer architecture. Let the string indicator change color while your producer loop collect new data. Then update the string indicator when you want to.

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 4 of 10
(8,131 Views)

This is what i currently do.

I have a queue taht is filles by other steps and the log-vi that reads out the queue all 50ms.

In the log-vi i just take the current content of the string-indicator and "concatenate" it with the new queue-content - then the result goes back in the string-indicator.

0 Kudos
Message 5 of 10
(8,127 Views)

I added an example to show my blinking problem.

I used Jims solution, put in in a subvi and added a reference as input. Then i pass static text to the subvi.

Normally the color should change only once - why is it blinking?

Thx

Download All
Message 6 of 10
(8,117 Views)

your simply loop structure make it blinking.

you can use event structure, state machine or other structure to avoid it.

0 Kudos
Message 7 of 10
(8,106 Views)

But why does the text-color go back to black after i changed it to red?

At the end of teh loop all text is correct colored (can be seen with beakpoint. But at the start of the next loop everything goes back to black.

Seems as if the changed reference-values inside of the sub-vi get overriden at the next call...

Makes no sense that it blinks.

 

0 Kudos
Message 8 of 10
(8,103 Views)

Try Deferring Panel Updates.

 

DeferUpdates2.png

Message 9 of 10
(8,089 Views)

Is there a way to change font color on the fly and not to scan through the entire string.  This is helpful when the string size gets large.  For example, we keep the font color format of the existing string and only format the most recent concatenated lines.

0 Kudos
Message 10 of 10
(7,135 Views)