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

Inherits com.boschrexroth.mlpi.MlpiComponent.

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

Classes

enum  AddressMode
 
enum  CommandStatus
 
class  ParameterAddressing
 
class  ReadEverythingAddressing
 
class  ReadEverythingData
 
class  WriteAccessData
 

Public Member Functions

native String readDataAsString (String idn, long address)
 
native String readMinimumAsString (String idn, long address)
 
native String readMaximumAsString (String idn, long address)
 
native String readDefaultAsString (String idn, long address)
 
native String readName (String idn, long address)
 
native String readUnit (String idn, long address)
 
native int readAttribute (String idn, long address)
 
native void command (String idn, long address)
 
native void writeDataAsString (String idn, long address, String data)
 
native Parameter.CommandStatus getCommandStatus (String idn, long address)
 
native boolean getDataStatus (String idn, long address)
 
native Parameter.ReadEverythingData[] readEverything (Parameter.ReadEverythingAddressing[] addressing, int dataLoad)
 
Parameter.ReadEverythingData readEverything (Parameter.ReadEverythingAddressing addressing, int dataLoad)
 
native int writeAccessSetup (Parameter.ParameterAddressing[] addressing)
 
native Parameter.WriteAccessData[] writeAccessStatus (int process, boolean waitForWriteAccess, int timeout)
 
native void writeAccessAbort (int process)
 

Static Public Member Functions

static long MLPI_ADDRESS (AddressMode mode, long master, long slave)
 

Static Public Attributes

static final long MLPI_ADDRESS_SLAVE_MASK = 0x000000000000FFFFL
 
static final long MLPI_ADDRESS_MASTER_MASK = 0x00000000FFFF0000L
 
static final long MLPI_ADDRESS_MODE_MASK = 0x000000FF00000000L
 
static final long MLPI_READ_EVERYTHING_SINGLE_PARAMETER = 8
 
static final long MLPI_READ_EVERYTHING_LIST_PARAMETER = 65536
 
static final long MLPI_INFINITE = -1
 

Detailed Description

Class definition of the ParameterLib.

Use the ParameterLib to access parameters on the MLPI device or its slave devices.

Definition at line 70 of file Parameter.java.

Member Function Documentation

static long com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS ( AddressMode  mode,
long  master,
long  slave 
)
inlinestatic

This method creates a correct 64 Bit address identifier.

Parameters
[in]modeAddress type (logical, physical, topological). Master and slave element of this address identifier are interpreted based on this selection. Use the AddressMode enum to define it.
[in]masterMaster address.
[in]slaveSlave address.
Returns
The 64 bit address identifier.
Example Java:
long address = Parameter.MLPI_ADDRESS(AddressMode.ADDRESS_MODE_LOGICAL, 0, 1);
Note:
This method maps to the mlpiCore struct MLPI_ADDRESS, where you can find further documentation.

Definition at line 352 of file Parameter.java.

References com.boschrexroth.mlpi.Parameter.command(), com.boschrexroth.mlpi.Parameter.getCommandStatus(), com.boschrexroth.mlpi.Parameter.getDataStatus(), com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS_MASTER_MASK, com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS_MODE_MASK, com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS_SLAVE_MASK, com.boschrexroth.mlpi.Parameter.readAttribute(), com.boschrexroth.mlpi.Parameter.readDataAsString(), com.boschrexroth.mlpi.Parameter.readDefaultAsString(), com.boschrexroth.mlpi.Parameter.readEverything(), com.boschrexroth.mlpi.Parameter.readMaximumAsString(), com.boschrexroth.mlpi.Parameter.readMinimumAsString(), com.boschrexroth.mlpi.Parameter.readName(), com.boschrexroth.mlpi.Parameter.readUnit(), and com.boschrexroth.mlpi.Parameter.writeDataAsString().

Here is the call graph for this function:

native String com.boschrexroth.mlpi.Parameter.readDataAsString ( String  idn,
long  address 
)

