Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Coupling Ansi C

Hi guys,

i am trying to set the Coupling of an NI 9233 with an USB-Carrier 9162 using Ansi C. I got the information that i should use SetAICoupling, but when I read it out using GetAICoupling, i get as value: 99864 which does not match with any coupling type. Any idea how i could manage it

yours chris
0 Kudos
Message 1 of 11
(4,865 Views)
Hello Chris!

We are working on your problem, but we have to less information!
Maybe you can send me the example so that I can have a look on it!

Stefan


Message 2 of 11
(4,815 Views)
I tried to set the coupling using this source:


DAQmxErrChk (DAQmxSetAICoupling(taskHandle, "Dev1/ai1",DAQmx_Val_AC));
DAQmxErrChk (DAQmxGetAICoupling(taskHandle, "Dev1/ai1", &kopplung));

printf("Kopplung: %d\n",kopplung);
if(kopplung == DAQmx_Val_AC)
{
printf("AC-Kopplung\n");
}
else if (kopplung == DAQmx_Val_DC)
{
printf("DC-Kopplung\n");
}
else if (kopplung == DAQmx_Val_GND)
{
printf("GND-Kopplung\n");
}

By using this source, i get:

Kopplung: 1004316

Please help me,

thanks yours christoph
0 Kudos
Message 3 of 11
(4,769 Views)
Hello Chris,

What I also need to know, are you using the NI 9233 or the NI 9233A.
You can only use the DAQmx if you have the  NI9233A, otherwise you have to  use DAQmx Base.

Stefan
0 Kudos
Message 4 of 11
(4,764 Views)
Are you sure? I am working with an 9233 but i am quite sure, that i use DAQmx and not DAQmx Base. What are the main differences?

yours christoph
0 Kudos
Message 5 of 11
(4,764 Views)
 

Hi Christoph-

Actually, there is no such thing as a USB-9233A.  The USB-9233 is definitely supported by NI-DAQmx.

Which version of NI-DAQmx are you using?  I inserted your code snippet into an analog input shipping example and the value returned was '10045' as expected.  If you haven't already I would suggest that you upgrade to NI-DAQmx 8.3.  If this does not solve the problem please post your entire .c file here and we can take a closer look.

Thanks-

Tom W
National Instruments
Message 6 of 11
(4,752 Views)
Shame on me I made a mistake!!
I thought about the NI 9215A and 9215!
Thank you Tom for correcting my .......!
Hope it works with 8.3

Stefan

Message 7 of 11
(4,744 Views)
I am already using NIDAQmx 8.3, with this Conditions I got the wrong result!

Any ideas how i could solve the problem?

Best Regards

Chris
0 Kudos
Message 8 of 11
(4,717 Views)
Here is my complete Source-File:


0 Kudos
Message 9 of 11
(4,714 Views)
>     int32         kopplung[180] = {'\0'};
>     ...
>    DAQmxErrChk (DAQmxGetAICoupling(taskHandle, "Dev1/ai1", &kopplung));
>    printf("Kopplung: %d\n",kopplung);

You're declaring kopplung as an array of int32s, not a single int32. printf() is printing the address of the first element. Try "int32 kopplung = 0;"
---
Brad Keryan
NI R&D
0 Kudos
Message 10 of 11
(4,680 Views)