DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

CNo Function

Solved!
Go to solution

Just noticed in the Help file for Diadem 2019SP1 the following

 

 

Function: CNo

 

 

 

Note  This command is no longer available in the current DIAdem version.

 

 

The function still works. Is this an error in the documentation or is CNo due to be deprecated in future releases?

 

 

0 Kudos
Message 1 of 4
(1,583 Views)

Hi Onkar,

 

Typically DIAdem obsolete commands are marked in a release as obsolete, and then one or two revisions later, the functions are removed completely. This is so that while the total functions you need to use are lowered (not supporting old technology/functions allows for more room for newer technologies without increasing time investment from users), you also have time to migrate this function between versions if required.

 

I don't currently have DIAdem 2020 or SP1 installed to check this, but I expect that one of these will be the last version this works in. If you currently use CNo, there should be a note in the help file on how to replace this in future versions.

 

Cheers,

Nick

0 Kudos
Message 2 of 4
(1,509 Views)
Solution
Accepted by topic author Onkar

Hi Onkar,

 

CNo() returns the channel number of the channel reference you pass into it.  DIAdem 20 years ago predominantly used channel number referencing, but for many years now R&D has been wanting to wean the user base off channel number referencing.  It made more sense to number channels uniquely when there was just the DATA panel in DIAdem 8.x.  Since DIAdem 9.0 and the advent of the Data Portal and channel groups, it makes a lot more sense now to reference the group and then the channel index within the group.

 

The main problem with channel number referencing is that when you move or delete or insert channels, that messes up the channel numbering.  It's really much MUCH better now to use the channel object variable and the channel group object variable.  Once you make the switch to using channel objects, you'll never want to use CNo() again.  I know, I used to use this function heavily and reference channels always by channel number.  One little known tip when using object variables, you can pass the channel object variable directly into just about any DIAdem command that you're used to passing a channel number into-- including CNo(ChannelObjectVariable).

 

Brad Turpin

Principal Technical Support Engineer

National Instruments

0 Kudos
Message 3 of 4
(1,501 Views)

Hi Onkar,

 

DIAdem R&D was strongly considering removing channel number indexing from DIAdem, for performance reasons, when they were expanding the maximum number of channels in the Data Portal from 65535 to 150000.  They discovered that the performance hit from the channel number indexing was not too bad.  The main bottlenecks were GUI elements such as the Data Portal and channel selection drop downs that preloaded all the channel information, instead of fetching the visible items' information on demand.  So channel number indexing survived that potential demise, and CNo() and all the other associated channel number approaches still work in DIAdem 2020 SP1 and will likely work in the next few versions as well.  I have not heard any renewed chatter about removing channel number referencing recently.  R&D reserves the right to terminate this approach if they decide at any future junction that it's in the best interest of the product's future.  Working in your favor, though, is that there is a WHOLE lot of VBScript code out there that uses channel numbers, so there would be a high support cost to removing that ability from any future DIAdem version.

 

In the meantime, though, I do recommend that you give the channel object approach a try for any new scripts to create.  I think you'll agree that, after you get used to the difference, the channel object approach is much more elegant and robust than the channel number approach.

 

Brad Turpin

Principal Technical Support Engineer

National Instruments

0 Kudos
Message 4 of 4
(1,400 Views)