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

Short description

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

LOGO! 0BA8 and previous versions devices 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 (integer or float):

  • AI 1:

    • LOGO! 9: AI1 to AI16 3

    • 0BA8: AI1 to AI8 4

  • AM 1:

    • LOGO! 9: AM1 to AM128

    • 0BA8: AM1 to AM64

    • 0BA7: AM1 to AM16

    • 0BA6: AM1 to AM6

  • NAI 1:

    • LOGO! 9: NAI1 to NAI128

    • 0BA7 or 0BA8: NAI1 to NAI32

  • AQ 1:

    • LOGO! 9: AQ1 to AQ16

    • 0BA8: AQ1 to AQ8

    • 0BA7: AQ1 and AQ2

  • NFAI 2:

    • LOGO! 9: NFAI1 to NFAI16

  • FAM 2:

    • LOGO! 9: FAM1 to FAM32

  • The block number of a function with analog output 1 2

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.

1 If the data type of Ax is integer and the data type of this FB is configured as float, LSC will convert Ax into 32-bit receivable float data.

2 If the data type of Ax is float and the data type of this FB is configured as integer, LSC will cut off the decimal numbers of Ax and convert it into 16-bit receivable integer data.

3 AI1 to AI16: 0 to 10 V corresponds with 0 to 1000, 0 to 4095 or 0 to 10000.

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

Extended analog input eAx

The eAx value can be provided by another already-programmed function:

For the 0BA7 and later version devices, you can additionally use the actual values of the following already-programmed functions:

For the 0BA8 and later version devices, you can additionally use the actual values of the following already-programmed functions:

For the LOGO! 9 and later version devices, you can additionally use the actual values of the following already-programmed functions:

You select the required function by the block number.

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):