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

Inherits com.boschrexroth.mlpi.MlpiComponent.

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

Public Member Functions

String getNameOfApplication ()
 
native void startApplication ()
 
native void runSingleCycleApplication ()
 
native void stopApplication ()
 
native void resetApplication (Logic.ApplicationResetMode mode)
 
native void saveRetainOfApplication (String path)
 
native void restoreRetainOfApplication (String path)
 
native Logic.ApplicationState getStateOfApplication ()
 
native Logic.ApplicationOpState getOperationStateOfApplication ()
 
native Logic.ApplicationInfo getInfoOfApplication ()
 
native String[] getSymbolsOfApplication ()
 
native Logic.ApplicationTaskInfo[] getTaskInfoOfApplication ()
 
native void writeMemoryAreaAsByteArray (Logic.ApplicationMemoryArea area, int byteOffset, int byteLength, byte[] data)
 
native byte[] readMemoryAreaAsByteArray (Logic.ApplicationMemoryArea area, int byteOffset, int byteLength)
 

Detailed Description

Class definition for PLC applications.

Definition at line 63 of file Application.java.

Member Function Documentation

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

This function starts the given application on the target.

Note
You can start all applications by using the method startApplication in the class Logic.
Example Java:
connection.logic().applications("Application").startApplication();
Note:
This method maps to the mlpiCore function mlpiLogicStartApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Application.getNameOfApplication().

Here is the caller graph for this function:

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

This function runs the given application on the target for one cycle.

Note
You can run all applications for one cycle by using the method runSingleCycleApplication in the class Logic.
Example Java:
connection.logic().applications("Application").runSingleCycleApplication();
Note:
This method maps to the mlpiCore function mlpiLogicRunSingleCycleApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Application.getNameOfApplication().

Here is the caller graph for this function:

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

This function stops the given application on the target.

Note
You can stop all applications by using the method stopApplication in the class Logic.
Example Java:
connection.logic().applications("Application").stopApplication();
Note:
This method maps to the mlpiCore function mlpiLogicStopApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Application.getNameOfApplication().

Here is the caller graph for this function:

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

This function resets the given application on the target. All motion that is assigned to the application will stop!

Note
You can reset all applications by using the method resetApplication in the class Logic.
Parameters
[in]modeReset mode Logic.ApplicationResetMode (0==RESET_WARM, 1==RESET_COLD, 2==RESET_ORIGIN).
Note
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().applications("Application").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.Application.getNameOfApplication().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.Application.saveRetainOfApplication ( String  path)

This function saves the retain data of an application to default storage or a user-defined file.

Parameters
[in]pathPath and name of retain data file. Use NULL to select default storage to load it on next reboot.
Example Java:
String retainFilename = "retaindata.dat";
// retrieve path to user partition and build absolute file path
String userPath = connection.system().getSpecialPath(SpecialPath.PATH_USER);
String retainPath = userPath + retainFilename;
// now save retain data to filesystem
java.lang.System.out.println("Saving retain data to " + retainPath + "... ");
connection.logic().applications("Application").saveRetainOfApplication(retainPath);
java.lang.System.out.println("DONE");
// ... and load again
java.lang.System.out.println("Restoring retain data from " + retainPath + "... ");
connection.logic().applications("Application").restoreRetainOfApplication(retainPath);
java.lang.System.out.println("DONE");
Note:
This method maps to the mlpiCore function mlpiLogicSaveRetainOfApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Application.getNameOfApplication().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.Application.restoreRetainOfApplication ( String  path)

This function restores the retain data of an application from a user-defined file.

Parameters
[in]pathPath and name of retain data file.
Example Java:
See documentation of saveRetainOfApplication.
Note:
This method maps to the mlpiCore function mlpiLogicRestoreRetainOfApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Application.getNameOfApplication().

Here is the caller graph for this function:

native Logic.ApplicationState com.boschrexroth.mlpi.Application.getStateOfApplication ( )

This function will return the state of an application using enum Logic.ApplicationState.

