Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

modbus_set_slave(3) [debian man page]

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_NEW_TCP_PI(3)						 Libmodbus Manual					      MODBUS_NEW_TCP_PI(3)

NAME
modbus_new_tcp_pi - create a libmodbus context for TCP Protocol Independent SYNOPSIS
modbus_t *modbus_new_tcp_pi(const char *node, const char *service); DESCRIPTION
The modbus_new_tcp_pi() function shall allocate and initialize a modbus_t structure to communicate with a Modbus TCP IPv4 or Ipv6 server. The node argument specifies the host name or IP address of the host to connect to, eg. 192.168.0.5 , ::1 or server.com. The service argument is the service name/port number to connect to. To use the default Modbus port use the string "502". On many Unix systems, it's convenient to use a port number greater than or equal to 1024 because it's not necessary to have administrator privileges. RETURN VALUE
The modbus_new_tcp_pi() function shall return a pointer to a modbus_t structure if successful. Otherwise it shall return NULL and set errno to one of the values defined below. ERRORS
EINVAL The node string is empty or has been truncated. The service string is empty or has been truncated. EXAMPLE
modbus_t *ctx; ctx = modbus_new_tcp_pi("::1", "1502"); if (ctx == NULL) { fprintf(stderr, "Unable to allocate libmodbus context "); return -1; } if (modbus_connect(ctx) == -1) { fprintf(stderr, "Connection failed: %s ", modbus_strerror(errno)); modbus_free(ctx); return -1; } SEE ALSO
modbus_new_tcp(3) modbus_new_rtu(3) modbus_free(3) 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_NEW_TCP_PI(3)
Man Page

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Installing os on slave

Hello Can We install an operating system like linux on slave disk. (5 Replies)
Discussion started by: hunter87
5 Replies

2. Linux

slave bind name resolution inquiry

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)
Discussion started by: marcpascual
2 Replies

3. AIX

P520 AIX com port (tty0) settings

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)
Discussion started by: ayman metwally
3 Replies

4. SCO

master and slave in lan network

hello , i setup a lan network , but i don't know how configure master and slave in the lan network please help me:confused: (2 Replies)
Discussion started by: hossein
2 Replies

5. IP Networking

TCP Same Ack Sequencing for Two Packets

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)
Discussion started by: mr_deb
3 Replies

6. UNIX for Beginners Questions & Answers

Why inactive slave bonding received network package in redhat?

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)
Discussion started by: samran35
4 Replies