MATLAB: Can I use the NI-DAQ library in the S-Function with Real Time Windows target

aquisitiondatainstrumentsnationalnini-daqrealtargettimeunsupportedwindows

Can I use the NI-DAQ library in my S-Function with Real Time Windows target?
I want to acquire real-time data from an optical encoder using my National Instrument PCI 6602 card. I wrote a working C programm in Visual C++. After that, I used the S-Function and tried to run it in Real-time Windows Target in Simulink. it works ok when it's in the 'normal' mode. however, when I run it in the 'external' mode, the entire PC crashes and auto reboots. Why won't my programm run in 'external mode'?

Best Answer

The NI-DAQ library is designed for Windows and cannot be used in the real time kernel of Real Time Windows Target (or any other real-time kernel, for that matter).
The only way to access an unsuppiorted data acquisition board from the Real Time Windows Target is to access its registers directly, via _inp() and _outp() and similar functions.