---
name: "modbus_set_float"
section: "3"
platform: "linux"
package: "libmodbus-dev"
version: "3.1.6-2.1"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/modbus_set_float"
---

# modbus\_set\_float(3)

set a float value from 2 registers

## NAME

modbus\_set\_float - set a float value from 2 registers

## SYNOPSIS

**void modbus\_set\_float(float** *f***, uint16\_t \****dest***);**

Warning, this function is **deprecated** since libmodbus v3.2.0 and has been replaced by **modbus\_set\_float\_dcba()**.

## DESCRIPTION

The **modbus\_set\_float()** function shall set a float to 4 bytes in Modbus format (ABCD). The *dest* array must be pointer on two 16 bits values to be able to store the full result of the conversion.

## RETURN VALUE

There is no return values.

## SEE ALSO

[**modbus\_get\_float**(3)](/modbus_get_float/3.md) [**modbus\_set\_float\_dcba**(3)](/modbus_set_float_dcba/3.md)

## AUTHORS

The libmodbus documentation was written by Stéphane Raimbault \<stephane.raimbault@gmail.com\>
