Limit value monitoring (Limit)

For the analog input, two limit values can be defined: "Limit 1" and "Limit 2". For each limit value, a variable of the same name in the process data indicates whether the current measured value is above or below the limit value.

Enabling limit value monitoring

In the factory setting, the limit value monitoring is disabled. To enable limit value monitoring, set the following parameters to TRUE

Definition of limit values

You can define the limit values in the following parameters:

Enter the limit values as signed integers in these parameters. Example: Formula for positive voltage limit values:

Limit value monitoring (Limit) 1:

Inverting the limit value monitoring

You can invert the limit function by setting the parameter 0x80A0:0E "Swap limit bits" to TRUE.

Evaluation

If the limit values are exceeded or not reached, the values of the status bits Limit 1 and Limit 2 are set accordingly in the process data:

Limit value monitoring (Limit) 2:

„Swap Limit“ = FALSE (Default)

„Swap Limit“ = TRUE

  • 0: Limit value monitoring not enabled.
  • 1: Measured value < limit value
  • 2: Measured value > limit value
  • 3: Measured value = limit value
  • 0: Limit value monitoring not enabled.
  • 1: Measured value > limit value
  • 2: Measured value < limit value
  • 3: Measured value = limit value
Limit value monitoring (Limit) 3:

Linking "Limit" in TwinCAT

The process data values "Limit1" and "Limit2" are two bits each. There is no suitable data type in the PLC that is also two bits in size.

  • Use the data type BYTE for the variable "Limit" in the PLC. Sample:
      VAR
        nLimit1 AT %I* : BYTE;
      END_VAR
  • Activate the checkbox "All Types" in the dialog box when linking the variables in order to be able to select variables with a different size.
  • Confirm the dialog box "Variable Size Mismatch" that then appears with OK.

Example:

Specification:

Presentation

Swap Limit

Limit 1

Limit 2

Signed integer

FALSE (Default)

"Enable Limit 1" = TRUE

"Enable Limit 2" = TRUE

"Limit 1" = 2.8 V

Input "Limit 1" 0x80A0:13
(2.8 V / 10 V) x 216 / 2 - 1 = 9,174dec

"Limit 2" = 7.4 V,

Input "Limit 1" 0x80A0:14
(7.4 V / 10 V) x 216 / 2 - 1 = 24,247dec

Output:

Input value

"Limit 1" (0x60A0:03)

"Limit 2" (0x60A0:05)

1.8 V

0x01hex, (limit value undershot)

0x01hex, (limit value undershot)

2.8 V

0x03hex, (limit value reached)

0x01hex, (limit value undershot)

4.2 V

0x02hex, (limit value exceeded)

0x01hex, (limit value undershot)

8.5 V

0x02hex, (limit value exceeded)

0x02hex, (limit value exceeded)