rciControlFxns(3)

NAME
rciControlFxns -- sets up RCI control functions.

USAGE
#include <rci.h>

rciControlFxns (td, startup, control, release, arg)
   RCI_DESC *td;
   int (*startup)();
   int (*control)();
   int (*release)();
   int arg;

ARGUMENTS

td --

    Pointer to task descriptor.

startup --
    Function called once at the start of every control session.

control --
    Function called once every control cycle.

release --
    Function called once at the end of every control session.

arg --
    Argument supplied to the control functions.

RESTRICTIONS
This routine must be called from the planning level.

DESCRIPTION
rciControlFxns() defines the user control functions that constitute an RCI control task. The routine may be called only when the task is idle (i.e., not running). Functions can be omitted by declaring the appropriate argument to be NULLF.

The control functions are the heart of the RCI task, and are described further in controlFxns(7).

DIAGNOSTICS
rciControlFxns() 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.

EActive --
    Task is currently active and hence its functions can't be changed.

ERange --
    The address associated with a function pointer lies outside of the control text area (this check is not made on all systems).

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

SEE ALSO
rciCreate(3), rciStart(3), errorStack(3), errorStack(3), controlFxns(7).