I have modified the "Voltage-Continuous Input VI" example so that it acquires from multiple channels and writes to a text file. I am having trouble however when I try to change the sample mode from "finite" sampling to continuous "sampling". I set the "samples per channel" input on the DAQmx Timing VI to 100,000, which is the buffer size recommended for the 250KHz we are sampling at; and I set the "number of samples per channel" input on the DAQmx Read (VI) to -1.
I get the error Error -200088 occurred at Voltage - Continuous Input.vi.
Can anyone suggest a recommendation on how to fix the problem?
Can you upload your code for LV 2012? Here is a help document on the error but I have no idea if it is relevant for you:
Your code seems to show Finite Samples, not Continuous. Also, I cannot find the Control "Number of Samples" -- it is hidden somewhere. Your code seems to take only one set of data, then stop. Where does it fail?
Have you ever considered writing a very simple VI with a single channel, sampling at 1000 Hz for 1000 samples (or 1 second), and simply plotting (or making an array of) the results? Just to see that something works? If it does, then start getting fancier, add channels, change sampling rate, number of samples (where is that control?), etc.
Sometimes it is better to "write your own simple code to do the one thing you want" than to take someone else's code that "handles every possible contingency, whether or not it is relevant to what you want to do". You learn more the DIY route ...
Here is the 2012 version, I got a warning that some of the VI's might break, not sure if they are not compatible with the 2012 version. Let me know if you can't open it and thank you so much for your willingness to try and help.
Open up the original shipping examples for both Finite and Continuous sampling. There's a few more differences than just that single setting when calling DAQmx Timing. If you want to switch from Finite to Continuous, it's simpler to start from the example for Continuous than to modify the example for Finite.
The main thing is that for Continuous Sampling, the call to DAQmx Read will typically be in a loop so that data can be read, um, *continuously*. You'll also note that you should specify an actual positive # of samples to read. -1 has a special meaning and the behavior is different for Finite vs Continuous sampling tasks.
For Finite tasks, it means "wait for all samples to accumulate and read them all at once". For Continuous tasks it means "don't wait at all, just give me all the available samples I haven't read before." If you don't otherwise slow down your continuous reading loop, it'll iterate really really faster, and many of the reads will return 0 samples because you're requesting new ones faster than the task is sampling.