Read Global Expression Evaluated

This MotoHawk™ block inserts a stub to call an arbitrary global function or expression returning a scalar variable.

Block ID

motohawk_read_global_expression_eval

Library

MotoHawk_lib/Extra Development Blocks

Description

This block allows an expression to be evaluated. That is, the content you enter in a parameter field is evaluated as a named variable. To use the parameter content as literal text you must enclose the parameter content in single quotes (except Data Type, a menu selection).

Title and Port Label are only used to label the block. Include Statement inserts code at the top of the generated C code file, to import declarations from a header file. Signature inserts a line directly preceding the expression. This can be used to extern functions or variables. Expression in inserted inline, to update the signal value. Return Data Type must be selected to declare the signal data type in Simulink. The values placed into this block are not checked. A compiler or linker error will occur if there are errors.

Block Parameters

Parameter Field Values Comments/Description
Title Alpha-numeric text (optional - single-quote enclosed) Enter name of known variable to Label Block (or use single-quote enclosure to use literal text).
Port Label Alpha-numeric text (optional - single-quote enclosed) Enter name of known variable to Label Port (or use single-quote enclosure to use literal text).
Include Statement Alpha-numeric text (optional - single-quote enclosed) Enter name of known variable to insert code at the top of the generated C code file, to import declarations from a header file (or use single-quote enclosure to use literal text).
Signature Alpha-numeric text (optional - single-quote enclosed) Enter name of known variable to insert a line directly preceding the expression which can be used to extern functions or variables (or use single-quote enclosure to use literal text).
Inline Expression Alpha-numeric text (optional - single-quote enclosed) Enter name of known variable to enter code expression to update signal value (or use single-quote enclosure to use literal text).
Data Type Drop-down list Select to declare signal data type in Simulink.