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

Inherits com.boschrexroth.mlpi.MlpiComponent.

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

Classes

enum  TaskProcessState
 
enum  TaskViewerState
 
class  Trigger
 
enum  TriggerEvent
 
enum  TriggerOption
 
class  TriggerSetup
 

Public Member Functions

native void setTriggerSetup (TriggerSetup[] triggerSetup)
 
native void getTriggerSetup (TriggerSetup[] tiggerSetup)
 
native void setTrigger (Trigger[] trigger)
 
native boolean getTrigger (Trigger[] trigger)
 
native void startTaskViewer ()
 
native void stopTaskViewer ()
 
native TaskViewerState getTaskViewerState ()
 
native long executeFile (String path, String envArguments, String arguments)
 
native TaskProcessState executeGetStatus (long handle)
 
native long[] executeGetActive ()
 
native void executeKill (long handle)
 
native String executeGetName (long handle)
 

Detailed Description

Class definition of the TaskLib.

Definition at line 67 of file Task.java.

Member Function Documentation

native void com.boschrexroth.mlpi.Task.setTriggerSetup ( TriggerSetup[]  triggerSetup)

This function sets the configuration of the external trigger. Use this function to deactivate cyclic events and configure the behaviour of the external trigger function.
Use the options 'MLPI_TASK_TRIG_OPT_NO_CYCLIC_MOTION' and 'MLPI_TASK_TRIG_OPT_NO_CYCLIC_SERCOS' to activate or deactivate cyclic execution of the events. It is only possible to decouple events if all axis are in standstill. Events are triggered synchronous to theirs specific cycles. To change this behaviour set the option 'MLPI_TASK_TRIG_OPT_IMMEDIATE_EXECUTION'. In this case all events are executed immediately one after the other and not within their cycles.
A warning is set as long as an event is decoupled from cyclic execution. To suppress this warning set the option 'MLPI_TASK_TRIG_OPT_NO_WARNING'. If an fatal error occurs all decoupled events will be reset and coupled again, so that an error reaction can be performed. To deactivate the reset of events set the option 'MLPI_TASK_TRIG_OPT_NO_ERROR_REACTION'. The call of the function 'mlpiTaskSetTrigger' is asynchronous and will return immediately. Set the option '' to call the function synchronous. In this case the function will return after all triggers are done.

Parameters
[in]triggerSetupArray of structures to activate and deactivate options.
Example Java:
// decouple motion from cyclic execution and set option synchronous
TriggerSetup setup[] = new TriggerSetup[2];
setup[0] = new TriggerSetup();
setup[1] = new TriggerSetup();
setup[0].active = true;
setup[0].triggerOption = TriggerOption.TRIG_OPT_NO_CYCLIC_MOTION;
setup[1].active = true;
setup[1].triggerOption = TriggerOption.TRIG_OPT_SYNCHRONOUS;
connection.task().setTriggerSetup(setup);
Note:
This method maps to the mlpiCore function mlpiTaskSetTriggerSetup, where you can find further documentation.
native void com.boschrexroth.mlpi.Task.getTriggerSetup ( TriggerSetup[]  tiggerSetup)

This function gets the configuration of the external trigger.

Parameters
[in,out]triggerSetupArray of structures to store the actual configured options. The triggerOption is an input parameter. It defines which option is requested. Active is an output parameter. It says if the option is activated or not.
Example Java:
// get configuration of option 'TRIG_OPT_NO_CYCLIC_MOTION' & 'TRIG_OPT_SYNCHRONOUS'
TriggerSetup setup[] = new TriggerSetup[2];
setup[0] = new TriggerSetup();
setup[1] = new TriggerSetup();
setup[0].triggerOption = TriggerOption.TRIG_OPT_NO_CYCLIC_MOTION;
setup[1].triggerOption = TriggerOption.TRIG_OPT_SYNCHRONOUS;
connection.task().getTriggerSetup(setup);
System.out.println("MLPI-TRIG_OPT_NO_CYCLIC_MOTION is " + (setup[0].active?"active":"inactive"));
System.out.println("MLPI-TRIG_OPT_SYNCHRONOUS is " + (setup[1].active?"active":"inactive"));
Note:
This method maps to the mlpiCore function mlpiTaskGetTriggerSetup, where you can find further documentation.
native void com.boschrexroth.mlpi.Task.setTrigger ( Trigger[]  trigger)

This function executes the external trigger. To trigger an event it has to be decoupled from the cyclic execution. Use the 'mlpiTaskSetTriggerSetup' function to decouple the events and to configure the behavior of execution. It is not possible to execute a new trigger if an execution is still active. To check if an execution is active use the 'mlpiTaskGetTrigger' function.

