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: 

Sliding window over wavetrain in waveform graph?

At NIWeek 2006, Michael Cerna gave a very nice presentation in the area of Math & Signal Processing.  One of his example VIs I believe was entitled 'Cursor-based Measurement.vi' and in it he showed an interesting method of sliding a window over the signal to compute local properties over just that portion of the waveform that the window covered.  The windowed waveform was hilighted in a different color than the remainder of the waveform.  I have done something similar with a set of slide controls that allows the length and position  of the window to be changed by moving the slides.  I am trying to find his example both in the LabVIEW 7.1 and LabVIEW 8 examples and cannot locate it.  I want to see how he did what he did and perhaps modify it so that one can lengthen the window by clicking and dragging rather than inputting a length into a numeric control.  If this example was written in LabVIEW 8.2, I wonder if could possibly be saved to 8.0 and posted here.

Thanks,

Don
Message 1 of 37
(5,317 Views)
I don't know anything about the specific example you cite, but I have been working on the same issue.

I have attached a VI to select a portion of a wave.

Drag either cursor and it drags the "window", but keeps the duration constant.

Hold down SHIFT, and it drags only the one side, changing the duration.

Unfortunately, it's Windows only, because it uses the INPUT DEVICES functions.

If you do it with normal key-down events, it will miss a key-down or key-up even WHILE you're dragging the mouse.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 2 of 37
(5,304 Views)
See the attached.  Likely similar to Michael's but he implemented somehow without a slide control.  Test this and see what you think. It does not require the keyboard utilities and might be a good cross-platform solution (until I figure out what he did or someone posts it).
 
Sincerely,
 
Don
0 Kudos
Message 3 of 37
(5,281 Views)
Well, you had asked about a "cursor-based" selection method so I gave you that. I have a PICTURE-based one, but it uses a slide control like yours.

If you move the START past the END, your program gets confused. I suspect it's the control itself which is confused.

Anyway, thanks for more ideas.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 37
(5,275 Views)

Right, the slider method is a little clunky (I'm not crazy about my method which is why I posted in the first place); probably there is a way to make sure end limit (slide) cannot go lower than start limit (slide).  I will look at adding that code and re-posting.    I think eventually Mike's VI will make its way to this discussion as well.  In his method he showed at NI week, there was no cursor visible but I assume somehow he was doing it with cursors.  The only thing you saw was the overlay window and he would mouse on that and move the window.

 

Don

0 Kudos
Message 5 of 37
(5,277 Views)
The only thing you saw was the overlay window and he would mouse on that and move the window.

Could you stretch and shrink it too?

I suppose you could do it by brute force, detecting clicks on a decoration or something on top of the graph, and moving / stretching / shrinking the decoration when the mouse moves. That's a lot of work, and you'd have to do a lot of coordinate transformation to get real data-coordinates out of it.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 37
(5,268 Views)
IN case anybody wants it, here's a way to use a picture to display the data and the sliding, adjustable window.

It uses a MODIFIED copy of the standard PLOT WAVEFORM vi, modified only to bring out the SCALE FACTORS so I can use them later.

It's not very pretty.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Download All
0 Kudos
Message 7 of 37
(5,267 Views)
You hit a key point.  No, he manually set the window width with a numeric control.  I wanted to see if I could modify it so you could stretch it in either direction using some LabVIEW technology.  I'm still working v7.1, I'll be upgrading to v8.2 soon and there may have been a technology that he used that was native to v8.2 that I/we don't know about that accomplished things in a less complicated way than we think.  Another reason we want to see it.  I know in v8 and above, there are cursor-based events that are not available in v7.1.
 
Don
0 Kudos
Message 8 of 37
(5,263 Views)

This version does some limit checking on the sliders so the end slider cannot be less than the start slider.  It also now uses a 'value change' event rather than 'mouse up' event so that the overlay on the graph now slides while moving, shortening, or expanding.  It may be in its optimized state right now so at this point, probably time to wait for Michael to post.

Don

0 Kudos
Message 9 of 37
(5,261 Views)
ps. I expect that with cursor-based value change events in v8.0 and above, we can implement a hybrid interface to what you and I have done, but without the keyboard utilities.  It would require a 3rd cursor, probably centered between the start and end cursors, that would be used to slide the whole window.  When I install v8.2, I can try this as well.....Don
0 Kudos
Message 10 of 37
(5,260 Views)