This method reads the value of a parameter and returns it as string. A conversion from other types is performed automatically.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressDevice address identifying the object to be accessed.
Returns
The parameter value as string.
Example Java:
// read a non-string parameter from the device
String data = connection.parameter().readDataAsString("C-0-0080",0);
// print to output
java.lang.System.out.println("Data: " + data);
Note:
This method maps to the mlpiCore function mlpiParameterReadDataString, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

Here is the caller graph for this function:

native String com.boschrexroth.mlpi.Parameter.readMinimumAsString ( String  idn,
long  address 
)

This method reads the minimum value of a parameter and returns it as a string. A conversion is performed automatically.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example, "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressDevice address identifying the object to be accessed.
Returns
The parameter minimum value as string.
Example Java:
// read the parameter minimum value from the device
String min = connection.parameter().readMinimumAsString("C-0-0080",0);
// print to output
java.lang.System.out.println("Minimum: " + min);
Note:
This method maps to the mlpiCore function mlpiParameterReadMinimumString, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

Here is the caller graph for this function:

native String com.boschrexroth.mlpi.Parameter.readMaximumAsString ( String  idn,
long  address 
)

This method reads the maximum value of a parameter and returns it as a string. A conversion is performed automatically.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example, "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressDevice address identifying the object to be accessed.
Returns
The parameter maximum value as string.
Example Java:
// read the parameter maximum value from the device
String max = connection.parameter().readMinimumAsString("C-0-0080",0);
// print to output
java.lang.System.out.println("Maximum: " + max);
Note:
This method maps to the mlpiCore function mlpiParameterReadMaximumString, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

Here is the caller graph for this function:

native String com.boschrexroth.mlpi.Parameter.readDefaultAsString ( String  idn,
long  address 
)

This method reads the default value of a parameter and returns it as a string. A conversion is performed automatically.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example, "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressDevice address identifying the object to be accessed.
Returns
The parameter default value as string.
Example Java:
// read the parameter default value from the device
String def = connection.parameter().readDefaultAsString("C-0-0080",0);
// print to output
java.lang.System.out.println("Default: " + def);
Note:
This method maps to the mlpiCore function mlpiParameterReadDefaultString, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

Here is the caller graph for this function:

native String com.boschrexroth.mlpi.Parameter.readName ( String  idn,
long  address 
)

This method reads the name of a parameter.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example, "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressDevice address identifying the object to be accessed.
Returns
The parameter name.
Example Java:
// read the parameter name from the device
String name = connection.parameter().readName("C-0-0080",0);
// print to output
java.lang.System.out.println("Name: " + name);
Note:
This method maps to the mlpiCore function mlpiParameterReadName, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

Here is the caller graph for this function:

native String com.boschrexroth.mlpi.Parameter.readUnit ( String  idn,
long  address 
)

This method reads the unit of a parameter.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example, "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressDevice address identifying the object to be accessed.
Returns
The parameter unit.
Example Java:
// read the parameter unit from the device
String unit = connection.parameter().readUnit("C-0-0080",0);
// print to output
java.lang.System.out.println("Unit: " + unit);
Note:
This method maps to the mlpiCore function mlpiParameterReadUnit, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

Here is the caller graph for this function:

native int com.boschrexroth.mlpi.Parameter.readAttribute ( String  idn,
long  address 
)

This method reads the attribute of a parameter.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example, "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressDevice address identifying the object to be accessed.
Returns
The parameter attribute.
Example Java:
// read the parameter attribute from the device
int attribute = connection.parameter().readAttribute("C-0-0080",0);
// print to output
java.lang.System.out.println("Attribute: " + attribute);
Note:
This method maps to the mlpiCore function mlpiParameterReadAttribute, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.Parameter.command ( String  idn,
long  address 
)

This method executes a parameter command. The command will be executed and the function will return when the command was either executed successfully or with an error (function is blocking while executing the command).

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example, "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressDevice address identifying the object to be accessed.
Example Java:
// call parameter to clear error
connection.parameter().command("C-0-1030", 0);
Note:
This method maps to the mlpiCore function mlpiParameterCommand, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.Parameter.writeDataAsString ( String  idn,
long  address,
String  data 
)

