LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make string indicator automatically scroll?

Hi - I'm afraid this is a rather simple question, but try as I might I cannot seem to find an answer to it!
 
I have a string indicator setup in my VI. I'm not sure if that is the appropriate term for it - but it's the textbox sort of VI that comes up when you right click on a string and click on create->indicator.
 
It is displaying data that is coming in over the serial port. The problem is, it doesn't scroll with the incoming data. In other words - once the visible area has filled with text, it'll keep on going down below the visible area and I will have to scroll down to there. I would like it to automatically scroll so that it is always showing the most recently read in data.
 
Can anybody suggest to me how to do this?
 
On a related note - is there any way for this string indicator to be cleared on initialization? I haven't been able to figure that out just yet.
 
Thanks!
 
-Mike
0 Kudos
Message 1 of 13
(7,057 Views)

Several possibilities.

You can keep a buffer of the last X lines, see e.g. http://forums.ni.com/ni/board/message?board.id=170&message.id=233288#M233288

If data appears line-by-line, append the new lines on top instead of the bottom so newest is top. 😉

Set scroll position via property node.

...

 

To clear a text indicator, write an empty string to a local variable of it.

Message 2 of 13
(7,046 Views)

Hi - thanks for the quick response! I think using a property node would be the best option for me. Can you tell me if I'm doing this correctly?  I added in a "property node" from programming -> application control. I then right clicked on the string indicator and clicked on "create reference". I then connected that to the property node. Problem is - when I click on "property" in the property node, I can't find a scroll position property. What am I doing wrong? If it matters, I am using LabVIEW 8.2.

Thanks!

-Mike

0 Kudos
Message 3 of 13
(7,037 Views)
Simpler:
 
SImply right-click on your text box, "create...property node". No need for references, etc.
 
Now select property "text...scroll position" and wire a suitable number whenever text changes.
Message 4 of 13
(7,031 Views)

hi Mike,

A string indicator normally scrolls automatically, meaning to emphasize that it updates the most recent data from top to bottom.

See my att VI & pic to get a clearer idea of what I imply.

U've keep one thing in mind. Smiley Wink

Only when U resize it so that it has >2 lines in visibility, then only the Rt Click -->> Visible Items -->> Scrollbar gets enabled, else the Scrollbar option is grayed out...

Hope U re cleared of Ur doubt !

- Partha ( CLD until Oct 2024 🙂 )
Message 5 of 13
(7,029 Views)


@parthabe wrote:
A string indicator normally scrolls automatically, meaning to emphasize that it updates the most recent data from top to bottom.

Your string does NOT scroll automatically. You are prepending the new text at the beginning of the string. The scroll position is always at zero in your case.
Message 6 of 13
(7,021 Views)

hi Altenbach,

Thank you for making me clear.

I was thinking in terms of scroll-bar only, NOT text scroll position...

It was a blunder from my side. Smiley Sad

But, to my disbelief, the scrollbar-visibility short-cut menu gets enabled only when I resize the text indicator to accepting >2 lines. Smiley Surprised Else, it is grayed out totally.

I'm using LV 7.1. Is it normal behaviour ?! Is it so in the later versions too... ?! Smiley Indifferent

Pl, clarify me...

- Partha ( CLD until Oct 2024 🙂 )
Message 7 of 13
(7,013 Views)

A-ha! That seems to work! Now one question though - it wants me to put in the line number that I want it to scroll to. How do I figure out how many lines my string is? (so that I know which line to have it scroll to)

Thanks!

-Mike

0 Kudos
Message 8 of 13
(6,992 Views)
you could wire the iterations terminal from the loop that you are writing to the control or just put an arbitrary value of say 10000
- James

Using LV 2012 on Windows 7 64 bit
0 Kudos
Message 9 of 13
(6,981 Views)

you can try this one,,,,,,,,,,,,,,,,

0 Kudos
Message 10 of 13
(5,815 Views)