Set/read data point elements

Set a data point element (dpSet)

This function writes the specified value to the specified data point. See also dpSet() under Control functions.

Values can be written for all types of graphics objects.

Figure 1. Set a data point element

Example

You can set, for example, defaults of measured values. You could, as an example, set a motor to a certain speed by clicking on a motor symbol. For instance, set the original value of a data point to 75 by entering the following:

  1. Enter the data point element "ExampleDP_Arg1." . The config original is displayed by default after transfer (for example, by pressing Return).

  2. Select "Set a data point element to fixed value".

  3. In the input box under "Set value" enter the value to be written to the DPE when the event occurs. For example, 45.

  4. Click on Finish.

Open your panel in the Vision module and click on the graphics object. The value 45 will be written to the DPE"ExampleDP_Arg1." when the corresponding event (for example, a double-click) occurs at runtime.

You can only toggle a value (switch between 0 and 1) for bool data types.

Read a data point element (dpGet)

This function reads the value of the specified data point and writes it to the selected graphics object. If a text value is queried, formatting can be specified (number of characters). In case of float values, the number of positions before and after the decimal point can be specified. The value can be queried only for primitive texts and text boxes.

Figure 2. Read a data point element

Example

You can display measured values or texts in text boxes at runtime. For example, in order to indicate current motor speed or silo fill level.

  1. Select the data point element"ExampleDP_Arg1.".

  2. Select Read the data point element (dpGet).

  3. Enter , for example, 3 digits before and 2 digits after the decimal point.

  4. Press Set to apply the format.

  5. Click onFinish.

Open your panel and click on your configured input box, the value of the data point element will be displayed in the specified format.

If you want to display a text as a value, specify the number of characters in the bottom area of the window.

Reading a data point on value change (dpConnect)

This function works in the same way as the "Read a data point" function, The values is, however, read whenever the value of the data point changes.

Example

The input is similar to "Read a data point". As the second step, however, select "Read the DP element at each value change (dpConnect)".