09-14-2008 11:55 AM
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
Solved! Go to Solution.
09-15-2008 09:09 AM
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
09-15-2008 09:48 AM
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
09-16-2008 09:52 AM
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
09-16-2008 11:43 AM
Hi Brad,
Thanks alot for your support and help...
Regards
HS