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

Short description

This function converts integers to floats, and store them in VM.

LOGO! only deal with integers. If you transfer some float from outer system by network with S7/Modbus protocol, LOGO! cannot deal with it directly. With this SFB, LOGO! can output floating numbers. This SFB converts integers to floating numbers by multiplying a resolution into the floating number. You need to set a suitable resolution for the input integers in the parameter tab.

Connection

Description

Analog input Ax

Input Ax is one of the following analog signals:

  • AI1 to AI8 (*)

  • AM1 to AM16 (if 0BA7), or AM1 to AM64 (if 0BA8)

  • NAI1 to NAI32

  • AQ1 to AQ2 (if 0BA7), or AQ1 to AQ8 (if 0BA8)

  • NAQ1 to NAQ16

  • Block number of a function with analog output

Extended analog input eAx

If the analog input (Ax) is not available, you can assign a value to Extended analog input (eAQ) by inputting a value to the eAx field or referring to other FB's parameter.

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

Parameter Par

  • Type: It specifies the type of output 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:

    • For Float: 0-847

    • For Double: 0-843

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

    Range of values: 0.001 to 1000

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 through 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.

 

* AI1 to AI8: 0 to 10 V corresponds with 0 to 1000 (internal value).

Parameter

In addition to the function block inputs, the following settings provide additional control over the integer to float converter:

Data Output: The output of Integer/Float is stored in VM. You can chose the output type as float or double and the start VM address where the converted float stores.

Resolution: You can set the dividend for the input integer.

Extended Analog Input: You can also set the input value here. If you don't connect the input pin In, the SFB uses the value set here as its input. It can also be used as reference for other parameter value, such as counter value.

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

Float Value in VM address

Float Value in VM address = Analog input x Resolution

Analog output (AQ)

Extended analog output (eAQ):