05-24-2016 10:57 AM
Hello to everyone!!
I need to use following statement:
ChnCalculate("Ch(""[1]/"Channel1""") = Round(Ch(""[1]/"Channel1"""),(cint(log(abs(Ch(""[1]/Channel1""))))-2))")
The rounding of values have this particular condition. As you see to calculate decimal places I use a "log". My problem is that when my channel value is equal to "0" the returned value of course is No Value. I don't know if is possible to only perform the ChnCalculate when the value in the channels is different from 0. Or I have to program my script differently.
Thanks to everyone!
Solved! Go to Solution.
05-25-2016 12:51 AM
Hello MariaEsmeral,
I fit is necessary for you to have a rounding with a dynamic number of digits then my suggestion is to add a NoValue function to your script. As you mentioned in case of zero the ChnCalculate function returnes for the log a NoValue. But in case of zero a rounding would return zero. So after the calculation with ChnCalculate you can set all NoValues to zero with this command:
Call ChnNovHandle("[1]/Channel1","[1]/Channel1","SetValue","XY",1,1,0)
You find the NoValue handling function in ANALYSIS in the toolbar “Channel functions”
Greetings
Walter