A visualization is usually configured so that it calls a virtual keyboard for a text input event when an input device is not available. For this purpose, the follow-up action “Write variable” is preset accordingly in the user input: The value “Standard” is selected for the “Input type” setting.
However, you can also configure especially how text is input. For this purpose, more
input types are available in the user input, such as Text input
or the listed visualizations. These visualizations have the visualization type “Numpad/Keypad” and display virtual keyboards or numeric keypads.
In the “Settings for default text input” setting of the visualization manager you can preset a keyboard visualization that is called from all visualizations in the application when required. This is possible without having to customize the user inputs of the visualizations.
Configuring text input especially for virtual keyboards
Requirement: A project is open with a visualization.
-
Declare an input variable in the
PLC_PRG
program.VAR_INPUT stInput : STRING; VAR_END
-
Add a button to the visualization and select the element.
-
Configure the property “Texts Text” with
Text input: %s
. -
Configure the property “Text variables Text variable” with
PLC_PRG.stInput
. -
Click auf “Configure” in the property “Input configuration OnMouseClick”.
The “Input Configuration” dialog box opens. The selected input event is printed below the caption.
-
Select the “Write variable” action.
-
Select the visualization
Visudialogs.Keypad
in “Input type” of the implementation of the action.The virtual keyboard
Visudialogs.Keypad
is selected as the input device. -
Compile, download, and start the application.
The visualization opens.
-
Click the button as a visualization user.
The virtual keyboard appears and allows text input by means of the mouse.
Configuring numeric input especially for virtual numeric keypads
Requirement: A project is open with a visualization.
-
Declare an input variable in the
PLC_PRG
program.VAR_INPUT iInput : INT; VAR_END
-
Open the visualization and added a “Rectangle” element.
-
Select the element in the editor.
The properties are visible in the “Properties” view.
-
Configure the property “Texts Text” with
Number input: %i
. -
Configure the property “Text variables Text variable” with
PLC_PRG.iInput
. -
In the “Input configuration” property, click the “Configure” button in the
OnMouseClick
line.The “Input Configuration” dialog box opens. The selected input event is printed below the caption.
-
Select the
Write variable
action from the list of possible actions and click thesymbol.
The action appears in the list of actions to be executed. The blank implementation of the action appears in the window area to the right of the list.
-
Select the following settings:
“Input type” set to
VisuDialogs.Numpad
.“Choose variable to edit” set to “Use text output variable”.
“Dialog title” set to
'My virtual numpad'
. -
Click “OK” to close the dialog box.
The user input is configured.
-
Compile, download, and start the application.
The application runs. The visualization opens. When a user clicks the rectangle, the numeric keypad opens.
Defining standard text input
Requirement: A project is open with a visualization and a user input configuration. For all “Write variable” follow-up actions, the value “Default” is selected for the “Input type” setting.
-
Double-click the visualization manager.
-
Click in the default text input in the “Settings” tab (“Default text input” group) and assign visualizations.
These visualizations are defined as default text input. If a display variant does not have a keyboard, then these visualizations are called without you having to adapt the user input.