We have a product that reads all alarm state changes (active and ack) and send SMS to users depending on profile, calendar, etc. Now we want to use CTAPI (not cicode, log devices and setup/config in Citect projects) for this.
This seems to work for us:
- build structure of all alarms initially with ctFind...()
- create list with all of them using ctListNew() and ctListAdd()
- while CTAPI is connected: poll the list periodically for changes on state using ctListRead(), ctListEvent() and ctListData()
- goto 1 (someone might have changed the project, recompiled and restarted the server)
...but we have a couple of issues:
- Not so good performance on "large" automation systems (Example: 1600 alarm tags from one cluster in a system with 4 clusters and redundancy in each results in about 12 seconds used to poll when only one alarm changes state. 2 changes results in about 24 seconds and so on. When no alarms change state, poll time is about 4 ms)
- Possibility for alarm changes not being detected if they are not active long enough.
Does anyone have experience with polling alarm changes using CTAPI? What functions in CTAPI is used then? Is it possible to read AlarmEventQue using CTAPI?