Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Simulink Real-Time C API

The Simulink® Real-Time™ C API consists of a series of C functions that you can call from a C or C++ custom program. This API is designed for multi-threaded operation on a 64-bit target computer.

The Simulink Real-Time C API DLL consists of C functions that you can incorporate into a custom program. You can use an application written through either interface to load, run, and monitor a real-time application without interacting with MATLAB®. Using the Simulink Real-Time C API, you write the custom program in a high-level language (such as C, C++, or Java®) that works with a real-time application. This option requires that you are an experienced programmer.

The xpcapi.dll file contains the Simulink Real-Time C API dynamic link library, which contains over 90 functions you can use to access the real-time application. Because xpcapi.dll is a dynamic link library, your program can use run-time linking rather than static linking at compile time. Use the Simulink Real-Time C API to build custom programs for development environments such as Microsoft® Foundation Class Library/Active Template Library (MFC/ATL) and third-party product APIs such as Altia®).

All custom Simulink Real-Time C API programs must link with the xpcapi.dll file (Simulink Real-Time C API DLL). Also associated with the dynamic link library is the xpcinitfree.c file. This file contains functions that load and unload the Simulink Real-Time C API. Build this file along with the custom Simulink Real-Time C API program.

The Simulink Real-Time C API consists of blocking functions. A default timeout of 5 seconds controls how long a target computer can take to communicate with a development computer.

The documentation reflects the fact that the API is written in the C programming language. However, you can call the API functions from non-C languages, such as C++ and Java.

    Note:   Refer to the compiler documentation of the non-C language for a description of how to access C functions from a library DLL. To access the Simulink Real-Time C API DLL, follow these directions.

Was this topic helpful?