Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behavior with NI 9401

Hi everyone!
I think I have a strange problem with the NI 9401 modules.
My hardware is a CompactRIO and I'm using Labview 8.0.
I'm reading a 13 bit encoder with two NI 9401 modules: the first for 8 input channels and the second for the other remaining 5. input channels.
13 bits means that the slots in the outest part of the counter are 8192 so i expect my encoder to count up/down till 8192. What instead happens is that the counter goes up to 7934, then suddenly to 7860, then from 0 to 254 and then finally to 0 again and up again to 7934 and the story always goes on like this. I put the true/false outputs of the encoder in a boolean array and then, from the boolean array to a number. (see the attacched VI)
 
Here's how I devided the inputs between the two modules
 
-NI 9401 2 :
 
DIO0= 2^0
DIO1= 2^1
DIO2= 2^2
DIO3= 2^3
DIO4= 2^4
DIO5= 2^5
DIO6= 2^6
DIO7= 2^7
- NI 9401
 
DIO0= 2^8
DIO1= 2^9
DIO2= 2^10
DIO3= 2^11
DIO4= 2^12
 
When running the VI I suddenly realized that every time all the input for each modules should be true ( i.e. five leds on for the second module or eight leds on for the first) , the value of all the inputs goes immediately to 0 i.e. all the leds switch off . To make an example: I see 4 leds on for the second module but when comes the time of the fifth, all the leds switch off so it means all the inputs are false which i can't understand. I tried to change the pin assignments in order to read the same inputs from different pins and this did'nt change anything. I tried to use only 4 inputs for the second module and this didn't work. Every time all the inputs for each module should be true it goes up to (n-1) inputs true and the n inputs zero. More information about this strange behaviour: while a normal false input produces a voltage of 0.036 V the voltage I measured from the last pin that should be true and that should give me all the leds on for one module, produces instead -0.146 V.
This is everything I tried in order to solve this problem but now I'm at a dead end.
Could it be a kind of module setting which I didn't consider?
Due to all the attempts I've made I excluded any disfunction of the encoder so I focused my attention to the modules.
 
Does anyone of you have any idea?
 
Thanks!!
 
Rob_F
Download All
0 Kudos
Message 1 of 4
(3,882 Views)
Hi Rob_F,

I looked to your project and VI and it looks alright. In case you haven't figured out what's wrong, there are a few things I can suggest:

- Make sure the signals coming from the encoder meet the Ni 9401 specifications. You can refer to the CompactRIO Bookshelf for this info:

NI 9401
Digital logic levels
Maximum input voltage .............5.25 V
Input high, VIH ...........................2 V min
Input low, VIL .............................0.8 V max

- Hand test all the lines to make sure they work independently.

- Swap modules and see if you get the same or similar results.

Hope this helps.

JMota
National Instruments
0 Kudos
Message 2 of 4
(3,865 Views)

Thanks a lot JMota!

We just sent back the encoder to the company who sells them. They want to be sure it's not a product defect or, even worse, a problem of conflict with the NI 9401.

In the meanwhile we built up the acquisition VI for the accelerometer and the encoder. One while loop sends the accelerometer data to a DMA FIFO and another parallel while loop is used to read the encoder outputs and send these data to another DMA FIFO. I did this because I know only 1 DMA FIFO can be used for each channel. When I read the data with two FIFO.read with two parallel loops in the Real-Time I discovered that I can't make them work indipendently as i thought i.e. reading settings of one FIFO.read ( number of elements and loop timing) affects also the other FIFO.read . 

Any explanation for this behavior?

Thanks again JMota!

0 Kudos
Message 3 of 4
(3,845 Views)

Hi Rob,

It may help if you could post the application you are currently using.  How does reading one FIFO affect the read of the other?  Is reading from multiple DMA FIFOs increasing the Jitter in your application?  See if you can explain a little more detail on how the Reads affect each other.

Regards,

Steve

0 Kudos
Message 4 of 4
(3,816 Views)