LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am running a strain gage test and can't get more than 1000 samples

A formor employee left a strain gage VI that I am attempting to reuse but no matter what I do I can,t get more than 1000 samples before needing to restart the loop. In the task timing (of NI-DAQmx) I have set the acquisition mode to N Samples and the clock settings to read 65000 samples at 25 Hz. There is a DAQmx timing(sample clock) VI that resets to finite samples and 1000 per channel when I close it but I have reset it to 65500 continious samples and left it open to no avail. There is a rate input to this sample clock on the front window that I have tried setting to several different rates to no avail. The Vi will run about 15 seconds, collect 1000 samples and then ask to verify the file location to save the data to. Upon verifying the file location the VI will run another 15 sec. loop before stopping for verification again.
If the loop is stopped rather thanhaving the file verified an error is listed:
Error-200278 occurred at DAQmx Read (Analog 1d WFm NChan NSamp).vi:1
The given possible reason given is: attempted to read a sample beyond the final sample acquired.
 
When I stop attempting to run the VI the block diagram opens with a dark block around file creation block. I need this VI to run for 10 min. collecting samples at about 25/sec. Can someone help me figure out what I am doing wrong?
I have made screen shots of the VI and the error code to assist finding the incorrect programing.
 
Thank you for your help.
 
Jim Steinmeyer
Jim Steinmeyer
Design Engineer
Reinke Mfg.
PO 566
Deshler NE 68340
jimsteinmeyer@reinke.com
0 Kudos
Message 1 of 7
(3,063 Views)

Hi Jim,

      Screen-shots are good - even encouraged - but it's more typical to submit JPGs.  DOCs are one of those animals that can carry viruses and I'd rather not risk it. Smiley Happy

It sounds like something is explicitly defining the number of samples at run-time - resetting the value you're defining back to 1000?  If this is occurring on a top-level Control & Front-Panel, then the program is probably setting the value through a "Local Variable".  The value may also be set via a "Property Node" or even via a "Reference" - regardless, you can track them all down by right-clicking on the control and following the "Find" options.  If you see Find ->Local Variable(s), examine each Local Variable (or property node).  For the record, there's no guarantee that the program will work correctly once you do manage to change this particular value. Smiley Wink

Regards.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 7
(3,040 Views)

Thank you,

I was just thinking about being able to increse the size of the doc.  for better visability. I have tried working with the rate input for the DaQmx for the sample clock and it does change the frequency of sampling, but I still get just the 1000 samples. I have included Jpegs this time. I have tried to exppand the two DAQ assistants that arn't expanded but am unable to, I also am unable to find a "propertys" command to open them up and see what exactly they do. The nested while loop for output also seems strange to me. Maybe I would be better to attempt a new program but being new to the language I thought using an existing program might be best.

Jim

Jim Steinmeyer
Design Engineer
Reinke Mfg.
PO 566
Deshler NE 68340
jimsteinmeyer@reinke.com
Download All
0 Kudos
Message 3 of 7
(3,026 Views)

Hi Jim,

      The DAQmx Timing.vi (see "Sample Clock") has a "samples per channel" input which is unwired on your diagram - surprise! - it defaults to 1000. Smiley Wink

I don't want to insult you with instructions on how to wire a value, if you already know how, just ignore the rest!  On your diagram, choose the wiring tool and move it along the top-edge of "DAQmx Timing.vi".  You should see the names of the connectors as you move the tool along.  With the mouse on the "samples per channel" input, RIGHT-click and choose, either, Create Control or Create Constant.  If you Create Control, a new control will appear on the Front Panel.  I'd send a pic, but this PC doesn't have the DAQmx VIs installed! (had to go to another machine to open DAQmx...)

Cheers.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 4 of 7
(3,010 Views)

Thank you for your suggestions, we are getting closer. Don't be afraid to insult my intelligence, I have been told I need to have some before it can be insulted.

When I wires in a control for the sample count I started getting a warning telling me that the VI was stopping at the "Analog 1D Wfm NChan NSamp" data assistant in the middle of the first loop. I wired in a counter to the timeout node and now the VI will run for the full amount of samples. Which is a good thing because I can now take all the needed samples. But it is also a bad thing, because I can't stop the VI until ALL the samples are taken. The program ignores the stop button and runs for the full number of samples. Is there a way to  change the input of the timeout to a true/false or something that could be controled with the stop button?

 

Message Edited by jimsteinmeyer on 07-05-2006 10:04 AM

Jim Steinmeyer
Design Engineer
Reinke Mfg.
PO 566
Deshler NE 68340
jimsteinmeyer@reinke.com
0 Kudos
Message 5 of 7
(3,000 Views)
Before the responce comes in to set the timeout to -1. I have tried with no results.
Jim Steinmeyer
Design Engineer
Reinke Mfg.
PO 566
Deshler NE 68340
jimsteinmeyer@reinke.com
0 Kudos
Message 6 of 7
(2,986 Views)

> Don't be afraid to insult my intelligence, I have been told I need to have some before it can be insulted.

Well, speaking from personal experience, ignorance is bliss! Smiley Wink

> The program ignores the stop button and runs for the full number of samples. Is there a way to  change the input of the timeout to a true/false or something that could be controled with the stop button?

I'm gonna have to bail on you here.  If you set a low time-out - to get the loop to iterate and check the Stop button - then you may have to handle a timeout-error (the DAQ won't complete within timeout).  The "DAQmx READ.vi offers a "number of samples per channel input" that might allow an incremental READ (no timeout error) - but what happens when the entire pre-set number of samples have been acquired, and the loop tries to read more?

I think you're headed for a "Continuous Acquisition" solution.  The "Cont Acq&Graph Voltage-To File(Binary).vi" example seems to fit your requirements.

Cheers.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 7 of 7
(2,970 Views)