pdcomm_modbus_endpoint_create
Function
Creates a disconnected endpoint with the default configuration.
int32_t pdcomm_modbus_endpoint_create(pdcomm_modbus_handle *out)The new endpoint is a Modbus TCP server configuration for 127.0.0.1:0 with unit identifier 1 and a local data model of 1024 entries per table. It owns no socket or serial port until {"action":"connect"}. Local commands such as execute and data_set work immediately.
Parameters
| Name | Description |
|---|---|
out | Receives the new endpoint handle; set to zero first. |
Returns
#PDCOMM_MODBUS_OK, #PDCOMM_MODBUS_INVALID_INPUT for a null out, or #PDCOMM_MODBUS_INTERNAL_ERROR.
Notes
- Release the endpoint with pdcomm_modbus_release(); releasing it closes its socket or serial port.