DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you find the average value of all the data between two points on a single channel

Solved!
Go to solution

Thank You Brad!

 

It looks that new version of the script works exactly like I need it to work 🙂

 

regards

Wojciech

0 Kudos
Message 11 of 16
(1,657 Views)

Hi All,

 

Whoops.  I missed one change in the script I posted yesterday.  Here's a fully functional version.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 12 of 16
(1,647 Views)

<Sigh>,

 

A customer pointed out to me that I had an error in the most recently posted script that incorrectly calculated array position from X axis position for waveform channels.

 

Here's the fix,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 13 of 16
(1,628 Views)

I'm not sure if the bug exists in all versions of the code shared here, but, when using the code with waveforms, it looks 1 second to the right of the selected window.

 

 

ElseIF ChnWfKey(Ych) THEN
  Start = Ych.Properties("wf_start_offset").Value
  Delta = Ych.Properties("wf_increment").Value
  IF Delta = 0 THEN Delta = 1
  P1 = 1 + CLng((X1 - Start)/Delta)
  P2 = 1 + CLng((X2 - Start)/Delta)

"P1 = 1 + ..." should not have the "1 +" term.

The attached file should take care of the problem.

 

0 Kudos
Message 14 of 16
(1,419 Views)

Hello jordani,

 

Thank You for information - I think that You have attached not the right file to the post (the one that is available is the script that loads the Layout / data not the "working script" itself.

 

Just for my understanding - bug exists only in the case that I will have less than 1second marked on the waveform chart ?

0 Kudos
Message 15 of 16
(1,413 Views)

Thanks for pointing that out. I've attached the correct file here.

 

The bug doesn't appear to be related to the amount of data selected. When the data are stored in waveform channels, a 1 second positive offset is added to the calculation window.

0 Kudos
Message 16 of 16
(1,405 Views)