Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpiCore)  1.26.2
Creating a new Downloadable Kernel Module (DKM) Project using Wind River Workbench 3.3

Introduction

To run your application as a real-time application on a control, you need to use the Wind River Workbench 3.3. This is because the firmware of the control is based on the VxWorks real-time operating system by Wind River. The development environment is not free, and can be bought either as full version from Wind River itself or as dedicated version for Bosch Rexroth application development (Workbench OEM) from Bosch Rexroth.

Note
Please contact sales of Bosch Rexroth for purchase of Workbench OEM software.

There are two different setup routines (WBOEM33_63, WBOEM33_69) available because at this time; Bosch Rexroth targets use two different releases of the real-time operating system Wind River VxWorks (release 6.3, release 6.9). Regarding your target, please install at least the required release of the development environment.

Target Version Wind River VxWorks release Installation Build spec
IndraMotion MLC XM2 14VRS 6.9 WBOEM33_69 ATOMgnu / ATOMgnu_RTP
IndraMotion MLC XM4 14VRS 6.9 WBOEM33_69 NEHALEMgnu_SMP
IndraMotion MLC VPx 14VRS 6.9 WBOEM33_69 PENTIUM4gnu_SMP
IndraMotion MLC CML75 14VRS 6.9 WBOEM33_69 ATOMgnu_SMP
IndraMotion MLC CML65 14VRS 6.3 WBOEM33_63 PENTIUMgnu
IndraMotion MLC CML45 14VRS 6.3 WBOEM33_63 PENTIUMgnu
IndraMotion MLC CML25 14VRS 6.3 WBOEM33_63 SH7750gnule
IndraMotion XLC CML75 14VRS 6.9 WBOEM33_69 ATOMgnu_SMP
IndraMotion XLC CML65 14VRS 6.3 WBOEM33_63 PENTIUMgnu
IndraMotion XLC CML45 14VRS 6.3 WBOEM33_63 PENTIUMgnu
IndraMotion XLC CML25 14VRS 6.3 WBOEM33_63 SH7750gnule

Learn how to set up a simple Workbench project which runs on a VxWorks real-time operating system and is able to connect to a MLPI device using MLPI function calls.

Installing MLPI SDK help

For the Wind River Workbench OEM an Eclipse plug-in of the MLPI SDK help is available. This plug-in has to be separately downloaded from the Open Core Engineering Network. The plug-in is located at the SDK download area within the section "Add-on packages". Please store the plug-in into a reusable directory (e.g. "C:\Users\john_doe\Downloads"), so you can use this folder also for an update installation.

To install the Eclipse plug-in of the MLPI SDK help into your Wind River Workbench OEM, please select from the "Help" menu of your Wind River WorkBench OEM the entry "Install New Software..." and add the plug-in package from your directory as a new "Archive..." repository.

Note
If the entry "Install New Software..." isn't available within the "Help" menu please switch your current perspective via "Window->Open Perspective" to "Advanced Device Development".
WBPluginInstallMainEmpty.png


WBPluginInstallAddRepo.png

Please accept the license agreements and confirm the installation with "Finish".

WBPluginInstallMainReady.png


WBPluginInstallMainLicense.png
Note
You have to confirm a security warning about the installation because the plug-in is not yet signed.

After a restart of your Wind River Workbench OEM the MLPI SDK help is available within the help content.

WBPluginUsage.png

You can easily update the Eclipse plug-in of the MLPI SDK help by replacing the old plug-in package by a new one and calling of "Check for Updates" within your Wind River Workbench OEM.

WBPluginUpdate.png

You can get information about the plug-in by selecting "About Wind River Workbench" and pressing the MLPI SDK icon.

WBPluginWBAbout.png


WBPluginPluginAbout.png

You can also uninstall the plug-in by selecting all regarding plug-in modules within "About Wind River Workbench", "Installation Details" (see above).

Setting Up the Project

Start Workbench 3.3 and create a new project.

  • Start a new project from menu with "File->New->Wind River Workbench Project".
  • On starting the wizard, choose your target operating system (see table above) "Wind River VxWorks 6.3" and click "Next".
