Rigbox icon indicating copy to clipboard operation
Rigbox copied to clipboard

suggestion for daqController functionality

Open nsteinme opened this issue 6 years ago • 0 comments

I think we need to move away from the "daqController.command([0 0 x])" system. It's inflexible and non-intuitive. I suggest leaving that function as it is but introducing a new one alongside that would instead have syntax like this:

>> daqController.output('mySignalGenName', {anyParameters});

SignalGenerators used in this way don't need to implement the "waveform" method, and they can be completely independent of a nidaq if they want (the daqController, when initialized, should call an "initialize" method of each of its signal generators).

Importantly, the daqController needs to know when two or more analog output channels are "linked", i.e. when you can't output something on one without affecting the other. In that case, it should be implementing something like the current "sigGen.waveform" system to make sure each analog output that will be affected has a chance to supply the output it wants to give after resuming.

Another option here is to have a totally other, higher-level thing like "outputGenerator", which contains a daqController (or multiple of them - which simplifies things because you can just put all your linked AO channels into one daqController and other channels into another one), along with any other output generators like to arduino, etc.

The main point is that there's only really one function of the daqController, which is to generate linked waveforms for linked AO channels - but it is stretched to include digital channels (and will stretch more to include clock outputs, e.g.), and has confusing/non-intuitive calling syntax. The proposals above just try to make something clearer and more flexible.

nsteinme avatar Apr 15 '18 13:04 nsteinme