SmcWGetAlarmCode


機能

アラームコードを取得します。

書式

Ret = SmcWGetAlarmCode( Id , AxisNo , AlarmCode )

引数

Id [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
SmcWInit 関数で取得したデバイスIDを指定します。

AxisNo [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
軸番号を指定します。

AlarmCode [ VB.NET: Short ] [ C, C++: short *] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short) ]
アラームコードを格納する変数のアドレスを指定します。

戻り値

Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]

0

正常終了

0以外

異常終了

参照:エラーコード詳細

説明

引数AlarmCodeで取得する値は、IN5~IN7の状態を示しています。
ドライバユニットからのアラームコードアウト出力が存在すれば、ドライバユニットとボードのIN5~IN7を接続してください。
本関数にてアラームコードを取得することが可能です。
アラームコードの詳細については各ドライバユニットの解説書を参照してください。

この関数は軸が動作中の場合も実行可能です。

使用例

軸番号1のアラームコードを取得します。

VB.NET
Dim Ret As Integer
Dim AlarmCode As Short
Ret = SmcWGetAlarmCode( Id , 1, AlarmCode )

C, C++
long Ret;
short AlarmCode ;
Ret = SmcWGetAlarmCode( Id , 1, &AlarmCode );

C#
int Ret;
short AlarmCode ;
Ret = Smc.WGetAlarmCode( Id , 1, out AlarmCode );

Python
Ret = ctypes.c_long()
AlarmCode = ctypes.c_short()
Ret.value = csmc.SmcWGetAlarmCode( Id , 1, ctypes.byref(AlarmCode) )