Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4Java)  1.26.2
com.boschrexroth.mlpi.MlpiConnection Class Reference

Inherits com.boschrexroth.mlpi.MlpiComponent.MlpiHandle.

Collaboration diagram for com.boschrexroth.mlpi.MlpiConnection:
Collaboration graph

Classes

enum  ApiProtection
 
class  ConnectionDescription
 
class  ConnectionInfo
 
class  Library
 
class  Version
 

Public Member Functions

 MlpiConnection ()
 
void finalize ()
 
void connect (String address)
 
void disconnect ()
 
long getConnectionHandle ()
 
Logic logic ()
 
System system ()
 
Watchdog watchdog ()
 
Motion motion ()
 
Io io ()
 
Parameter parameter ()
 
Robot robot ()
 
Container container ()
 
Task task ()
 
Security security ()
 
Security Security ()
 
AccessControl accessControl ()
 
AccessControl AccessControl ()
 
native boolean isConnected ()
 
native Version getClientCoreVersion ()
 
native Version getServerCoreVersion ()
 
native void delay (int delayMilliseconds)
 
native ConnectionInfo testConnection (int payloadBytes, int numMeasurements)
 
native void setNameOfConnection (String name)
 
native void setLabelOfConnection (String label)
 
native ConnectionDescription getOwnConnectionDescription ()
 
native ConnectionDescription[] getAllConnectionDescription ()
 
native void closeConnectionByUid (long uid)
 
native void closeConnectionsByUser (String user)
 
native void closeConnectionsByUri (String uri)
 
native void userAccountControlReload ()
 
native void userAccountControlLoadAccounts (String path)
 
native void userAccountControlUnloadAccounts (String path)
 
native String[] getOwnPermissions ()
 
native String[] getAccounts ()
 
native String[] getAccountPermissions (String account)
 
native Library[] getLibrarySupport ()
 

Detailed Description

Definition of the MlpiConnection which is the root object of a connection to a MLPI Device.

The MlpiConnection class is the root object of the MLPI object hierarchy. It represents a single connection to a device that supports the MLPI. The MlpiConnection class contains properties and subobjects which contain further MLPI methods.

Definition at line 66 of file MlpiConnection.java.

Constructor & Destructor Documentation

com.boschrexroth.mlpi.MlpiConnection.MlpiConnection ( )
inline

Default constructor.

Definition at line 268 of file MlpiConnection.java.

Member Function Documentation

void com.boschrexroth.mlpi.MlpiConnection.finalize ( )
inline

Destructor. Calls disconnect.

Definition at line 273 of file MlpiConnection.java.

References com.boschrexroth.mlpi.MlpiConnection.disconnect().

Here is the call graph for this function:

void com.boschrexroth.mlpi.MlpiConnection.connect ( String  address)
inline

This function connects the user application with a MLPI Device. The first argument is used to specify the target device to which you want to connect. This can either be a control running on the same physical device as your application or a control that is connected via a network, for example, by UnsecCommunication. In this case, you have to give the IP or host name of the target. For MLPIS the argument 'tls' must be specified (as seen below), if it is not given, then non secure MLPI connection is used by default. The client is not required to provide credentials (i.e. private key and certificate), however, the server must provide them. These credentials are automatically generated in targets with Firmware versions starting with version 14V18.

It is also possible to set additional options in the connect string as an argument list.

  • address=value IP or URL path of connection.
  • timeout_connect=value Timeout used for connecting in milliseconds.
  • timeout_send=value Timeout used for sending data to target in milliseconds.
  • timeout_receive=value Timeout used for receiving data from target in milliseconds.
  • auto_reconnect=value If set to 1 or 'true', then the MLPI will try to reconnect with each new call of any MLPI function after connection was lost. For connecting, the same timeout settings are used as given for the first connect.
  • user=value Login name of user. See Permission and user management for more information about user and permission system.
  • password=value Password of user.
  • tls=value If set to 'active', then MLPI is tunneled through TLS rather than TCP, thus providing data confidentiality and integrity for the connection (default: false). It is highly recommended to change this setting to true if possible.

