DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Object required in 'CNO(...)'

Solved!
Go to solution

Hi,

 

This is my first time using  DIADEM and VB scripting, apologies in advance, if my question does not make more sense. In the below line of code, i am looking for "If The Definition channel is present or not "

If CNo(GroupTxt & "id_"& TempEmisType & TempChnStr & "Definition_").Properties("Unique_Definition").Value>0 Then

but, its throwing the error saying: Object required :'CNO(...)'

for your reference the above variables hold this values :

GroupTxt  1,

TempEmisType - emissions

TempChnStr-stream

 

And when i am using the old code, which i need to do certain modifications but majority of syntax is same, its still working, old code is:

If CNo(GroupTxt & "Ad_"& TempEmisType & TempChnStr & "DefinitionUnique_")>0

Any help is highly appreciated.
Thanks in Advance

0 Kudos
Message 1 of 3
(2,253 Views)
Solution
Accepted by topic author Kandukuri_raghavendra

The upper code does not work because CNO(...) returns a numeric value back and not a group or a channel so

.Properties("Unique_Definition").Value

on a numeric will not work. However, you can use the numeric you get back from CNO(...) to get the group and the use ".properties" on it.  Try:

If Data.Root.ChannelGroups(CNo(GroupTxt & "id_"& TempEmisType & TempChnStr & "Definition_")).Properties("Unique_Definition").Value>0 Then

http://zone.ni.com/reference/en-XX/help/370858M-01/functions/functions/cno/

Message 2 of 3
(2,227 Views)

Thank you @gsklyr, will try it.

0 Kudos
Message 3 of 3
(2,219 Views)