---
name: "modbus_rtu_get_rts"
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_rtu_get_rts"
---

# modbus\_rtu\_get\_rts(3)

get the current RTS mode in RTU

## NAME

modbus\_rtu\_get\_rts - get the current RTS mode in RTU

## SYNOPSIS

**int modbus\_rtu\_get\_rts(modbus\_t \****ctx***);**

## DESCRIPTION

The **modbus\_rtu\_get\_rts()** function shall get the current Request To Send mode of the libmodbus context *ctx*. The possible returned values are:

• MODBUS\_RTU\_RTS\_NONE

• MODBUS\_RTU\_RTS\_UP

• MODBUS\_RTU\_RTS\_DOWN

This function can only be used with a context using a RTU backend.

## RETURN VALUE

The function shall return the current RTS mode if successful. Otherwise it shall return -1 and set errno.

## ERRORS

**EINVAL**

The libmodbus backend is not RTU.

## SEE ALSO

[**modbus\_rtu\_set\_rts**(3)](/modbus_rtu_set_rts/3.md)

## AUTHORS

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