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

1 view (last 30 days)
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'?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
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.

More Answers (0)

Categories

Find more on Hardware Discovery and Setup in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!