modbus_close


 

Function

 

Disconnects from the Modbus slave device.

 

Format

 

modbus_close( modbus_t *'ctx' );

 

Parameters

 

ctx [ VB.NET: IntPtr ] [ C, C++: modbus_t * ] [ C#: IntPtr ] [ 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.

 

VB.NET

Dim ctx As IntPtr

modbus_close(ctx)

 

C, C++

modbus_t *ctx;

modbus_close(ctx);

 

C#

IntPtr ctx;

modbus.Close(ctx);

 

Python

ctx = ctypes.POINTER(modbus_t)

modbus.modbus_close(ctx)