Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4COM)  1.26.2
Creating a new Visual Basic (.NET) project for Windows using Visual Studio 2005

Learn how to set up a simple VS2005 project which runs on the BoschRexroth VEP WinCE6.0 platform and how to access the MLP firmware using MLPI function calls.

Setting Up the Project

Start Visual Studio 2005 and create a new project: ( From Menu: File->New->Project ).

vsVBProject.png

Select 'Console Application' and finish the project wizard by clicking 'Finish'. You have now an empty WinCE project and may want to start developing with the MLPI-API library.

Add the MLPI-COM reference to the VB Project ( From Menu: Project->Add Reference...)

Rexroth MotionLogicProgrammingInterface 1.x Type Library
vsComDllRef.png

Setting Build Configuration for x86 platform ( From Menu: Build->Configuration Manager->Active Solution Platform )

vsVCPlatform.png

You have to include the MLPI library to the project properties (Right click: Project->Properties->References) by activating it.

vsVBAddReference.png

You are now able to use MLPI functions. Here is some example code showing how to connect to a MLC/MLP/XLC control and to read the current control firmware version. Don't forget to replace the IP address of your control in the example code.

Module Module1
Sub Main()
' create MotionLogicControl
Dim connection As MlpiConnection
connection = New MlpiConnection
' connect to control
connection.Connect("192.168.0.161 -user=mlpiTest -password=mlpiTest")
' read the firmware version
System.Console.WriteLine("Firmwareversion: " + connection.System.GetVersionInfo("VERSION_FIRMWARE"))
' read and display some control information
System.Console.WriteLine("Diagnosis Text: " + connection.System.GetDisplayedDiagnosis().text)
' set a new control name
System.Console.Write("new control name: ")
connection.System.SetName(System.Console.ReadLine())
' read the new control name
System.Console.WriteLine("control name: " + connection.System.GetName())
' disconnect from control
connection.Disconnect()
System.Console.WriteLine("press enter to quit")
System.Console.ReadLine()
End Sub
End Module

Starting the Project

Build your project by selecting Build->Build Solution from the Visual Studio menu.