Code Comments
Programming Forum and web based access to our favorite programming groups.Hi all, I am attaching my labview code with this post. My problem is t hat the code runs correctly with "write to lvm file" applette. Without this aplette the waveform shows a continuous graph. But when I add this applette to store the data, the wave form gets broken. It updates after every 100 - 200 sec. Eventhough I used X- scrollbar, I am not able to access the data onc3e it gets updated.Is there a ny other method to store the data from DAQ.?I tried to store it spreadsheet, and also used write to TDM file. But in vain. I have been trying this out since 4 days. I don't know wh ere am I wrong. Please help me out. Data Acquisition from 6 Sensors.vi: http://forums.ni.com/attachments/ni/170/313000/1/Data Acquisition from 6 Sen sors.vi
Post Follow-up to this messageStoring data as text takes a long time. LVM, TDM, and ASCII are all te xt. The overhead of creating the and storing the data is taking longer than the DAQ card is taking for each set of data. As a result, you ar e getting data overruns on the DAQ card - look at the error out output of the DAQ Assistant while the p roblem is occurring. Fortunately, there are two things you can do to m ake things better. You should probably do both. - Do not use a text format. You can either use raw binary using the VI s from the File I/O palette or NI-Hierarchical Waveform Storage (NI-HWS).&nb sp; NI-HWS is the easier of the two. If you do not have NI-HWS, you ca n get it with almost any of the measurement device drivers (e.g. NI-SCOPE). Make sure you open the file before you run the loop and close it after the loop exits. - Do your file storage in a parallel loop to your data acquisition. Th is is called a producer/consumer architecture. You can find examples i n the LabVIEW examples. Use a queue to pass data from the acquisition loop to the storage loop.&n bsp; This will allow your data acquistion to run at full speed, relatively i ndependent of the file storage (they still use the same processor). Using these two methods will allow you to write data to disk at hardware lim ited speeds. Note that there are a few other things you could do to make your code simple r. - Since your processing is the same for all channels, there is no need to br eak the data up into individual channels before processing. The proces sing blocks can handle multiple input waveforms. - There is no need to query for the current time six times outside the loop and six times inside (you can wire an output to multiple inputs). This also will reduce the number of calculations you need to set the timestamps. - You can convert your dynamic data into an array of waveforms subtract the starting timestamp from the original in a FOR loop - no need to query for the current time inside the loop, the DAQ Assistant already gives you th is information. This will get rid of the incorrect dt value, duplication of Y values, and dubious timestamps. Good luck. Let us know if you need more help.
Post Follow-up to this messageDear DFGray, Thanx for the help. I don't have NI-SC OPE and NI-HWS installed on my PC. And also I am short of time. So, I used t he same code. It ran continously for 6 sec. That what I needed the most. I m ade some changes in the cod e. Used mathematical operations instead of formula palette. It code gave me the results continuously for 6 sec. Anyways, thank you ve ry much for your help.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.