A timeout value of 0 means that the timeout value should be chosen automatically by the operating system.

Note
If you are developing on Android operating system and continuously getting the error "0xF0360007 MLPI_E_CONNECTFAILED: Connection failed", then please check, that you didn't forget to give your application the needed android permissions. To use the MLPI, you need the permissions Android.permission.ACCESS_NETWORK_STATE and Android.permission.INTERNET. These can be found in the AndroidManifest.xml of your application. See also in the manual Introduction
Example Java using MLPI:
//create connection object
MlpiConnection connection = new MlpiConnection();
// try to connect
connection.connect("192.168.1.71");
Example Java using MLPIS:
//create connection object
MlpiConnection connection = new MlpiConnection();
// try to connect
connection.connect("192.168.1.71 -tls=active");
Note:
This method maps to the mlpiCore function mlpiApiConnect, where you can find further documentation.

Definition at line 324 of file MlpiConnection.java.

References com.boschrexroth.mlpi.MlpiConnection.disconnect(), and com.boschrexroth.mlpi.MlpiConnection.getConnectionHandle().

Here is the call graph for this function:

void com.boschrexroth.mlpi.MlpiConnection.disconnect ( )
inline

This function disconnects the user application from the MlpiConnection. After closing the MLPI connection, no more method calls to the MLPI device can be made.

Note:
This method maps to the mlpiCore function mlpiApiDisconnect, where you can find further documentation.

Definition at line 354 of file MlpiConnection.java.

References com.boschrexroth.mlpi.MlpiConnection.getConnectionHandle().

Referenced by com.boschrexroth.mlpi.MlpiConnection.connect(), and com.boschrexroth.mlpi.MlpiConnection.finalize().

Here is the call graph for this function:

Here is the caller graph for this function:

long com.boschrexroth.mlpi.MlpiConnection.getConnectionHandle ( )
inline

This function returns the connection handle of the MLPI connection.

Returns
The connection handle of the MLPI connection.

Definition at line 377 of file MlpiConnection.java.

Referenced by com.boschrexroth.mlpi.MlpiConnection.connect(), and com.boschrexroth.mlpi.MlpiConnection.disconnect().

Here is the caller graph for this function:

Logic com.boschrexroth.mlpi.MlpiConnection.logic ( )
inline

Property to access the Logic methods of the MLPI device.

Returns
Returns the Logic object.

Definition at line 385 of file MlpiConnection.java.

System com.boschrexroth.mlpi.MlpiConnection.system ( )
inline

Property to access the System methods of the MLPI device.

Returns
Returns the System object.

Definition at line 393 of file MlpiConnection.java.

Watchdog com.boschrexroth.mlpi.MlpiConnection.watchdog ( )
inline

Property to access the Watchdog methods of the MLPI device.

Returns
Returns the Watchdog object.

Definition at line 400 of file MlpiConnection.java.

Motion com.boschrexroth.mlpi.MlpiConnection.motion ( )
inline

Property to access the Motion methods of the MLPI device.

Returns
Returns the Motion object.

Definition at line 407 of file MlpiConnection.java.

Io com.boschrexroth.mlpi.MlpiConnection.io ( )
inline

Property to access the Io methods of the MLPI device.

Returns
Returns the Io object.

Definition at line 414 of file MlpiConnection.java.

Parameter com.boschrexroth.mlpi.MlpiConnection.parameter ( )
inline

Property to access the Parameter methods of the MLPI device.

Returns
Returns the Parameter object.

Definition at line 421 of file MlpiConnection.java.

Robot com.boschrexroth.mlpi.MlpiConnection.robot ( )
inline

Property to access the Robot methods of the MLPI device.

Returns
Returns the Robot object.

Definition at line 428 of file MlpiConnection.java.

Container com.boschrexroth.mlpi.MlpiConnection.container ( )
inline

Property to access the Container methods of the MLPI device.

Returns
Returns the Container object.

