modbus_close


 

Function

 

Disconnects from the Modbus slave device.

 

Format

 

modbus_close( modbus_t *'ctx' );

 

Parameters

 

ctx [ C : modbus_t * ] [ Python : ctypes.POINTER(modbus_t) ]

Specify the pointer to the libmodbus structure.

 

Return values

 

None

 

Remarks

 

Disconnects from the Modbus slave device.

After using this function, release the secured libmodbus structure by using modbus_free.

 

Example

 

Disconnects from the Modbus slave according to the structure specified by ctx.

 

C

modbus_t *ctx;

modbus_close(ctx);

 

Python

ctx = ctypes.POINTER(modbus_t)

modbus.modbus_close(ctx)