01-22-2009 08:04 AM
Hello, I have some problems to realize a program so as to use the PCI cards 622O(AI) and 6703(AO). This cards are configured in -10 +10 V. And I would like to have an example which illustrate how to use the DAQMX function read and write in Binary I16. There is no documentation in the DAQMX docs that illustrates these functions. Could I expect to have -32768 for the -10V, 0 for the 0V or 32767 for the 10V?
Thanks
Best regards
Stephanie
01-22-2009 07:39 PM
Check out this VI for acquiring voltage in binary
C:\Program Files\National Instruments\LabVIEW 8.6\examples\DAQmx\Analog In\Measure Voltage.llb\Cont Acq&Graph Voltage-To File(Binary).vi
01-23-2009 04:03 AM
01-23-2009 05:43 AM
Hi Stefany,
Which application development enviromnment are you using?
Sorry I assumed that you will be using LabVIEW.
01-23-2009 07:06 AM - edited 01-23-2009 07:06 AM
Hi and thanks to post on NI forum,
When you connect a I16 datatype, you obtain +32768 for your maximum value and -32767 for the minimum.

Regards.
Aurélien J.
National Instruments France
01-23-2009 07:38 AM
I make a C program in linux for testing the read and write functions. I just want to know how can I exploit this function in my code. My AI AO channel are configured in -10V/10V. So what does I write so as to have 8V in output( for example)?
I try to explain what i do.(plese regards my C program attached on this mail)
My four outputs are connected on my four inputs. So if I write a value on my output, i will be able to read the same value on my corresponding input.
So as to test that, I tested 4 fonctions: 2 in float and 2 in binary.
The function read/WriteAnalogF64 are OK. I can read what i write.
But its more difficult in binary:
I think the DaqmxWriteBinaryI16 is wrong: I can't read what I write
I test the write in float and the read in binary:
When i write 10 V in float, I read 32768 in binary and -10V==> -32768 so there is no problem here.
But if I Write in binary and I read in float, the results is wrong:
write -32768 ==> 0,0023V
-16000 ==>5V
-100 ==> 10V
100 ==> -10V
16000 ==> -5V
32000==> -0,0023V
????????
There is an offset in the two scale read and write.
So I don't understand how does it work.
01-23-2009 08:41 AM
I don't see why you obtain an incorrect behavior, I will suggest you to contact NI support of your country.
Regards.
Aurélien J.
National Instruments France
01-23-2009 09:38 AM
SteFaNy wrote:
But if I Write in binary and I read in float, the results is wrong:
write -32768 ==> 0,0023V
-16000 ==>5V
-100 ==> 10V
100 ==> -10V
16000 ==> -5V
32000==> -0,0023V
????????
There is an offset in the two scale read and write.
So I don't understand how does it work.
Stefany,
Your program looks all right to me.
for 6220 card if you just consider 16-bit resolution at +/-10V, then the resolution will be 0,0003V. Account for noise in AO and AI and I guess 0,0023 is a good enough measuremnt for 0V.
Now if the question is why -32765 correspond to -0V, may be that's the way the device is supposed to respond, but I am not very sure.
Your results show that -100 correspond to -10V. This is somewhat puzzling because it implies that the full 16-bit resolution is not avaiable.
BTW, why do you want to use binary isn't it simple to use the write float value directly?
01-23-2009 09:57 AM
Maybe its more easy but with the binary writing I can't write values>10 or <-10 which could crash the running of the function.
Moreover with the F64 function I don't know how the conversion float==>binary is made.
If I use the binary function I would be able to master the conversion myself and I sure not to waste time in execution function.
01-23-2009 01:24 PM