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

Inherits com.boschrexroth.mlpi.MlpiComponent.

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

Classes

class  ApplicationInfo
 
enum  ApplicationMemoryArea
 
class  ApplicationOpState
 
enum  ApplicationResetMode
 
enum  ApplicationState
 
class  ApplicationTaskInfo
 
class  LogicArrayRange
 
enum  LogicCapabilityOperation
 
enum  LogicCapabilityOperationValue
 
enum  LogicSymbolAccessRights
 
class  LogicSymbolInformation
 
enum  LogicType
 
class  LogicUserTypeInformation
 

Public Member Functions

Application applications (String name)
 
native void startApplication ()
 
native void runSingleCycleApplication ()
 
native void stopApplication ()
 
native void resetApplication (ApplicationResetMode mode)
 
native String readVariableBySymbolAsString (String symbol)
 
native void writeVariableBySymbolAsString (String symbol, String data)
 
native String getNameOfApplication (int index)
 
native int getNumberOfApplications ()
 
native String loadBootApplication (String file, String path)
 
native LogicCapabilityOperationValue getCapabilityOfOperation (LogicCapabilityOperation operation)
 
native void setCapabilityOfOperation (LogicCapabilityOperation operation, LogicCapabilityOperationValue value)
 
native LogicSymbolInformation getInformationOfSymbol (String symbol)
 
native LogicUserTypeInformation[] getInformationOfUserType (String javaSymbol)
 
native String getStopAxesConfiguration ()
 

Static Public Attributes

static final int LOGIC_MAX_DIMENSION_OF_ARRAY = 3
 

Detailed Description

Class definition of the LogicLib.

Definition at line 63 of file Logic.java.

Member Function Documentation

Application com.boschrexroth.mlpi.Logic.applications ( String  name)
inline

This method returns an application object which allows access to methods controlling a PLC application on the device.

Parameters
[in]nameThe name (e.g. "Application") of the requested application.
Returns
The application instance of the requested application.
Example Java:
// get the name of the first application in the device
String appName = connection.logic().getNameOfApplication(0);
java.lang.System.out.println("Name of first application: " + appName);
// get instance of the first application
Application app = connection.logic().applications(appName);
// print state of application to output
java.lang.System.out.println("State of first application: " + app.getStateOfApplication().toString());

Definition at line 539 of file Logic.java.

References com.boschrexroth.mlpi.Logic.getCapabilityOfOperation(), com.boschrexroth.mlpi.Logic.getInformationOfSymbol(), com.boschrexroth.mlpi.Logic.getInformationOfUserType(), com.boschrexroth.mlpi.Logic.getNameOfApplication(), com.boschrexroth.mlpi.Logic.getNumberOfApplications(), com.boschrexroth.mlpi.Logic.getStopAxesConfiguration(), com.boschrexroth.mlpi.Logic.loadBootApplication(), com.boschrexroth.mlpi.Logic.readVariableBySymbolAsString(), com.boschrexroth.mlpi.Logic.resetApplication(), com.boschrexroth.mlpi.Logic.runSingleCycleApplication(), com.boschrexroth.mlpi.Logic.setCapabilityOfOperation(), com.boschrexroth.mlpi.Logic.startApplication(), com.boschrexroth.mlpi.Logic.stopApplication(), and com.boschrexroth.mlpi.Logic.writeVariableBySymbolAsString().

Here is the call graph for this function:

native void com.boschrexroth.mlpi.Logic.startApplication ( )

This method starts all applications on the target.

Note
You can only start a single application using the method startApplication in the class Application.
Example Java:
connection.logic().startApplication();
Note:
This method maps to the mlpiCore function mlpiLogicStartApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.Logic.runSingleCycleApplication ( )

This method runs all applications on the target one single cycle.

Note
You can only run a single application one single cycle using the method runSingleCycleApplication in the class Application.
Example Java:
connection.logic().runSingleCycleApplication();
Note:
This method maps to the mlpiCore function mlpiLogicRunSingleCycleApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.Logic.stopApplication ( )

This method stops all applications on the target.

Note
You can only stop a single application using the method stopApplication in the class Application.
Example Java:
connection.logic().stopApplication();
Note:
This method maps to the mlpiCore function mlpiLogicStopApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.Logic.resetApplication ( ApplicationResetMode  mode)

This method resets all applications on the target. All motion that is assigned to the applications will stop!

Note
You can only reset a single application using the method resetApplication in the class Application.
Parameters
[in]mode

RESET_WARM: All global data except retain data are reset to their default values.

RESET_COLD: All global data and (!) retain data are reset to their default values.

RESET_ORIGIN: Delete the application, delete all application files (boot project, etc.), reset all global and retain data.

Example Java:
connection.logic().resetApplication(Logic.ApplicationResetMode.RESET_WARM);
Note:
This method maps to the mlpiCore function mlpiLogicResetApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

native String com.boschrexroth.mlpi.Logic.readVariableBySymbolAsString ( String  symbol)

