I have been finishing a software project after the original developer left the company. The software runs on a PC target that runs the QNX operating system. NI 6259 and 6602 cards are used to read from/write to a pneumatic test rig. The software is wriiten in C++ and it performs a real time simulation using data read from the rig. We have had numerous problems with the analogue data aquisition. It appears to be writting data to the FIFO buffer and because of intermittent reading of these channels, lags in the data were discovered. The lag can be removed by calling aiClearFifo before the simulation starts. We have also found problems where the scanning rate of the 6259 card is faster than the simulation rate, hence the program reads the data at a slow rate and the simulation results are not accurate.
The 6259 reads 9 analogue and 20 digital channels and outputs 4 analogue and 28 digital channels, the simulation will normally run between 200 to 5000 Hz. The DAQ is read from a separate program and this program will send the rig values in a structure to the simulation program every time the simulation requests the data.
I am of the opinion that the situation could be improved by only storing one set of results in the FIFO buffer, there would be no lags and the data in the buffer would be the latest available data set so the simulation should read the data at the correct rate. I have not been able to find much information on programming the 6259 card but the attached code is used to initialise the 6259 card.
Please could you advise on any changes to the settings to allow only one data set to be stored in the FIFO buffer or advise of any alternative solutions.
Many thanks in advance.
Cathy