LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Always get the same port value using DAQmxReadDigitalU8

Hi,
I have an issue using the DAQmxReadDigitalU8 function,
I read the 8 bytes port on change detection event and I am actually trying to test my acquisition with a 5 v power supply connecting to one of my digital inputs,
the problem is when I put 5 volts on one of the inputs the value collected by the DAQmxReadDigitalU8 function always give a 47 value,
does anybody have a suggestion on what I am not doing the right way.

Thanks

Olivier
0 Kudos
Message 1 of 8
(4,296 Views)
Please help I don't know how to handle it

thanks
0 Kudos
Message 2 of 8
(4,259 Views)
Is this question related to this other one? Have you tried using DAQmxReadDigitalLines instead of DAQmxReadDigitalU8?


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 8
(4,242 Views)

Hi,

Could you post your code so that we could have a better look at it.

Best regards,

0 Kudos
Message 4 of 8
(4,230 Views)
Hi,
More or less it is related to the other message, I have tried to use readdigitallines function and now it seem to work better, because port values are not the same all the time.
But, I don't get the expected port value.
in fact I put a 5v power supply on each digital inputs and verify if the corresponding one is turning on and th port value I get doesnt match the correct port value expected,
for exemple at start I put ov on the first digital input and i get 00000000 and then if I put 5v on the same input I get 01111110 ( byte 8 is not used)
 or I was expecting to get 10000000, moreover when I change the digital input i put 5 volt on for exemple the byte 2 i get 11111110 which is not was I was expecting neither (01000000)
consequently I  infer that the voltage value i am actually connecting to the inputs does not match correctly the port value
So I guess the acquisition is not wirking correctly or maybe I am doing something wrong
I attached my code.
thanks
Olivier
Download All
0 Kudos
Message 5 of 8
(4,209 Views)

Hi,

Nothing seems to be wrong in your code, can you tell me what's exactly your hardware ?

Best regards,

0 Kudos
Message 6 of 8
(4,189 Views)
Hi
It is a NI 9401 racked on a NIcDAQ9172 on slot 4.
I also have an NI 9205 on slot 1 and a NI9263 on slot 2.

Thanks
Olivier
0 Kudos
Message 7 of 8
(4,183 Views)

Hi,

Could you try updating your version of DAQmx ? You can download it right here : DAQmx 8.5.

Best regards,

0 Kudos
Message 8 of 8
(4,163 Views)