Float/Integer converter (LOGO! 8.FS4 and later versions only)

Short description

This function convert a float stored in VM to an integer and output the result via the parameter (eAQ) or AQ.

LOGO! only deals with integers. If you transfer some float from outer system by network with S7/Modbus protocol, LOGO! cannot deal with it directly. With float to integer converter, you can convert floating numbers stored in VM to integers. This SFB does the conversion by dividing the float by a resolution. You need to set a suitable resolution for the input float in the parameter tab.

Connection

Description

Analog output AQ

AQ is the analog output value. It has the following features.

  • Used as input value of the other function block.

  • Signed 16 bit value.

  • Range of values: -32768 to 32767.

Extended analog output eAQ

Extended analog output for programming via parameter reference.

  • Used as a reference parameter of the other function block.

  • Signed 32 bits value.

  • Range of values: -999,999,999 to 999,999,999.

Parameter Par

  • Type: It specifies the type of input data.

    • Float: it is a 32 bits single-precision float number;

    • Double: it is a 64 bits double-precision float number.

  • VM: Variable Memory Address, starting address of float or double stored in VM.

    Range of values:

    • For Float: 0-847

    • For Double: 0-843

  • Resolution: it’s a divider for input data.

  • Range of values: 0.001 to 1000

Parameter

You can use the following parameters to control the float to integer converter:

Data Input: The input for this SFB is from VM.

Resolution: You can set the multiplier for the input float.

Description of the function

You usually need both the blocks Float/Integer converter and Integer/Float converter to complete a task. A typical way to use these function blocks is:

  1. Transfer the floats from outer system by network (with S7/Modbus protocol) and store them in VM.

  2. Convert the floats stored in VM to integer by Float/Integer converter.

  3. Process the integer with LOGO! BM.

  4. Convert the result to floats by Integer/Float and store them in the VM.

  5. Transfer the floats to outer system (with S7/Modbus protocol).

Calculation rule

Define Q =Data Input/Resolution

Analog output (AQ)

Extended analog output (eAq)