HMI Builder Overview

The HMI Display Builder is used to build interactive display windows for use under SIMulation Workbench™.

swbdisplaybuilder.png 

A display is built by selecting widgets from the widget panel, clicking where you want to place them in the display, configuring their properties such as colors, position and general visual settings, and connecting widget variables to RTDB variables.

Once the display has been created and saved, it can be viewed in the Control Center or in HMI Display. Many of the widgets can be connected to real-time database (RTDB) variables so that the widget will display their values. Most of the widgets can also be used to modify the value of variables.

The display builder is divided into several panels.

swbdisplaybuilder_light.jpg 

Corner Controls

Snap Grid

Grid size in pixels to which widget locations are snapped. The pixel location of the upper left corner of widgets is snapped to the nearest multiple of this value. While the widget is being dragged around, the selection corners will snap to show the final location of the widget.

Hide Side Panels

Hides the panels on the left and right edges of the window so that the central display editing area occupies the full width of the window. This makes it easier to position widgets in large displays by avoiding the need to scroll.

Filter Points

Restricts the display of I/O points and model signals and parameters to names containing the regular expression entered in this field. See Regular Expressions.

Expand All expandall.png

Expands the hierarchy tree for all RTDB variable names in the variable tables. I/O point names with periods in the names are hierarchical names and are displayed as a tree. A.ai000 and A.ai001 are displayed with ai000 and ai001 as children of the A node. Model parameter and signal names with a virgule in the name are treated similarly.

Collapse All collapseall.png

Collapses the hierarchy tree for all variable names in the variable tables to show just the top level nodes.

Demonstrate helpvideo.png

Opens a short video clip that demonstrates the basic workflow of this form.

Help help.png

Opens this section of the manual. If a widget button or widget is selected, the section documenting that particular widget is opened.

New Displaytoolbar.png

Creates a new empty display in the central area.

Open Display...toolbar00001.png

Opens an existing display in the central area. Browse to the .swbd file with the file browser that opens. See HMI File Manager for instructions on how to change the default location for the HMI files.

Save Displaytoolbar00002.png

Saves the display in the central area that has focus to the same file as it was opened from or previously saved to.

Save Display As...toolbar00003.png

Saves the display in the central area that has focus to a new file name, which is specified with the file browser that opens. See HMI File Manager for instructions on how to change the default location for the HMI files.

Save and Launchtoolbar00004.png

Saves the display in the central area that has focus to the same file as it was opened from or previously saved to (if it has been modified) then launches the display. This is very helpful when in an edit & test cycle.

Deletetoolbar00005.png

Deletes the selected widget(s) without putting them into the paste buffer.

Cuttoolbar00006.png

Deletes the selected widget(s) and puts them into the paste buffer.

Copytoolbar00007.png

Copies the selected widget(s) into the paste buffer.

Pastetoolbar00008.png

Pastes the widgets in the paste buffer into the display in the central area that currently has focus.

Align Lefttoolbar00009.png

Aligns the left edge of the selected widgets.

Align Righttoolbar00010.png

Aligns the right edge of the selected widgets.

Align Toptoolbar00011.png

Aligns the top edge of the selected widgets.

Align Bottomtoolbar00012.png

Aligns the bottom edge of the selected widgets.

File Menufile_menu.png

All the lower left corner buttons’ file operations are also available through the File menu. Additionally, there is a dynamically updated Open Recent menu. Every time a display is opened in the editor or launched, it is moved to the head of this list. Selecting a display in this menu opens it in the builder for editing. This list is maintained across program invocations. There is a Clear History menu item in it to erase this history of opened displays.

Edit Menuedit_menu.png

All the lower left corner buttons’ edit operations are also available through the Edit menu.

NOTE

To select multiple widgets, select the first widget by click­ing on it, then holding down the control button while clicking on additional widgets. Multiple widgets may also be selected by clicking on an empty area and dragging with the mouse button still held down to select multiple widgets with a selection lasso.

