Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with NIDAQmx C API by setting minimum and maximum values for a channel.

Hi,

I am using NIDAQmx C API provided by NI to access analog inputs. I wrote some functions to create analog input channel and to set minimum and maximum values for a particular channel.
For this I used the following function to create analog channel.
DAQmxCreateAIVoltageChan (taskHandle, "Dev1/0", "", DAQmx_Val_Diff, -10, 10, DAQmx_Val_Volts ,NULL);

and I used this function to set some different min and max voltages for the above created channel.
DAQmxSetAIMin(taskHandle, "Dev1/0", -5);
DAQmxSetAIMax(taskHandle, "Dev1/0", 5);

When I called these functions it is not rising any exceptions. It is returning "0", this means function is successfully executed.
Then I tried with DAQmxGetAIMin, DAQmxGetAIMax functions to know the current min and max voltages.
I found min and max voltages are -10 and 10. But I set these values as -5 and 5.
Please guide me is there any need to use any other functions to set the new min and max voltages.

Thanks
0 Kudos
Message 1 of 5
(2,941 Views)
Thank you for your reply.
Where can i get the gain information of PCI 6251.

Thanks
0 Kudos
Message 3 of 5
(2,923 Views)
Try page 4 of the brochure at:

http://www.ni.com/pdf/products/us/044063301101dlr.pdf

You can also try setting the max value to something lower than the lowest gain that NI uses and see what is acturally set and try setting it slightly higher than the value returned, try again to set it slightly higher, etc. until you get all the possible max values.

Message Edited by duncan carter on 06-13-2005 03:17 PM

0 Kudos
Message 4 of 5
(2,916 Views)
Shouldn't this be:

DAQmxCreateAIVoltageChan (taskHandle, "Dev1/ai0", "0", DAQmx_Val_Diff, -10, 10, DAQmx_Val_Volts, NULL);
DAQmxSetAIMin(taskHandle, "0", -5);
DAQmxSetAIMax(taskHandle, "0", 5);
0 Kudos
Message 5 of 5
(2,896 Views)