Returns
An enumeration showing the current state of the application (RUN, STOP, etc...).
Example Java:
Logic.ApplicationState appState = connection.logic().applications("Application").getStateOfApplication();
java.lang.System.out.println("Current ApplicationState: " + appState.toString());
Note:
This method maps to the mlpiCore function mlpiLogicGetStateOfApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Application.getNameOfApplication().

Here is the caller graph for this function:

native Logic.ApplicationOpState com.boschrexroth.mlpi.Application.getOperationStateOfApplication ( )

This function returns the extended operation state of an application using an instance of ApplicationOpState.

Returns
An ApplicationOpState object containing several elements describing the current operation state of the application.
Example Java:
Logic.ApplicationOpState appState = connection.logic().applications("Application").getOperationStateOfApplication();
java.lang.System.out.println("Current ApplicationOpState: " + appState.toString());
Note:
This method maps to the mlpiCore function mlpiLogicGetOperationStateOfApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Application.getNameOfApplication().

Here is the caller graph for this function:

native Logic.ApplicationInfo com.boschrexroth.mlpi.Application.getInfoOfApplication ( )

This function returns miscellaneous information about the given application using an instance of Logic.ApplicationInfo. This includes its name, author, etc...

Returns
An ApplicationInfo object with miscellaneous information about the given application.
Example Java:
Logic.ApplicationInfo appInfo = connection.logic().applications("Application").getInfoOfApplication();
java.lang.System.out.println("Name: " + appInfo.name);
java.lang.System.out.println("Author: " + appInfo.author);
java.lang.System.out.println("Description: " + appInfo.description);
java.lang.System.out.println("Profile: " + appInfo.profile);
java.lang.System.out.println("DateTime: " + appInfo.dateTime.day + "." + appInfo.dateTime.month + "." + appInfo.dateTime.year);
Note:
This method maps to the mlpiCore function mlpiLogicGetInfoOfApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Application.getNameOfApplication().

Here is the caller graph for this function:

native String [] com.boschrexroth.mlpi.Application.getSymbolsOfApplication ( )

This function reads all symbols in an application as a string array.

Returns
A string array containing a symbol for each element.
Example Java:
// This example reads all exported symbols in the application found first on the target.
// The name of each symbol is written on the console.
// It then tries to read the variable value of each symbol. If the variable type is supported by the
// MLPI, the value is also printed to the console.
// check for existing project
if (connection.logic().getNumberOfApplications() < 1)
{
java.lang.System.out.println("Error: No application loaded on target. Please load application first!");
return;
}
// get name of first application
String applicationName = connection.logic().getNameOfApplication(0);
// read all symbols
String[] symbols = connection.logic().applications(applicationName).getSymbolsOfApplication();
// print list of all symbols and try to read the value
java.lang.System.out.println("Found " + symbols.length + " symbol(s) in application");
for (int i=0; i<symbols.length; i++ )
{
// print symbol name
java.lang.System.out.println(symbols[i]);
// read data to string
String value = connection.logic().readVariableBySymbolAsString(symbols[i]);
// print value
java.lang.System.out.println(" --> " + value);
}
Note:
This method maps to the mlpiCore function mlpiLogicGetSymbolsOfApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Application.getNameOfApplication().

Here is the caller graph for this function:

native Logic.ApplicationTaskInfo [] com.boschrexroth.mlpi.Application.getTaskInfoOfApplication ( )

This function returns information about all IEC tasks running on an application using an array of Logic.ApplicationTaskInfo objects.