Definition at line 435 of file MlpiConnection.java.

Task com.boschrexroth.mlpi.MlpiConnection.task ( )
inline

Property to access the Task methods of the MLPI device.

Returns
Returns the Task object.

Definition at line 442 of file MlpiConnection.java.

Security com.boschrexroth.mlpi.MlpiConnection.security ( )
inline

Property to access the Security methods of the MLPI device.

Returns
Returns the Security object.

Definition at line 449 of file MlpiConnection.java.

Security com.boschrexroth.mlpi.MlpiConnection.Security ( )
inline
Deprecated:
Please use security() instead.

Definition at line 457 of file MlpiConnection.java.

AccessControl com.boschrexroth.mlpi.MlpiConnection.accessControl ( )
inline

Property to access the Access Control methods of the MLPI device.

Returns
Returns the Access Control object.

Definition at line 464 of file MlpiConnection.java.

native boolean com.boschrexroth.mlpi.MlpiConnection.isConnected ( )

This function returns the current state of the MLPI connection. If false is returned, then the connection is either not yet established or closed due to a communication error or because disconnect has been called. In all cases, a reconnect using connect has to be made to make new MLPI method calls. If the connection has been lost for an unknown reason, try increasing the connection timeout using connect.

Returns
The current state of the MLPI connection.
Note:
This method maps to the mlpiCore function mlpiApiIsConnected, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native Version com.boschrexroth.mlpi.MlpiConnection.getClientCoreVersion ( )

This function returns the client core version of the MLPI connection using a Version object.

Returns
The client core version of the MLPI connection.
Example Java:
Version clientVersion = connection.getClientCoreVersion();
System.out.println("ClientCoreVersion: " +clientVersion.major+"."+clientVersion.minor+"."+clientVersion.patch+"."+clientVersion.build+"."+clientVersion.patch);
Note:
This method maps to the mlpiCore function mlpiApiGetClientCoreVersion, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native Version com.boschrexroth.mlpi.MlpiConnection.getServerCoreVersion ( )

This function returns the server core version of the MLPI connection using a version object.

Returns
The server core version of the MLPI connection.
Example Java:
Version serverVersion = connection.getServerCoreVersion();
System.out.println("ServerCoreVersion: " +serverVersion.major+"."+serverVersion.minor+"."+serverVersion.patch+"."+serverVersion.build+"."+serverVersion.patch);
Note:
This method maps to the mlpiCore function mlpiApiGetServerCoreVersion, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.MlpiConnection.delay ( int  delayMilliseconds)

This function does a simple delay on the server side. All this function does is a blocking delay on the server side in the given amount of milliseconds. Use it during development or debugging of your application to simulate high traffic on your network. This way you can test the behavior of your client application when MLPI communication slows down. The delay has no impact on the performance of the control.

Parameters
[in]delayMillisecondsDelay in milliseconds to block.
Example Java:
// block on server side for 1 second
connection.delay(1000);
Note:
This method maps to the mlpiCore function mlpiApiDelay, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native ConnectionInfo com.boschrexroth.mlpi.MlpiConnection.testConnection ( int  payloadBytes,
int  numMeasurements 
)

This function performs a benchmark on the MLPI communication mechanism. Use it to measure the duration of a MLPI function call with the given payload in bytes. The resulting timing values are the durations which are necessary to marshal the payload, send the payload to the MLPI server, unmarshal it on the MLPI server, perform the remote procedure call, marshal the results, send them back to the MLPI client unmarshal them again and return them to the client thread program. These are the basic costs needed for nearly every MLPI call.

Parameters
[in]payloadBytesPayload in number of bytes that is used for the MLPI communication to be measured.
[in]numMeasurementsNumber of measurements to do for calculating the average resulting timing values.
Returns
The calculated timing values using a ConnectionInfo object.
Example Java:
// run 50 iterations with 100 byte payload to measure the connection speed
MlpiConnection.ConnectionInfo info = connection.testConnection(100, 50);
// print info
System.out.println("Average: " + info.average * 0.001 + " ms");
System.out.println("Minimum: " + info.minimum * 0.001 + " ms");
System.out.println("Maximum: " + info.maximum * 0.001 + " ms");
System.out.println("Variance: " + info.variance);
System.out.println("Standard Deviation: " + info.standardDeviation * 0.001 + " ms");
Note:
This method maps to the mlpiCore function mlpiApiTestConnection, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.MlpiConnection.setNameOfConnection ( String  name)

