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: 

Working with shift registers for finding index of threshold point.

Solved!
Go to solution

In your FALSE case, you wired up the input tunnel.  It should be the one coming from the shift register.


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 11 of 17
(1,104 Views)

Wired the ouput shift register with the input shift register for the false statement

 

Result:

The previous and the new values are the same. The subtraction shows 0 result.

heartbeat = infinty.

 

Thanks

0 Kudos
Message 12 of 17
(1,102 Views)
Solution
Accepted by topic author anupam2016

I think what is happening is your value is staying above the threshold for more than 1 sample, and therefore you are getting indexes that are right next to each other.  Since we only care about the rising edge for the sake of our calculations here, use a Boolean Crossing PtByPt to only perform the calculation when the threshold detector result goes from FALSE to TRUE.


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 13 of 17
(1,090 Views)

Hi,

 

I tried implementing the Boolean crossing ptbypt VI. I wired the output of the threshold pt by pt into the input of booleancrossing ptbypt. I set the direction to false from true. The results were similar to previous tries. Both the shift registers gave same values, making heartbeat = infinite.

I also tried making the direction to true to false , but it gave no results. i.e: The shiftregisters seemed to not get updated.

 

Can you suggest me something else which I can try?

 

Thanks

 

P.S:I am uploading my modified VI.

0 Kudos
Message 14 of 17
(1,079 Views)
  • Do you have a stretch of typical voltage data that we can use to play back and test? We don't have your instrument.
  • Why the boolean crossing? Why don't you just check if the index has changed instead, that would ensure that the value differ and you don't get a division by zero.
  • Your diagram comment is differs 180 degrees from the actual setting you use (true-false vs. false-true).
  • How noisy is the data? Wouldn't it make more sense to analyze the threshold of the filtered data?
  • Is this the established way to analyze that kind of data or did you come up with that?

 

0 Kudos
Message 15 of 17
(1,073 Views)

Hello,

Will a TDMS file work. I am attaching it.

I was told to use boolean crossing, after number of tries.

The comment in the diagram is a mistake.

Noisy is present, but is negligible in contrast to the signal.

Similar logic is used in few videos where implementation is in MATLAB.

 

Thanks

0 Kudos
Message 16 of 17
(1,071 Views)
Solution
Accepted by topic author anupam2016

Seems to work just fine. Did you set the threshold correctly?

Message 17 of 17
(1,067 Views)