From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write analog data in timed loop FPGA

Hi,

 

I have array of data in FIFO from RT VI. I have to read the array of data in FPGA and write the data to Analog channel with 20us time interval. I have to write the same data back to another FIFO. When i use AO control in timed loop, i got compilation errorsaying that i cant use it in timed loop. how do i achive this?

 

Thank you,

Ranjith

0 Kudos
Message 1 of 5
(2,729 Views)

Timed Loops in LabVIEW FPGA are known as Single Cycle Timed Loops. When used with an FPGA target this loop executes all functions inside within one tick of the FPGA clock you have selected. Functions that take longer than one tick, such as analog I/O functions or any functions that wait cannot be used inside the SCTL. Also, if you have a chain of logic inside the loop that takes longer than one clock tick to execute, this logic cannot be used inside the SCTL and your VI will fail to compile.

Single-Cycle Timed Loop FAQ for the LabVIEW FPGA Module

 

So, to answer your question, just use a while loop instead.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 5
(2,724 Views)

SCTL [single cycle timed loops] in FPGA executes all the code within in 1 clock cycle of the FPGA base clock.  A analog write cannot be completed within this short period and hence analog rw operation cannot be performed in SCTL.

 

Use while loop to perform analog rw operations.

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 3 of 5
(2,715 Views)

I am trying to acheive  this using while loop with ticks timer. if the diference is >=20 us, i shall execute the code. Will this be reliable? are there any other better ways to do it? how much time does FIFO read and FIFO write takes?

 

0 Kudos
Message 4 of 5
(2,702 Views)
FPGAs are definitely reliable. Try to benchmark the FIFO reads and writes yourself.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 5 of 5
(2,682 Views)