Using this function, you can assign a short descriptive name to your connection. It is not necessary to give your connection a name, but the name might be useful for debugging and maintaining your connections.

Parameters
[in]nameUser-defined name of connection.
Example Java:
//assign a name to the connection
connection.setNameOfConnection("MyConnection");
Note:
This method maps to the mlpiCore function mlpiApiSetNameOfConnection, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.MlpiConnection.setLabelOfConnection ( String  label)

Using this function, you can assign a long descriptive label to your connection. It is not necessary to set the connection label, but the label might be useful for debugging and maintaining your connections.

Parameters
[in]labelUser-defined label of connection.
Example Java:
//assign a label to the connection
connection.setLabelOfConnection("This is the label of my connection. It is much longer than the name of the connection.");
Note:
This method maps to the mlpiCore function mlpiApiSetLabelOfConnection, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native ConnectionDescription com.boschrexroth.mlpi.MlpiConnection.getOwnConnectionDescription ( )

This function will return information about the connection.

Returns
The information about the connection as ConnectionDescription object.
Example Java:
MlpiConnection.ConnectionDescription description = connection.getOwnConnectionDescription();
System.out.println("Uid: " + description.uid);
System.out.println("User: " + description.user);
System.out.println("Uri: " + description.uri);
System.out.println("Name: " + description.name);
System.out.println("Label: " + description.label);
System.out.println("Datetime: " + description.dateTime.toString());
System.out.println("RequestCounter: " + description.requestCounter);
System.out.println("LastRequest: " + description.lastRequest);
System.out.println("Protection: " + description.protection);
System.out.println("Watchdog: " + description.watchdog);
Note:
This method maps to the mlpiCore function mlpiApiGetOwnConnectionDescription, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native ConnectionDescription [] com.boschrexroth.mlpi.MlpiConnection.getAllConnectionDescription ( )

This function will return information about all established connections of the device.

Returns
The information about all connections as array of ConnectionDescription objects.
Example Java:
MlpiConnection.ConnectionDescription[] descriptions = connection.getAllConnectionDescription();
for (int i=0;i< descriptions.length;i++)
{
System.out.println("\n-------Connection Description " + i + "-------");
System.out.println("Uid: " + descriptions[i].uid);
System.out.println("User: " + descriptions[i].user);
System.out.println("Uri: " + descriptions[i].uri);
System.out.println("Name: " + descriptions[i].name);
System.out.println("Label: " + descriptions[i].label);
System.out.println("Datetime: " + descriptions[i].dateTime.toString());
System.out.println("RequestCounter: " + descriptions[i].requestCounter);
System.out.println("LastRequest: " + descriptions[i].lastRequest);
System.out.println("Protection: " + descriptions[i].protection);
System.out.println("Watchdog: " + descriptions[i].watchdog);
}
Note:
This method maps to the mlpiCore function mlpiApiGetAllConnectionDescription, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.MlpiConnection.closeConnectionByUid ( long  uid)

This function performs the closing of a connection selected by the unique identifier (uid) of a connection. You can determine the uid by using the function getOwnConnectionDescription.

Note
A connection cannot be closed if it runs in a protected mode (see ApiProtection). In this case, the function will return with the error MLPI_E_RD_WR_PROTECTION.
Parameters
[in]uidUnique identifier of connection.
Note:
This method maps to the mlpiCore function mlpiApiCloseConnectionByUid, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.MlpiConnection.closeConnectionsByUser ( String  user)

This function performs the closing of multiple connections selected by the user.

