This function divides one input by the other. Output = Dividend / Divisor or the Output = Dividend modulo Divisor depending on the Operation. Division by 0 results in an invalid output.
Figure 1: Divide - Wire Sheet |
Figure 2: Divide - Property Sheet |
Figure 3: Divide -Logic Diagram
Input
Input Name |
Description |
Dividend |
If the operation is set to Divide, Out = Dividend/Divisor. If the operation is set to Modulo, Out = Dividend modulo Divisor. |
Divisor (In & Par) |
If the operation is set to Divide, Out = Dividend/Divisor. If the operation is set to Modulo, Out = Dividend modulo Divisor. |
Table 1: Inputs of Divide Function
Output
Output Name |
Description |
Out |
If the operation is set to Divide, Out = Dividend/Divisor. If the operation is set to Modulo, Out = Dividend modulo Divisor. If the Dividend = "null" or the Divisor = "null" or "0", the output is "null". |
Table 2: Outputs of Divide Function
Parameter
Parameter Name |
Description |
Divisor Par (In & Par) |
If Divisor is "null", Divisor Par is used as parameter. Divisor Par must be unequal to 0. |
Operation |
There are two operations: Modulo: Out = Dividend modulo Divisor Divide: Out = Dividend / Divisor |
Out Save |
Master Sync Enabled: If you set it to "true" the last output will be set as output for one cycle after the controller restarts. The application can use it to return to the same state before the controller restart. Out: To enable or disable the Out feature. |
Table 3: Parameters of Divide Function
Example
1. Operation is Divide
Figure 4: Divide Example with Operation = Divide Operation is Modulo
10 modulo 3 = 1 because (3 x 3) + 1
Figure 5: Divide Example with Operation = Modulo
Refer to General Description for general information about IRMN4 Function Blocks.