Creating Octave Components

REDHAWK provides the ability to auto-generate a REDHAWK component given an Octave M function. Assuming M functions are set up to input/output data vectors rather than relying on file or terminal-based input/output, these components are seamlessly deployable on runtime systems.

Octave version 3.4 or greater, with development support, must be installed on the development and deployment systems. This requirement can be met by either installing Octave from source or installing the octave-devel RPM.

The generated REDHAWK C++ code utilizes the Octave C++ programming interface to:

In many cases, the Octave component can be created without any C++ programming by the developer and without an in-depth understanding of REDHAWK. Developers with a more in-depth understanding of C++ programming and REDHAWK have the option of leveraging more advanced REDHAWK features by modifying the generated C++ code. Furthermore, Octave components can be composed into waveforms with components written in other languages (Java, C++, and Python).

The createOctaveComponent Script

Octave components can be generated using a command line tool (createOctaveComponent) or using the REDHAWK IDE. The help string for the command line tool can be accessed by entering the following command:

createOctaveComponent --help

In the most simple case, the command line tool is passed a list of M files with no additional flags. Function arguments that have a default value are treated as properties and function arguments without default values are treated as ports.

Below is an example of a basic M function defined in a file named addConst.m:

function myOutput = addConst(myInput, myConst=0)
    myOutput = myInput + myConst

To generate the component code, use the following command:

createOctaveComponent addConst.m

Refer to the createOctaveComponent help string for flags to:

Design Considerations

There are a few design considerations to keep in mind when creating an M file to be used in REDHAWK: