GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MODBUS_SET_SLAVE (3)

.ds Aq ’

NAME

modbus_set_slave - set slave number in the context

CONTENTS

SYNOPSIS

int modbus_set_slave(modbus_t *ctx, int slave);

DESCRIPTION

The modbus_set_slave() function shall set the slave number in the libmodbus context.

The behavior depends of network and the role of the device:

RTU

Define the slave ID of the remote device to talk in master mode or set the internal slave ID in slave mode. According to the protocol, a Modbus device must only accept message holing its slave number or the special broadcast number.

TCP

The slave number is only required in TCP if the message must reach a device on a serial network. The special value MODBUS_TCP_SLAVE (0xFF) can be used in TCP mode to restore the default value.

The broadcast address is MODBUS_BROADCAST_ADDRESS. This special value must be use when you want all Modbus devices of the network receive the request.

RETURN VALUE

The modbus_set_slave() function shall return 0 if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EINVAL

The slave number is invalid.

AUTHORS

The libmodbus documentation was written by St\(&#146;ephane Raimbault <\m[blue]stephane.raimbault@gmail.com\m[][1]>

NOTES

1. stephane.raimbault@gmail.com  mailto:stephane.raimbault@gmail.com
Search for    or go to Top of page |  Section 3 |  Main Index


libmodbus 3&.1&.0 MODBUS_SET_SLAVE (3) 10/06/2013

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.