LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquire data only once

Hi,

 

In my program in LabVIEW FPGA, the FPGA I/O Node is placed inside a conditional loop. I need to acquire analog input from the FPGA I/O Node just once when a boolean is on. This boolean continuously goes on and off at regular intervals.

 

When the boolean is off, no analog input has to be acquired and when it switches to 'on', data has to be acquired just once and stopped.

 

However, since the boolean is ON over a period of time (few milli seconds); data is being acquired as long as the boolean is on; multiple samples are being input.

 

Please suggest me how I have to solve this issue. Is there any way we can instruct the FPGA I/O node to acquie a simgle sample?

 

Thank you

 

 

Dheeraj Bharadwaj
IIT-Madras
0 Kudos
Message 1 of 4
(2,471 Views)

Hi Dheeraj,

 

the concept is known as "rising edge detection"...

 

Read the FPGA IO node only when bool = TRUE and previous value of bool = FALSE!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(2,464 Views)

Another option would to use a Wait On Edge node.  It looks like an FPGA property node.  It has been awhile since I used one, but it worked well.  This would freeze your loop until the designated edge you specify on the input occurs.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 4
(2,446 Views)

As GerdW mentioned, you can check the previous value.  You can use a feedback node (wired in the Forward direction) to get access to the previous iteration's value or a shift register.  Use boolean logic  (Current value) AND (NOT(Previous Value)).

 

Another option is to change the boolean value to false once a read is completed.  This assumes the boolean is not used for anything else as this could cause problems.

0 Kudos
Message 4 of 4
(2,436 Views)