This method writes a value given as a string to a parameter. A conversion is performed automatically if possible.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example, "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressDevice address identifying the object to be accessed.
[in]dataInput data to be written to the parameter.
Example Java:
// read a non-string parameter from the device
String data = connection.parameter().readDataAsString("C-0-0080",0);
// print to output
java.lang.System.out.println("Write data: " + data);
// write data
connection.parameter().writeDataAsString("C-0-0080", 0, data);
Note:
This method maps to the mlpiCore function mlpiParameterWriteDataString, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

Here is the caller graph for this function:

native Parameter.CommandStatus com.boschrexroth.mlpi.Parameter.getCommandStatus ( String  idn,
long  address 
)

This function will return the status of a command execution using enum Parameter.CommandStatus.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example, "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressDevice address identifying the object to be accessed.
Returns
An enumeration showing the current status of the command execution (COMMAND_IN_PROGRESS, COMMAND_INTERRUPTED, etc...).
Note
You may want to look at the sercos specifications for a detailed description of the meaning of the command status.
Example Java:
Parameter.CommandStatus cmdStatus = connection.parameter().getCommandStatus("C-0-1030", 0);
java.lang.System.out.println("Current command status: " + cmdStatus.toString());
Note:
This method maps to the mlpiCore function mlpiParameterReadCommandStatus, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

Here is the caller graph for this function:

native boolean com.boschrexroth.mlpi.Parameter.getDataStatus ( String  idn,
long  address 
)

This function will return the data status of a parameter.

Parameters
[in]idnString representation of a SERCOS parameter IDN. For example, "S-0-0051", "S-0-1050.0.1", "C-0-0484", "A001:A-0-0100", "S" or "P-100".
[in]addressDevice address identifying the object to be accessed.
Returns
The return value will be TRUE if data status of the parameter is valid.
Note
You may want to look at the sercos specifications for a detailed description of the meaning of the data status.
Example Java:
boolean dataStatus = connection.parameter().getDataStatus("C-0-1030", 0);
java.lang.System.out.println("Current data status: " + dataStatus.toString());
Note:
This method maps to the mlpiCore function mlpiParameterReadDataStatus, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

Here is the caller graph for this function:

native Parameter.ReadEverythingData [] com.boschrexroth.mlpi.Parameter.readEverything ( Parameter.ReadEverythingAddressing[]  addressing,
int  dataLoad 
)

This function reads every SERCOS element of a list of given sets of device address and SERCOS parameter IDN.

Parameters
[in]addressingArray containing sets of device address and SERCOS parameter IDN (ReadEverythingAddressing).
[in]dataLoadSize of buffer in bytes for data exchange used by the mlpiCore function. You can calculate the worst case data load by using MLPI_READ_EVERYTHING_SINGLE_PARAMETER and MLPI_READ_EVERYTHING_LIST_PARAMETER.
Returns
Returns an array containing sets every SERCOS element (ReadEverythingData).
Example Java:
// Request list of C parameter
ReadEverythingAddressing request = new ReadEverythingAddressing(0,"C-0-0110");
ReadEverythingData response = connection.parameter().readEverything(request, 0x8000);
// Build request list of all C parameter
Vector<ReadEverythingAddressing> readEverythingRequestList = new Vector<ReadEverythingAddressing>();
String[] listOfControlParam = response.data.split(" ");
for (String ControlParam : listOfControlParam) {
readEverythingRequestList.add(new ReadEverythingAddressing(0, ControlParam));
}
// Request all C parameter
ReadEverythingData ControlParamData[] = connection.parameter().readEverything((ReadEverythingAddressing[]) readEverythingRequestList.toArray(new ReadEverythingAddressing[readEverythingRequestList.size()]), 0x80000);
readEverythingRequestList.removeAllElements();
for (ReadEverythingData dataset : ControlParamData)
{
System.out.println();
System.out.println("address: " + dataset.address);
System.out.println("idn: " + dataset.idn);
System.out.println("dataStatus: " + dataset.dataStatus);
System.out.println("cmdStatus: " + dataset.cmdStatus);
System.out.println("name: " + dataset.name);
System.out.println("attribute: " + dataset.attribute);
System.out.println("unit: " + dataset.unit);
System.out.println("min: " + dataset.min);
System.out.println("max: " + dataset.max);
System.out.println("data: " + dataset.data);
System.out.println("result: " + dataset.result);
}
Note:
This method maps to the mlpiCore function mlpiParameterReadEverything, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS(), and com.boschrexroth.mlpi.Parameter.readEverything().

