LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Initialization of PtByPt Lilter

Hi everyone,

 

I am acquiring a continuous waveform signal and would like to run a bandpass filter on prior to real-time display... I understand I need to use a ptbypt filter and that the "initialize" input t the ptbypt vi should be "true" for the first iteration of the while loop and "false" for the following loops within the same call.

 

Any suggestions for how I can do this?

 

Regards,

Jack

 

 

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

Maybe you could use the first call? primitive and a T/F case structure inside your loop? Make sure you read the help for that primitive.

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 2 of 5
(2,664 Views)

The easy way is to use a "Equal to 0?" function with the loop iteration counter.  The first iteration of the loop will have i == 0, so you only initialize on the first loop.


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
0 Kudos
Message 3 of 5
(2,660 Views)
Hi GovBob and Crossrulz,

Thank you for your replies... Very helpful... I was thinking something alone those lines....

However, my continuous daq vi will have an "idle" case in the loop that will keep the loop running but will "stop" the "read.vi" (so I can do some basic signal analysis, stop data to the graph so I can use the graph palette tools to zoom in etc)... When I start the "read.vi" again should the filter be re-initialized? How might I do this given that to loop has not stopped and the first call will not work and the loop iteration could be anything... Perhaps through a shift register?

Thanks,
Jack
0 Kudos
Message 4 of 5
(2,652 Views)

Since you are using a state machine, I would use a boolean in a shift register.  Set the value to TRUE when you need to reset the filter, set it to FALSE when using the filter, and wire it straight through for all of the other cases.


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
0 Kudos
Message 5 of 5
(2,648 Views)