DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Channel Syntax in ChnDel vs. ChnAlloc in DIAdem 9.1 SP2c

Hi,

I just updated my DIAdem 9.1 to SP2c and found some inconveniences in the change of the syntax of ChnAlloc. Since SP2b you have to give just the name without the "Group/" part. But ChnDel still needs this! This is pretty ugly on working in loops. I have a script which runs over a dozen groups and creates/modifies some channels (about half a dozen source channels and a dozen result channels). To be on the save side I delete the channels before allocation (if I rerun a script I don't want to get old results). Using "On Error Resume Next" this is no problem if the channel doesn't exist, but not inlcuding "Group/" in ChnDel will result in deletion of the channel with this name in a inactive group!

So with the new syntax for ChnAlloc I have to use two different channel name strings for deletion and allocation. This isn't nice! I'd rather prefer usage of "Group/Channel" anyway as this is clearer. And else ChnDel("Channelname") should just act on the current group and not delete a channel with this name in another group!

It took me quite a while to figure out why my script didn't work as expected (and I updated while writing this script, so it worked first).

So long,
    Carsten
0 Kudos
Message 1 of 4
(3,447 Views)

You're right, I also regard this as a bug. According to NI, it is a feature.

Even worse: in some commands you have to give the channel index, in some the channel name....

A quick hint: If you use "/channelname" instead of "channelname" the command deletes the channel in the defaultgroup, not the first channel with this name. 

0 Kudos
Message 2 of 4
(3,413 Views)
Yeah I know. Thanks. Still this is  just a workaround. Best seems to use CNo everywhere and use the index to adress a channel. Just one step more and not possilbe for ChnAlloc 😞 I really don't want to use GroupDefaultSet but address all channels absolutely everywhere.

Actually I can't understand, why the syntax is not the same for all commands in this regard. I assume for historical reasons...
0 Kudos
Message 3 of 4
(3,408 Views)
Hi all,

I will try to explain the difference:

ChnDel requires the address of the channel which should be deleted. You can use one of the following possible channel address terms:

"Group_Index/Channel_Index"  
Address a channel via specific group index and specific channel index (since DIAdem 9.0)

"Group_Name/Channel_Index"
Address a channel via specific group name and specific channel index (since DIAdem 9.0)
 
"Group_Index/Channel_Name"
Address a channel via specific group index and specific channel name (since DIAdem 9.0)
 
"Group_Name/Channel_Name"
Address a channel via specific group name and specific channel name (since DIAdem 9.0)
 
"/Channel_Name"
Address a channel via Defaultgroup and specific channel name (since DIAdem 9.1)
 
"Channel_Name"
Address a channel via specific channel index (since DIAdem 1.0) DIAdem is looking for the first channel with the name "Channel_Name" in order of the channel numbers. This is necessary to be compatible to older DIAdem scripts.
 
"Channel_Number
Address a channel specific channel number (since DIAdem 1.0) DIAdem is using the channel numbers. This is necessary to be compatible to older DIAdem scripts.


Different to that is the command ChnAlloc. The first parameter is the Channel name. You can make a suggestion for this Channel name and DIAdem checks whether this name is OK (necessary because of unique channel names in a channel group, if the name is not OK DIAdem fits the name automatically).
In DIAdem 9.1 the command ChnAlloc was overdetermined. You could specify the target channel group together with the channel name suggestion and additional to that with the 6th parameter. That was a bug which was fixed with the service pack.
To work more easily with the generated channels we added a return value to the command ChnAlloc for DIAdem 10. This return value is an array with all generated channels. The channel name syntax depends on the current channel name address syntax which is by default "Group Index/Channel name".

I hope this clarifies the problem.

Greetings
Walter


0 Kudos
Message 4 of 4
(3,398 Views)