|
|
Connects to a MODBUS/TCP slave.
This function establishes a logical network connection between master and slave. After a connection has been established data and control functions can be used. A TCP/IP connection should be closed if it is no longer needed.
- Note:
- The default time-out for the connection is 1000 ms.
The default TCP port number is 502.
- Parameters:
-
| hostName | String with IP address or host name |
- Exceptions:
-
| IOException | An I/O error occured |
| ConnectException | Connection refused by remote, no service listening |
| BindException | Remote port in use |
| NoRouteToHostException | No route to host |
| UnknownHostException | Unknown host, e.g. wrong IP address or name |
| SecurityException | Security violation |
- Note:
- The time-out parameter does not apply for connection to a host. Instead the system's default time-out value will be used by the JVM.
|