WBnewProject_1.png
  • Choose the build type "Downloadable Kernel Module" (DKM) and click "Next".
WBnewProject_2.png
  • Setup the name of your project and make the decision where the project is located. By default, the standard workspace is labeled. Click "Finish" to finally create the new project.
WBnewProject_3.png

Setting up the project

After creating a new project, at first you should reduce the available build specs. When right-clicking your project, please select the "Properties" and switch to the "Build Properties". On tab "Build Support and Specs", you can delete (or disable) all unneeded build specs. The table shows the required build specs. Please apply your selection and confirm the rebuilt request of the C/C++ index with "Yes".

WBbuildTarget_0.png


WBbuildTarget_1.png
Note
If you use more than one build spec you can switch the type quickly by pressing the target selecting button of the project explorer view.
WBbuildTarget_2.png

Now you have to set the include paths of your MLPI-SDK installation for the compiler. Otherwise, you get errors during the build process for your project. You will do this by switching to the "Paths" tab of the "Build Properties". At this time, there should be existing already two default paths:

  • "-I$(WIND_BASE)/target/h"
  • "-I$(WIND_BASE)/target/h/wrn/coreip"
WBbuildTarget_4.png

Add the include search path for mlpiCore header files to all targets by pressing the button "Add to all...". By default, you will find the header files of the MLPI-SDK in the following folder:

  • Windows 7: ".../Program Files (x86)/Rexroth/MLPI-SDK/01VRS/mlpiCoreClient/include"

The installation of the MLPI SDK automatically sets up the new system environment variable "MLPI_SDK_01" which can be used within the include search path settings.

  • "-I$(MLPI_SDK_01)/mlpiCoreClient/include"

If you are interested, you can find the environment variable mapping in the "Advanced System Settings" of the Windows Control Panel in the dialog "System->Advanced System Settings->Advanced->Environment Variables".

WBbuildTarget_8.png

Finally press "Apply" and "OK" to complete the setup of your project.

WBbuildTarget_7.png
Note
Wind River Workbench can not handle special characters, such as round brackets, etc. within include paths, so you must not use this characters within your paths. In addition, the Wind River Workbench cannot handle space characters within include paths, so you have to use the 8.3 DOS path replacements! You can find out the right path name by calling the DOS shell command "dir /x". For the path example above, you have to use following paths replacements:
  • Windows 7: ".../Progra~2/Rexroth/MLPI-SDK/01VRS/mlpiCoreClient/include"

WBbuildTarget_5.png

WBbuildTarget_6.png

Example project

Note
When using the MLPI interface you have to call mlpiApiConnect(const WCHAR16 *connectionIdentifier, MLPIHANDLE *connection) at first. You could connect your MLPI client to the MLPI server via a local connection by using the predefined symbol MLPI_LOCALHOST within the argument "connectionIdentifier" or via TCP/IP by using an IP address within the same argument.
On VxWorks downloadable kernel modules function calls which using a connection via the predefined symbol MLPI_LOCALHOST will be executing very fast as direct calls without using the TCP stack.

Please start your project by creating your first *.cpp file from menu by selecting "File->New->File".

WBnewFile.png

At first you have to include all needed MLPI headers, e.g.:

#include <mlpiApiLib.h>
#include <mlpiSystemLib.h>

Now you are able to use MLPI functions. Here is some example code showing how to connect to an MLPI device and how to read the current firmware version.