Widget Indicator

The lower right corner indicates the type of widget that has been clicked on most recently. If one of the widget buttons in the upper left panel was clicked on, the indicator will read Click to Insert: Widget Type to indicate that clicking in a display in the central area will insert a widget of that type. If a widget in a display has been selected, it will read Selected Widget: Widget Type to indicate what type of widget a given widget is. Since many widgets are very customizable, it isn’t always clear from appearance which type of widget they are.

Display Propertiesdisplayprop.png

Properties of the HMI Display window. To set the properties of the display window, deselect all items in the display by clicking on an empty area within it.

x

Horizontal position on the screen where the display will initially open, measured in pixels from the left side of the screen.

y

Vertical position on the screen where the display will initially open, measured in pixels from the top of the screen.

Width

Initial width in pixels for the display. If the display is not configured to be resizable, this will be the fixed width of the widget.

Height

Initial height in pixels for the display. If the display is not configured to be resizable, this will be the fixed height of the widget.

NOTE

If the specified location and size of the display does not fit within an actual physical screen when the display is opened, it will be moved to the nearest screen that it does fit on.

Title

Title to display in the title bar of the display window. If this is not specified, the title will be set to the name of the display file.

Background Color

Background color to fill the display with.

Background Image

Name of an image file to fill the display with.

Stretch Image

Expands or shrinks background image so that it fits entirely within the display. If the display is configured to be resizable, the image will expand or shrink with the size of the window.

x,y Image Origin

Comma separated coordinates (x,y) of the background image within the display window. This is only use when the Stretch Image option is off. Negative numbers can be specified.

Examples:

The background image is stretched to fill the display background:

dis_displayex.png 

The background image is not stretched (shown at its native resolution) and its origin is at 20,20:

dis_displayex2.png 

The background image is not stretched and its origin is at -20,-20:

dis_displayex3.png 

Resizable

Permits the display window to be resized by dragging the border. If the display is not resizable, it will always have the fixed width and height assigned to the parameters above.

Scrollable

Enables vertical and horizontal scroll bars in the display window so that when the display is resized to a size smaller than its content, the user can scroll to hidden parts of the display.

Title Bar

Shows the title bar. A window without a title bar cannot be moved by the user.

Always on Top

Keeps display on top of any other windows displayed on the screen.

Load with Any RTDB

Permits running the display with any RTDB that has the same variables.

RTDB Name

Name of the SIMulation Workbench real-time database that this display expects to be loaded into memory for getting the values of connected variables. This is set by selecting an RTDB from the drop down list of SIMulation Workbench RTDBs on the right side of the display builder screen. An error message will be issued when a display that requires one RTDB is opened while a test is running on the real-time host with a different RTDB unless the Load with Any RTDB option is selected.

If the RTDB name is set to NONE, the display can be run with any RTDB loaded, but cannot access any variables. This is useful for creating a display dedicated to launch tests or other displays.

RTDB & Model Variables

An HMI display contains a set of widgets that display the values of variables, model signals, and model parameters that exist in the currently loaded real-time database (RTDB). Widgets are associated with specific variables that only exist within a particular RTDB. Only one RTDB can be loaded into memory on the real-time host at a time, so displays (and tests) are associated with a specific RTDB when they are created. This way, the HMI run-time is able to check that the display being opened corresponds to the RTDB loaded in memory and the variables connected to the widgets in that display exist on the real-time host.

Choosing an RTDBrtdbselect.png

Before a widget can be associated with an RTDB variable, the specific RTDB that the display is being designed for must be selected. This is done via the drop-down combo box of RTDBs as shown in the picture.

The drop-down combo box will show all the RTDBs defined on the real-time host. Once one has been selected, the table below the drop-down combo box is filled with all the variables that exist within the selected RTDB.

Choosing a Modelmodelvariables.png

