LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Auto scrolling buffer for Serial recieve

Solved!
Go to solution

Refer the attched VI ( LV2012)

 

Data arrives at the input buffer to this VI once every second.

 

With the setup as I have I am able to see it but only for a second and then a new ones comes.in. I tried concatenating but that works till only the visible range of the indicator I have.

 

What I need is  an auto scrolling indicator that adds a  vertical scroll bar the moment the values go out of the lower edge of the indicator.

 

Any ideas ?

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 4
(3,280 Views)
Solution
Accepted by MogaRaghu

Hi Raghu,

 

I tried concatenating but that works till only the visible range of the indicator I have.

There is no concatenation in your current VI - no wonder you only see the latest value until a new one comes in!

 

What I need is  an auto scrolling indicator that adds a  vertical scroll bar the moment the values go out of the lower edge of the indicator.

At first you need to concatenate new values to the old ones.

When there are more than 8 (adjustable) lines of strings you could enable the scrollbar of the string indicator. And you can even set the scroll position of the scroll bar - it's all done using property nodes of that string indicator!

 

Btw: Concatenating new strings in front of the old ones enables your user to see the most recent values instantly…

 

Moreover: when enabling the TermChar for a serial communication you should get rid of BytesAtPort!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(3,268 Views)

Yes its working now after I brought in the changes suggested by you. Actually the point regarding adding the current value in "front" of the earlier value did the trick -  earlier while concatenating i did it "after " the earlier one and so very soon the updates fell out of the indicator ! In fact with this done, I dont even need a scroll bar to view as the new  data keeps pushing the old data down !

 

Anyway I brought in the scroll bar to be able to view past history.

 

Only thing,  if I remove the "Bytes at buffer"  it still works but i loose some characters particularly more in the begining of the init process. And the it gets tricky to stop the loop at times...

 

Since I am not "waiting" to get all the bytes at the buffer, i am running it in a non blocking mode and there is no problem with this approach.

 

Of course my constant fed into the Read function should be always more than expected bytes not to loose any bytes !!

 

Thanks Gerd.

 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 3 of 4
(3,234 Views)

GerdW wrote:

Moreover: when enabling the TermChar for a serial communication you should get rid of BytesAtPort!


I would say the OP is actually using the Bytes At Port correctly in this case.  It is just used to see if a message has even started to come in.  If not, wait and check again.  If there is any data, then the large constant will allow the termination character to be used.  This is a good setup for sporatic messages.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(3,227 Views)