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: 

Array, signal post processing

Solved!
Go to solution

Mr kevin

i have counted no gmr and encA  pulses in between z index.

please would share logic how to write code to find # enc A pulses between first 2 GMR pulses *after* a Z pulse 

thanks in anticipation

0 Kudos
Message 11 of 12
(207 Views)

It looks like you made 2 copies of the algorithm I posted, but it isn't clear what you've done to *understand* it.  You'll *need* to understand it because you have different kinds of evaluation conditions and some of them may have tricky boundary conditions.  For example, when you want to count pulses "after" something or "between" two things, how will you handle cases where things are simultaneous?  Do they or don't they count as "after" or "between"?

 

So let's try things this way.  Write a brief text description of an algorithm that you think should do what you want.  Then try to implement that algorithm in LabVIEW code.   Evaluate your results.  Adjust algorithm/code as needed.  Put some time into tinkering.  If you get stuck again, *then* post back with the text algorithm, the LabVIEW code, and some description of what you discovered and changed during your troubleshooting.

 

For example, here's my text description of the algorithm I posted:

1.  Identify sets of indices for rising edges of both GMR and encA signals.

2.  For each consecutive pair of GMR indices, identify which encA indices fall between them.  (Simultaneous indices count as falling between.)

3.  Count them.

 

Both text description and code implementation are important for troubleshooting.  Sometimes the error is in the logic of the algorithm description, sometimes it's in the code.  (And sometimes both.)

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 12 of 12
(191 Views)