help correction programme
souhail
i'm asking for help please :)
i'm working in an project, and my programm does not work yet .
my issue is to do some traitment to the signals i have, more clearly i have a periodic square signal , and i have to take out the standard deviation, the mean, the max and mean of every square( in the attatchment a pic thas explains all) without passing through null values.
my methode to do that , is to make a a differential of my signal , and after that i can identify the rising edge and the falling edge, and finaly identifying the square by placing cursors A,B and making the statistics.
program code
#pragma rtGlobals=1 // Use modern global access method.
Macro Ttmt()
statistiques()
END
Proc statistiques()
variable/G XL1,XL2
variable/G ii=0
// debut de boucle sur le nombre de passage (cordons)
do
FindLevel/EDGE=1/R=(XL1,XL2) LL_DIF,2 // first rising edge
XL2=XL1+13800 //
FindLevel/EDGE=2/R=(XL1,XL2) LL_DIF,-2 // first filling edge
XL2=V_LevelX
// take out statistic data LL
WaveStats/Q/R=(XL1,XL2) LL
LL_rms[ii]=V_rms
LL_max[ii]=V_max
LL_min[ii]=V_min
LL_sdev[ii]=V_sdev
ii=ii+1
while (ii<50) // as long as expression is TRUE // taken into account all the signal
End
Thank you for your help
July 31, 2014 at 01:52 am - Permalink
Now, generally it would be better to write "functions" instead of macros. You are not writing what exactly does not work, so I take some guesses. There seem to be some issues with the assignment of "XL1" and "XL2". Are you using the output of the first
Findlevel
function somewhere? Also, there is no initialization or update of the variable "XL1". Do you use some other function for that? You might want to check the values of "XL1" and "XL2" during the run using the debugger to make sure it does everything as intended. Hope that helps a bit.July 31, 2014 at 04:12 am - Permalink
July 31, 2014 at 05:09 am - Permalink