10-28-2009 12:20 PM
I'm trying to use the diadem calculator to create the equivalent of a 'if less than 4.0 replace with no value or 0' for the complete cell count of a named channel . Either create a new channel for the result or replace the old values
thanks
AdeK
10-29-2009 02:25 AM
Hi Adek
There is an "Procedure" in the help that describes exactly what you want. The formula is:
Ch("Group2/Result") = Ch("Group1/Input")+CTNV(Ch("Group1/Input")<4)
For explanations see the help tree under "Procedures>Mathematics>Eliminating Outliers Using NoValues"
Hope this helps.
Winfried
10-29-2009 03:43 AM
Hi Winfried,
Thanks for the advice, I searched the forum instead of looking in the help....my mistake !
I will first search the standard help in future .
Regards
AdeK
11-03-2009 07:55 AM
Hi Winfried,
It's not quite the solution i need.
I want to turn a noisy analogue signal into a digital state plot therefore if <5V substitute a 0, if >5V substitute a 1- if this can be acheived using the Diadem calculator in one operation, this would be useful.
Regards
AdeK
11-03-2009 01:10 PM
Hello Adek!
The IIF command is the solution for you task. Try this expression:
Ch("Result")=IIf( Ch("Input")>=5,1,0)From my experience you have to filter or smooth the input singal in front of the calculation to get a good result. This depdends on how 'noisy' the signal realy is.
Matthias
| Matthias Alleweldt Project Engineer / Projektingenieur  | Twigeater? | 
11-04-2009 10:08 AM
Hi Adek,
Twigeater is absolutely right, as always, and he's pointed you to the most recent and syntax-friendly option available in DIAdem 11.0 and later.
If you are using an older version of DIAdem, or if you're manipulating very large channels, I'd recommend using the old "FormulaCalc()" function, which is faster for numeric channels and has a boolean construction that automatically resolves to 0 or 1, corresponding nicely to what you want. Here's the code:
R1 = 0.2
L1 = CNo("Noise data/Noise_1")
Call FormulaCalc("Ch(L1):= (Ch(L1)>R1)")
Brad Turpin
DIAdem Product Support Engineer
National Instruments