Hello,
I'm fairly new to DAQ coding so please bear with me.
I have a PCI-6221 that I'm using to send 16 bit signals to one device, read multiple analog signals from another device, and send a 1 bit signal to a third device. These 3 operations are controlled by a matlab program that runs at ~1khz. At certain points during operation I need the first two operations, the 16 bit signal and the analog read, to continue while the third signal is sent with as high a temporal accuracy as can be achieved, much better than the 1khz the matlab program runs by default. The third signal is sent in trains of ~100-200ms with between 40 and 120 pulses with arbitrary timing.
My question is: is there a way to offload the responsibility for sending this third signal completely to the DAQ card and have it run autonomously while that is being generated? As in, can I turn the digital write into a non-blocking
operation? I had thought to create a buffered digital output task and give it a vector containing the entire signal train in discrete time chunks, relying on the card's internal timer to send each consecutive element in the vector on time, but so far I've been unsuccessful with this approach. This may be due to my programming, but if anyone can tell me if this is even possible before I continue banging my head against it, I would appreciate it. If anyone has a better approach, that would also be appreciated, as the vector containing the entire 200ms signal at 1mhz can get fairly large (200,000 elements).
To put it in schematic form, I need the following:
Matlab program calls DAQ mex file with 200ms digital output task
DAQ card buffers/internalizes this output task somehow
control is returned to matlab
at time point x DAQ card sets port high with no matlab oversight
at time point y DAQ card sets port low with no matlab oversight
contd for duration of signal train...
at the end of the signal the DAQ card frees the resource for matlab to use on the next signal train iteration
Thanks!