This method reads a string value from a variable by symbolic access. You can use this method not only for string variables, but also for other types. In this case, the method returns a string representation of the given value. This can be useful if you only want to display the variable as string and you don't need to know the type of the variable.

After you set up the 'Symbol Configuration' you should be able to read a symbolic variable by its name. Please keep in mind that you have to use all name spaces for this variable. For example, if you have a variable "x1" in your task called "Prog", then you have to ask for the variable "Application.Prog.x1".

Parameters
[in]symbolZero terminating string containing the symbolic name to be accessed.
Returns
A string representing the symbol data.
Example Java:
//read a variable from the PLC. This variable has to exist on the control and has to be part of the symbol table.
String variableName = "Application.UserVarGlobal.varReal";
String variableValue = connection.logic().readVariableBySymbolAsString(variableName);
//print value of variable to output
java.lang.System.out.println("Value of PLC variable '" + variableName + "': " + variableValue);
Note:
This method maps to the mlpiCore function mlpiLogicReadVariableBySymbolString, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.Logic.writeVariableBySymbolAsString ( String  symbol,
String  data 
)

This method writes a string value to a variable by symbolic access.

After you set up the 'Symbol Configuration' you should be able to write a symbolic variable by its name. Please keep in mind that you have to use all name spaces for this variable. For example, if you have a variable "x1" in your task called "Prog", then you have to ask for the variable "Application.Prog.x1".

Parameters
[in]symbolZero terminating string containing the symbolic name to be accessed.
[in]dataThe data to write to the symbolic variable.
Note:
This method maps to the mlpiCore function mlpiLogicWriteVariableBySymbolString, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

native String com.boschrexroth.mlpi.Logic.getNameOfApplication ( int  index)

This method returns the name of an application selected by index.

Parameters
[in]indexIndex of the application.
Returns
The name of the application with the given index.
Example Java:
//get the number of loaded applications
int numApplications = connection.logic().getNumberOfApplications();
java.lang.System.out.println("Found " + numApplications + " application(s).");
//list names of all found applications
for (int i = 0; i < numApplications; i++)
{
String appName = connection.logic().getNameOfApplication(i);
java.lang.System.out.println(i + " - " + appName);
}
Note:
This method maps to the mlpiCore function mlpiLogicGetNameOfApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

native int com.boschrexroth.mlpi.Logic.getNumberOfApplications ( )

This method returns the number of loaded applications on the device. This also includes stopped applications.

Returns
The number of loaded applications.
Example Java:
//get the number of loaded applications
int numApplications = connection.logic().getNumberOfApplications();
java.lang.System.out.println("Found " + numApplications + " application(s).");
Note:
This method maps to the mlpiCore function mlpiLogicGetNumberOfApplications, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

native String com.boschrexroth.mlpi.Logic.loadBootApplication ( String  file,
String  path 
)

This function loads an application from the file system of the control. The application files can be created from within IndraWorks by creating a boot project when not logged into the control. This file *.app together with a corresponding *.crc checksum file can be copied to the flash card of the control (i.e. using FTP transfer). Use this function to load it.

Note
This method will not unload a previously loaded application. Subsequently, this method may fail if there are already too many applications loaded on the target and there is no additional application supported. To make room for a new application, you can unload a single application by calling Application.resetApplication with RESET_ORIGIN of class Application, or resetApplication of Logic to unload all applications.

After loading the application, it is in the state STOP. You have to start the application by using the function StartApplication.

Parameters
[in]fileFilename of the new application file without file extension, i.e. "Application".
[in]pathPath to the file of the new application. The default root paths can be determined by using the function System.getSpecialPath in System.
Returns
The name of the new application. The name of the application is stored inside the application project file (.app) and is returned here. Use the application name as handle for other function calls which require the application name in order to identify which application you want to access on the control.
Example Java:
// This example deletes all available applications on the target.
// It then tries to load the application 'ApplTestLogicLib' from directory 'projects' on the OEM partition.
// For this example to work you need to transfer an application named ApplTestLogicLib (ApplTestLogicLib.app + ApplTestLogicLib.crc)
// to the storage card of the target. E.g. using ftp transfer.
//
// init file path information
//
// name of the application file without file extension
String file = "ApplTestLogicLib";
// name of the subdirectory where the application is stored
String pathSub = "projects";
// retrieve root path of the OEM storage on the device
String pathOEM = connection.system().getSpecialPath(SpecialPath.PATH_OEM);
// combine root path and subdirectory to get absolute path to application project
String pathAbsolute = pathOEM + pathSub;
//
// unloading existing applications
//
int numApplications = connection.logic().getNumberOfApplications();
java.lang.System.out.println("Found " + numApplications + " existing application(s).");
if (numApplications > 0)
{
// delete all applications and make room for new app
connection.logic().resetApplication(Logic.ApplicationResetMode.RESET_ORIGIN);
}
//
// loading application project
//
java.lang.System.out.println("Loading " + file + " from " + pathAbsolute);
String applicationName = "";
applicationName = connection.logic().loadBootApplication(file, pathAbsolute);
java.lang.System.out.println("Successfully loaded application: " + applicationName);
//
// starting application
//
connection.logic().applications(applicationName).startApplication();
Note:
This method maps to the mlpiCore function mlpiLogicLoadBootApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

