10-17-2013 03:23 PM - edited 10-17-2013 03:50 PM
Hi. I'm new to Labview and am having am having trouble with something relatively simple. I am using Labview 2013 on an XP PC with a USB-1208LS from mcc. I don't have internet access on that though so my pics are in mac version and it doesn't recognize the mcc modules, but you'll get thte idea. So I made a sub-vi to read out voltages from 4 pins on an analog output to the DAQ. I have the voltages spitting out in a waveform (1D Analog NChan Nsamp) to an indicator which I'm just making a data hub. I then insert the vi into a while loop to get the data and save it to a spreadsheet. However, the sub-vi is spitting out multiple data lines per minute. The rate of the DAQ is 100-1200Hz so I thought maybe taking 1 sample per channel would set that to 1 second intervals. I was wrong. I also tried adding a mean function before my calculations of concentration. So pics below show the vi's. The Analog is taking Dev0/Ai0:Ai3 (it cut off). I've played with the placement of Mean and with the rate/samples settings. I want it to spit out one data point per second. Right now its spitting out between 5 and 10 data points per second (see example below).I want 1 data point per second that may average all those data points within the second. Any help is very much appreciated. I'm hoping this is an easy fix. Ive tried to follow some of the posts, but don't understand half of it.
Example data out right now:
10/17/13 19:00:38 0.000128645 0.000127473 0.000469353 2.8547
10/17/13 19:00:44 0.000128645 0.000127473 0.000469353 2.8547
10/17/13 19:00:44 0.000128645 0.000127473 0.000469353 2.8547
10/17/13 19:00:44 0.000128645 0.000127473 0.000469353 2.8547
10/17/13 19:00:44 0.000128254 0.000127473 0.000469353 2.86447
10/17/13 19:00:44 0.000128645 0.000127473 0.000469353 2.84493
10/17/13 19:00:45 0.000128645 0.000127473 0.000469353 2.84493
10/17/13 19:00:45 0.000128645 0.000127473 0.000469353 2.83516
10/17/13 19:00:45 0.000128645 0.000127473 0.000469353 2.83516
10/17/13 19:00:45 0.000128645 0.000127473 0.000471306 2.84493
10/17/13 19:00:45 0.000128645 0.000127473 0.000469353 2.84493
10/17/13 19:00:45 0.000128645 0.000127473 0.000469353 2.8547
10/17/13 19:00:45 0.000128645 0.000127473 0.000463492 2.8547
10/17/13 19:00:45 0.000128254 0.000127473 0.000469353 2.8547
10/17/13 19:00:45 0.000128645 0.000127473 0.000469353 2.8547
10/17/13 19:00:46 0.000128645 0.000127473 0.000469353 2.8547
10/17/13 19:00:46 0.000128645 0.000127473 0.000469353 2.8547
10/17/13 19:00:46 0.000128645 0.000127473 0.000469353 2.8547
10/17/13 19:00:46 0.000128645 0.000127473 0.000469353 2.84493
10/17/13 19:00:46 0.000128645 0.000127473 0.000469353 2.84493
10/17/13 19:00:46 0.000128645 0.000127473 0.000469353 2.84493
10/17/13 19:00:46 0.000128645 0.000127473 0.000469353 2.84493
10/17/13 19:00:46 0.000128254 0.000127473 0.000469353 2.83516
10/17/13 19:00:46 0.000128645 0.000127473 0.000471306 2.8254
10/17/13 19:00:47 0.000128645 0.000127473 0.000469353 2.81563
break
10-18-2013 06:08 PM
It seems like you may be able to add a Wait Until Next ms Multiple function within your inner while loop and set it to 1000 ms. This will force that loop to only run once per second. Right now, there is no timing for that loop so it could be taking a different amount of time to execute every time it loops.
Can you add clarification to your end goal? I'm not sure I fully understand what question you are trying to ask. Exactly what problem would you like help with?
10-21-2013 11:09 AM
So my big problem is I want to keep my computer from crashing after 4 hours of running the program. I thought that reducing the amount of data being collected would help, but to no avail. I'm not sure if its a problem with the computer or the DAQ I'm using, but it seems like I can only get 4-6 hours of data before the program crashes. Can you see some reason that it would crash like that?
10-22-2013 09:29 AM
It seems as though you are still collecting the same amount of data but writing less of it to file. You may want to set your sampling rate to be slower in your DAQmx task in order to actually collect less data.
When LabVIEW is crashing, is it reporting any error message? Have you tried tracking your computer's CPU usage or Memory usage while running your program to determine if there is a memory leak? There are several tools you can use under Tools>>Profile to help you analyze if there are any performance problems that may be causing LabVIEW to crash.
10-30-2013 10:58 AM - edited 10-30-2013 11:04 AM
I have lowered my rate down to 100 Hz (lowest this DAQ can go) and it is still giving me an error:
Error 10003 occurred at ULx Read (Analog 1D Wfm NChan 1Samp).vi
Possible reason(s):
Measurements: Some or all of the samples requested have not yet been acquired.
To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger, make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.
How would I check for a memory leak? I am using XP, but tomorrow I am getting a new netbook with Windows 8.
As to the error, I have played with the rate from 100 to 1200 Hz (full range), changed my timeout from 0 up to 20.