I forgot to mention:
ch(#):= creates a new channel in the data area, since you did not specify a name to it it will be automatically asigned. Since you dont know the channelnumber it might get difficult to reference that channel later on. There are two possibilities to work around that problem: Firstly, as you did, call the command with a channelname that you know is unique in that goup. Afterwards, you can reference the channel by its name. Secondly, you could run the command
L1=cno("free") prior to do the calculation. This expression finds out the number of the next empty channel and assigns it to L1 - and this is exactly the channel formulacalc will be using to store the results.
There is another variable, that works in most situations:
GlobUsedChn gives you the number of channels that are in use. In most cases this variable will give you the number of the channel you created latest.
ChnNoMax in contrast gives you the number of channels currently reserved. Depending on the settings in your memory management it will show you the amount of channels allocated in memory - allthough they might be unused at the moment.
Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany