LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timing a while loop for a specific frequency on cRIO

Hey

 

I'm working on creating a simulator where I use a cRIO-9012 with a 9265 AO. The data to be sent are read from file then continuously accessed point by point from the read array. The problem is that the loop currently operates at 31KHz, but I need it to be 25kHz.

 

Any reply will be appreciated.

 

Vedi 

0 Kudos
Message 1 of 7
(3,019 Views)

Have you specified the loop rate using a timed loop?  What does your VI look like?

 

Dan

0 Kudos
Message 2 of 7
(3,000 Views)

Hey, I have not tried a timed loop yet. I tried to use a while loop with wait ms and ticks, but it slowed the process to much from 31kHz to 13kHz.

 

The VI is attached, never mind all the mathmatic operations that seem meaninglesss inside the loop. I just created them as a way of slowing the loop 🙂 

0 Kudos
Message 3 of 7
(2,984 Views)

Hello Verdi,

 

thank you so much for your forum post.

 

The timing from your analog output should be arranged by the FPGA VI; you can use a loop here, and with the most accurate timing you are able to update the analog outputs.

Just a quick thought;

With the RT VI you should open the files, do the mathematics and write those in a DMA FIFO. Please have a look at the KB; you need the other way around; host to target DMA.

In the FPGA VI you can read the FIFO and send the values to the analog output on the hardware timing of the FPGA clock (most accurate). Now you can write quite fast the values tot the FIFO in the RT VI (write at once or with blocks) and read those out at the required clock rate in the FPGA VI.

 

I hope this will bring you further, please don't hesitate to post if you have any further questions.

 

Best regards,

Martijn S
Applications Engineer
NI Netherlands
0 Kudos
Message 4 of 7
(2,971 Views)

Thank you for the reply.

 

If I understand your post correct, you think I should send the data to the FPGA, use a FIFO and let the FPGA send the AO?

0 Kudos
Message 5 of 7
(2,955 Views)
How can i wirte a FIFO on the cRIO, can't seem to find that option. I can only read on the cRIO and write on the FPGA.
0 Kudos
Message 6 of 7
(2,950 Views)

Dear Verdi,

 

First of all you create a host to target fifo (please see attachment). In the FPGA VI you can drag and drop the fifo you created in your project. In the host VI you are able to use the FPGA refrence (the same you used to read / write the controls from your FPGA front panel) and place a Invoke method from the FPGA functions palette. Here you should be able to write this fifo. 

 

Please let me konw if you have any further questions,

 

Best regards,

Martijn S
Applications Engineer
NI Netherlands
0 Kudos
Message 7 of 7
(2,929 Views)