#include <iostream>
#include <mlpiGlobal.h>
#include <wchar16.h>
#include <vxwhelper.h>
#include <mlpiApiLib.h>
#include <mlpiSystemLib.h>
extern "C" int helloMLPI(void)
{
// print stdout to telnet connection
enableTelnetPrintf();
enableFpuSupport();
WCHAR16 szText[128]={0};
float fTemperature;
//
// connect to API
//
MLPIRESULT result = mlpiApiConnect(MLPI_LOCALHOST, &connection); // replace localhost with control IP to connect to another control
if (MLPI_FAILED(result))
{
printf("\nERROR: failed to connect to MLPI. ErrorCode: 0x%08x", (unsigned)result);
return result;
}
//
// read and display some control information
//
// read control name
mlpiSystemGetName(connection, szText, _countof(szText));
printf("\nControlName: %s", W2A16(szText));
// read firmware version information
mlpiSystemGetVersionInfo(connection, MLPI_VERSION_FIRMWARE, szText, _countof(szText));
printf("\nFirmware-Version: %s", W2A16(szText));
// read control temperature
mlpiSystemGetTemperature(connection,&fTemperature);
printf("\nTemperature: %.2f", fTemperature);
//
// disconnect from mlpi and shutdown api
//
result = mlpiApiDisconnect(&connection);
if (MLPI_FAILED(result))
{
printf("\nERROR: failed to disconnect from MLPI. ErrorCode: 0x%08x", (unsigned)result);
return result;
}
return 0;
}

Build or rebuild your project by selecting the green colored "Build Targets" in the project explorer view and executing the command "Build->Build Project" or "Build->Rebuild Project".

Creating a target connection

To transfer the compiled project into a control, a target connection is required. The following steps show how to create a new target connection to a control.

Choose "New Connection..." from the context menu at the view "Remote Systems".

WBtargetconnection_1.png

Select "Wind River VxWorks 6.x Target Server Connection".

WBtargetconnection_2.png

Set IP address of control and the path of the actual VxWorks Kernel Image (vxworks.st) of the current firmware-release.

Note
To get the "vxworks.st", you have to download the file via FTP client directly from "ata0" of the control to a local path on your pc.
  • FTP Login to control:
    • User: boschrexroth
    • Password: boschrexroth
Finish the dialog.
WBtargetconnection_3.png

Starting the Project

For testing and monitoring the sample project, you can use a terminal session via telnet. Connect the terminal to control with user "boschrexroth" and password "boschrexroth".

WBterminalconnect.png

To run the project, select "Run->Run As->VxWorks Kernel Task".

WBrun_1.png

If you are not connected now, do this in the current dialog. Connect to a VxWorks target server and enter "helloMLPI" as "Entry Point" in "General". It is also possible to use the "browse" button to search for the "helloMLPI" function using the user interface. At "Advanced", set the task priority above 100 and the stack size above 0x200000.

WBrun_2.png

If floating point operations are used in the project (e.g. read temperature in sample project), it is required to set the checkbox "VX_FP_TASK" in "Advanced Options".

WBrun_3.png

Click "Apply" and "Run", to start your project as a task in the control. Now you should see the name of control, the current firmware version and the current temperature in the terminal window.

WBterminalresult.png

Congratulations! Your first realtime-mlpi-project is running on the control.

Known Bugs

Linker error "(87) invalid arguments" when linking too much files.

This is a known problem (Wind River defect WIND00243042). If the Partial Image Linker/Linker/Librarian command line has too many object files to be linked, the command line length limit will be exceeded. This limit is imposed by the Windows system. As a workaround, you can dump your list of object files into a control file and use the @ option with your list in your command line.

Specifically here are the changes to the command line:

  • Add this: echo %Objects% > objects.lst;
  • Change: -o %OutFile% %Objects% to -o %OutFile% @objects.lst
  • Add this to delete the file afterwards: && rm objects.lst

Here is a typical Partial Image Linker command line if the GNU compiler is used:

echo "building $@";%linkerprefix% $(TOOL_PATH)ccpentium -r -nostdlib -Wl,-X %ToolFlags% -o %OutFile% %Objects% $(ADDED_OBJECTS) %Libraries% $(LIBPATH) $(LIBS) $(ADDED_LIBPATH) $(ADDED_LIBS) && if [ "$(EXPAND_DBG)" = "1" ]; then plink "$@";fi

Change to:

echo "building $@";echo %Objects% > objects.lst;%linkerprefix% $(TOOL_PATH)ccpentium -r -nostdlib -Wl,-X %ToolFlags% -o %OutFile% @objects.lst $(ADDED_OBJECTS) %Libraries% $(LIBPATH) $(LIBS) $(ADDED_LIBPATH) $(ADDED_LIBS) && rm objects.lst && if [ "$(EXPAND_DBG)" = "1" ]; then plink "$@";fi