DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

CNo("free") in DIAdem 11.0 ???

Hi,

 

the lovely command CNo("free") returns in DIAdem 11.0 only the value 0 in any case, even if some channels are loaded. In Help there is no advice for another possibility to get the first free channel number.

Has somebody any idee how to proceed in DIAdem 11.0?

 

Thanks

 

Sven

 

0 Kudos
Message 1 of 5
(3,948 Views)

Hi Sventtke,

 

Since DIAdem 10.x the old static data matrix with pre-allocated data channels of static length no longer exists in DIAdem.  Instead, we now have a dynamic matrix of channels which can be dynamically resized.

 

The short answer is that now if you want a new channel, you have to create it, either with a ChnCalculate() expression, some other ANALYSIS function that creates new channels, or with the explicit ChnAlloc() command.

 

Brad Turin
DIAdem Product Support Engineer
National Instruments

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

Hi,

 

finally I want to know the number of first free channel to start import for the next one of my 15 ASCII-Files and as basis to rename channel names and so on. In former versions (DIAdem 8.1) I used to do this starting to ask for the "position" in data area with command L1 = CNo("free"). Is there any paossibility in version 11.0 to do something like that?

 

Regards

 

Sven

 

0 Kudos
Message 3 of 5
(3,908 Views)

Hello Sven!

 

The simple but not very elegant solution is to use 'ChnNoMax+1'.

 

If you can invest a little bit more time to update the old script igve the ChannelGroup concept a try. Just create a group for every file you want to import. In the group the numbering starts with 1.

 

Matthias

Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  
0 Kudos
Message 4 of 5
(3,896 Views)

Hi Sven,

 

The only way this will work in DIAdem 11.0 is if you are intentionally loading or configuring a DDD file that explicitly creates static data channels when DIAdem launches.  If you take the DIAdem 11.0 defaults, there ARE no "next available channels".  This is a feature.  If you want a channel, you create the channel.  If you decide the channel you already have needs to be twice as long, you can reallocate that channel to have a longer length, without losing the data already in it:

 

Call DataDelAll

Call GroupCreate("New Group Name")

Call GroupDefaultSet(GroupCount)

ChnArray = ChnAlloc("New Channel Name", 5000)

L1 = CNo(ChnArray(0))

ChD(1, L1) = -2.12

Call ChnReAlloc(L1, 10000)

ChnLength(L1) = 10000

ChD(10000, L1) = 3.14

Call ChnCharacter(L1)

MsgBox CMin(L1) & vbCRLF & CMax(L1)

 

Brad Turpin
DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 5
(3,879 Views)