HMI Object Definition

This MotoHawk™ block is part of the HMI Blockset and allows various widget objects to be used with a graphic HMI (Human Machine Interface) to be defined.

Block ID

HMI Object Defn

Library

motohawk_HMI_lib

Description

This MotoHawk™ block allows various widget objects to be used with a graphic HMI (Human Machine Interface) to be defined. Examples of objects include Charts, Labels and Containers.

Objects have a number of common attributes that all objects share. These can be interacted with using the HMI Object Get and HMI Object Set blocks. Objects also have a Type like Label that have additional widget specific attributes that are altered using the type specific block. For example the text of a Label could be altered using the HMI Label Set block.

Use the Container Type to define an object that can house other objects. As such a Container is allowed to be a parent for (say) a group of Labels and a Chart. All objects housed within a Container inherit attributes from that Container. Thus, for example, the coordinate origin of a Label that is housed within a Container will be the Container instead of (say) the Screen that the Container references.

Block Parameters

Attributes Visible for all Object Types

Parameter Field Values Comments/Description
Name Single quote enclosed alpha-numeric text The name given to the Object that other related blocks would reference.
Parent Name Single quote enclosed alpha-numeric text The name of a screen block or another object that the defined object is to be a member of.
Object Type Drop Down
(Container, Label, Chart, Line)
The type of widget to be defined.
Default X Coordinate Spin Box The initial X coordinate that will be applied to the object when it creates. Value can be altered at runtime via the HMI Object Set block.
Default Y Coordinate Spin Box The initial Y coordinate that will be applied to the object when it creates. Value can be altered at runtime via the HMI Object Set block.

Attributes Visible when Object Type is a Label

Parameter Field Values Comments/Description
Default Label text Single quote enclosed alpha-numeric text The default value of the label that will be applied when the label is created. A NUL terminator will be automatically added to the end of the resulting string.
Is Constant Checkbox Check to indicates that the label's text is constant. Constant labels use less memory, but their text can't be altered with the HMI Label Set block.

Attributes Visible when Object Type is a Chart

Parameter Field Values Comments/Description
Define Object attributes for Graphics Driver Drop Down The visible attributes for a chart are determined based upon the chosen Graphics Driver in use. The resource chosen to ultimately Display the chart will identify the Graphics Driver that is to be used. Many (or most) of the attributes will be supported by all possible drivers. However there may be some that are unsupported. Only those attributes that are supported by the selection will be visible on the block mask dialog.
Default number of data points Spin Box The initial number of points that a Data Series attached to this chart will have. Value can be altered at runtime via the HMI Chart Set block.
Default min range Spin Box Values of a Data Series that are smaller than the minimum range will not be shown on the chart. Value can be altered at runtime via the HMI Chart Set block.
Default max range Spin Box Values of a Data Series that are larger than the maximum range will not be shown on the chart. Value can be altered at runtime via the HMI Chart Set block.
Default Data Line Width Spin Box The default width of the line used to draw the Data Series. Value can be altered at runtime via the HMI Chart Set block.
Axis Margin (pixels) Spin Box Defines the region reserved to the left and bottom of the chart to display axis information. A margin of zero will prevent axis information like ticks and labels from being visible.
Number of X Grid Line Spin Box Defines the number of vertical grid lines that are shown on the chart. These are separate from axis ticks.
Number of Y Grid Line Spin Box Defines the number of horizontal grid lines that are shown on the chart. These are separate from axis ticks.
X-Axis Tick Labels Cell array of single quote enclosed alphanumeric strings Each string defines a label that will be populated on the X-axis, starting from the left of the chart. The number of strings defines how many major ticks will be populated on the axis.
X-Axis Major Tick Length (pixels) Spin Box Defines the length of the major tick that will be drawn on the chart.
X-Axis Minow Tick Length (pixels) Spin Box Defines the length of the minor tick that will be drawn on the chart.
Number of minor X-Axis Ticks (pixels) Spin Box Defines how many minor ticks will be drawn between each major tick or the total number of ticks if there are no major ticks. Note that the first minor tick is drawn on top of the major tick so to have a single minor tick between two major ticks would require a value of 2 to be used.
Y-Axis Tick Labels Cell array of single quote enclosed alphanumeric text Each string defines a label that will be populated on the Y-axis, starting from the top of the chart. The number of strings defines how many major ticks will be populated on the axis.
Y-Axis Major Tick Length (pixels) Spin Box Defines the length of the major tick that will be drawn on the chart.
Y-Axis Minow Tick Length (pixels) Spin Box Defines the length of the minor tick that will be drawn on the chart.
Number of minor Y-Axis Ticks (pixels) Spin Box Defines how many minor ticks will be drawn between each major tick or the total number of ticks if there are no major ticks. Note that the first minor tick is drawn on top of the major tick so to have a single minor tick between two major ticks would require a value of 2 to be used.

Attributes Visible when Object Type is a Line

Parameter Field Values Comments/Description
Default Point Coordinates Simulink Matrix
[x1,y1;x2,y2;x3,y3;...]
A matrix of X,Y coordinates that define the start/end points of each line segment. A matrix of [x1,y1;x2,y2;x3,y3] would define two line segments, one segment from (x1,y1) to (x2,y2) and another from (x2,y2) to (x3,y3). Coordinates are relative, so a [0,0;0,10;5,10] L shape would be drawn at [50,0;50,10;55,10] if the XY Coordinates of the Line Object were set via HMI Object Set to (50,0).
Is Constant Checkbox Check to indicates that the line defined by the Default Point Coordinates is constant. The line segments of such a line can not be modified (though runtime attributes like its base X,Y coordinates can still be altered via the HMI Object Set block). A constant line will use less memory.