Adds a read-only text field and a numeric key pad to the current dialog.
Informal Syntax:
DialogAddNumericKeyPad( Target )
Formal Syntax:
DialogAddNumericKeyPad( Target:=Variable Reference )
Parameter | Type | Description |
---|---|---|
Target |
REF_TO ANY_NUM REF_TO DATE |
A reference to a program variable:
|
None.
VAR Value : LREAL; DialogResult : INT; END_VAR (* Get the current value of the tag *) Value := %".Value Tag"; (* Start a new dialog definition *) DialogNew(); (* Add a label showing the current target *) DialogAddLabel(CONCAT('Current target: ', TO_STRING(Value))); (* Add another label above the numeric keypad *) DialogAddLabel('Enter new target:'); (* Add the Numeric Keypad *) DialogAddNumericKeyPad( Value ); (* Open the dialog. The program waits here until the user presses OK or Cancel *) DialogResult := DialogOpen( "Set Target", 1 ); (* Did the user press OK ? *) IF DialogResult = 1 THEN (* User pressed OK, so write the new value *) TagWriteValue( %".Value Tag.FullName", Value ); END_IF
Notes:
The above code would show the following dialog:
To learn about starting a new dialog definition.
To learn about adding labels to a dialog definition.
To learn about opening the current dialog definition.
To learn where you can use this function.
For the meaning of terms used in Fernhill SCADA.