rciExecute(3)

NAME
rciExecute
 -- execute function for an RCI task.

USAGE
rciExecute (td, fxn, arg, ret)
   RCI_DESC *td;
   int (*fxn)();
   int arg;
   int *ret;

ARGUMENTS

td --
    Pointer to RCI task descriptor.

fxn --
    Pointer to function to be executed.

arg --
    Argument to the function.

ret --
    If not NULL, this is used to accept the return value from the function.

RESTRICTIONS
This routine must be called from the planning level.

DESCRIPTION
rciExecute() executes a function for a particular control task. This may be done at any time, whether the task is active or idle. It is guaranteed, however, that the execution of this function will not interrupt the execution of a control function belonging to the same task, and vice versa.

The function fxn is called by the task's monitor, on the CPU assigned to that task, with td and arg as arguments:
        (*fxn)(td, arg);

DIAGNOSTICS
The function returns -1 when an error occurs. Error information is reported on the errorStack (q.v.).

Returned error codes, accessible with getErrorCode(), are:

EDescriptor --
    Invalid task descriptor.

ERange --
    The address associated with the function lies outside of the control text area.

EInternal --
    Unexpected internal software problem, or loss of communication with the monitor.

The routine will abort the program if called from the control level.

SEE ALSO
rciCreate(3), rciStart(3), rciControlFxns(3), errorStack(3).