DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

ChnCalculate

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? 

0 Kudos
Message 1 of 5
(4,463 Views)

Hello!

 

It must be CTNV and not CNTV as you wrote.

 

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 2 of 5
(4,448 Views)

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?

0 Kudos
Message 3 of 5
(4,432 Views)

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

0 Kudos
Message 4 of 5
(4,417 Views)

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?  
0 Kudos
Message 5 of 5
(4,410 Views)