LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

logging rate in labview

I am using Compact DAQ-9172 to acquire various signals from instruments on a valve. I have written the code to log this data to a csv file. However I want to log at 40 times per second- hence I have set the wait to next ms multiple to 25ms (see attached portion of code). When  I open up the log file, i find that the data hasn't logged at anywhere near this rate.
Does anyone have any suggestions?
 
Thanks
0 Kudos
Message 1 of 8
(3,179 Views)
Jamie asked "Does anyone have any suggestions?"
 
Yes convert over to a Producer Consumer architecture (Search this forum for Producer Consumer)
 
Explanation:
 
Every thing in your loop must complete before it can re-iterate.
 
Opening, writing, and closing takes more than 25 ms (in fact just opening may take seconds).
 
By switching over to a Producer Consumer and in the consumer side, open once, write repeatedly, close when all done your code has a chance of keeping up.
 
I have used this approach (and a couple of tricks) to track 40,000 channels at up to 1000 Hz with good results.
 
Trying to help,
 
Ben
 
PS Your DAQ functions will prbably benefit from the open once ,.... approach as well.


Message Edited by Ben on 03-12-2008 08:21 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 8
(3,171 Views)

Thanks Ben for taking the time to point me in the right direction. I have had a look at the template in labview and I am struggling to convert my code into this format as I am fairly new to labview and unfamiliar with this approach. Could you post an example based on my code of how I can go about this. I am using labview 7.1

 

Many thanks.

0 Kudos
Message 3 of 8
(3,146 Views)
"Could you post an example based on my code of how I can go about this."
 
Yes I could but I would not be serving you or myslef by doing so.
 
What I suggest is that
 
1) you do your best and then post ALL of the VI's associated with your app (zip if you have to)
 
2) Define your questions clearly re:what you understand and what you don't.
 
3) Post images (like you did to start) of the code that is giving you trouble.
 
4) Standby and brace yourself for some scathing (sp?) feedback.
 
5) Carefully read any responses you get and update your code.
 
6) If you still have trouble, "lather rinse repeat".
 
We (the gold-bars) are all volunteers in this forum. We attempt to "hook" users into loving LabVIEW by teaching and sharing our knowledge. If you ride out the rough parts and keep trying, I hope you will someday become comforatble with LV and learn to love it as much as the rest of the "nut-cases" that prowl these forums.
 
Trying to help,
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 8
(3,141 Views)
ok thanks.
0 Kudos
Message 5 of 8
(3,139 Views)

Ben,

I tried to edit my code into the producer consumer format, but I get an error- "An error ocurred while compiling this VI" am i on the correct lines. I have attached a jpeg to have a look at.

thanks 

0 Kudos
Message 6 of 8
(3,113 Views)

Hi Jaime

It looks like you are on the right track with converting your code to a producer consumer architecture. What error are you getting while compiling?

Regards

Beejal S
NI UK & Ireland
0 Kudos
Message 7 of 8
(3,059 Views)

I have solved the problem. I did this by breaking up the DAQ assitant and only reading the value in the while loop. All other tasks are performed once outside the loop. I am now getting the update rate I need. When I changed to the producer consumer architecture, I still had the problem with the log rate due to the express VI, so would need to do the same.

Thanks.

Message 8 of 8
(3,055 Views)