01-18-2018 08:58 AM
I am trying to output two different analog outputs on two channels on my cDAQ. One output is a square wave and the other is
a constant voltage that changes when I press a button on the front panel. I cannot get both outputs to work at the same time.
I have successfully outputted two constant voltages but when I try the waveform it does not work. I included a screen shot where i have two inputs merged together, with the same sample rates, to one task to be executed by the DAQ assistant. The error I am getting is Error -200018 saying the DAC conversion attempted before data to be converted was available. Can someone help me with this conversion issue?
I am using a cDAQ 9174, and an NI 9263 AO module.
01-18-2018 10:19 AM
Please do not use Express-VIs. If you use only one, it works. If you use one source and one target, if might work also, but if you use two sources and one target, you get nice looking code, which is horribly to debug. Please convert the VIs to regular code. Also this task combining thingy makes me cringe.
First: convert the express VIs to regular code by rightclick>show frontpanel>convert>rightcklick>replace with subVI content. Then post the spaghetti code and I might help you to change this into what you want.
All the cDAQ stuff works like a phone. You take the receiver of the phone (new task), call them (configure task = choosing device and stuff), then you listen to them (=reading from task) or talk to them (=writing to task).
01-18-2018 12:57 PM - edited 01-18-2018 12:58 PM
I have converted from the express VI to the standard code and attached it below. It still gives me the same error as before.
01-19-2018 04:47 AM
First of all, you only converted one of three express-VIs.
If you take a look at your code, you see, that the output runs in a while loop itself. Until the inner loop is terminated, the outer loop never runs a second run. You have to configure the output outside of the loop (left), write to the output in the loop and then close the output outside of the loop again. The big loop has to look like the small loop. You also can put everything in the inner loop and delete the outer loop.
Furthermore, use VIs from this palette (see attachement). They produce much less overhead and are imho more easy to use.
Change it, then show again. And please use screenshots or at least additional screenshots, because I dont have the drivers for your cDAQ stuff.
01-22-2018 08:46 AM
I have converted all of the express VI's but I don't understand how to setup the output and the while loop like you were suggesting. How do I put everything into the inner loop and is this the reason I have the DAC conversion error?
01-23-2018 06:07 PM
Hi Josh - What happens when you try to run your VI with the updates you have made? Do you still get the DAC conversion error? I would recommend taking a look at our example finder. If you go to Help >> Find Examples it will open up the NI Example Finder. You can then look under browse for Hardware Input and Output >> DAQmx >> Analog Output >> Voltage - Continuous Output.vi. These examples are a great place to get started with programming an analog output task in LabVIEW. You can then modify the example from there to fit your needs!
01-24-2018 10:46 AM
I recreated the problem with a cDAQ-Digital-IO-module.
I used the express-vi, teared it into pieces and added the signal stuff. Right now it is configured for 1kS/s and 1kS are written per second and 1kS/s are created using the signal-vis. This means 1000 samples per second created, 1000 samples written to the output and 1000 samples played in 1 second. This should result in a loop rate of 1s.
This vi is just an example, how it could work. Since I used analog signals and digitals IO-modules, it shows an error. Furthermore, I dont know, if the settings fit your setup.