Note
A connection cannot be closed if it runs in a protected mode (see ApiProtection). In this case, the function will return with the error MLPI_E_RD_WR_PROTECTION.
Parameters
[in]userLogin user name of connection.
Note:
This method maps to the mlpiCore function mlpiApiCloseConnectionsByUser, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.MlpiConnection.closeConnectionsByUri ( String  uri)

This function performs the closing of multiple connections selected by a combination of the uniform resource identifier (uri) and the placeholder '*'.

Note
A connection cannot be closed if it runs in a protected mode (see ApiProtection). In this case, the function will return with the error MLPI_E_RD_WR_PROTECTION.
Parameters
[in]uriURI of connection (e.g. "mlpi.tcp://'IP-address':'port'").
Note:
This method maps to the mlpiCore function mlpiApiCloseConnectionsByUri, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.MlpiConnection.userAccountControlReload ( )

This function performs the reloading of all currently loaded account manifests know as 'accounts.xml'.

Note
The permissions of an established connection will not be influenced from new account settings.
Attention
A fail of reloading of the default account manifests maybe requires a reboot of the control because another new connection can not be established furthermore.
Note:
This method maps to the mlpiCore function mlpiApiUserAccountControlReload, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.MlpiConnection.userAccountControlLoadAccounts ( String  path)

This function performs the loading of the accounts of an additional account manifest.

Note
It's recommended, but not required to name the additional account manifest 'accounts.xml'.
Parameters
pathString
Note:
This method maps to the mlpiCore function mlpiApiUserAccountControlLoadAccounts, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.MlpiConnection.userAccountControlUnloadAccounts ( String  path)

This function performs the unloading of the accounts of an additional account manifest.

Note
The permissions of an established connection will not be influenced from new accounts settings.
Parameters
pathString
Note:
This method maps to the mlpiCore function mlpiApiUserAccountControlUnloadAccounts, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native String [] com.boschrexroth.mlpi.MlpiConnection.getOwnPermissions ( )

This function provides the reading of own permissions based on account manifest 'accounts.xml'.

Returns
String
Note
In case the buffer is too short, the function will still return the required number of WCHAR16 elements by 'numElementsRet'.
Note:
This method maps to the mlpiCore function mlpiApiGetOwnPermissions, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native String [] com.boschrexroth.mlpi.MlpiConnection.getAccounts ( )

This function provides the reading of all available accounts based on account manifest 'accounts.xml'.

Returns
String
Note
An empty user name will be replaced by the surrogate string MLPI_ACCOUNT_EMPTY_NAME, but this surrogate string cannot used as login name!
Note: In case the buffer is too short, the function will still return the required number of WCHAR16
elements by 'numElementsRet'.
Note:
This method maps to the mlpiCore function mlpiApiGetAccounts, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native String [] com.boschrexroth.mlpi.MlpiConnection.getAccountPermissions ( String  account)

This function provides the reading of the permissions of an account based on account manifest 'accounts.xml'.

Returns
String
Note
In case the buffer is too short, the function will still return the required number of WCHAR16 elements by 'numElementsRet'.
Parameters
[in]accountString that identifies the account for which permissions were read. Set to NULL to get your own permissions.
Note:
This method maps to the mlpiCore function mlpiApiGetAccountPermissions, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:

native Library [] com.boschrexroth.mlpi.MlpiConnection.getLibrarySupport ( )

This function provides names and IDs of supported libraries.

Returns
The information about all libraries as array of Library objects.
Example Java:
MlpiConnection.Library[] libraries = connection.getLibrarySupport();
MlpiConnection.ConnectionDescription[] descriptions = connection.getAllConnectionDescription();
for (int i=0;i<libraries.length;i++)
{
System.out.println("\n-------Library " + i + "-------");
System.out.println("Name: " + libraries[i].name);
System.out.println("ID: " + libraries[i].id);
}
Note:
This method maps to the mlpiCore function mlpiApiGetLibrarySupport, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.MlpiConnection.AccessControl().

Here is the caller graph for this function:


The documentation for this class was generated from the following file: