Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4MATLAB)  1.26.2
TaskLib
Collaboration diagram for TaskLib:
Task Functions

Task Functions

Description

This function group provides functionality to control and change the tasking and scheduling of the MLC/MLP/XLC system and the user application.

Using the task functions it is possible to hook your task into the real-time task scheduler of the target system. Of course, this makes only sense if your program runs on the same target as the device you are connected to. Using the task functions when connecting via MLPI over ethernet is possible but the timing of the methods is non deterministic. But when running with your application on the target you can make sure, that your task is one of the first tasks to get scheduled, when for example new data has arrived on the sercos bus. To do this you have to increase the task priority of your task using m4MTaskSetCurrentPriority and then you may want to wait for a given system event using m4MTaskWaitForEvent.

More Information

For more information, refer to mlpiCore documentation: TaskLib.

Copyright

Legal notice and version: © 2017 Bosch Rexroth Corporation http://www.boschrexroth.com DC-AE/EAS1 (MGo) Library version: 1.26.2.0.0

m4MTaskWaitForEvent

m4MTaskWaitForEvent

m4MTaskWaitForEvent

Task-Function: Suspend task until event occurs.

Description

This function pends the calling task until the defined event occurs. You can use it to synchronize a task to a system event. This way, you can get for example a task which is activated every time data arrives from the sercos bus. Of course, your task needs to have a priority which is high enough to be activated immediately. Otherwise the time between the event and this function to return is not deterministic.

Normally this function makes sense only if the code is running on the MLPI target. This is because the MlpiTaskEvent occurs in the range of milliseconds while communication between code that does not run on the target and the target normally is above some 10 milliseconds.

Syntax

m4MTaskWaitForEvent(connection, taskEvent, timeout)

result = m4MTaskWaitForEvent(connection, taskEvent, timeout)

Input Arguments

connection defines the connection that will be used. The argument must be scalar and of type MlpiConnection.

taskEvent defines the event the function waits for. The argument must be scalar MlpiTaskEvent enumeration.

timeout defines the time in milliseconds how long the function waits for the event before it returns with a timeout error indicated by a negative result value. The argument must be a real numeric scalar value. Internally it will be casted to uint32.

Output Arguments

result contains the return value of the MLPI function. The argument is scalar and of type int32. Negative values indicate a failed function call. For details refer to the section Error Identification and Handling in Fundamentals of MLPI Programming.

Example Files

Here you will find instructions to use the examples.

The following example is available in the folder ./mlpi/mlpi4MATLAB/bin:

See also

Reference to mlpiCore

This function maps to the mlpiCore function: mlpiTaskWaitForEvent

Copyright

Legal notice and version: © 2017 Bosch Rexroth Corporation http://www.boschrexroth.com DC-AE/EAS1 (MGo) Library version: 1.26.2.0.0