Q10022 Reconfigurable number of sampling channels
I run some related experiments, with an adjustable number of channels. My processing commands also need to know how many channels are present. Is there a way to do this automatically by adjusting a single parameter?
No there isn't. For configuring sampling activity, the DAPL system must build some complicated control structures to represent your channels, their gains, their signal connections, storage buffers, synchronization switches and so forth. Whether the configuration is feasible can depend on the number of channels. Whether the channels are present or not determine the timing requirements. So the DAPL system really has to know everything about the sampling configuration, and then it is committed. It is too late to change this by adjusting some kind of macro or parameter.
Here is an alternative that does almost the same thing. Your DAPL configuration allows you to define multiple sampling configurations. You only use one of them at any given time.
constant NCHAN word = 0
idefine ONECHAN
channels 1
set ip0 S0
time 1000
end
idefine TWOCHAN
channels 2
set ip0 S0
set ip1 S1
time 500
end
idefine THREECHAN
channels 3
set ip0 S0
set ip1 S1
set ip2 S2
time 333.32
end
And now you can pick which sampling configuration to run by sending two command lines instead of the usual one command to start the processing.
let NCHAN = 2
start TWOCHAN
L23104
START command.
