Question on keyboard entry

I’m converting our existing HMI program written in VB to use ignition. There are a lot of displays like this one
image
The teal text is the actual value, the indigo text is the setpoint, and clicking anywhere within the white box pops up a keyboard to let the operator change the setpoint.
I can make the box with a label and put two numeric labels on top and then link those displays to OPC tags. But how would I make it so that clicking anywhere on the label would open a keypad to enter a new setpoint value that would then be displayed in the corner?

Thank you for the help.

Is this vision or perspective?

I’m currently working with Vision

This might be a bit of a lengthy answer, but I think it will meet your need. I would start with a template based on this statement.

Using a template assumes that all the displays have a similar structure.

The template will have several parameters. One will be the tag path to the setpoint value (I assume you're storing the setpoint in a tag). In the template you can use an indirect binding to show the value of the setpoint and, as described below, you can use this path in a script to pop the keypad and set the setpoint.

The script you write will be part of the template as well. It should go on the root of the template. I think the mousePressed event would be appropriate, but you should test to determine what works best with your physical setup (touchscreen vs mouse, etc.). To make sure the script is called for a mouse press anywhere in the template, make sure none of the components in the template also have a mouse event script. The script you write will need to:

  1. Consume the custom property created earlier (the tag path to the setpoint value)
  2. Call system.gui.showNumericKeypad to get the new setpoint value
  3. Call system.tag.writeBlocking to write the new setpoint value to the setpoint tag.
  • You'll also want to be sure to handle the case where showNumericKeypad returns None (operator pressed cancel on the keypad) as well as any input that isn't allowed (decimal places where they setpoint is an integer).

There will be more custom parameters (Current process value, units, title), but this lets you apply one solution to all of the displays. If the displays really aren't that similar, you can accomplish the same thing by following these steps using a container instead of a template.

Awesome, thank you! I can figure out where to go from there.

1 Like