diff --git a/docs/modbus_new_tcp.md b/docs/modbus_new_tcp.md index 1bb2ae94..3843db76 100644 --- a/docs/modbus_new_tcp.md +++ b/docs/modbus_new_tcp.md @@ -41,7 +41,7 @@ defined below. ```c modbus_t *ctx; -ctx = modbus_new_tcp("127.0.0.1", 1502); +ctx = modbus_new_tcp("127.0.0.1", 502); if (ctx == NULL) { fprintf(stderr, "Unable to allocate libmodbus context\n"); return -1; diff --git a/docs/modbus_new_tcp_pi.md b/docs/modbus_new_tcp_pi.md index fa0b5c0c..d57e81aa 100644 --- a/docs/modbus_new_tcp_pi.md +++ b/docs/modbus_new_tcp_pi.md @@ -42,7 +42,7 @@ defined below. ```c modbus_t *ctx; -ctx = modbus_new_tcp_pi("::1", "1502"); +ctx = modbus_new_tcp_pi("::1", "502"); if (ctx == NULL) { fprintf(stderr, "Unable to allocate libmodbus context\n"); return -1; diff --git a/docs/modbus_read_registers.md b/docs/modbus_read_registers.md index 8f853cc7..26554002 100644 --- a/docs/modbus_read_registers.md +++ b/docs/modbus_read_registers.md @@ -38,7 +38,7 @@ uint16_t tab_reg[64]; int rc; int i; -ctx = modbus_new_tcp("127.0.0.1", 1502); +ctx = modbus_new_tcp("127.0.0.1", 502); if (modbus_connect(ctx) == -1) { fprintf(stderr, "Connection failed: %s\n", modbus_strerror(errno)); modbus_free(ctx); diff --git a/docs/modbus_send_raw_request.md b/docs/modbus_send_raw_request.md index 66ceceaa..f71e1463 100644 --- a/docs/modbus_send_raw_request.md +++ b/docs/modbus_send_raw_request.md @@ -38,7 +38,7 @@ uint8_t raw_req[] = { 0xFF, MODBUS_FC_READ_HOLDING_REGISTERS, 0x00, 0x01, 0x0, 0 int req_length; uint8_t rsp[MODBUS_TCP_MAX_ADU_LENGTH]; -ctx = modbus_new_tcp("127.0.0.1", 1502); +ctx = modbus_new_tcp("127.0.0.1", 502); if (modbus_connect(ctx) == -1) { fprintf(stderr, "Connection failed: %s\n", modbus_strerror(errno)); modbus_free(ctx); diff --git a/docs/modbus_send_raw_request_tid.md b/docs/modbus_send_raw_request_tid.md index 69dc4e13..6d4470fb 100644 --- a/docs/modbus_send_raw_request_tid.md +++ b/docs/modbus_send_raw_request_tid.md @@ -40,7 +40,7 @@ uint8_t raw_req[] = { 0xFF, MODBUS_FC_READ_HOLDING_REGISTERS, 0x00, 0x01, 0x0, 0 int req_length; uint8_t rsp[MODBUS_TCP_MAX_ADU_LENGTH]; -ctx = modbus_new_tcp("127.0.0.1", 1502); +ctx = modbus_new_tcp("127.0.0.1", 502); if (modbus_connect(ctx) == -1) { fprintf(stderr, "Connection failed: %s\n", modbus_strerror(errno)); modbus_free(ctx); diff --git a/docs/modbus_set_socket.md b/docs/modbus_set_socket.md index cdf811b5..5fb91a07 100644 --- a/docs/modbus_set_socket.md +++ b/docs/modbus_set_socket.md @@ -23,7 +23,7 @@ The function shall return 0 if successful. Otherwise it shall return -1 and set ## Example ```c -ctx = modbus_new_tcp("127.0.0.1", 1502); +ctx = modbus_new_tcp("127.0.0.1", 502); server_socket = modbus_tcp_listen(ctx, NB_CONNECTION); FD_ZERO(&rdset);