![]() |
![]() |
|
![]() |
||
Divide Instruction in Ladder Logic |
DIV - DivideWhen rung condition is true, this output instruction divides Source A by Source B and stores the result in the destination and the math register. The value stored in the destination is rounded. The value stored in the math register consists of the unrounded quotient (placed in the most significant word) and the remainder (placed in the least significant word) ExampleEquation: N:64 = N7:60 / 2 (13 / 2 = 6.5 ) Notice the result in N7:64 is rounded up to 7). Ladder Logic SolutionSource A = N7:60 = 13, Source B = 2, Destination = N7:64 = 7, Notice the result in N7:64 is rounded up to 7). ![]() Math Register: The value stored in the math register consists of the unrounded quotient placed in the most significant word (6) and the remainder placed in the least significant (1) ![]() ExampleEquation: F8:62 = f8:50 / F8:61 ( 100.0 / 0.26 = 384.6154). The result is rounded to the closest value. Ladder Logic SolutionSource A = F8:60 = 100.00 , Source B = F8:61 = 0.26, Destination = F8:62 = 3846154 ![]() ExampleEquation: N7:63 = N7:62 / F8:63 (100 / 0.9 = 111.111) Ladder Logic SolutionSource A = N7:62 = 100 , Source B = F8:63 = 0.9 , Destination = N7:63 = 111 (Rounded) ![]() Notice that since N7:63 are an integer it will only hold the quotient part. Note
|
|