03-10-2009 05:12 PM
Hi,
I have two NI 9205 Analog Input Modules which I have setup to read from each of their 32 channels. I used the DAQ Assist wizard to generate the vi which contains the task out - DAQmx event and also the DAQmx Read vi.
I used the wizard twice, one time for each 9205 module and then put the read functions in a sequence structure so that only one read would be executed at a time. This all works fine!
Now I want to add in code to wait in a loop prior to the while loop containing the read functions, so that the user can press a button on the GUI to send a logic 1 to the device under test, and after this is sent immediately begin collecting data.
The DAQ Assist wizard does not recognize the 9205 module when I try to set up a task to write a digital output. The 9205 has 1 digital output so why is the wizard not recognizing this? I also tried to create a task manually, but I got stuck.
Someone please help. I can attach the source if necessary, but I thought the above descriptions were sufficient.
Thanks,
Gary
Solved! Go to Solution.
03-11-2009 06:35 PM
Hello,
I can think of a couple ways to do this. One is to have a case structure in your code where the code inside the case is your DAQ code. Then register a value change event for some boolean button on your front panel. If you are sampling continuously you would also want to have a while loop around your DAQ code that has a stop button. Once you run the DAQ code your event structure will be done and your program will stop. This however, is somewhat dangerous is you're going to have a bunch of other code in your VI, because by default the case structure will lock your VI when the code inside it runs.
Another way to implement this is to have a while loop that is front of your code that has the error cluster inside it that passes to your DAQmx code. Also, you would want to put a wait VI in there and then the stop button for that VI can be your start button indicating that you want to exit that while loop and execute the rest of your DAQ code. I have attached an example that is similar to this. I would really suggest looking in the NI Example Finder for some better code than what you get out of the DAQ Assistant. For example, check out the example program called Acq&Graph Voltage-Int Clk.vi. I hope this helps.
Chris
03-12-2009 08:02 AM
It doesnt show anything in your example about writing to the digital output. That is what I am mostly trying to figure out. How to write out of the 1 digital output that is part of the NI 9205 analog input module. The wizard does not detect the digital output and i couldnt figure out how to set it up manually.
I will try to use your example to set up the digital output.
Any suggestions would be helpful.
Thanks,
Gary
03-12-2009 08:11 AM
The create channel VI does not recognize the digital output DO0 from the NI 9205 when the VI is setup for a digital output. Does anyone know why the digital output is not being recognized???
03-12-2009 01:10 PM
There is no digital output on the 9205. Whichever line you are referring is not a data line and cannot be configured to work in a DAQmx task. Take a look at the product page for the 9205. If you go to the resources tab and scroll down you will see that the number of Digital I/O channels is 0.
You will have to get a Digital I/O module to do any digital communication.
Chris
03-12-2009 01:48 PM - last edited on 03-13-2009 02:05 PM by Support
The 9205 module lists DO0 on the side where it shows the pinout and it also lists DO0 in the attached pdg on page 8 and page 26. This doesn't make sense to me at all.
The link that you listed was not viewable for me.
http://digital.ni.com/manuals.nsf/websearch/075737D1A40189A8862573D0006C6146
03-12-2009 02:40 PM
Hello,
You are right that it does show a DO line in that user manual, and actually you have found an instance where a key piece of information was left out of the documentation. That digital output line is actually only useable when you are using a cRIO chassis. It won't work with the 9172 compact DAQ chassis. Here is a knowledgebase that explains this. I am also going to go ahead and file a corrective action request so that this note is included in the next release of this manual. Thanks for the feedback.
Chris
03-12-2009 03:34 PM
Thank you very much. We may look into purchasing a cRIO chassis.
Gary