12-09-2016 04:06 PM
I'm trying to create an analog output signal on a PCIe-6321 using Matlab (while simultaneously collecting data with analog inputs, but I've isolated the problem to the output). I can't get it to actually generate the voltages I set in the output signal. They're always +/- ~0.6 V or just 0. I've tested this both in Matlab and in NIMAX with a task. I put a DMM on the pins and I never see above or below ~0.6 V. The only thing I've noticed that is different from online is that the Matlab help pages have the output channel set as differential, but I get an error when I try that.
12-12-2016 05:12 PM
Try running one of the LabVIEW shipping examples. You can find these in LabVIEW by navigating to Help > Find Examples > Hardware Input and Output > DAQmx > Analog Output.
It would also be good to try another measuring device. Do you have an o-scope or other device you can use to confirm the measurement you are getting from the DMM?
12-12-2016 07:47 PM
I don't have LabVIEW to try that.
I can try an oscillascope or another DMM, but I've no reason to suspect that the DMM is wrong. It also happens to be brand new.
I'm using this to control a switch, so I can also tell by the fact that the switch is not switching since it requires 3.5 V to switch.
12-13-2016 11:51 AM
Why are you using analog output rather than digital to control the switch? Could you try using a digital output instead?
Have you ever had the analog output of this card working properly in the past?
When you are using a task in MAX, does it appear to be outputting the proper voltage? Could you post a screenshot of your task as it is running in MAX?
12-14-2016 10:33 AM - edited 12-14-2016 10:39 AM
I was using a digital output, but I could never get past this error: http://forums.ni.com/t5/Multifunction-DAQ/Matlab-Error-Analog-Output-underflow-event-but-I-m-not-usi...
When I switched to analog output, I could at least run the Matlab script all the way through without error.
This is the first time I'm using this DAQ; it's new. Here's a screenshot of one task I've tried. No matter what the voltage is set to on the task (-10 to 10 or -1 to 1) or what shape (sine, square, or triangle), when I run it and put the DMM on the pins, I get +0.55 V for five seconds and -0.55 V for five seconds.
12-15-2016 01:54 PM
Are you using a mechanical relay?
My suspiscion is that you are seeing this voltage because of the added resistance of the relay. The card is not able to source enough current to provide more than about 0.6 volts to the relay. To test if the card is outputting voltage properly, please disconnect it from the relay and run your task in MAX. Does the DMM read the correct voltage if the card is not connected to the switch?
12-15-2016 02:01 PM
This is where I was headed too. I have gotten it to work with NIMAX without anything connected, but only once. After, even with everything still disconnected, it won't work again. I'm not sure if going between NIMAX and MATLAB creates an issue in which MATLAB is somehow holding the voltage even though the script is done running. I tried clearing MATLAB and even closing it, but still cannot get the task in NIMAX to work again. The switch appears to require ~0.12 A, and the card is rated for 5 mA, so that would explain things. I think I'll try a different switch and see if that fixes it. I wonder if that could have been the issue when I was trying digital output.
12-16-2016 01:43 AM - edited 12-16-2016 01:45 AM
Is your switch a relay? (an inductive load?)
You might have blown the output, even 5mA can cause a high voltage peak on an inductor.
I don't have the schematics of the card, maybe the voltage supply for the AO is down, maybe only for one channel, maybe for all..... can you check other AOs? (Without load)
The 0.6V you still get migth be a (protection) diode to the AO voltage rail witch is down to GND now 😞 ....
Inductive loads (like relays) want to keep their internal current... if you turn off the power, the current still wants to flow, with the result, that the voltage on the inductor increases. (For a ananlog EE that's 101). One common way to avaoid that voltage peaks is a 'free wheeling' diode at the inductor. ...
There is at least one KB article on how to drive a relay with a DO (or AO) ...