From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.


Showing results for 
Search instead for 
Did you mean: 

Integrating over a portion of data

I want to run an integral on a portion of my data, but I cant seem to figure out how to select a time period.  All I can seem to do is itegrate across all of my data.  Is there a way to select a portion of data?

0 Kudos
Message 1 of 8

Hi spickman,


A handfull of analysis functions in DIAdem do support operation over a specific row range of the input channels, but the integration function is not one of those.  In general what you do in DIAdem is select the X-axis range of interest in VIEW with band cursors and flags, then copy out the region of interest with the flag copying icon.  This gives you a new X and Y channel pair that runs only over the X-axis range you're interested in, and you can apply the integration calculation to those new channels to get your desired result.


Let us know if you have trouble with the X-axis region copying in VIEW,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 8

I'm currently working on this same type of issue. Therefore, I have a couple of additional questions on the subject.


1. How do you specify which channel will get flags when you click the "Set Flags" Button? I may have many channels shown in the VIEW window, and I am looking to pull the region from specific channel(s).

    So far all that I can get to happen is that DIAdem sets flags on one channel (that I can't seem to figure out how to control) or holding shift I can set flags onto all channels.


2. How can I integrate a curve with an offset? For example, I may have many channels and a plot that displays from -10 to 250 on the y-axis, but I may wish to determine the area that is under Channel #10 and above 70.

    i.e. I may wish to know the "degree-minutes" area that describes how long the temperature sensor (Channel #10) was above 70 deg F.


Any suggestions? I'm self-training in DIAdem at the moment and video tutorials generally do not cover the things that are most important to our data manipulation practices.



0 Kudos
Message 3 of 8

I have been running through the steps necessary to do the type of calculation I was talking about for an entire channel (simpler than a portion of a channel), and the amount of required steps seems excessive.

I will list below what I am attempting and my list of required steps; let me know if I can do anything to make this process easier.


Goal: Find the Integration (area under the curve) of a data channel that is above 80 deg F.




1. Create linear channel @ 80 with units of deg F
 2. Convert Channels to deg F from the way in which they were imported (F)[Which DIAdem sees as Farad]
 3. Use channel calculator to manually create new channel = (data channel)-(80F linear channel)

 4. Convert resultant channel to deg F
 5. Attach the proper timescale axis to resultant channel (none inherently attached)
 6. Convert timescale axis to proper units (not stored with any units)
 7. Use Analysis functions to integrate under resultant difference channel
 8. Attach appropriate timescale axis to resultant channel
 9. Rename created integration channel as appropriate (cannot specify name during calc process)
 10. Drag to plot 


This seems like a lot of work. Is there any way to simplify?

In addition, I'm importing all my data as TDMS files that were created by LabVIEW processes. How can I get my data to import with correct units? This may save me some time.

In LabVIEW, we're using units (F,VAC, etc) simply as strings that control an Enum to perform data-specific calculations during data collection. I assume that this is why the units are importing incorrectly.

0 Kudos
Message 4 of 8

Hi Chris,


First of all, when you're saving the TDMS file in LabVIEW, attach a property named "Unit_String" to each channel with the desired DIAdem Unit.  By the way, "°F" will work in DIAdem as well as "degF", if you prefer.  If you know the timebase for each channel in LabVIEW, then you can save the appropriate waveform properties to each channel:

wf_start_offset		DBL
wf_increment		DBL
wf_xname			String
wf_xunit_string		String
wf_samples		I32 (optional)
wf_time_pref		String ("relative" or "absolute")
wf_start_time		DateTime (optional)


Do you really want to subtract the 80°F value from your data, or are you only doing that to make the desire integral region easier?  If you really do want to subtract this value, then I'd recommend you use the ChnLinScale() command and skip creating the threshold channel and the channel calculator.


Do you always want to integrate the values in excess of 80°F?  If so, then I can suggest an efficient few lines of code to calculate the x region and calculate the integral in that region.  If the region you want to integrate is different from data set to data set, perhaps it would make sense to surround the desired x region with band cursors and use those in the VBScript.


Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 8



Thanks for that information. I believe that I can get the units worked out with a little bit of LV code modification. I really would like to have my data in waveform format but there is an issue with my data and waveform channels.


1. All of my data channels have unique timestamps (I believe that this is covered in your previous response)

2. My data points are NOT necessarily recorded at a set interval. We're using a queue from multiple sources, so my timestamps are NOT always at a given interval


As for the integration itself, we would like to be able to follow this format:


User Defined Inputs:   (Threshold Value (deg F), Integral Region Start (time), Integral Region End (time)

Outputs:                    Area of Integral region following User Defined Inputs


I have tried using band cursors, but can't seem to figure out how to define what channel gets flagged. I have multiple data channels on one view and the band cursors seem to have a mind of their own regarding which line is the lead.

0 Kudos
Message 6 of 8



You must select the channel on the right of the graph. See The picture below:



National Instruments
0 Kudos
Message 7 of 8

Hi Chris,


The leading curve that the cursor tracks with is the one whose legend color square has a solid black center.  You can click in the center of the legend color square of any curve to change the leading curve.  There can be only one leading curve at a time.


I put together an interactive example that I think will interest you and may solve your interval integration needs.  If I had access to your data set, I could have customized the VIEW layout to point to your data channel names.


Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 8 of 8