05-29-2013 03:47 PM
Hi fellas and lady fellas,
Newbie here. I am trying to build a multichannel "oscilloscope" using a DAQ card, specifically the USB 6218 BNC (which I do not have yet, I am using the simulated instrument).
So far I can display and adjust heights/timescale/offset for multiple channels with digital/analog triggering when doing continuous sampling, but I have a question as to how I can extend the code I have written to be able to take a finite number of samples, rather than just continuous sampling.
When I run finite samples in analog trigger mode, the program runs-- it actually runs over and over because I still have it in a loop, but that's something I can presumably fix to stop after one run when in finite sample mode.
However, in digital triggering or no trigger, I get Error -200278 that I am trying to read a sample beyond the final sample acquired. I have searched for information about this error, but I guess I just don't quite understand how to fix it in my code.
I have tried adjusting combinations of sample rate/samples per channel/number of samples per channel, but I think I just don't quite understand what is being adjusted with the simulated device.
Anyways here's my code. It's still pretty rough, for example the adjustments like sec/div are not yet labelled accurately, I'm just adjusting the time frame arbitrarily.
Thanks for any help you can!
05-29-2013 05:59 PM
I forgot to add this file, I dont know whether the program works without this or not. It's just the analog software trigger from the examples
05-30-2013 07:15 PM
Hello beefcake,
You can take a look at this Knowledge Base article for more information about the error you're receiving. It seems that having a finite acquisition with the Read VI in a loop could cause this error.
You should also know that hardware triggering is currently not supported in our simulated devices that use the DAQmx drivers. If you configure any trigger, it will "trigger" immediately when you run your task.
Hope this helps.