Configuring Text Input with the Virtual Keyboard

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.

For example, controllers that are employed as CODESYS TargetVisu often do not have a keyboard. A visualization calls a virtual keyboard. In contrast, a CODESYS WebVisu usually has a keyboard. A users specifies text the by means of a keyboard.

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.

See also

Configuring ordinary text input

Requirement: A project is open with a visualization. The CODESYS TargetVisu does not have a keyboard.

  1. Declare an input variable in the PLC_PRG program.

    VAR_INPUT stInput : STRING; END_VAR

  2. Add a button to the visualization and select the element.

  3. Configure the property Texts ‣ Text with Text input: %s.

  4. Configure the property Text variables ‣ Text variable with PLC_PRG.stInput.

  5. Click Configure in the property Input configuration ‣ OnMouseClick .

    ⇒ The Input Configuration dialog box opens. The selected input event is printed below the caption.

  6. Select the Write variable action.

  7. Select the value Standard in Input type of the implementation of the action.

    ⇒ The input is configured as usual.

  8. Compile, download, and start the application as CODESYS TargetVisu.

    ⇒ The visualization opens.

  9. Click the button as a visualization user.

    ⇒ An input field appears with a virtual keyboard that allows text input by means of the mouse.

  10. Compile, download, and start the application as CODESYS WebVisu.

    ⇒ The visualization opens.

  11. Click the button as a visualization user.

    ⇒ An input field appears and prompts for text input.

See also

Configuring text input especially for virtual keyboards

Requirement: A project is open with a visualization.

  1. Declare an input variable in the PLC_PRG program.

    VAR_INPUT stInput : STRING; END_VAR

  2. Add a button to the visualization and select the element.

  3. Configure the property Texts ‣ Text with Text input: %s.

  4. Configure the property Text variables ‣ Text variable with PLC_PRG.stInput.

  5. Click Configure in the property Input configuration ‣ OnMouseClick .

    ⇒ The Input Configuration dialog box opens. The selected input event is printed below the caption.

  6. Select the Write variable action.

  7. 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.

  8. Compile, download, and start the application.

    ⇒ The visualization opens.

  9. Click the button as a visualization user.

    ⇒ The virtual keyboard appears and allows text input by means of the mouse.

See also

Configuring numeric input especially for virtual numeric keypads

Requirement: A project is open with a visualization.

  1. Declare an input variable in the PLC_PRG program.

    VAR_INPUT iInput : INT; END_VAR

  2. Open the visualization and added a Rectangle element.

  3. Select the element in the editor.

    ⇒ The properties are visible in the Properties view.

  4. Configure the property Texts ‣ Text with Number input: %i.

  5. Configure the property Text variables ‣ Text variable with PLC_PRG.iInput.

  6. 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.

  7. Select the Write variable action from the list of possible actions and click the symbol.

    ⇒ 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.

  8. 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'.

  9. Click OK to close the dialog box.

    ⇒ The user input is configured.

  10. 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.

  1. Double-click the visualization manager.

  2. 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.