native LogicCapabilityOperationValue com.boschrexroth.mlpi.Logic.getCapabilityOfOperation ( LogicCapabilityOperation  operation)

This method returns the current capability of execution of operations LogicCapabilityOperation.

Parameters
[in]operationOperation which can be enabled or disabled.
Returns
The current capability of execution of operation.
Example Java:
// Read the current capability to execute online changes.
Logic.LogicCapabilityOperationValue isOnlineChangeAllowed = connection.logic().getCapabilityOfOperation(Logic.LogicCapabilityOperation.LOGIC_CAP_OPERATION_ONLINE_CHANGE);
if (isOnlineChangeAllowed == Logic.LogicCapabilityOperationValue.LOGIC_CAP_OPERATION_ENABLE)
java.lang.System.out.println("Online change currently allowed");
else
java.lang.System.out.println("Online change currently NOT allowed");
Note:
This method maps to the mlpiCore function mlpiLogicGetCapabilityOfOperation, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.Logic.setCapabilityOfOperation ( LogicCapabilityOperation  operation,
LogicCapabilityOperationValue  value 
)

This method enables or disables the capability of execution of operations LogicCapabilityOperation. The capability will be set global for all applications. After reboot the capability will be set to default.

Parameters
[in]operationOperation which can be enabled or disabled.
[in]valueTarget capability of execution of operation.
Example Java:
// Disable capability to execute online changes.
connection.logic().setCapabilityOfOperation(Logic.LogicCapabilityOperation.LOGIC_CAP_OPERATION_ONLINE_CHANGE, Logic.LogicCapabilityOperationValue.LOGIC_CAP_OPERATION_DISABLE);
Note:
This method maps to the mlpiCore function mlpiLogicSetCapabilityOfOperation, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

native LogicSymbolInformation com.boschrexroth.mlpi.Logic.getInformationOfSymbol ( String  symbol)

This method reads the type, size and access rights of a symbol variable of an PLC application.

Parameters
[in]symbolZero terminating string containing the symbolic name which should be accessed.
Returns
An instance of LogicSymbolInformation containing information about the size, type and access rights of the symbol.
Example Java:
// read informations about a variable from the PLC. This variable has to exist on the control and has to be part of the symbol table.
String variableName = "Application.UserVarGlobal.varReal";
Logic.LogicSymbolInformation variableInfo = connection.logic().getInformationOfSymbol(variableName);
// print info of variable to output
java.lang.System.out.println("Type: " + variableInfo.type.toString());
java.lang.System.out.println("SubType: " + variableInfo.subType.toString());
java.lang.System.out.println("AccessRights: " + variableInfo.accessRights.toString());
java.lang.System.out.println("DataSize: " + variableInfo.dataSize);
java.lang.System.out.println("Dimension: " + variableInfo.dimension);
java.lang.System.out.println("NumElements: " + variableInfo.numElements);
java.lang.System.out.println("Range[0].minimum: " + variableInfo.range[0].minimum);
java.lang.System.out.println("Range[0].maximum: " + variableInfo.range[0].maximum);
java.lang.System.out.println("Range[1].minimum: " + variableInfo.range[1].minimum);
java.lang.System.out.println("Range[1].maximum: " + variableInfo.range[1].maximum);
java.lang.System.out.println("Range[2].minimum: " + variableInfo.range[2].minimum);
java.lang.System.out.println("Range[2].maximum: " + variableInfo.range[2].maximum);
Note:
This method maps to the mlpiCore function mlpiLogicGetInformationOfSymbol, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

native LogicUserTypeInformation [] com.boschrexroth.mlpi.Logic.getInformationOfUserType ( String  javaSymbol)

This method reads names and information as LogicUserTypeInformation of variables of a symbol if type of symbol is MLPI_LOGIC_TYPE_USERDEF.

Parameters
[in]javaSymbolZero terminating string containing the symbolic name which should be accessed.
Returns
An instance of LogicUserTypeInformation containing information about the symbol.
Note:
This method maps to the mlpiCore function mlpiLogicGetInformationOfUserType, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

native String com.boschrexroth.mlpi.Logic.getStopAxesConfiguration ( )

This function returns the active "StopAxes" and "StopAxesCommon" configuration of all applications.

Returns
Active "StopAxes" and "StopAxesCommon" configuration of all applications.
Example Java:
//get active "StopAxes" and "StopAxesCommon" configuration
String configuration = connection.logic().getStopAxesConfiguration();
java.lang.System.out.println(configuration);
Note:
This method maps to the mlpiCore function mlpiLogicGetNameOfApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Logic.applications().

Here is the caller graph for this function:

Member Data Documentation

final int com.boschrexroth.mlpi.Logic.LOGIC_MAX_DIMENSION_OF_ARRAY = 3
static

Maximum dimension of an array.

Definition at line 69 of file Logic.java.


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