Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9401 at startup is outputting a value greater than 4,000,000,000

Solved!
Go to solution

I am using DAQ Assistant to read linear displacement from a NI 9401 in a cDAQ 9178 chassis.  On some ocassions, when I load the VI and start logging the position before there is any movement, the NI 9401 outputs values as high as 4,294,967,241.  It slowly counts down and then when there is actual movement, the NI 9401starts counting the position from 0.  On other ocassions, it starts normally from a position of 0.  Does anyone know what this large value refers to and why it is being output?

0 Kudos
Message 1 of 5
(5,206 Views)

I have just discovered that I have negative movement prior to positive movement which is the reason the value is counting down slowly.  The initial top number that it begins to count down from is 4,294,967,295.  Does this mean that this is the highest value it will count up to?  If so, at that point does it go back to 0 or does it top out and stop counting?

0 Kudos
Message 2 of 5
(5,200 Views)

Numbers like that are near the extreme values possible for an I32. I suspect that your negative movement caused a counter rollover which was interpretted as a maximum or near maximum negative number.

 

Lynn

0 Kudos
Message 3 of 5
(5,192 Views)
Solution
Accepted by VPEA

@johnsold wrote:

Numbers like that are near the extreme values possible for an I32. I suspect that your negative movement caused a counter rollover which was interpretted as a maximum or near maximum negative number.


You are actually at the limit of U32 (unsigned 32 bit integer).  So the backwards movement would cause the rollover from 0 to 4294967295 and slowly going down as you move backwards.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(5,189 Views)
Solution
Accepted by VPEA

Thank you.  This makes sense.  This will be a problem regardless even if I use double precision so I will develop a work around.

0 Kudos
Message 5 of 5
(5,026 Views)