Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Why can't I configure 1 MHz clock timed while loop in crio 9002

Hi,
 
I am using crio9002 controller with crio9233(24 bit ADC).
 
I am specifying scan rate in buffered acquisition fpga code( modified NI example code) as 100 microseconds. I expect data to be available in RT(crio 9002) after every 100 microseconds. I did not get the desired result with normal while loop. Hence I tried using timed while loop.
 
I can configure the time loop for 1MHz, but the code stops after running once. And the code runs with 1KHz clock.
 
Is there a limitation in using the 1MHZ clock in 9002. it has only 32MB RAM.
 
Best Regards,
 
Bipin M
0 Kudos
Message 1 of 2
(4,141 Views)

If you are seeing a Timed Loop option for using the 1 MHz clock, you must not be targeted to cRIO FPGA backplane.  When LabVIEW is targeted to the FPGA, your loop options include the For Loop, While Loop, and Single Cycle Timed Loop (SCTL).  You will not be able to acquire from the 9233 within the SCTL because analog input cannot complete within a single tick of the 40 MHz FPGA timebase.  The While Loop would be your best design option in this case.

First, target LabVIEW to the cRIO FPGA backplane (look for the VISA address in your execution target list).  In your while loop, place a sequence structure.  In the first frame, place a Loop Timer.vi to provide your 100 microsecond timing.  Then in the second frame, place the Analog Input node for the 9233 and simply send the data to a front panel indicator at first.  Add the stop button to your while loop.  Finally, place another instance of the Loop Time (configured in the same way) outside of the while loop and ensure that this Loop Timer will execute before the while loop begins.  You should be able to compile this VI and run the VI at 10 kHz, as you have configured.

You may also want to reference the shipping examples for the 9233, which contains an example of using the calibration data to properly interpret your input values.  These examples can be found at C:\Program Files\National Instruments\LabVIEW 7.1\examples\FPGA\CompactRIO\cRIO-9233

I hope this helps.

Regards,

Kristi H
National Instruments

DeveloperZone: LabVIEW 7.1 FPGA Module Training
0 Kudos
Message 2 of 2
(4,122 Views)