I am new to DAQmx and trying to build several simple VIs to use on a USB 6212 BNC.
I started working with an example VI, Voltage - On Demand Output.vi, that I would like to modify to a step function with monitoring of things like rise time, slew rate, overshoot, etc. The example itself works fine and I am able to verify on a multimeter that the voltage is rising as indicated. When I add a read to monitor the channels voltage, however, I am able to run the VI but get an error that says:
Read failed, because there are no channels in this task from which data can be read.
Task Name: _unnamedTask<21>
All I did was add a DAQmx Read, set it to match the Write and created an indicator for the data. I'm wondering if I need to set another channel to do the monitoring but, if that is the right solultion, I have not been successful with it so far. I've tried seaching the forums for similar errors and am going through my literature on DAQ but haven't found anything to shed some light on the issue.
I am attaching my, very slightly, modified VI and hoping to hear back from the community.
Thanks in advance,
As a followup, I've been reading the Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications article (http://www.ni.com/white-paper/2835/) and I am wondering if I need to configure another channel to read and then connect their BNC cables. Seems a bit cluttered, isn't there an internal way to monitor the channel after/while setting it?
Would really appreciate some input.
Yes you would have to create a new AI channel and read from that. AI channels read analog data and AO channels write analog data. So you have to plug your analog input into the AI line and your analog output on the AO line. If you want to synchronize these measurements you would have to synchronize their clocks.
It seems that your code is trying to read and write from the same channel. This is not possible because the AO channels are analog output channels which contain an DAC, or a digital to analog converter. The analog input channels have an ADC, or an analog to digital converter. The reason you cannot read and write on the same channel is because DACs cannot act like ADCs and vice versa. The DACs, convert a digital signal to analog so you can output a digital signal from your computer and the DAQ board then converts that so it can output an analog signal. The ADC, converts an analog signal into digital so that your computer can interpret and analyze the data.
Thank you so much for your reply, that certainly simplifies things!
I was hoping the probe the issue a bit more. If I were doing this on a physical device I would just jumper the two channels after writing the code. When I try to do it on a Simulated Device, however, I am not able to find a tool that will allow me to do this. Could you please advise on how this could be achieved? I have a physical device but trying to be able to set up equivalent simulated code when the device is not on hand.
Hope to hear from you,
I don't think this is possible with simulated devices. If you use the test panels in MAX you can see that AI already has a simulated signal and AO also has a simulated signal. The simulated device is more for checking if your program is compatible with real data rather than seeing if your wiring is correct. You can program an output for the AO channel, though there would be no way to read it. But the AI signal comes with a generated signal, so you can use that as a source of data, though this data may not conform to the data you expect. I would recommend using an analog in to pass data through your program or maybe just generating a signal, using the simulate signal express vi.
Hope that helps.
Thank you for the response. I was hoping that it would be possible to both set and monitor my simulated channels but I guess I will have to work with what is available.
That being said, I have gone back and tried to synchronize the clocks as per your suggestion. Unfortunately I am getting an error that reads:
Error -201025 occurred at DAQmx Start Task.vi:7220001
Non-buffered hardware-timed operations are not supported for this device and Channel Type.
Set the Buffer Size to greater than 0, do not configure Sample Clock timing, or set Sample Timing Type to On Demand.
I am not able to find the Buffer Size setting and the whole point, as per your suggestion, was to configure the Sample Clock timing. Did I misunderstand you regarding the synchronization?
I'm including my .VI in hopes that it will help. Forgive these foolish errors, I am just learning DAQmx.
These are all understandable issues for people just starting out on DAQmx.
Synchronization is tricky, I found a resource which may help you better understand how to do it. Follow this link.
I also found a resource on your error code which may better help you. Follow this link.
When trying to run it, it worked for me, but I only simulated the device and did not have the physical hardware. One thing I noticed was that I was unable to select an analog input channel. I would replace the control with a new on the analog input task by right clicking on the Physical channels terminal and go to Create>>Control to create a control that allows you to choose an analog in.
Hope this helps
Thank you for your reply and your patience.
Could you please elaborate on the analog input? Is that causing a problem with acquisition? I've so far just been writing in the analog in in a task that does not require it but I've been able to make data acquisitions, could that be causing an issue?
No, it may just be on my end. If you are able to acquire data without error, then it should be good.
Old thread, I know, but I ended up here trying to solve my own problem of a very similar nature. I have a USB-6216, and I want to be able to readback the value of, e.g., ao0, as part of a control algorithm to ensure that the output is not straying outside bounds. If I try to do this with a simple read of the ao0 channel, I get an error -200460 also. Every indication in the manual and such is that one would need to have a physical feedback from ao0 to a spare ai port to do this as a physical read. Turns out that's not actually the case, you can indeed do it internally. The corresponding Labview code is...
This actually works perfectly well. All inputs disconnected and available, ao0 sourcing a multimeter only for checking, the readback agrees with both the set and the multimeter to mV level at least.
My next challenge is how to implement in python, but internal readback of output certainly seems viable, at least with the nearby model USB-6216 (BNC version).