I am trying to quickly find/determine a programming model for my application. I am developing using Visual C++ with TRADITIONAL NI-DAQ and the AT-DIO-32HS. In general, here is what my software needs to do:
My software communicates with an external device via the AT-DIO-32HS card. The protocol that I MUST implement (because it is protocol of external device) is as follows:
1. My program monitors an input line that is raised high by the device when the device is ready for data from my software. We call this the FIFO READY line
2. When FIFO READY line goes high, my program then must raise an output line HIGH. This is called the SELECT line. This tells the external device that the software is ready to begin outputting data via the data lines.
3. While the WRITE line is high, my program will output an array of 32-bit words to the device. There are about 515 32-bit elements in this array.
3b. So, FOR EACH element in the array, OUTPUT the 32-bit element via ports 0-3, then PULSE an output line in port 4, called the WRITE line.
4. After all elements of the array have been written, lower the SELECT line (that was raised high in step 2), and then go back to step 1.
So there is one input control line, and 2 output control lines used.
I developed a simple program using the TRADITIONAL NIDAQ library. I used PORTS 0-3 to output the data, and used PORT 4 to monitor and control the input and output line(s). I used the functions DIG_OUT_PORT and DIG_OUT_LINE and DIG_IN_LINE. We timed the signals and my program was running about 100 times slower than it should be.
So obviously my method is not acceptable. I see in the documentation that there are other 'programming models' available. No model seems to exactly fit the protocol that I must implement above. Any ideas or suggestions ?
Thanks in advance !