I am new to using the Tc3EventLogger functionality. I have created my EventClasses in the Type system. I have successfully created and raised single instances of different alarms based on an EventClass using CreateEx, IpArguments, Raise, etc.
Issue: My issue is that I have multiple pieces of equipment that need to raise the same Alarm Type, but I differentiate them to the operator (HMI EventGrid) by supplying arguments.
My approach to this has been to create arrays of FB_TcAlarm and iterate through them in a loop to CreateEx, verify creation by HRESULT, modify arguments for each FB_TcAlarm instance in the array, and then later raise them individually when process conditions should trigger the alarm.
// Bank Global Pressure Limit Alarms
FOR nLoopCtr := 1 TO nNumBanks BY 1 DO
arrFbBankPressHresult[nLoopCtr] := arrFbBankPressAlm[nLoopCtr].CreateEx(TC_Events.BankPressureAlarm.Trigger, FALSE, 0);
END_FOR
However when I do this, only a single alarm instance is created (verified by one index having an HRESULT = S_OK), while the remaining FB_TcAlarm objects in the array have a HRESULT = 16#B7 which is "ERROR_ALREADY_EXISTS". Also, when I inspect the TcSourceInfo.nId of the created alarm instances in the array, they are all the same.
I have read through the Beckhoff manual TC3 Event Logger.
Any feedback on why this is happening or how my understanding of the EventClass or FB_TcAlarm is incorrect would be greatly appreciated.
Thank you.
- Adam