Short description
The mathematic instruction error detection block sets an output if an error has occurred in the referenced mathematic instruction function block.
|
Connection |
Description |
|---|---|
|
Input En |
Enable the mathematic instruction error detection function block. |
|
Input R |
Reset the output. |
|
Parameter |
Referenced FB: block number of a mathematic instruction
Error to detect: Zero division, Overflow, or Zero division OR Overflow. |
|
Output Q |
Q is set high if the error to detect occurred in the last execution of the referenced mathematic instruction function block. |
|
|
0BA1- 0BA5: |
Parameter Referenced FB
The value for the Referenced FB parameter references the block number of an already-programmed mathematic instruction function block.
Description of the function
The mathematic instruction error detection block sets the output when the referenced Mathematic instruction function block has an error. You can program the function to set the output on a zero division error, an overflow error, or when either type of error occurs.
If you select the "Automatically reset" check box, the output is reset prior to the next execution of the function block. If not, the output retains its state until the mathematic instruction error detection block is reset with the R parameter.
In any scan cycle, if the referenced mathematic instruction function block executes before the mathematic instruction error detection function block, the error is detected in the same scan cycle. if the referenced mathematic instruction function block executes after the mathematic instruction error detection function block, the error is detected in the next scan cycle.
Mathematic instruction error detection logic table
In the table below, Error to Detect represents the parameter of the mathematic instruction error detection instruction that selects which type of error to detect. Zero represents the zero division bit set by the mathematic instruction at the end of its execution: 1 if the error occurred, 0 if not. OF represents the overflow bit set by the mathematic instruction: 1 if the error occurred, 0 if not. Zero division OR Overflow represents the logical OR of the zero division bit and the overflow bit of the referenced mathematic instruction. Output (Q) represents the output of the mathematic instruction error detection function. An "x" indicates that the bit can be either 0 or 1 with no influence on the output.
|
Error to Detect |
Zero |
OF |
Output (Q) |
|---|---|---|---|
|
Zero division |
1 |
x |
1 |
|
Zero division |
0 |
x |
0 |
|
Overflow |
x |
1 |
1 |
|
Overflow |
x |
0 |
0 |
|
Zero division |
1 |
0 |
1 |
|
Zero division |
0 |
1 |
1 |
|
Zero division |
1 |
1 |
1 |
|
Zero division |
0 |
0 |
0 |
If the referenced mathematic instruction function block is null, then the output is always 0.