Velocity Scripts
This section explains which Velocity scripts are available for use in either telnet or web session. See also the Velocity NIMMSTA Script Library-Demo Explanation document for more detail.
NIMMSTA Library
Download NIMMSTA Library v2.4.2
The NIMMSTA Library script contains the functionality to interface with the NIMMSTA App for both Android and Windows. The other scripts in the demo projects use functions that are defined in this script. The NIMMSTA Library script must be linked to the session to start the scanner pairing mechanism.
The script has parameters that have effect at the start of a session.
Parameter | Description |
Trigger Mode | Define the scan trigger: the scan trigger button and/or the touch display. |
Timeout | Delay in seconds between starting the NIMMSTA Service and contacting the Connection manager. |
Keys on Connect | Optional. A (string of) character(s) that will be pressed after a connection with the scanner is made. Use this to navigate thought the menus to start scanning. Example: - 1{enter} - 1{enter}{pause:200}2{enter}{pause:200}3{enter} |
Use Location For Light Tag? | Is the Light Tag is a pick-by-light system used for locations? |
Light Tag Color | Light Tag LED Mode Color |
Light Tag LED Mode Intensity | This value should be something between 0 and 255. |
Light Tag LED Blinking Pattern | Select the Light Tag LED blinking pattern |
Telnet Scripts
The scripts that are used in the telnet demo call the functionality that is defined in the NIMMSTA Library script. They are intended to collect the required parameter values as easily as possible for the integration of the HS 50. The display and feedback scripts are provided in two versions:
- A version that can be linked to the session scope multiple times and will act on the information that is displayed on the telnet session, every time the screen information is updated.
- A version that can be linked to a specific template scope.
An example of a template scope is the main menu. A MainMenu template is defined in the Screens section:
Feedback by LED flashing, sound and vibration will then be generated on the NIMMSTA HS 50 Display by linking the Play Feedback (Link to scope) script to the @MainMenu scope.
Using templates is a very powerful way to define specific situations in which information must be displayed on the HS 50 display. The version that responds to the ScreenUpdated event checks for a single piece of text at a defined position on the screen. Keep in mind that row and column numbers start at 0. For instance, in the example below the text ‘Task Location’ is found on row 0, column 8:
The corresponding parameter to select are:
Search Text: Task Location
Search Method: Row and column
Search Text Row: 0
Search Text Column: 8
Set Show Display Text to TRUE during testing to check if the entered search text and position match with the text on the screen. In cases where there are multiple input fields on the screen the script parameters also provide the option to not use a specific text position but verify if the search text is found at the same row as the cursor. It doesn’t matter if the text is to the left or to the right of the cursor. In this example the script must be triggered when the cursor is in the Itm: field:
The corresponding parameter to selects are:
Search Text: Itm:
Search Method: Cursor Position
The Row and Column field are ignored
Display Data Scripts
Download displayDataLinkToScope v2.2.1
Download displayDataOnScreenUpdate v2.2
The NIMMSTA library contains multiple layouts to display data which consist of fields and/or buttons. The available layouts are explained in the Available display layouts section at the end of this document. An example of a layout that contains two fields:
The fields in these layouts contain a smaller header part and a bigger data part. These layouts can be called with the Display Data scripts. After selecting the desired layout both the header part and the data part of a field can either contain static text or text that is read from the telnet screen. Static text can be entered in the parameter field, telnet screen text is referred to by its row and column position and length, preceded by ‘pos:’:
Both the Display Data (On Screenupdate) and Display Data (Link to Scope) scripts contain a large number of variables to display the information on the HS 50 display. Not every parameter applies to every layout. This table shows the parameters that apply to a specific layout:
Layout | Applicable Parameters |
One fields | Header 1, Data 1 |
Two fields | Header 1, Data 1, Header 2, Data 2 |
Three fields | Header 1, Data 1, Header 2, Data 2, Header 3, Data 3 |
Four fields | Header 1, Data 1, Header 2, Data 2, Header 3, Data 3, Header 4, Data 4 |
Five fields | Header 1, Data 1, Header 2, Data 2, Header 3, Data 3, Header 4, Data 4, Header 5, Data 5 |
Six fields | Header 1, Data 1, Header 2, Data 2, Header 3, Data 3, Header 4, Data 4, Header 5, Data 5, Header 6, Data 6 |
One buttons | Caption 1 |
Two fields | Header 1, Header 2 |
One field, one button | Header 1, Data 1, Caption 1 |
NumPad | None |
Function Keys | None |
Scan Counter | Header 1, Data 1 |
Options Menu
Every layout can be displayed with or without an available options menu. This options menu is accessible via a small button at the top of the display.
This button becomes available if at least one of the four Option parameters is defined.
The texts that are entered as options are displayed on the HS 50 display as button caption text. When an option button is pressed, the functionality for it must be defined in the NIMMSTA Button Handler script. If more than two options are defined, a second options menu page becomes available.
Navigating between these pages is done with the PAGE1 and PAGE2 buttons. The O.BACK button at the top close the options menu.
Feedback Scripts
Download playFeedbackLinkToScope v2.0
Download playFeedbackOnScreenUpdate v2.0
As with the display scripts, feedback can be triggered on the connected NIMMSTA Device (beep, LED, vibrate) by information that is displayed in the Velocity session. The blinking color, number of repeats and vibration can be configured. Also, the scan trigger can be disabled when feedback is given. This can be useful if the user must confirm an error message before proceeding.
NIMMSTA Double Trigger Handler (Telnet)
Download nimmstaDoubleTriggerHandlerTelnet v2.0
This script is the event handler that responds to a double click of the scan button. The script can be linked multiple times. Link to either the session scope or a named scope. When linked to the session scope, a search text can be used to identify the screen for which the handler should be active. If no search text is defined the configured action will be triggered every time the scan button is double clicked. If a search text is defined a specific action can be performed. In this example, the enter key is pressed when the scan button is double clicked and the text ‘Press
Three different actions can be performed:
- Send one or more characters or key codes, for instance a single ‘{enter}’ or ‘yes{enter}’
- Enter a portion of the text that is displayed on the screen. Enter the row, column and length of the text and define a confirmation key when that text is entered.
- (Re-) enable the scan trigger mode to what is set with the NIMMSTA library task. This can be useful to (re-) enable the scan trigger mode after the scan trigger is disabled with feedback.
NIMMSTA Triple Trigger Handler (Telnet)
Download nimmstaTripleTriggerHandlerTelnet v2.0
This script is the event handler that responds to a triple click of the scan button. The script can be linked multiple times. Link to either the session scope or a named scope. When linked to the session scope, a search text can be used to identify the screen for which the handler should be active. If no search text is defined the configured action will be triggered every time the scan button is triple clicked. If a search text is defined, a specific action can be performed. In this example, when the scan button is clicked three times and the text ‘Warehouse’ is displayed on row 8 and starts at the first column, numeric values are entered to navigate from the main menu to the start of the picking process screen:
Three different actions can be performed:
- Send one or more characters or key codes, for instance a single ‘{enter}’ or ‘yes{enter}’
- Enter a portion of the text that is displayed on the screen. Enter the row, column and length of the text and define a confirmation key when that text is entered.
- (Re-) enable the scan trigger mode to what is set with the NIMMSTA library task. This can be useful to (re-) enable the scan trigger mode after the scan trigger is disabled with feedback.
Illuminate Light Tag (Telnet)
Download illuminateLightTagTelnet v1.0
This script illuminates a Light Tag that is associated with a location displayed on the screen. Link to the session scope. Define the text and its position that identifies the screen containing the location text, then identify the position and length of the text on the screen to use as the location.
Stop Illuminate Light Tags (Telnet)
Download stopIlluminateLightTagsTelnet v1.0
This script stops the illuminates of any Light Tag. Link to the session scope. Define the text and its position on the screen that identifies the screen where no Light Tags should illuminate.
Functions used in the Web Demo
The logistic process that is shown in the web demo is the same as that of the telnet demo and shows the same interaction with the NIMMSTA HS 50 Display. The scripts in the demo use the same functions from the NIMMSTA library but require different functionality to interact with the web pages. Where the telnet script can be linked to the session scope and respond to updated screen information, the ones for a web application must be linked to a specific named scope.
Web scopes
By default, the only scope that is available in a Velocity web session is a page scope. Field scopes do not exist. A page scope is entered when a specific URL is loaded. A page scope is named after the path without the hostname or port. For example, if the URL of the page is https://www.ivanti.com/wl/help/velocity.htm, use the page scope: “@wl/help/velocity.htm”. In many cases a page scope cannot be used to link scripts. For instance, when the web application only uses one URL, and the content of the web page is updated. Or when the URL is very long. The demo kit contains a script that creates a scope for when an element on the web page is focussed (clicked/tapped), effectively creating field scopes.
Create Web Scopes/Show Scopes
Create Web Scopes (Link To Session) creates scopes for every webpage and its elements. Scripts can then be linked to these scopes. This is useful for when a script should be called if an input field gets focus. For example, when HS 50 Display should inform the user when a location barcode should be scanned. Set the Scope Mechanism parameter to ‘Active Element’. A scope will then be created based on either the id or name of the page element:
The Show Scopes script shows the name of the active scope with a toast message on the screen. This is useful during testing, to determine the scope name to use. In this example the input element has ‘tasknumber’. The scope name for when the input field gets focus is ‘@tasknumber’. This scope name is briefly displayed in a toast message at the bottom of the screen:
The demo uses a combination of page scopes and web scopes:
Page scopes are used in the demo because multiple pages contain an input element with the id ‘edtmenu’. The scope ‘@edtmenu’ can therefore not be used because this would not uniquely identify the required situation whereas the page URLs are unique in this demo.
Create Element Scope
Some web applications use empty elements on the page that are assigned a text value once the page is loaded or an action is performed. For instance, to display error messages. The web pages in the demo contain an element with id ‘message’ to display messages like ‘Location required’ when the input field is empty:
This element is not an input field and will not be selected or get focus. In this case the Create Element Scope will create a scope named ‘@message’ when the element is assigned a text value:
This scope can then be used to call the feedback script to notify the user:
Display Data Scripts
Download displayDataLinkToScopeWeb v2.3
The NIMMSTA library contains multiple layouts to display data which consist of fields and/or buttons. The available layouts are explained in the Available display layouts section at the end of this document.
An example of a layout that contains two fields:
The fields in these layouts contain a smaller header part and a bigger data part. These layouts can be called with the Display Data scripts. After selecting the desired template, any header part or data part of a field or button caption can either contain static text or text that is displayed on the web page. Static text can be entered in the parameter field, text on the web page is referred to by the id or name of the corresponding element, preceded by either ‘id:’ or ‘name:’. Whichever is applicable.
Link to either the session scope, a named scope or a combination of scopes. When linked to the session scope, a search text can be used to identify the web page for which the layout should be displayed. This text can be a text on the page, the name or id of an element or basically any piece of text in the source code of the page. If no search text is defined the configured action will be trigger every time the scan button is double clicked. The Display Data (Link to Scope) script contains a large number of variables to display the information on the HS 50 display. Not every parameter applies to every layout. This table shows the parameters that apply to a specific layout:
Layout | Applicable Parameters |
One fields | Header 1, Data 1 |
Two fields | Header 1, Data 1, Header 2, Data 2 |
Three fields | Header 1, Data 1, Header 2, Data 2, Header 3, Data 3 |
Four fields | Header 1, Data 1, Header 2, Data 2, Header 3, Data 3, Header 4, Data 4 |
Five fields | Header 1, Data 1, Header 2, Data 2, Header 3, Data 3, Header 4, Data 4, Header 5, Data 5 |
Six fields | Header 1, Data 1, Header 2, Data 2, Header 3, Data 3, Header 4, Data 4, Header 5, Data 5, Header 6, Data 6 |
One buttons | Caption 1 |
Two fields | Header 1, Header 2 |
One field, one button | Header 1, Data 1, Caption 1 |
NumPad | None |
Function Keys | None |
Scan Counter | Header 1, Data 1 |
Options Menu
Every layout can be displayed with or without an available options menu. This options menu is accessible via a small button at the top of the display.
This button becomes available if at least one of the four Option parameters is defined.
The texts that are entered as options are displayed on the HS 50 display as button caption text. When an option button is pressed, the functionality for it must be defined in the NIMMSTA Button Handler script. If more than two options are defined, a second options menu page becomes available.
Navigating between these pages is done with the PAGE1 and PAGE2 buttons. The O.BACK button at the top close the options menu.
Feedback Scripts
Download playFeedbackLinkToScopeWeb v2.1
As with the display scripts, feedback can be triggered on the connected NIMMSTA Device (beep, LED, vibrate) by information that is displayed in the Velocity session. The blinking color, number of repeats and vibration can be configured. Also, the scan trigger can be disabled when feedback is given. This can be useful if the user must confirm an error message before proceeding.
Nimmsta Double Trigger Handler Web (Web Demo)
Download nimmstaDoubleTriggerHandlerWeb v1.1
This script is the event handler that responds to a double click of the scan button. The script can be linked multiple times. Link to either the session scope or a named scope. When linked to the session scope, a search text can be used to identify the web page for which the handler should be active. This text can be a text on the page, the name or id of an element or basically any piece of text in the source code of the page. If no search text is defined the configured action will be trigger every time the scan button is double clicked. In this case the content of the element with id ‘qtyOnQty’ will be entered when it is found on the page:
Three different actions can be performed:
- Send one or more characters or key codes, for instance a single ‘{enter}’ or ‘yes{enter}’
- Enter the text content of an element on the page. The element must be referenced by either its id or name. A confirmation key can be defined to post the data to the webserver.
- (Re-) enable the scan trigger mode to what is set with the NIMMSTA library task. This can be useful to (re-) enable the scan trigger mode after the scan trigger is disabled with feedback.
NIMMSTA Triple Trigger Handler (Web)
Download nimmstaTripleTriggerHandlerWeb v1.1
This script is the event handler that responds to a triple click of the scan button. The script can be linked multiple times. Link to either the session scope or a named scope. When linked to the session scope, a search text can be used to identify the screen for which the handler should be active. If no search text is defined the configured action will be trigger every time the scan button is triple clicked. If a search text is defined a specific action can be performed.
Three different actions can be performed:
- Send one or more characters or key codes, for instance a single ‘{enter}’ or ‘yes{enter}’
- Enter a portion of the text that is displayed on the screen. Enter the row, column and length of the text and define a confirmation key when that text is entered.
- (Re-) enable the scan trigger mode to what is set with the NIMMSTA library task. This can be useful to (re-) enable the scan trigger mode after the scan trigger is disabled with feedback.
Illuminate Light Tag (Web)
Download illuminateLightTagWeb v1.0
This script stops the illuminates of any Light Tag. The script can be linked multiple times. Link to either the session scope or a named scope. When linked to the session scope, a search text can be used to identify the web page where no Light Tags should illuminate.
Stop Illuminate Light Tags (Telnet)
Download stoplluminateLightTagsWeb v1.0
TThis script stops the illuminates of any Light Tag. The script can be linked multiple times. Link to either the session scope or a named scope. When linked to the session scope, a search text can be used to identify the web page where no Light Tags should illuminate.
NIMMSTA Button Handler (don't link script)
Download Button Handler Telnet Example
Download Button Handler Web Example
This function is called every time when a button on the display of the HS 50 is touched. The function is automatically called and must not be linked to a scope. Two variables are passed: 'buttonValue', the caption/the button text, and ‘buttonName’, as defined in the layout xml. With these values, actions can be scripted that must be performed when the button is pressed. Many of these actions in this script can be reused in your custom project, like handling of the keys on both the NumPad and FunctionsKeysLayout layouts and the Options menus. The button actions are defined in a series of if-then-else blocks where a check is done on the returned button caption text. In your custom project, change or extend this sequence with else if commands:
} else if (buttonValue == "Cancel Hold" ) {
// Cancel hold task
Device.sendKeys( "n" );
} else {
// A quantity is confirmed
Device.sendKeys( "{enter}" );
}
The scripting language is JavaScript, augmented with the available Velocity APIs: https://help.ivanti.com/wl/help/en_US/VScript/1.2/Using/ScriptingAPI.htm
NIMMSTA Touch Handler (don't link script)
This function is called when the display of the NIMMSTA device touched, in an area that is not a button. The function is automatically called and must not be linked to a scope. The version in the demo kit sets the scan trigger mode as is defined by the NIMMSTA Library task. This functionality can be used for instance when the scan trigger has been disabled in the case of an error.