04-30-2014 03:46 PM
hi, my mother languaje is spanish and i'm very confused
the user dialog box what it should be doing is that i could choose from two chn combo boxes 2 angles data from which i want to calculate the difference.
tl:dr i want to select 2 angles and Call Calculate("Ch(""ANS"") = (Ch(""L1(1,1))"") -(Ch(""L1(1,2)""))
this is by far my script in the user dialog box
'advierte de cambio de variable En ANGLE1
Sub ChnComboBox1_EventChange(ByRef This) 'Created Event Handler
Call MsgBoxDisp("Selected channel: " & ChnComboBox1.Text)
End Sub
'advierte de cambio de variable En ANGLE2
Sub ChnComboBox2_EventChange(ByRef This) 'Created Event Handler
Call MsgBoxDisp("Selected channel: " & ChnComboBox2.Text)
End Sub
'PLOTS
Sub Button1_EventClick(ByRef This) 'Created Event Handler
Call Calculate("Ch(""Result5"") = (Ch(""L1(1,1))"") -(Ch(""L1(1,2)""))
End Sub
had a lot of trouble with examples please help any advice will suffice
Solved! Go to Solution.
05-05-2014 04:42 PM
Hi Johnny,
As long as you have a reasonably new DIAdem version, you should be able to use the built-in subtraction function from the ANALYSIS panel instead of the channel calculator, like this:
Call ChnSub(ChnComboBox1.Text, ChnComboBox2.Text, "Result5")
Brad Turpin
DIAdem Product Support Engineer
National Instruments
05-05-2014 10:36 PM
thanks that did the job
12-03-2019 07:47 AM
what will be the result channel's frequency after subtraction, if both parameter channels have different sampling rate?
12-05-2019 04:19 PM
Hi Sovarian,
Most ANALYSIS functions in DIAdem that use multiple input channels assume that the channels are the same length and run the calculation row-by-row across the input channels. So you'd need to row-align the channels you want to subtract first before running the subtraction calculation. In all versions of DIAdem you can use the ANALYSIS function "Linear Mapping", and in newer DIAdem versions there is a "Resampling" function you could also use.
Brad Turpin
Senior Technical Support Engineer
National Instruments