MODBUS_SET_SLAVE(3) Libmodbus Manual MODBUS_SET_SLAVE(3)NAME
modbus_set_slave - set slave number in the context
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 Stephane Raimbault <stephane.raimbault@gmail.com[1]>
NOTES
1. stephane.raimbault@gmail.com
mailto:stephane.raimbault@gmail.com
libmodbus 3.0.3 05/26/2012 MODBUS_SET_SLAVE(3)
Check Out this Related Man Page
MODBUS_REPORT_SLAVE_(3) Libmodbus Manual MODBUS_REPORT_SLAVE_(3)NAME
modbus_report_slave_id - returns a description of the controller
SYNOPSIS
int modbus_report_slave_id(modbus_t *ctx, uint8_t *dest);
DESCRIPTION
The modbus_report_slave_id() function shall send a request to the controller to obtain a description of the controller.
The response stored in dest contains:
o the byte count of the response
o the slave ID, this unique ID is in reality not unique at all so it's not possible to depend on it to know how the information are
packed in the response.
o the run indicator status (0x00 = OFF, 0xFF = ON)
o additional data specific to each controller. For example, libmodbus returns the version of the library as a string.
RETURN VALUE
The modbus_report_slave_id() function shall return the number of read data if successful. Otherwise it shall return -1 and set errno.
EXAMPLE
uint8_t *tab_bytes;
...
rc = modbus_report_slave_id(ctx, tab_bytes);
if (rc > 1) {
printf("Run Status Indicator: %s
", tab_bytes[1] ? "ON" : "OFF");
}
AUTHORS
The libmodbus documentation was written by Stephane Raimbault <stephane.raimbault@gmail.com[1]>
NOTES
1. stephane.raimbault@gmail.com
mailto:stephane.raimbault@gmail.com
libmodbus 3.0.3 05/26/2012 MODBUS_REPORT_SLAVE_(3)
hi. i configured a master and slave bind server on my vmware test network. i used nslookup to the slave name server to lookup a fake entry for network.com that the master dns set, however, the slave is resolving the real ip of www.network.com, instead of what the master dns server set. i checked... (2 Replies)
I have software running under AIX 5.3 that should communicate with a special device using standard communication protocol (Modbus) using serial RS-232 line
The settings are correct in both sides, But I can't establish a connection.
I suspect that there's something that I should do regarding the... (3 Replies)
I was analyzing a TCP snoop. And found following scenario
From Server to Client ---> SEQ 2993 ACK 1744 WIN 8192 LEN 13
From Server to Client ---> SEQ 3006 ACK 1744 WIN 8192 LEN 13
From Client to server --> SEQ 1744 ACK 3019 WIN 3304
I just want to know Why Packet 1 and 2... (3 Replies)
bond0 active in eth0 and inactive in eth4. why eth4 received network package?
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: eth0 (primary_reselect failure)
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
... (4 Replies)