Returns
An array of Logic.ApplicationTaskInfo objects. Each object gives you information about an application task.
Example Java:
// read task info of application with name "Application"
Logic.ApplicationTaskInfo[] appTaskInfos = connection.logic().applications("Application").getTaskInfoOfApplication();
// write info of each task to output
java.lang.System.out.println("Found " + appTaskInfos.length + " task(s) in application");
for (Logic.ApplicationTaskInfo appTaskInfo: appTaskInfos)
{
java.lang.System.out.println("->Name: " + appTaskInfo.name);
java.lang.System.out.println(" Priority: " + appTaskInfo.priority);
java.lang.System.out.println(" CycleCount: " + appTaskInfo.cycleCount);
java.lang.System.out.println(" CycleTime: " + appTaskInfo.cycleTime);
java.lang.System.out.println(" MinCycleTime: " + appTaskInfo.minCycleTime);
java.lang.System.out.println(" MaxCycleTime: " + appTaskInfo.maxCycleTime);
java.lang.System.out.println(" AverageCycleTime: " + appTaskInfo.averageCycleTime);
}
Note:
This method maps to the mlpiCore function mlpiLogicGetTaskInfoOfApplication, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Application.getNameOfApplication().

Here is the caller graph for this function:

native void com.boschrexroth.mlpi.Application.writeMemoryAreaAsByteArray ( Logic.ApplicationMemoryArea  area,
int  byteOffset,
int  byteLength,
byte[]  data 
)

This function writes a byte array to the PLC memory area of the application.

Parameters
[in]areaMemory area to access (Logic.ApplicationMemoryArea : MEMORY_AREA_INPUT, MEMORY_AREA_OUTPUT, MEMORY_AREA_MARKER).
[in]byteOffsetZero based byte offset.
[in]byteLengthNumber of bytes to write from data array to the memory area.
[in]dataInput data array of bytes to be written to the given area starting at given byteOffset. Array must be greater than or equal to byteLength.
Example Java:
// we want to write the memory area of the application found first
String applicationName = connection.logic().getNameOfApplication(0);
// create array of 256 bytes and fill with example data
byte[] myMarkerData = new byte[256];
for (int i = 0; i < myMarkerData.length; i++)
myMarkerData[i] = (byte)i;
// write data to marker area
connection.logic().applications(applicationName).writeMemoryAreaAsByteArray(Logic.ApplicationMemoryArea.MEMORY_AREA_MARKER, 0, myMarkerData.length, myMarkerData);
// read back data
byte[] myMarkerArea = connection.logic().applications(applicationName).readMemoryAreaAsByteArray(Logic.ApplicationMemoryArea.MEMORY_AREA_MARKER, 0, myMarkerData.length);
java.lang.System.out.println("Dumping MarkerMemoryArea from byte %MB0.0 to %MB255.0");
for (byte input: myMarkerArea)
java.lang.System.out.println(String.format(" 0x%02x", input));
Note:
This method maps to the mlpiCore function mlpiLogicWriteMemoryAreaArrayUchar, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Application.getNameOfApplication().

Here is the caller graph for this function:

native byte [] com.boschrexroth.mlpi.Application.readMemoryAreaAsByteArray ( Logic.ApplicationMemoryArea  area,
int  byteOffset,
int  byteLength 
)

This function reads a byte array from the PLC memory area of the application.

Parameters
[in]areaMemory area to access (Logic.ApplicationMemoryArea : MEMORY_AREA_INPUT, MEMORY_AREA_OUTPUT, MEMORY_AREA_MARKER).
[in]byteOffsetZero based byte offset.
[in]byteLengthNumber of bytes to read from memory area.
Returns
An array of bytes containing the requested memory area. Index starts at 0.
Example Java:
// we want to read the memory area of the application found first
String applicationName = connection.logic().getNameOfApplication(0);
// read 256 bytes of input area
byte[] myInputArea = connection.logic().applications(applicationName).readMemoryAreaAsByteArray(Logic.ApplicationMemoryArea.MEMORY_AREA_INPUT, 0, 256);
// write data array to output
java.lang.System.out.println("Dumping InputMemoryArea from byte %IB0.0 to %IB255.0");
for (byte output: myInputArea)
java.lang.System.out.println(String.format(" 0x%02x", output));
Note:
This method maps to the mlpiCore function mlpiLogicReadMemoryAreaArrayUchar, where you can find further documentation.

Referenced by com.boschrexroth.mlpi.Application.getNameOfApplication().

Here is the caller graph for this function:


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