LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sluggish data collection will log but not plot

Please be gentle with another newbie here. Unfortunately, I am stuck using LV6 on a Windows XP machine so I am limited in some of the options I have to control data logging and event structures. However, I have done the best I can for the application with what I have learned of LabView. I am trying to set up a multichannel, continuous (long-term) data collection from the serial port which will send the data to a chart and a log. I have tried to build my own event structure to tell it to collect faster if there is a change in the data value and to collect slower when the change in the data is minimal (based on the mean values).

 

Any ideas on why this is running so sluggishly and not charting?

Thanks for all input and help!!

0 Kudos
Message 1 of 2
(1,910 Views)

Some things I see.

 

1.  You are setting a lot of properties for the charts on every iteration, along with property nodes for some other controls.  Particularly the ones involving scaling.  These cause the UI interface to need to update often.  I would recommend only writing values to property nodes in the event that something changes.  If you can use an event structure, great.  If not, just compare the old value to the new value and only write out values if they are different.

 

2.  I can't tell if anything controls the speed of you main while loop.  You might want to put in a small wait statement.

 

3.  Don't open and close the serial port on every iteration.  You are actually doing it several times within an iteration.  Open it once, Read and Write to it in a loop. Close the port when the program ends after the loop.

 

4.  Some of the stacked sequence structures seem suspect.  Some are using dequeues from the same queue in every frame, only to OR all the data together at the end.  It seems like a For Loop would be a better choice.

 

5.  Do all your graphs need to be single representation?  Make them double.  You can also avoide the bullet conversion from double to single in your Scan from String functions if you wire a single representation constant into the type terminal of the Scan from String function.

 

I'm sure there are more things that could be fixed, but I really suspect #1 and #2 as the main problems as to why your code seems sluggish.

0 Kudos
Message 2 of 2
(1,893 Views)