Set/read datapoint elements

Set a datapoint element (dpSet)

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

Values can be written for all types of graphics objects.

Figure 1. Set a datapoint 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 datapoint to 75 by entering the following:

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

  2. Select "Set a datapoint 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 datapoint element (dpGet)

This function reads the value of the specified datapoint 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 datapoint 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 datapoint element"ExampleDP_Arg1.".

  2. Select Read the datapoint 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 datapoint 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 datapoint on value change (dpConnect)

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

Example

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