I'm using the PCI-6509, and I'm attempting to use a write task and a read task together, with the read task using change detection from the write task.
The write task is a simple Line Output type, and I'm reading from an array of 5120 uInt8 values: 1, 0, 1, 0, etc.--- in other words, a brute-force clock (since the 6509 has no real clock generation capability in HW). The write task output is physically connected to another port pin (in this case, Port3.0). BTW, I don't care about the clock being jittery. I just need rising edges, so the SW clock is OK for my purposes.
The read task is setup to read 2560 16-bit samples from Ports 1 and 2 with change detection from the rising edge of Port3.0. I'm using the 'N Samples' acquisition mode, with Samples to Read set to 2560. I'm using DAQmx_Val_GroupByScanNumber to interleave the bytes from Ports 1 and 2.
I've had very little success getting this to work; frequently, I hit the timeout error with timeouts on the order of 10 seconds! 2560 int16's or 5120 bytes should be able to be read in under 10 seconds.
I'm currently working around this problem by clocking in one sample at a time, which works well, but takes 0.8 seconds or so for each block of 2560 int16's.
How do I make the read task read 2560 samples with change detection? Please go into detail as to what order the API calls should be made, in addition to the task setup in MAX (or via the API).