In addition to RTDB variables, widgets can also be connected to model parameters and signals. Currently, there is no way to enforce the relationship between displays and specific models, so models are not tied to specific displays. Nevertheless, model parameters and signals are created at run time when a test is started and are accessible as RTDB variables. This only applies to Simulink™ models whose executable has been generated via the tools provided by SimWB as those will extract the model parameters and signals from the generated source code.

In order to connect a model signal or parameter to a widget, select a model from the model drop-down combo box. The drop-down combo box will show all the models defined on the real-time host. Once one is selected, the table below will be filled with the hierarchy of parameter and signal names defined for the model.

Model parameters are accessible under the Parameters branch in the tree. Model signals are accessible under the Signals branch in the tree. Model signals will only be accessible for Simulink™ models that have been generated with the C-API option on. Only leaves in the tree can be connected to widget variables.

Be aware that as Simulink models are edited, parameters and signals that are used in a display might no longer exist once the model is saved and regenerated. The HMI will show an error message when a display that references variables that don't exist in the RTDB is opened.

Once a model signal or parameter has been connected to widget variable of the selected widget, it will show in the same fashion as I/O points in the list of connected variables.

Connecting an RTDB or Model Variable to a Widgetconnectedvariables.png

To connect the widget internal variable(s) to RTDB variable(s), first select the widget on the display. The internal widget variable(s) will appear in the Connected Variable(s) list as shown. By default, the first widget variable will be preselected when you selected the widget. Other widget variables may be selected by clicking on them in the table.

To connect an RTDB variable to the selected widget variable, locate the RTDB variable in the tables below the Connected Variable(s) table and click the check box next to its name.

When a widget variable that is already connected to an RTDB variable is selected, the check box next to that RTDB variable will be checked by SimWB. Click in the check box to clear the check mark to disconnect them, or click on the Disconnect button.

Testing Widget Behavior

You can test how the widget will display for different values of its connected variables by typing values in the entry fields, which are located immediately below the Connected Variable(s) table.

String Variables

In addition to numerical variables such as double, float, etc., string variables can also be defined in the RTDB. As with numerical variables, string variables are defined as either input or output. They are really defined as binary buffers with the associated buffer length. A limited set of widgets in the SIMulation Workbench HMI support string variables:

   Action Button

   Checkbox

   Toggle Button

   Combo Value

   Numeric Value

In the HMI, a distinction is made between regular ASCII strings and binary strings. ASCII strings only contain characters defined within the ASCII character set and can thus be displayed and set via data entry as normal text would be.

The content of a binary string is defined by a special format string. The format string consists of a comma-separated list of entries that specify the subfields of the binary string. Each entry contains the type and value specifiers of the subfield. For some widgets, the value may be specified as the value of a data entry field, otherwise the value is an integer constant.

The valid type specifiers are:

I1

The number following the I1 specifier is to be packed as a single byte. This specifier is optional for specifying the value of a single byte with an integer value.

I2

The number following the I2 specifier is to be packed in the buffer as a little-endian 2-byte short number.

I4

The number following the I4 specifier is to be packed in the buffer as a little-endian 4-byte int number.

The value specifier is a simple integer value or a field specifier, which specifies which field in a data entry form to get the value from with an F followed by the number of field in the data entry form (numbered from 0).

Example:

3,I14,I2F0,I4F1

The binary string will be:

hmi_builder00015.jpg 

Specifying Field Entry

In the case of the Combo Value widget (see Combo Value), the data entry fields are part of the combo value widget itself.dis_combovalue.png

In the case of the Numeric Value widget (see  Numeric Value), the data entry fields are in the data entry dialog that appears when the value is edited, the associated variable is defined as a binary string, and the binary string format contains Fx field specifiers.binarystringentrydlg.png

Action Buttons, Toggle Buttons and Checkboxes do not support subfield data entry, and in this case, the Fx field specifier is not used.

For those widgets, we would specify the value to send on click, for eample:

0,I412,I222

