2. Installation

This section describes the procedure to install the Vortex DDS Simulink Integration on a Linux or Windows platform.

2.1. System Requirements

  • Operating System: Windows or Linux

  • MATLAB Simulink installed

  • Java 1.7 or greater

2.3. OpenSplice (OSPL) Configuration

By default OSPL uses single process configuration.

If however, shared memory configuration is used, additional OSPL configuration steps need to be taken to work with MATLAB Simulink.

2.3.1. Linux

OSPL-9882 Linux: MATLAB/Simulink hangs when connecting to shared memory domain

Description On Linux, a MATLAB script or Simulink model connecting to a Vortex OpenSplice domain via shared memory will hang.

Resolution MATLAB, like Java applications requires that the environment variable LD_PRELOAD be set to reference the active Java installations libjsig.so library. The MATLAB user interface uses Java, and thus requires the same signal handling strategy as Java applications connecting to Vortex OpenSplice. The precise syntax for setting the LD_PRELOAD environment variable will depend on the shell being used.

The libjsig.so file you specify in LD_PRELOAD should match the Java installation used by MATLAB. By default, MATLAB uses a private java installation. If you have not explicitly specified a MATLAB java version (by setting the MATLAB_JAVA environment variable), you should use the libjsig.so library that ships with MATLAB. You can find the library with the following command:

find MATLAB-install-dir -name libjsig.so

As an example, MATLAB R2016b installed in the default location, LD_PROLOAD should contain:

/usr/local/MATLAB/R2016b/sys/java/jre/glnxa64/jre/lib/amd64/libjsig.so

If you have set MATLAB_JAVA, then you should use the libjsig.so from that installation. For example, on Oracle JVMs, LD_PRELOAD should contain this value:

$JAVA_HOME/jre/lib/amd64/libjsig.so

2.3.2. Windows

OSPL-10018 MATLAB: Shared Memory Database Address on Windows needs to be changed from default

Description On a Windows 64-bit system, an OpenSplice system configured with Shared Memory, MATLAB cannot connect to the OpenSplice domain if the Shared Memory Database Address is set to its default value of 0x40000000. The error log (ospl-error.log) will show entries such as: Report : Can not Map View Of file: Attempt to access invalid address. Internals : OS Abstraction/code/os_sharedmem.c/1764/0/1487951812.565129500

Resolution Use the configuration editor to change the default data base address. Use the ‘Domain’ tab, and select the ‘Database’ element in the tree. If necessary, right click the Database element to add an ‘Address’ element. Change the address. In general, a larger number is less likely to be problematic. On a test machine, appending two zeros to the default address allowed for successful connections.

2.5. Examples

Example models have been provided in the examples folder.

../tools/matlab/examples/simulink