Here is the caller graph for this function:

Parameter.ReadEverythingData com.boschrexroth.mlpi.Parameter.readEverything ( Parameter.ReadEverythingAddressing  addressing,
int  dataLoad 
)
inline

This function reads every SERCOS element of given set of device address and SERCOS parameter IDN.

Parameters
[in]addressingSingle set of device address and SERCOS parameter IDN (ReadEverythingAddressing).
[in]dataLoadSize of buffer in bytes for data exchange used by the mlpiCore function. You can calculate the worst case data load by using MLPI_READ_EVERYTHING_SINGLE_PARAMETER and MLPI_READ_EVERYTHING_LIST_PARAMETER.
Returns
Returns a single set of every SERCOS element (ReadEverythingData).
Example Java:
// Request list of S parameter
ReadEverythingAddressing request = new ReadEverythingAddressing(AddressMode.ADDRESS_MODE_PHYSICAL, 0, 1,"S-0-0017");
ReadEverythingData response = connection.parameter().readEverything(request, 0x80000);
System.out.println();
System.out.println("address: " + response.address);
System.out.println("idn: " + response.idn);
System.out.println("dataStatus: " + response.dataStatus);
System.out.println("cmdStatus: " + response.cmdStatus);
System.out.println("name: " + response.name);
System.out.println("attribute: " + response.attribute);
System.out.println("unit: " + response.unit);
System.out.println("min: " + response.min);
System.out.println("max: " + response.max);
System.out.println("data: " + response.data);
System.out.println("result: " + response.result);
Note:
This method maps to the mlpiCore function mlpiParameterReadEverything, where you can find further documentation.

Definition at line 654 of file Parameter.java.

References com.boschrexroth.mlpi.Parameter.readEverything(), com.boschrexroth.mlpi.Parameter.writeAccessAbort(), com.boschrexroth.mlpi.Parameter.writeAccessSetup(), and com.boschrexroth.mlpi.Parameter.writeAccessStatus().

Here is the call graph for this function:

native int com.boschrexroth.mlpi.Parameter.writeAccessSetup ( Parameter.ParameterAddressing[]  addressing)

This function initializes a monitoring of parameters on a write access of the operation data. Not the modification of the operation data is monitored, but the write access. A process is started in the control. The status of this process can be read via the function writeAccessStatus. The process can be stopped via the function writeAccessAbort.

Note:
A process is related to the connection that initialized the process. If the connection is terminated also the process will be stopped and the handle is not longer Valid.
If the option 'auto_reconnect' is used for the connection and the connection is terminated, the process will also be stopped. A new monitoring will not automatically be initialized.
Parameters
[in]addressingSet of device address and SERCOS parameter IDN (ParameterAddressing).
Returns
Handle to the created process.
Example Java:
// monitor write access of parameter C-0-0400 and A-0-0024 of Axis 1
Vector<Parameter.ParameterAddressing> writeAccess = new Vector<Parameter.ParameterAddressing>();
writeAccess.add(new Parameter.ParameterAddressing(0, "C-0-0400"));
writeAccess.add(new Parameter.ParameterAddressing(1, "A-0-0024"));
int process = connection.parameter().writeAccessSetup((Parameter.ParameterAddressing[]) writeAccess.toArray(new Parameter.ParameterAddressing[writeAccess.size()]));
if(0 == process)
{
System.out.println("error during initialization of write access monitoring");
return;
}
System.out.println("process: " + process);
Note:
This method maps to the mlpiCore function mlpiParameterWriteAccessSetup, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.readEverything().

Here is the caller graph for this function:

native Parameter.WriteAccessData [] com.boschrexroth.mlpi.Parameter.writeAccessStatus ( int  process,
boolean  waitForWriteAccess,
int  timeout 
)

This function reads the status of a write access monitoring process. Process has be initialized via the function writeAccessSetup.

