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: 

Array display in front panel slows down when scrolling

Has anyone ever noticed that sometimes scrolling and clicking can effect the way things are being displayed on the front panel?

 

My program uses some VIs that log data trough a SIO4 card, and when I display the 28 bytes in an array in the front panel, they update continuously. But if I scroll it slows down, and continuous scrolling makes them completely stop updating. I tried just making a simple for loop that puts some random values into an array and display it, but here it doesn't happen.

 

Has anyone ever had similar issues or noticed this problem? It's not just the esthetics, it's messing with how my data logs as well.

 

Thanks

0 Kudos
Message 1 of 16
(2,687 Views)

You should probably upload your code if you want a more detailed response.

 

But I have some tips:

 

Yes, this is a common issue.  It can be caused by many things, such as:

 

-  Perhaps the code for your UI and the code for your data-acquisition are in the same loop or thread. 

-  It can also be caused by improper use of property nodes

-  And be care when using the "Synchronous Display" proprty on your controls/indicators

 

Best way to solve this issue is to split the code into separate loops.  Or even into separate VIs which and put them in separate execution systems (threads).  Especially if the timing of your daq process is important.

http://www.medicollector.com
0 Kudos
Message 2 of 16
(2,676 Views)

Thank you for the tips. I think I might have discovered part of the problem. The FIFOs on the serial card is 4k, and the sensor sends 28byte packages at 400Hz, so that means 11,4k of data per second. This sort of explains why it works when left alone, but any event, especially mouse scrolls, causes weird data results (shifts and data loss).

 

Does this sound reasonable? Is there anything I can do to minimize the time windows spends on these events, or do I need to get a new card with bigger FIFOs?

 

Thanks again!

0 Kudos
Message 3 of 16
(2,670 Views)

josborne answered your question before you asked it.

 

Search on "Producer/Consumer" to learn about a design pattern that uses multiple loops to do more than on ething at a time.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 16
(2,668 Views)

The program runs fine the way it is now if it is left alone. No problem gathering and displaying the data. It only reacts to external events such as mouse scrolling, changing windows, clicking etc. Would chaning the design have any effect on this? After initialization, the program enters a loop that only aquires data and passes it to an array. Thats it. I dont really see how that can be optimized?

 

Thanks for your inputs guys!

0 Kudos
Message 5 of 16
(2,662 Views)

@q-bertsuit wrote:

The program runs fine the way it is now if it is left alone. No problem gathering and displaying the data. It only reacts to external events such as mouse scrolling, changing windows, clicking etc. Would chaning the design have any effect on this? After initialization, the program enters a loop that only aquires data and passes it to an array. Thats it. I dont really see how that can be optimized?

 

Thanks for your inputs guys!


I can esily imagine someone being offered an aspirin tablet years ago reacting similarly saying "I don't see how putting something in my stomach is going to help my headache."

 

GUI updates are handled in a single thread.

 

When you are not touching the screen the GUI thread has little to do. WHen people are poking at it it has to work harder.

 

If the sinlge thread is part of the code flow, it becomes a bottle neck.

 

You fix the bootle neck by getting it out of the way of the other tasks. That can be done by seperating the work so the GUI stuff is not involved with the acquistion work.

 

YOu don't have to change it if you can live with it.

 

I am just trying to explain what you are seeing and offer a method to change it.

 

Its your call.

 

have fun!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 16
(2,659 Views)

I had every intention of trying out your suggestion! I started working on it before I wrote the post, I just wanted to understand why it would help. Thanks for clearing that up for me. I'll let you know how it goes.

0 Kudos
Message 7 of 16
(2,646 Views)

I still really would like to see your code.

 

"but any event, especially mouse scrolls, causes weird data results (shifts and data loss)."

 

Are you using an actual event structure or are you using the term "event" generically?

0 Kudos
Message 8 of 16
(2,643 Views)

I tried both using local variables and using queues as suggested, but they didn't seem to have any effect.

 

Altenbach: I'm using the term generically.

 

I got rid of all unnecessary code and added queues. When this program runs, the array in my frontpanel updates continuously. I can see that everything is as it's supposed to because array number 5 is always a "1". Then, if I scroll the mouse wheel or open up firefox or something, the data gets messed up. Like I said, runs smoothly if I leave it alone.

 

The "receive data and wait" VI has to run quite often, as the FIFOs gets filled up every 44ms. The FIFO counts function displays how full the FIFOs are. Normally no lamps are lit, but after a mouse scroll they pretty much all light up, then they turn off again as the receive VI gets to run again, but by then a lot of data has been lost..

 

untitled.JPG

0 Kudos
Message 9 of 16
(2,641 Views)

How many CPU cores does your computer have? More than one?

How are you interfacing to the instrument? Seems like you are using serial.

Can you show us the code where you setup and read from the connection?

 

What is happening in the two central subVIs in the two while loops?

Are they both accessing the same serial port? What's in them? Who wrote them?

Why is there a 9-frame stacked sequence?

What determines the loop rate of the upper while loop?

 

This really cannot be debugged by a picture that only show a small fraction of the code.

0 Kudos
Message 10 of 16
(2,632 Views)