12-07-2007 11:52 AM
12-10-2007 07:01 AM
More information...
If I try to call the function a 3rd time in Matlab, Matlab hangs.
I tried setting the DAQmx Write properties Relative to and Offset to "First sample" and zero respectively, before the data is written to the buffers. I really thought this would fix the problem because there is no way it should be trying to write data after the end of the buffer if I have specifically told it to write at the start. It doesn't make any difference, I still get the same error.
I noticed that after I have used the function once in Matlab, I cannot run the corresponding vi in Labview because the hardware resource (ie. the PCI-6221) is in use by another program. I think this is a clue to what's going on - Matlab is not releasing the DAQ card after the function executes.
12-10-2007 07:33 AM
OK, found the cause of the problem - I had not cleared the digital output task.