modbus_get_response_timeout


機能

 

Modbus通信におけるレスポンスタイムアウト時間を取得します。

 

書式

 

ret = modbus_get_response_timeout( ctx ,  to_sec , to_usec )

 

引数

 

ctx [ VB.NET: IntPtr ] [ C, C++: modbus_t * ] [ C#: IntPtr ] [ Python:ctypes.POINTER(modbus_t) ]

libmodbus構造体へのポインタを指定下さい。

 

to_sec [ VB.NET:ByRef Uinteger ] [ C, C++: uint32_t * ] [ C#: out uint() ] [ Python: ctypes.POINTER(ctypes.c_uint32) ]

タイムアウト時間における、1秒以上の部分(秒単位)を格納するポインタを指定下さい。

 

to_usec [ VB.NET:Uinteger  ] [ C, C++: uint32_t * ] [ C#:out uint ] [ Python: ctypes.POINTER(ctypes.c_uint32) ]

タイムアウト時間における、1秒未満の部分(μ秒単位)を格納するポインタを指定下さい。

 

戻り値

 

ret [ VB.NET:Integer ] [ C, C++: int ] [ C#: int ] [ Python: ctypes.c_int ]

成功時には0が入ります。失敗時には-1が入り、以下の errno が設定されます。

 

定義

意味

EINVAL

CTXが不正です。

 

説明

 

Modbus通信におけるレスポンスのタイムアウト時間を取得します。

 

使用例

 

タイムアウト時間を取得します。

 

VB.NET

Dim ret As Integer

Dim ctx As IntPtr

Dim to_sec UInteger

Dim to_usec UInteger

ret = modbus_get_response_timeout(ctx,to_sec,to_usec )

 

C, C++

int Ret;

modbus_t *ctx;

uint32_t to_sec;

uint32_t to_usec;

Ret = modbus_get_response_timeout(ctx, &to_sec, &to_usec);

 

C#
 

int ret;

IntPtr ctx;

uint to_sec;

uint to_usec;

ret = modbus_get_response_timeout(ctx, out sec, out to_usec);

 

Python

ret = ctypes.c_int

ctx = ctypes.POINTER(modbus_t)

uint32_to_sec = ctypes.c_ulong

uint32_to_usec = ctypes.c_ulong

ret = modbus.modbus_get_response_timeout(ctx, sec, to_usec)