01-23-2009 05:46 AM
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
01-23-2009 09:40 AM
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
01-26-2009 07:35 AM
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
01-26-2009 11:59 AM
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? |
01-27-2009 09:32 AM
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