DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

scale channel by property

I have saved a number of channels in TDMS. The data is unscaled to save disk space. I attached the scaling factors of each channel as properties to each waveform. Now all I have to do is to multiply the waveform with one of its own properties. I've been trying to accomplish that using the calculator. Unfortunately I just can't get the syntax right. I have been trying the special variable "ChnPropGet(??,prop name)"
Anybody know how to do this right? Thanks!
0 Kudos
Message 1 of 3
(3,657 Views)

Hello Art-Jan!

You have to loop over all channels and make this call (assuming the factor is in 'registrerval1'):

Call FormulaCalc("Ch('[1]/MyChannel1') := Ch('[1]/MyChannel1') * " & str(ChnPropValGet("[1]/MyChannel1", "registerval1")) )

(replace '[1]/MyChannel1' with the group/channel name')

Matthias

 

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
Message 2 of 3
(3,642 Views)
Hi Aart-Jan,
 
Matthias is of course right as always.  Just in case you're like me and would welcome a little explicit clarity, here's the format I prefer:
 
L1 = CNo("[1]/Channel Name")
R1 = ChnPropGet(L1, "ScalingPropName")
Call FormulaCalc("Ch(L1):= Ch(L1)*R1")
 
Cheers,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
Message 3 of 3
(3,635 Views)