10-08-2010 09:14 AM
Hi there,
I'm having some trouble creating a VI to do what I want. I'm trying to simultaneously record 5 signals at 1kHz, for roughly 30 seconds.
Three of the signals are simply analog voltages. The other two are encoders (one is 54 pulse/rev, other is 60 pulse/rev).
I can get DAQ assistant to record the voltages for a fixed number of samples.
I can also put the DAQ assistant in a while loop and record frequency continuously though it doesn't record at a regular interval, which is what I need to do.
If I put all measurements in a while loop it slows way down and sometimes doesn't work at all. I'm sure there's a simpler way to do this but I'm a Labview Novice and the help files aren't helping. I've attached one of my crude VIs.
10-11-2010 05:33 PM
When I am trying to aquire analog data with encoder data I log the encoder outputs in an analog channel then postprocess the encoder data at a later date.
10-11-2010 07:53 PM
Yes, that was what I did in my previous VI. It works I suppose, but I'd like to minimize post processing if possible.
10-11-2010 08:57 PM
10-13-2010 04:11 PM
I got that program to work out but it slows way down when I add more inputs. Am I doing something wrong here? I can't add more analog channels because it says the resource is reserved.
10-13-2010 04:46 PM
Hi mooktank,
It looks like you're trying to read 1 sample per loop iteration. At 1 kHz, this isn't too feasible once you start adding more channels. I recommend using the N Sample versions of DAQmx Read. Setting N to 100 will mean your loop will iterate about 10 times a second. Each loop iteration would return a 100-point array per task which you could send to a buffer etc.
All analog input channels must be part of the same task (unlike counters where you use a separate task for each). If you have multiple Global Virtual Channels defined in MAX (which is what it looks like), you can reference them as a comma separated list in LabVIEW.
Best Regards,
10-14-2010 03:03 PM
Thanks for the replies thus far!
I'm starting to get closer. I've got the VI to the point where I can read three analog voltages and one frequency and start logging them to a text file. However, I'm having an error after running the program ~10s and the time column in my file is about 10x too small. When number of samples is 1, my gauge works nicely. When it's 10, it's choppy but okay. At 100, it's useless.
Any ideas?
10-15-2010 05:12 PM
Here's my latest iteration. It works okay at 100 Hz. I can take about 30s worth of data from all required channels. 1k is not really possible. Pardon my ignorance but I have no idea how to configure the buffers to run these tasks properly.
10-17-2010 11:28 AM
whats the exact error when you increase the rate?
-Ciao 😉
10-17-2010 06:19 PM
Actually I get this error even with writing disabled and at 100Hz 1 sample/iteration:
"Error -200279
Possible reason(s):
Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.
Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.
Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0
Task Name: Turbine Torque, Load Cell L, Load Cell R"