DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Expanding channels

Can anyone provide me with some more detail about which script functions produce implicit channels and when expanding them will be permanent?

 

I have a number of scripts called by a master script that seem to result in large numbers of implicit channels, but calling ChnValExpand at the end of the master script doesn't expand the channels permanently. They will be expanded when the file is first created by the scripts, but if I close the file and reopen it the channels will return to the implicit state.

 

However, in a few places I have used ChnValExpand almost directly (but not exactly) after using ChnAlloc. In some cases, the channel is expanded and stays expanded, but in some cases it doesn't work. Further, it's a pain to write this line specifically for every channel allocation. Ideally, I would like all channels to be expanded all the time. I have no need for any other kind of channel than explicit ones.

 

If anyone knows of a way to either only create explicit channels or expand all implicit channels once and permanently then I would appreciate their help.

 

Regards,

 

Simon.

0 Kudos
Message 1 of 5
(2,407 Views)

Hi Simon,

 

Looks like you cannot expand the implicit channels permanently:

"If you previously assigned a channel you expanded with the command ChnValExpand() to an object, you must reassign this channel to the object because you cannot convert an implicit or registered channel object into an explicit channel object. If you do not execute this assignment after the expansion again, the channel object retains the contents it had before the expansion."

 

http://zone.ni.com/reference/en-XX/help/370858P-01/comoff/chnvalexpand/

 

Kind regards,

Kelly

 

Message 2 of 5
(2,371 Views)

Hi, thanks for your response. I don't really follow the reference to an 'object' I'm afraid. However, I suspect this is one of those cases where DIAdem is doing something complicated and un-intuitive so I'll more than likely give up trying to solve the problem.

 

To see what I mean, ChnLinGen generates a data channel with equidistant values. When it is created its storage is shown as explicit. It is only after saving AND reopening that its storage type changes to implicit_linear. This isn't helpful so I would much rather be able to create all channels in an explicit state AND have them stay in that state.

 

Regards,

 

Simon.

0 Kudos
Message 3 of 5
(2,360 Views)

Hi Simon,

 

Can you remind me what DIAdem version you're using?  Your references to ChnAlloc() make me think you may be working a decade or more behind the current version.  The DIAdem file saving behavior may have been different back then to what it is now with DIAdem 2018.

 

Specifically, the ChnLinGen() command creates an explicit channel.  This command will create a new "ABC" channel with 100 values between 0 and 1:

Call ChnLinGen("ABC", 0, 1, 100)

 

The ChnLinGenImp() command, however, always generates an implicit channel.  This is the same command that is invoked when you interactively right-click on a VIEW table and use the dialog to insert linear values.  The below command will create a new "ABC" channel with 100 values between 0 and 99.

Call ChnLinGenImp("ABC", 0, 1, 100)

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 5
(2,278 Views)

Hi Brad,

 

I'm using 2011. Some of the team here are using the same, some 2012 and some 2015. We tend to update slowly as we don't need to update year on year, and it normally brings trouble for our scripts.

 

Thanks for the info. I'll be getting 2018 soon, in theory, but I can only update our scripts in a way that is backward compatible.

 

Regards,

 

Simon.

0 Kudos
Message 5 of 5
(2,269 Views)