02-17-2010 03:33 AM
Hello!
I am trying to execute the following ChnCalculate function:
Dim TargetChannel, YTolerance
TargetChannel = "[1]/I_"
YTolerance = 0.03
Call ChnCalculate("CH(""/1stFilter"")=CH("TargetChannel")+CNTV(CH(""/3PtsSumAvgDev"")>YTolerance)")
I searched through the form and have found that variables inside ChnCalculate() have to be global. So using R1 or T1 (and so on...) or a globalvar should be fine. Right?
Thus, I switched to the following code and the problem with 'YTolerance' variable has disappeared.
R1 = 0.03
Call ChnCalculate("CH(""/1stFilter"")=CH(""/I_"")+CNTV(CH(""/3PtsSumAvgDev"")>R1)")
But the 'TargetChannel' does not let me execute the code no matter what I do. Is it because CH() does not accept variable as its argument?
02-17-2010 10:46 AM
Hello!
It must be CTNV and not CNTV as you wrote.
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
02-18-2010 01:35 AM
Oh! Sorry about the confusion. It should be CTNV instead of CNTV. But I don´t think the problem comes from CTNV. Is my variable declaration with "I_" wrong?
02-18-2010 08:36 AM
HI kincyber,
Do you still get the errors if you replace all your "/Channel" references with explicit "Group/Channel" references? You may want to post your data set so we can help you debug better.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
02-18-2010 12:30 PM
Hello!
I renamed my example channels according your names. Everythings worked fine for me. As Brad mentioned might it be a problem not to define a group name for your channels. If you have several groups and the default group is the wrong one you will run into trouble.
What is exactly your situtation now? Do you get an error message or are the values in the result channel wrong?
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |