05-10-2013 01:53 PM
Hi All,
I am trying to read voltage using a NI-DAQ-6211 Card using Measurement Studio 2010 SP1 V9.1.0.204. using Visual Basic .Net 2010.
When I create the DAQ task using the Measurement studio wizard, (DAQ Assistant) everything works fine. However, when I try creating my own reader task by looking over the "ContAcqVoltageSamples_IntClk" all I read is a value going from Vmax to Vmin (or from Vmax to Vmin) and then it stays there no matter if I change my input voltage. Vmin and Vmax dont even correspond to my voltage values. (It acts like this both on my application and the NI's example) I guess I have missed some initial settings. The AIChannel config in both projects (manual Task and Augo-Gen Task) use AIChannelConfig.RSE (I have tried other options but no luck).
The only wiered thing is that when I open example projects, VS does not recognize objects references from NI.DAQmx namespace. When I check the references, it shows that it cannot find the reference to NI.Common. So, to make it compile/work, I removed it from the solution and added it again. (I dont think this is related, as it seems that there are voltages available but not being correctly read.)
The other thing is that my input voltage is either 3 or 0 volts. when using the manual DAQtask, when I toggle the voltage, the displayed values change momentarily in the order of 0.001 Volts and then go back to their previous values of Vmax or Vmin.
Are there any more details that I can provide?
Please help,
Thanks
Solved! Go to Solution.
05-10-2013 02:20 PM
Could it be due to this explanation in the code comments?
' I/O Connections Overview:
' Make sure your signal input terminal matches the physical channel I/O
' control. In the default case (differential channel ai0) wire the positive
' lead for your signal to the ACH0 pin on your DAQ device and wire the
' negative lead for your signal to the ACH8 pin on you DAQ device. For more
' information on the input and output terminals for your device, open the
' NI-DAQmx Help, and refer to the NI-DAQmx Device Terminals and Device
' Considerations books in the table of contents.
My DAQ card is inside of a casing and I have no access to it. How can I modify the pins corresponding to my AI channels? I think the DAQ assistant shows your input voltage wires are connected to which pins and I am pretty much sure my ai0 is not connected to ACH0 and ACH8 pins.
but again, is this even the case??? or is it initializations???
05-10-2013 03:54 PM
Yay! I just solved my problem,
From the first moment I knew there was something fishy about that AITerminalConfig thingy! I was making two mistakes:
1- In the example code the AI Configuration is coded as: CType(-1, AITerminalConfiguration) that caused the example code not work for all the AI channels
2- Also, I in my own code, I had set that config to the correct value but i was checking ai0 all the time while the signal was on another ai. I was under impression that it since the example is not working for all my channels, then probably my code is not working as well.
So after changing the line in the example to the correct terminal config settings, it started working for the ai# that I was looking too and I found that my code was working for my ai# correctly from the beginning. I just wasnt seeing it!