DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

design mathematical calculation in script on each element of array.

Solved!
Go to solution

Hi all,

 

I am trying to write the VB script in which i want to do different custom mathematical operation on each element of any specific channel data. For example for every element i want to find average of next two index data and two before and then after based on results, there is further computation.

 

It will be great help if any one can guide me in performing operation on array elements inside diadem script, as we can do in labview using index in array. There is predefined mathematics and statistics tool in Diadem under analysis tab. But i want to design for my custom mathematical operation.

 

Thnks

HS

Message 1 of 5
(4,665 Views)

Hi HS,

 

What version of DIAdem are you using?  The data access functions were improved in the latest DIAdem 11 version.

 

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 2 of 5
(4,652 Views)

Hi Brad,

 

I am using DIAdem 10.2. I m looking for help in designing custom mathematical operation as i had explained in my previous post..can we do in this version ? and please help me designing so.

 

Thanks

HS

0 Kudos
Message 3 of 5
(4,644 Views)
Solution
Accepted by topic author H_SH

Hi HS,

 

Here is a DIAdem 10.2 version of what I understand you to be asking for:

 

Window = 2

Denom = 2*Window+1

Threshold = 10

ChNum = CNo("[1]/Speed")

FOR i = 1+Window TO ChnLength(ChNum)-Window

  Sum = 0

  FOR j = i-Window TO i+Window

  Sum = Sum + ChDX(j, ChNum)

  NEXT ' j

  Ave = Sum/Denom

  IF Ave > Threshold THEN

    ' do contingent action

  END IF

NEXT ' i

 

Brad Turpin
DIAdem Product Support Engineer
National Instruments

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

Hi Brad,

 

Thanks alot for your support and help...

 

Regards

HS

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