valueEditor() - obsolete
Obsolete since WinCC OA version 2.12.1.
Opens a dialog for numeric target input.
Synopsis
int valueEditor(string dp, string workFunc, string format, float val, bool
enteron, string comment [, int x_coordinate, int y_coordinate] [, float min,
float max]);
Parameters
Parameter | Description |
---|---|
dp | Name of the data point |
workFunc | Name of the work function |
format | Digits before the decimal point |
val | Default on opening. |
enteron | If "TRUE" editor has Enter key |
comment | Name or comment, for dialog. If the string is " " (empty), the data point name dp is used as the comment |
x_coordinate | Value for position of the dialog relative to the VISION module |
y_coordinate | Value for position of the dialog relative to the VISION module |
min | Minimum |
max | Maximum |
Return value
valueEditor() returns 0, in the event of a failure -1.
Description
This function displays a dialog in the Vision module to help the user input numbers for target defaults. The dialog shows numbers in an edit box comparable to a calculator display (Figure: Editor 1 and Editor 2 for target input). Below are a "+" and a "-" key for each button. Clicking these buttons increases/decreases the number. In order to enter negative values, the whole left side is changed by pressing "+" or "-" until a negative sign appears.
Optionally, this dialog may have an additional "Enter" button.
The first parameter dp contains the name of the data point to which the work function workFunc() is registered. The parameter format defines the format for the value, e.g. number of digits before and after the decimal point (see below). val contains the default to be displayed. If enteron is "true", the dialog has the aforementioned "Enter" button. The string comment can contain any name or comment to be displayed in the dialog. If this string is empty (""), the name of the data point is used as a comment. Both parameters x_coordinate and y_coordinate determine the position of the dialog relative to the VISION module.
"format" uses a special format:
two options, "%x.yfUnit" or "%xdUnit",
x designates the digits before and y the digits after the decimal point. Unit is the string passed without inverted commas. The "f" means float, i.e. floating point number, "d" is an integer.
A decimal with 3 digits before and 2 after the decimal point and "Meter" as unit would thus be "%3.2fMeter"
The work function must contain the following parameters:
void workfunc (string dp, float result);
where "workfunc" can be any name.
The work function should be defined in a library, because the value editor is a panel with references and the work function is called from the reference.
The value editor is based on panels and scripts. The behavior and design of the value editor can easily be changed, if you copy from directory <wincc_oa_path>/panels/vision die files valueEditor.pnl, valueEditorValue.pnl, valueEditorPoint.pnl into the directory <proj_path>/panels/vision and the script <wincc_oa_path>scripts/libs/libCTRL.ctl into the directory <proj_path>/scripts/libs.
Figure: Editor 1 and Editor 2 for target input
Example
The value editor is called for data point "ExampleDP_Arg1". The input mask is a float value with 6 digits before and one after the decimal point, default 10.0 (see above).
main()
{
valueEditor("ExampleDP_Arg1.:_original.._value", "workfunc",
"%6.1fMeter", 10.0, TRUE, "Länge ", 100, 100, 0, 100,
FALSE);
}
Assignment
Dialog functions
Availability
UI