LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Improving Write to Measurement File Rate

Hello again everyone,
I was wondering if I could once again get some help with my VI which is dealing with data aquisiton, display and logging. I'm attempting to display and record all the data that is incoming serially from some external ADC boards. The data is received at 500Hz and I am trying to currently record this through the use of Write to Measurement file, however i'm finding that I am not recording all the data that is captured into the file. When I tested this code I found I was only getting a recorded sample rate of about 3Hz... I'm looking to reach at least recording the data at 50Hz minimum, however i'm having trouble figuring out how.

I currently have a global loop with a delay of 100ms, however reducing this increment did not noticeably increase the rate at which the data is recorded. I suspect it is due to the time taken to carry out everything within the loop, however I don't know how to improve this, using a different structure perhaps? If someone could take a look at my VI and give me some pointers on how to improve the cycle rate that would be awsome.

Also, I find that the display is quite laggy in displaying the incoming data. Again this wasn't improved by changing the delay in between the loops or selecting the synchronous display option. The delay in inputing data at the ADC and seeing the result on the screen was somewhere around 1 second!

Any help would be greatly appreciated as I don't know how to sort this problem out.

Thanks in advance!
Stirling
0 Kudos
Message 1 of 5
(3,491 Views)

Hi Stirling,


I don’t think it’s a problem with the Write to Measurement File.vi. You need to have a look at the VISA Read.vi. You are reading 5K at every iteration of the loop and that could probably be causing the delay. A great way to troubleshoot this would be to turn on highlight execution.

Also, you should consider using the Array to Cluster.vi and the Convert to Dynamic Data.vi in the Write to Measurement File.vi block. This shouldn’t effect anything; just a suggestion to take advantage of LabVIEW functions.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 5
(3,471 Views)

The express VI and the dynamic data stretch carry a lot of extra baggage. You also write ASCII, causing expensive formatting operations.

I would suggest to open the file outside the loop, append binary data (your integer array) to the open file inside the loop, and close the file once the loop has finished.

0 Kudos
Message 3 of 5
(3,466 Views)
Thanks for all the help!
It seems like I was reading too much from the serial port and holding up the loop. The write to measurement file does chew up a lot of time, I couldn't get it past 25 samples per second. However writing to a file straight in binary has got the record rate right upto 200 samples per second! Only down side is that it will need post processing to make it legible.

Just another quick question, what would be the best way to time stamp the packets? At the moment i'm using the Tick Count milisecond counter and converting its output to a 16 bit interger that gets recorded along with the other data, it obviously gives good accuracy however with 16bit I only get 65 seconds before it starts again from zero. Is there another way around this other then recording the time stamp at 32 bit?

Thanks again
Stirling
0 Kudos
Message 4 of 5
(3,450 Views)
Hi Stirling,

I don't think there is any other way around it. Tick Count (ms) in 32 bits is definitely the best solution.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 5 of 5
(3,445 Views)