FIX16Div
 
 
This function divides two signed 16-bit fixed-point numbers. The resolution (number of decimal places) of the numbers does not have to be the same. The resolution of the number with the higher number of decimal places is reduced before division. This means that the decimal places of the number with the higher resolution are truncated. The result of the division is a signed 16-bit fixed-point number.
 Return value
 Return value
| Name | Type | Description | 
|---|---|---|
| FIX16Div | 
 | 
 Inputs
 Inputs
VAR_INPUT
    dividend : T_FIX16;
    divisor  : T_FIX16;
END_VAR| Name | Type | Description | 
|---|---|---|
| dividend | Number that is divided | |
| divisor | Number by which the dividend is divided | 
Example:
PROGRAM FIXDIV
VAR
    a, b   : T_FIX16;
    result : LREAL;
END_VARa := LREAL_TO_FIX16( -22.5, 8 );
b := LREAL_TO_FIX16( 10.0, 8 );
result := FIX16_TO_LREAL( FIX16Div( a, b ) ); (* The result is: -2.25 *)Requirements
| Development environment | Target platform | PLC libraries to be integrated (category group) | 
|---|---|---|
| TwinCAT v3.1.0 | PC or CX (x86, x64, Arm®) | Tc2_Utilities (System) |