1. Dead zone control BAND/BANDD/BANDF
1. Dead zone control BAND/BANDD/BANDF
1.1. Instruction Description
The single character dead zone control (BAND) command specifies whether the input value (IN3) of a single character is within the range of the lower limit value (IN1) and upper limit value (IN2) of the dead zone, in order to control its storage in (OUT).
The Double Word Dead Zone Control (BANDD) and Floating Point Dead Zone Control (BANDF) correspond to the types of Double Word and Floating Point, respectively.
When IN3 (input value) is less than IN1 (lower limit value), OUT (output value) is set to IN3 (input value) - IN1 (lower limit value).
When IN3 (input value)>IN2 (upper limit value), OUT (output value) is set to IN3 (input value) - IN2 (upper limit value).
When IN1 (lower limit)&# 60= IN3 (input value)&# 60= When IN2 (upper limit value) is reached, OUT (output value) is set to 0.
图1 Upper and Lower Limit Control
1.2. The valid operands of the instruction
1.2.1. Single word dead zone control(BAND)
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| MIN | 16 bit integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | minimum |
| MAX | 16 bit integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | maximum |
| VAL | 16 bit integer | D/CV/TV/AI/AO/K/H/V/Z/FD, bit composite word (X/Y/M/C/T/S), local variable (LW) | current value |
| OUT | 16 bit integer | D/CV/TV/AO/V/Z, bit composite word (Y/M/C/T/S), local variable (LW) | output |
1.2.2. Double word dead zone control(BANDD)
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| MIN | 32-bit integer | D/CV/K/H/FD, bit composite word (X/Y/M/C/T/S), local variable (LD) | minimum |
| MAX | 32-bit integer | D/CV/K/H/FD, bit composite word (X/Y/M/C/T/S), local variable (LD) | maximum |
| VAL | 32-bit integer | D/CV/K/H/FD, bit composite word (X/Y/M/C/T/S), local variable (LD) | current value |
| OUT | 32-bit integer | D/CV, bit composite word (Y/M/C/T/S), local variable (LD) | output |
| ### Real number | D/K/FD, local variable (LF) | current value | |
| OUT | 32-bit real number | D, local variable (LF) | output |
Floating point dead zone control (BANDF)
| Input/Output | Data Type | operand | Description |
|---|---|---|---|
| MIN | 32-bit real number | D/K/FD, local variable (LF) | minimum |
| MAX | 32-bit real number | D/K/FD, local variable (LF) | maximum |
| VAL | 32 |
1.3. Example
Command table:
NETWORK 000
LD X000
BIN K16X20 D0 // Convert the BCD values of X020~X037 to integers and store them in D0
BAND K-1000 K1000 D0 D1//Perform dead zone control on D0 and output it to D1
图2 BAND
1.4. Action
When D0<-1000, the value of D0- (-1000) is saved in D1.
When 1000<=D0<=1000, save 0 in D1.
When D0>1000, the values of D0-1000 are saved in D1.
图3 Action