Where byte zero is a 0, bytes one to four are the little-endian 32-bit integer value 12 and bytes five and six are packed with little-endian 16-bit integer value 22.

Remote Function Calls

The HMI run-time includes the ability of calling some SIMulation Workbench™ or user-defined routines.The function calls are executed by the guirpcsrv process. There is one instance of this process for each instance of the HMI run-time. The call requests are sent via a SIMulation Workbench™ specific protocol over the network connection that is created between the HMI run-time and the corresponding instance of the guirpcsrv process.

Not all SIMulation Workbench functions supported by the API are callable via this mechanism. Only the functions that accept scalar arguments (no pointers) and return an integer error code are defined as callable by the HMI run-time.

SIMulation Workbench Callable Functions

The list of SIMulation Workbench functions callable by the HMI run-time is defined in the simwbfunctionlist.txt file in the /usr/local/ccursim/GUIHooks directory. This is an ASCII file generated automatically with each SIMulation Workbench release and is included in the standard release. This is the content of the file distributed with a typical SIMulation Workbench: TODO: get current version of this file???

function=ccurEB5100_startCommunication(int )

function=ccurEB5100_stopCommunication(int )

function=ccurEB5100_commitFrame(int ,int )

function=ccurEB5100_enableSendFrame(int ,int )

function=ccurEB5100_disableSendFrame(int ,int ,int ,int )

function=ccurEB5100_getLastError(int )

function=ccurGen_addGenerator(char *,int , int ,float ,float ,float ,float , float ,float ,double , char * )

function=ccurGen_startAllGenerators()

function=ccurGen_stopAllGenerators()

function=ccurGen_rampToValue(char *,double ,double , int ,double )

function=ccurGen_rampRate(char *,double ,double ,int ,double )

function=ccurRTDB_resumeDLogger()

function=ccurRTDB_pauseDLogger()

function=ccurRTDB_stopCircularLogger()

function=ccurAsyncIO_arinc429TXQueueNowName(char *)

function=ccurAsyncIO_arinc429TXQueueNowLabel(int ,int ,int  )

function=ccurAsyncIO_arinc429SetInvertParity(char *,int )

function=ccurAsyncIO_arinc429SetTxRateLabel(int ,int ,int ,int ,int )

function=ccurAsyncIO_arinc429SetTxRate(char * ,int )

function=ccurAsyncIO_arinc429SetTxScheduledToFIFO(char * )

function=ccurAsyncIO_arinc429SetTxFIFOToScheduled(char *,int )

function=ccurAsyncIO_arinc429SetFIFOTxOnChange(char *,int )

function=ccurAsyncIO_arinc429HaltPointChannel(char * )

function=ccurAsyncIO_arinc429StartPointChannel(char * )

function=ccurAsyncIO_arinc429HaltChannel(int ,int  )

function=ccurAsyncIO_arinc429StartChannel(int ,int  )

function=ccurAsyncIO_arinc429PauseLabel(int ,int ,int  )

function=ccurAsyncIO_arinc429PauseItemLabelName(char * )

function=ccurAsyncIO_arinc429ResumeLabel(int ,int ,int  )

function=ccurAsyncIO_arinc429ResumeItemLabelName(char * )

function=ccurAsyncIO_canTXQueueNowName(char * )

function=ccurAsyncIO_canTXQueueNowCANId(int ,int ,int  )

function=ccurAsyncIO_canSetFIFOTxOnChange(char *,int )

function=ccurAsyncIO_ao16SetFrequencyWave(int ,int ,double ,char * )

function=ccurAsyncIO_ao16Resume(int )

function=ccurAsyncIO_ao16Pause(int )

function=ccurAsyncIO_ao16SetFilter(int ,int )

function=ccurSched_pause()

function=ccurSched_resume()

function=ccurSched_nonRT()

function=ccurSched_resumeRT()

function=ccurSched_step(int )

funcselection_dlg.png