DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

NoValues

Hello,
I am having a problem while doing a For...next sequence.
I'm trying to delete NoValues of several Channels of different groups. The problem is that only the NoValues of the first Group are deleted.
I am using this For...next sequence because the number of Groups will be different in every execution.
I am using version 9.0.


Dim i
L1=GroupCount
for i=1 to L1
Call GroupDefaultSet (i)
Call ChnNovHandle ("ANIMAL","INSENTEC-Temps","Delete","xy",1)
next


Thank you!
0 Kudos
Message 1 of 6
(4,077 Views)
Hi Leiabcn,

You have two possibilities to set the correct addressing for a channel in DIAdem 9.0:

1) cno("GroupName/ChnName")
2) cnoxget(GroupIndex,ChnIndex)

The CNO result is the channel number (the number you can see in the Dataportal list view). The input are the names of the group and the channel)

The CNO result is the channel number (the number you can see in the Dataportal list view) but the input are the index of the group and the index of the channel in this group.

for you example you can use that like:

Dim i
for i=1 to GroupCount
Call GroupDefaultSet (i)
Call ChnNovHandle (cnoxget(i,1),cnoxget(i,2),"Delete","xy",1)
next

Greetings

Walter

PS. With DIAdem 9.1 we expand the channel addressing so that you have more flexibility:

Channels and Channel References
DIAdem stores data in channels. To access channel data, you need unique channel references in dialog boxes and scripts. For example, to compare channels from different channel groups, you must give the channels unique names. If you select channels in a dialog box or record commands in a dialog box, DIAdem automatically references the correct channel.
The default channel reference consists of the group index and the channel name. To modify the default setting, select Settings»Desktop parameters»General. You can also reference channels with any combination of the group name or the group index with the channel name or the channel index. The channel index is the position of the channel in the group, and the group index is the position of the group in the data set.

[Group index]/Channel name :
Default setting. Use this setting if you do not know the names of the channel groups or if the names can change, but the names of the channels to be compared are the same in different channel groups. The order of the channel in a group can change.

[Group index]/[Channel index] :
Use this setting if you do not know the names of the channel groups and of the channels, or if the names can change, but the indexes of the channels to be compared are the same in different channel groups.

Group name/[Channel index] :
Use this setting if you do not know the names of the channels, or if the names can change, but the indexes of the channels to be compared are the same in different channel groups. The order of the groups can change.

Group name/Channel name :
Use this setting if the channel groups have different names and the channels have different names, and you need both names for a unique channel reference. The channel index and the group index are irrelevant. The order of the channels in a group and the order of the groups can change.

Only channel name :
Use this setting if the Data Portal has only one channel group or if the channel references have to be compatible with earlier DIAdem versions. The channel reference does not include a group name. The channel reference is ambiguous if several channels in different channel groups of the Data Portal have the same name. DIAdem then uses the channel with this name and the lowest channel number, in dialog boxes or scripts.

Channel number :
Use this setting if the channel references must be compatible with earlier DIAdem versions and you are sure that the order of channel numbers has not changed. The channel names are irrelevant.
0 Kudos
Message 2 of 6
(4,063 Views)
Thank you very much Walter. Your help has been very useful!
0 Kudos
Message 3 of 6
(4,056 Views)
Hello again,
I tried your script and it works but only when there is only one y-channel to be processed.
I would like to process more y-channels (from 2 to 9).How can I do: cnoxget(i,"2-9")?
Any idea?

Dim i
for i=1 to GroupCount
Call GroupDefaultSet (i)
Call ChnNovHandle (cnoxget(i,1),cnoxget(i,"2-9"),"Delete","xy",1,0)
next

Thank you very much!
0 Kudos
Message 4 of 6
(4,054 Views)
Hi Leiabcn,

The variable you need is:GroupChnCount

Than your script must be modified like this:


Dim i, sChnNoStr
for i=1 to GroupCount
Call GroupDefaultSet (i)
sChnNoStr = str(cnoxget(i,2)) & "-" & str(cnoxget(i,GroupChnCount(i)))
Call ChnNovHandle (cnoxget(i,1),sChnNoStr,"Delete","xy",1,0)
next

Greetings

Walter
0 Kudos
Message 5 of 6
(4,051 Views)
Thank you Walter!
It works really well!
0 Kudos
Message 6 of 6
(4,048 Views)