The FaultInterface is the main way to retrieve information about alarms and alarm history in addition to clearing alarms and warnings.
Name | Description |
---|---|
GetActiveAlarms | Get any active alarms. |
GetAlarmHistory | Get the alarm history for a given time period. |
ClearAllFaults | Clear errors. |
Get any active alarms.
StatusInfo GetActiveAlarms(out ActiveAlarms activeAlarmsData);
activeAlarmsData
[out] Current active alarms. See ActiveAlarms.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Faults.GetActiveAlarms(out ActiveAlarms alarms);
Console.WriteLine(alarms);
Console.WriteLine(status);
//be sure to close `c` with `YMConnect.CloseConnection` when the application is done
Output
Code (0): OK
1 alarms active.
Alarm 1 : Code: 8000
Subcode: 0
Time: 2023/10/12 04:45
Name: Alarm Example
Similar to GetActiveAlarms, but returns the number of alarms specified by the quantity parameter.
StatusInfo GetAlarmHistory(AlarmCategory alarmCategory, UInt32 quantity, out AlarmHistory alarmHistoryData);
alarmCategory
[in] The category of alarms to retrieve. See AlarmCategory.
quantity
[in] The number of alarms to retrieve. Maximum is 100.
alarmHistoryData
[out] Array of historical alarms. The amount returned is specified by the parameter quantity
. See AlarmData.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Faults.GetAlarmHistory(AlarmCategory.Major, 5, out AlarmHistory alarmHistoryData);
Console.WriteLine(status);
Console.WriteLine(alarmHistoryData);
//be sure to close `c` with `YMConnect.CloseConnection` when the application is done
Output
Code (0): OK
3 alarms in history.
Alarm 1 : Code: 8000
Subcode: 0
Time: 2023/10/12 04:45
Name: SAMPLE ALARM
Alarm 2 : Code: 4744
Subcode: 0
Time: 2023/10/11 00:23
Name: M-SAF PP ENABLE SW SIG. ERROR
Alarm 3 : Code: 4744
Subcode: 0
Time: 2023/10/11 00:23
Name: M-SAF PP ENABLE SW SIG. ERROR
Clear all errors and alarms.
StatusInfo ClearAllFaults();
Please note that this function will not clear Major alarms.
None.
A StatusInfo object indicating if the operation was successful.
//`c` is a MotomanController object that has been created with ` YMConnect.OpenConnection`
status = c.Faults.ClearAllFaults();
Console.WriteLine(status);
//be sure to close `c` with `YMConnect.CloseConnection` when the application is done
Output
Code (0): OK