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: 

How to throw an event in the Host.vi when a bool on the FPGA target changes

I would like to receive an event in one of my host VIs as soon as a bool on my FPGA changes. My host vi structure is multi threaded using the actor framework.

 

- I could set up a while(1) loop in a dedicated thread somewhere that used the "read/write control" to read the flag on the fpga target and send an event as the flag on the FPGA changes state. This results in high CPU load by the constantly running while loop though wich i would like to avoid.

- i could set up an event to be thrown every say 100ms that would call the "read/write control" and read the flag on the fpga and send a 2nd event in case the flag did change. This has reduced CPU load, but i would like to be updated about the changing flag asap and not only check for it every 100ms. It basically has the same CPU load problem as above, just at a reduced polling rate.

 

I would imagine there is a way to get a vi called (by a interrupt or event beeing thrown by the FPGA) as soon as the flag changes, so i dont have to constantly execute the read operation. Something like a locking read from the host.vi would also do, as my application is multithreaded anyway. As long as it doesnt consume CPU load it would be ok for me if the call only returns, once the flag on the FPGA did change.

 

Do you know about the memory/variable/interface that fits my purpose here?

 

Thanks a lot for your time!

0 Kudos
Message 1 of 3
(1,828 Views)

I would use this link from the LabVIEW Help https://zone.ni.com/reference/en-XX/help/371599P-01/lvfpgahosthelp/synchronizing_using_interrupts/

 

(the other one is a non-NI site)


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
0 Kudos
Message 3 of 3
(1,784 Views)