# $ Functions: HMI

Cognex Designer offers the following $ functions for WebHMI development:

HMI.ClosePage(pageName : String)
Returns | N/A
Arguments | pageName: The name of the web page to close.
Description | Closes the web page specified by the pageName argument. Tip: Use this $ function to close overlaying HMI pages.

HMI.ShowKeyboard(currentText : String, hideCharacters : Boolean, zoom : Double) : String
Returns | String, showing the text typed in with the keyboard on the web page.
Arguments | currentText: String, specifying the text typed in with the keyboard on the web page. hideCharacters: Boolean, specifying if the typed characters should be hidden or not. zoom: Double, specifying the amount of zoom while typing text on the webpage.
Description | Shows the text typed with the keyboard as specified with the above arguments.

HMI.ShowKeypad(initialValue : Double, decimalPlaces : Integer, zoom : Double) : Double
Returns | Double, showing the number typed in with the keypad on the web page.
Arguments | initialValue: Double, specifying the number typed in with the keypad on the web page. decimalPlaces: Integer, specifying the number of decimal places of the value typed in with the keypad. zoom: Double, specifying the amount of zoom while typing the number on the webpage.
Description | Shows the number typed with the keypad as specified with the above arguments.

HMI.ShowMessage(message : String)
Returns | N/A
Arguments | message: String, specifying the message to show on the web page.
Description | Shows the message specified with the message argument.

HMI.ShowError(message, title : String)
Returns | N/A
Arguments | message: String, specifying the text of the error message to show on the web page. title: String, specifying the title of the error message.
Description | Shows the error message specified with the above arguments.

HMI.ShowInformation(message, title : String)
Returns | N/A
Arguments | message: String, specifying the text of the message to show on the web page. title: String, specifying the title of the message.
Description | Shows the information message specified with the above arguments.

HMI.ShowPage(pageName : String, xOverride, yOverride : Double)
Returns | N/A
Arguments | pageName: String, specifying the name of the page to show. xOverride: Double, specifying the position of the top left point of the page on the X-axis. The default value is 0. yOverride: Double, specifying the position of the top left point of the page on the Y-axis. The default value is 0. Tip: The xOverride and yOverride arguments are optional. If they are not specified, then Cognex Designer uses the X and Y-axis positions defined by the Page object.
Description | Shows the page specified with the pageName argument in the location specified with the xOverride and yOverride arguments.

HMI.ShowQuestion(message, title : String)
Returns | N/A
Arguments | message: String, specifying the text of the question message to show on the web page. title: String, specifying the title of the question.
Description | Shows the question specified with the above arguments.

HMI.Invoke(actionName : String, args : Object[])
Returns | N/A
Arguments | actionName: String, specifying the name of the action to invoke on the web page. args: An array of objects, specifying the arguments of the action to invoke.
Description | Invokes a complex action (named with the actionName property) according to the array of objects specified with the args property.

HMI.ShowOverlayPage(pageName : String, xOverride, yOverride : Double)
Returns | N/A
Arguments | pageName: String, specifying the page to show as an overlay page. xOverride: Double, specifying the position of the top left point of the page on the X-axis. The default value is 0. yOverride: Double, specifying the position of the top left point of the page on the Y-axis. The default value is 0. Tip: The xOverride and yOverride arguments are optional. If they are not specified, then Cognex Designer uses the X and Y-axis positions defined by the Page object.
Description | Shows the page specified with the pageName argument as a popup page, in the location specified with the xOverride and yOverride arguments. The pages below the overlay page will be disabled. Tip: Use the ClosePage $ function to close the overlay page.