04-29-2011 02:32 PM
Hello,
I need to implement SPI communication in LabVIEW to talk to my sensor. I am new to LabVIEW and to NI PXI cards.
What card should I use? My current choices are: PXI 6123 or the PXI 6250. Since the 6250 can do clocked digital I/O, is it beneficial to use this over the 6123? I am not sure if the PXI 6123 can do clocked DIO.
Please advice.
Thanks,
Siddharth
05-02-2011 05:46 PM
Hi Siddharth,
From my understanding, PXI 6123 is correlated DIO where as PXI 6250 is hardware timed so both are clocked.
What are you looking to do specificially? For example, one card is meant for simultaneous sampling where as the other is multiplexed sampling. You didn't list a lot of requirements for your card. NI.com has a good sales tool to go through all devices based on their features? Have you tried using that?
I recommend calling our Sales Department and they will help you find the card that's right for you. You can reach them at (800) 531-5066.
Allie
05-06-2011 04:05 PM
Allie,
I am currently acquiring an analog voltage signal and an encoder signal using a PXI 6123 card. Both signals are being simultaneously sampled at 500kHz. I need to implement SPI communication to read data from a sensor. It is critical for my application that the SPI data is in synchronism with the analog signal and the encoder signals.
The hardware that I have currently available is the PXI 6123 and the PXI 6250. Is it possible to accomplish the task with just these, or do I need to look at buying new hardware?
Please advice.
Thanks,
Siddharth
05-09-2011 09:28 AM - edited 05-09-2011 09:31 AM
Hi Siddharth,
Both the 6123 and the 6250 support correlated digital I/O at up to 10 MHz. Correlated just means that the boards are capable of clocked DIO, but the clock must come from somewhere else (another subsystem or an external signal). In contrast, newer hardware like X Series supports generating a DI/DO sample clock directly.
Assuming you are using a quadrature encoder with both A and B outputs, I recommend using the 6250 for the encoder task. The 6250 supports the "CI Angular Encoder" task which supports A, B, and Z index inputs. The 6123 can use quadrature encoders in the same way as E Series boards by using an edge count task with an up/down terminal. However, this method is more susceptible to noise and does not support the Z index. I would use the AI Sample Clock from the 6123 to time the encoder task on the 6250 (the routing will be done across the PXI backplane).
So, this leaves the SPI implementation. Since you would have both counters available on the 6123 if you use the 6250 for edge counting, I would implement a retriggerable finite pulse train generation to be used for your SPI clock on the 6123. Trigger the pulse generation off of the AI Sample Clock. Since the maximum timebase on the 6123 is 20 MHz, you would have to change the counter output behavior to "Pulse" instead of "Toggle" to get 10 MHz (see here). If you are transferring less than 20 bits, at 10 MHz you should be able to fit them in between the 500 kHz AI Sample clock. Use the DI and DO lines for data and chip select as necesary (many SPI devices use the falling edge of the cs line for initiating an acquisition).
Best Regards,