DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I calculate an average of a section of data from one channel

I want to be able to:

- plot some data in VIEW

- zoom in on a section of a channel of interest (lets say zoom in on 10 seconds of pressure data from a 10 minute log)

- calculate an average of the data that falls in that zoomed time range, i.e. calculate the 'local' average of that 10 seconds worth of my pressure data

0 Kudos
Message 1 of 5
(4,840 Views)

Hello David,

 

There is an example in the example finder in DIAdem that shows exactly this functionality.

 

Please select the following menu: Help > Examples and select the example shown below:

 

6-19-2011 11-41-54.png

 

That example does exactly what you are asking for ...

 

Hope that helps,

 

      Otmar

Otmar D. Foehner
0 Kudos
Message 2 of 5
(4,829 Views)

Otmar,

 

It does indeed do what I want (on the example data). I want to then do two things. One, remove any link to the example data so that this functionality can be used on the data I have loaded. Two, modify DIAdem so that this script can be triggered via a menu command whenever I desire this same functionality and I have my own data loaded. Is it possible (like it is with an Excel Addin) to add custom menus to DIAdem to allow fast launching of existing scripts?

 

Thanks,

David.

0 Kudos
Message 3 of 5
(4,811 Views)

Hi David,

 

In order to link in your data instead of the example data, you will need to edit the script associated with that example.  In the example finder, if you select the "Copy example files" option under "Start example," then you can copy the necessary files to a different location and then load them into the script window of DIAdem.  You can then edit the file and path information i nthe VIEW_Statistic_Init.vbs file.

 

You can also add a menu command to run this script to your DIAdem interface.  You will need to use the MenuItemAdd command to do so.  You can read more about the command in the DIAdem Help:

 

DIAdem menu add.png

 

 

Hope this helps!

 

 

Regards,

 

Stephanie R.

National Instruments

Stephanie R.
National Instruments
0 Kudos
Message 4 of 5
(4,792 Views)

Hi David,

 

Yes, we can add a custom menu or custom icon that calls code like this to operate on whatever channels you have in the Data Portal or perhaps alternatively whatever channels you have selected in the Data Portal.  Here's a similar example that would be easier to edit.

 

Let me know if you have any trouble,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 5
(4,624 Views)