Adds a field to the current dialog, where the field is mapped to a program variable. The type of field added depends upon the type of variable:
Informal Syntax:
DialogAddValue( Prompt, Target )
Formal Syntax:
DialogAddValue( Prompt:=Expression, Target:=Variable Reference )
Parameter | Type | Description |
---|---|---|
Prompt | ANY_STRING | The prompt string associated with the text entry field. |
Target | REF_TO ANY_ELEMENTARY |
A reference to a program variable:
|
When the Target field is a BOOL value, the function creates a check box to represent the field value. For all other types of field, the function creates a text entry field to represent the field value.
None.
VAR NewState : BOOL; DialogResult : INT; END_VAR DialogNew(); DialogAddValue( "New State", NewState ); DialogResult := DialogOpen( "Set new state", 1 ); IF DialogResult = 1 THEN (* Add code here to do something with NewState *) END_IF
The above code sample would display this dialog:
VAR NewValue : REAL; DialogResult : INT; END_VAR DialogNew(); DialogAddValue( "New Value", NewValue ); DialogResult := DialogOpen( "Set new value", 1 ); IF DialogResult = 1 THEN (* Add code here to do something with NewValue *) END_IF
The above code sample would display this dialog:
To learn where you can use this function.
For the meaning of terms used in Fernhill SCADA.