DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Split a Waveform into Smaller Segments

Solved!
Go to solution

I have a waveform that I would like to perform power quality analysis on.  There are several segments on one waveform that I would like to split up in order to perform the analysis on each segment individually.  Is there a way to accomplish this?

 

I have attached a picture to show the waveform.  I would like to segment it at each area where there is a change in magnitude.

 

0 Kudos
Message 1 of 6
(7,383 Views)
Solution
Accepted by Maverik380

Hey,

 

What you are going to want to do is to copy the data into new channels to perform the analysis on.  You'll use a for or while loop to cycle through the data, then, when you notice the max value of a specific segment changes, you'll want to copy that specific section to a new channel.

 

Call Data.Root.ChannelGroups(4).Channels.Add("Channel",DataTypeFloat64)

Call DataBlCopy("[1]/Time",1,16,"[4]/Channel",1)

 

In your loop, you can always use the ChnFind or CHD to find the numeric value.

Jesse S.
Applications Engineer
National Instruments
Message 2 of 6
(7,359 Views)

Hi Maverick,

 

Here's what I use to edit waveforms interactively.  If you detach the ZIP file contents to a new folder, then run the "Waveform Editing.VBS" VBScript in the DIAdem SCRIPT panel, it will add 4 new icons to the top icon bar in VIEW and 1 new icon in the NAVIGATOR.  You can position the band cursors and then click on one of those icons to perform the action you see in the tip strip.  These functions will NOT work if you have an Xchannel, only if you plot waveform channels or plot numeric channels vs. the array index.  The buttons will operate on all channels in the first group in the Data Portal.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 3 of 6
(7,355 Views)

This makes perfect sense, thanks!

0 Kudos
Message 4 of 6
(7,353 Views)

Thanks, Brad!  That sounds even better!

0 Kudos
Message 5 of 6
(7,352 Views)

Hello Maverik380,

 

I understand that your question on how to interactively select the segments has been answered. I would be interested to have NI R&D check whether your data can be splitted into segments automatically. To try this out, I would need an example dataset. Please let me know whether you are interested.

 

Andreas

0 Kudos
Message 6 of 6
(7,291 Views)