Parameters
[in]triggerArray of structures to activate and deactivate events. Use the parameter numTriggers to define how often an activated events should be triggered.
Attention
According to the operation mode of the real drive connected to the axis, an movement may continue once triggered. If the drive is e.g. in the velocity control mode and the event motion is triggered, the drive keeps this velocity until interrupted by a new command. Error on real drives can not be recognized if motion isn't triggered. So no error reaction can occur.
This function should be used for simulation and not on real machines.
Example Java:
// trigger motion 10 times and sercos 20 times
Trigger trigger[] = new Trigger[2];
trigger[0] = new Trigger();
trigger[1] = new Trigger();
trigger[0].triggerEvent = TriggerEvent.TRIG_EVT_MOTION;
trigger[0].active = true;
trigger[0].numTriggers = 10;
trigger[1].triggerEvent = TriggerEvent.TRIG_EVT_SERCOS;
trigger[1].active = true;
trigger[1].numTriggers = 20;
connection.task().setTrigger(trigger);
Note:
This method maps to the mlpiCore function mlpiTaskSetTrigger, where you can find further documentation.
native boolean com.boschrexroth.mlpi.Task.getTrigger ( Trigger[]  trigger)

This function gets the configuration of the events of external trigger functionality.

Parameters
[in,out]triggerArray of structures to store configuration of the events. The triggerEvent is an input parameter. It defines which event is requested. The parameter active defines if an event is actual active or not and numTriggers defines how many triggers are left for this event.
Returns
True if an execution of an external trigger is active.
Example Java:
// get trigger configuration for motion and sercos
Trigger trigger[] = new Trigger[2];
trigger[0] = new Trigger();
trigger[1] = new Trigger();
trigger[0].triggerEvent = TriggerEvent.TRIG_EVT_MOTION;
trigger[1].triggerEvent = TriggerEvent.TRIG_EVT_SERCOS;
boolean active = connection.task().getTrigger(trigger);
System.out.println("MLPI-Execution of an external trigger " + (active?"active":"inactive"));
System.out.println("MLPI-TRIG_EVT_MOTION is " + (trigger[0].active?"active":"inactive") + "; number of triggers: " + trigger[0].numTriggers);
System.out.println("MLPI-TRIG_EVT_SERCOS is " + (trigger[1].active?"active":"inactive") + "; number of triggers: " + trigger[1].numTriggers);
Note:
This method maps to the mlpiCore function mlpiTaskGetTrigger, where you can find further documentation.
native void com.boschrexroth.mlpi.Task.startTaskViewer ( )

This function starts a task viewer session, all task information is stored in a ring buffer as long as the recording is running. You have to use IndraWorks to upload and view the session in a graphical window. Please have a look within the IndraWorks help system to find more information about the task viewer.

Example Java:
// start a task viewer session
connection.task().startTaskViewer();
Note:
This method maps to the mlpiCore function mlpiTaskViewerStart, where you can find further documentation.
native void com.boschrexroth.mlpi.Task.stopTaskViewer ( )

This function stops a task viewer session.

Example Java:
// stop a task viewer session
connection.task().stopTaskViewer();
Note:
This method maps to the mlpiCore function mlpiTaskViewerStop, where you can find further documentation.
native TaskViewerState com.boschrexroth.mlpi.Task.getTaskViewerState ( )

This function gets the current state if the task viewer.

Returns
The current state of the task viewer.
Example Java:
TaskViewerState state = connection.task().getTaskViewerState();
System.out.println("Task viewer state: " + state.toString());
Note:
This method maps to the mlpiCore function mlpiTaskViewerGetState, where you can find further documentation.
native long com.boschrexroth.mlpi.Task.executeFile ( String  path,
String  envArguments,
String  arguments 
)

This function executes a file.

Parameters
[in]pathPath of file to be executed.
[in]envArgumentsArguments for execution environment.
[in]argumentsArguments for execution.
Returns
Execution handle.
Example Java:
long handle = connection.task().executeFile("/ata0b/test.lua", "", "");
System.out.println("Task handle: " + handle);
Note:
This method maps to the mlpiCore function mlpiTaskExecuteFile, where you can find further documentation.
native TaskProcessState com.boschrexroth.mlpi.Task.executeGetStatus ( long  handle)

This function gets the status of an executed file.

Parameters
[in]handleHandle of the execution.
Returns
TaskProcessState of the executed file.
Example Java:
TaskProcessState processState = connection.task().executeGetStatus(handle);
System.out.println("TaskProcessState " + processState.toString());
Note:
This method maps to the mlpiCore function mlpiTaskExecuteGetStatus, where you can find further documentation.
native long [] com.boschrexroth.mlpi.Task.executeGetActive ( )

This function gets handles for all executed files.

Returns
Array where handles of executions will be stored.
Example Java:
long[] handles = connection.task().executeGetActive();
Note:
This method maps to the mlpiCore function mlpiTaskExecuteGetActive, where you can find further documentation.
native void com.boschrexroth.mlpi.Task.executeKill ( long  handle)

This function stops execution of file.

Parameters
[in]handleHandle of the execution.
Example Java:
connection.task().executeKill(handle);
Note:
This method maps to the mlpiCore function mlpiTaskExecuteKill, where you can find further documentation.
native String com.boschrexroth.mlpi.Task.executeGetName ( long  handle)

This function gets the name of an executed file.

Parameters
[in]handleHandle of the execution.
Returns
Name of the executed file.
Example Java:
String name = connection.task().executeGetName(handle);
Note:
This method maps to the mlpiCore function mlpiTaskExecuteGetName, where you can find further documentation.

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