03-18-2008 01:03 PM
03-18-2008 02:46 PM
Hello Adek!
The generic approach looks like this:
Call ChnCalculate("Ch(""Result"") = Ch(""Values"") / Array(1,10,100)(Ch(""Index""))")
Assuming 'Values' is your values channel name and 'index' is the index channel name with the 0/1/2 values.
If it is just the calculation you described you can also use a little bit mathematics:
Call ChnCalculate("Ch(""Result2"") = Ch(""Values"") / 10^(Ch(""Index""))")
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
03-19-2008 02:19 AM
Hello Matthias,
Thanks for the information, just to confirm, the excel function I am trying to replicate is :
Cell C2 =IF(Cell A2=0,Cell B2/1,IF(Cell A2=1,Cell B2/10,IF(Cell A2=2,Cell B2/100,Cell B2)))
Repeated for the whole channel length.
Therefore two channels A and B with the data and a new created channel C which is the result of the function
Maybe more of a nested function than concatenated perhaps.
Will your solution give me this result ?
Thanks
Ade
03-19-2008 02:24 AM
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
03-19-2008 02:32 AM
Thanks Matthias,
I will give it a try.
Ade
03-19-2008 10:55 AM
Hi adek (and others),
Just a quick note for the future. R&D is actively working on making exactly this Excel IF() use case easier in the Channel Calculator.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
03-19-2008 11:41 AM
Hi Brad,
Thanks for the info, I'm sure it will be a welcome addition to the diadem tools for many users.
Regards
Ade