機能
Modbus通信におけるバイト間のタイムアウト時間を取得します。
書式
ret = modbus_get_byte_timeout( ctx , to_sec , to_usec )
引数
ctx [ C: modbus_t * ] [ Python: ctypes.POINTER(modbus_t) ]
libmodbus構造体へのポインタを指定下さい。
to_sec [ C: uint32_t * ] [ Python: ctypes.POINTER(ctypes.c_uint32) ]
タイムアウト時間における、1秒以上の部分(秒単位)を格納するポインタを指定下さい。
to_usec [ C, C++: uint32_t * ] [ Python: ctypes.POINTER(ctypes.c_uint32) ]
タイムアウト時間における、1秒未満の部分(μ秒単位)を格納するポインタを指定下さい。
戻り値
ret [ C: int ] [ Python: ctypes.c_int ]
成功時には0が入り、失敗時には-1が入ります。
説明
Modbus通信における、同メッセージ内のバイト間におけるタイムアウト設定を取得できます。
使用例
タイムアウト時間を取得します。
C |
int ret; modbus_t *ctx; uint32_t to_sec; uint32_t to_usec; ret = modbus_get_byte_timeout(ctx, &to_sec, &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) |