Parameters
[in]processHandle of process.
[in]waitForWriteAccessSet this value 'true' to call this function synchronously. The function returns in this case if one monitored parameter has been written.
[in]timeoutTimeout in milliseconds if the value of 'waitForWriteAccess' is 'true'. Use MLPI_INFINITE for infinite wait.
Returns
Returns an array containing the data of all written parameters (WriteAccessData).
Example Java:
// monitor write access of parameter C-0-0400 and A-0-0024 of Axis 1
Vector<Parameter.ParameterAddressing> writeAccess = new Vector<Parameter.ParameterAddressing>();
writeAccess.add(new Parameter.ParameterAddressing(0, "C-0-0400"));
writeAccess.add(new Parameter.ParameterAddressing(1, "A-0-0024"));
int process = connection.parameter().writeAccessSetup((Parameter.ParameterAddressing[]) writeAccess.toArray(new Parameter.ParameterAddressing[writeAccess.size()]));
if(0 == process)
{
System.out.println("error during initialization of write access monitoring");
return;
}
System.out.println("process: " + process);
// modify parameter C-0-0400 and A-0-0024 of Axis 1
connection.parameter().writeDataAsString("C-0-0400", 0, "4000");
connection.parameter().writeDataAsString("A-0-0024", 1, "0");
// get status of process
Parameter.WriteAccessData[] writtenParameters = connection.parameter().writeAccessStatus(process, false, 0);
if(null == writtenParameters)
{
System.out.println("write access status not working");
return;
}
for (Parameter.WriteAccessData data : writtenParameters)
{
System.out.println("address: " + data.address);
System.out.println("idn: " + data.idn);
}
Note:
This method maps to the mlpiCore function mlpiParameterWriteAccessStatus, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.readEverything().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.Parameter.writeAccessAbort ( int  process)

This function aborts a write access monitoring process.

Parameters
[in]processHandle of process.
Example Java:
// monitor write access of parameter C-0-0400 and A-0-0024 of Axis 1
Vector<Parameter.ParameterAddressing> writeAccess = new Vector<Parameter.ParameterAddressing>();
writeAccess.add(new Parameter.ParameterAddressing(0, "C-0-0400"));
writeAccess.add(new Parameter.ParameterAddressing(1, "A-0-0024"));
int process = connection.parameter().writeAccessSetup((Parameter.ParameterAddressing[]) writeAccess.toArray(new Parameter.ParameterAddressing[writeAccess.size()]));
if(0 == process)
{
System.out.println("error during initialization of write access monitoring");
return;
}
System.out.println("process: " + process);
// cancel process
connection.parameter().writeAccessAbort(process);
Note:
This method maps to the mlpiCore function mlpiParameterwriteAccessAbort, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Parameter.readEverything().

Here is the caller graph for this function:

Member Data Documentation

final long com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS_SLAVE_MASK = 0x000000000000FFFFL
static

This definition masks the slave address of an address identifier.

Definition at line 76 of file Parameter.java.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

final long com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS_MASTER_MASK = 0x00000000FFFF0000L
static

This definition masks the master address of an address identifier.

Definition at line 78 of file Parameter.java.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

final long com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS_MODE_MASK = 0x000000FF00000000L
static

This definition masks the address mode of an address identifier.

Definition at line 80 of file Parameter.java.

Referenced by com.boschrexroth.mlpi.Parameter.MLPI_ADDRESS().

final long com.boschrexroth.mlpi.Parameter.MLPI_READ_EVERYTHING_SINGLE_PARAMETER = 8
static

This definition helps you to calculate the maximum (worst case) required data load (bytes) for a single parameter on a readEverything request.

Definition at line 83 of file Parameter.java.

final long com.boschrexroth.mlpi.Parameter.MLPI_READ_EVERYTHING_LIST_PARAMETER = 65536
static

This definition helps you to calculate the maximum (worst case) required data load (bytes) for a list parameter on a readEverything request.

Definition at line 85 of file Parameter.java.

final long com.boschrexroth.mlpi.Parameter.MLPI_INFINITE = -1
static

Infinite timeout value.

Definition at line 87 of file Parameter.java.


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