機能
Modbus通信におけるバイト間のタイムアウト時間を取得します。
書式
ret = modbus_get_byte_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: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が入ります。
説明
Modbus通信における、同メッセージ内のバイト間におけるタイムアウト設定を取得できます。
使用例
タイムアウト時間を取得します。
VB.NET |
Dim ret As Integer Dim ctx As IntPtr Dim to_sec As Uinteger Dim to_usec As Uinteger ret = modbus_get_byte_timeout(ctx, to_sec, to_usec)
|
C, C++ |
int ret; modbus_t *ctx; uint32_t to_sec; uint32_t to_usec; ret = modbus_get_byte_timeout(ctx, &to_sec, &to_usec);
|
C# |
int ret; IntPtr ctx; uint to_sec; uint to_usec; ret = modbus_get_byte_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_byte_timeout(ctx, sec, to_usec) |