Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show only
|
Search instead for
Did you mean:
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send InviteCancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
📖HomeBack When doing division in logic, the selection of integer or floating-point division depends on the input types. If both the numerator and denominator are integers (DINT, INT, SINT) it will do integer division. If one is not, it will do floating-point division.
The following examples show the differences:
Out := (8/15); (* will return 0 *) Out := (8.0/15); (* will return 0.5333333 *) Out := (8/15.0); (* will return 0.5333333 *) Out := (8.0/15.0); (* will return 0.5333333 *)
If using variables, DINT_TO_LREAL type conversions can be used to force floating-point division. E.g.
PROGRAM DivideTest VAR In1 AT %I(.In1.CurrentValue) : DINT; In2 AT %I(.In2.CurrentValue) : DINT; Out AT %M(.Out.CurrentValue) : LREAL; END_VAR Out := DINT_TO_LREAL(In1) / DINT_TO_LREAL(In2); END_PROGRAM
This also affects FBDs and other IEC 6-1131 logic types.