Mathematical Operations

Mathematical Operations (.DIV, .MUL)

Used to divide or multiply a tag’s value. The target tag type must be REAL or LREAL.

  • Division: Tag_1.DIV(Constant) (Divides Tag_1’s value by the entered constant).
  • Multiplication: Tag_1.MUL(Constant) (Multiplies Tag_1’s value by the entered constant).

Dynamic Calculation and Synchronization

In mathematical operations, the system operates bi-directionally and is fully synchronized.

Definitions:

  • Tag_Source: The raw value coming from the PLC. (Type: INT, Value: 100)
  • Divisor/Multiplier Constant: 3.5
  • Tag_1: Internal Tag. (Address: Tag_Source.DIV(3.5), Value: 28.57)

Operational Logic:

  • Coefficient Change: If the user changes the constant from 3.5 to 5.0, Tag_1 is automatically recalculated:
    • 100 / 5.0 = 20.0
  • Data Entry and Rounding (Tag_1): If the user attempts to change the Tag_1 value to 30.1, the system performs a reverse calculation to determine the Tag_Source value:
    • Calculation: 30.1 * 3.5 = 105.35
    • Rounding: Since the Tag_Source type is INT, the result is rounded to the nearest integer 105.
    • Synchronization: Since Tag_Source is now 105, Tag_1 is recalculated and updated: $105 / 3.5 = 30.0$.
  • Result: Even if the operator enters 30.1, the value is automatically corrected to 30.0.

Note: This process ensures that the value displayed in SCADA always remains consistent with the actual resolution of the PLC source (Tag_Source).

Leave a Reply