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.
|
|
Extended analog output eAQ |
Extended analog output for programming via parameter reference.
|
|
Parameter Par |
|
Parameter
You can use the following parameters to control the float to integer converter:
Data Input: The input for this SFB is from VM.
Type: You can chose the input data as Float or Double.
VM Address: You can specify the start VM address where the input float stores.
Size: The input float occupies 4 bytes while double occupies 8 bytes.
Range: Float (0-847), Double (0-843).
Resolution: You can set the multiplier for the input float.
Range: 0.001-1000
Precision: 1/1000
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:
Transfer the floats from outer system by network (with S7/Modbus protocol) and store them in VM.
Convert the floats stored in VM to integer by Float/Integer converter.
Process the integer with LOGO! BM.
Convert the result to floats by Integer/Float and store them in the VM.
Transfer the floats to outer system (with S7/Modbus protocol).
Calculation rule
Define Q =Data Input/Resolution
Analog output (AQ)
if -32768 ≤ Q ≤ 32767, the Analog output = Q.
if the Q ≥ 32767, then Analog output = 32767.
if the Q ≤ -32768, then Analog output = -32768.
Extended analog output (eAq)
if -999,999,999 ≤ Q ≤ 999,999,999, the Extended analog output = Q.
if the Q ≥ 999,999,999, then Extended analog output = 999,999,999.
if the Q ≤ -999,999,999, then Extended analog output = -999,999,999.