Applies To: |
|
Summary: |
When certain Alarms are triggered, I want
to reset a number of PLC tags and also advise the Operator to this
effect. I have decided to do this via a Report. I have defined a
Report called Reset which sets some variables and prompts the
Operator. Next I call the report in the On Action field of my Alarm
Category. i.e. Report("Reset");.
But at runtime when I trigger an alarm in this category, the report does not get run. There are no hardware alarms or error messages. I have confirmed that running Report("Reset") from a button or the Kernel Cicode window does work. |
Solution: |
This is the common problem of attempting
to call a blocking function in a foreground Cicode task. The online
help states that Report() is a blocking function. Therefore, it
cannot be called from any location where Citect requires the result
of the Cicode immediately. Page Animation and Alarm On and Off
Actions are examples of these. Refer to Cicode Blocking Function in
the Online Help Glossary for more information.
To overcome this, create a new task from which to call your Report. Then your Report code will be assigned its own thread (and timeslice in which to execute), and the calling task will not be waiting on it to return, as the two tasks will be running in parallel. e.g. Call TaskNew("Report","Reset",5) in the Alarm On Action field. Refer to TaskNew() documentation in the online help for further details on mode settings. Key words: OnAction |
Keywords: |
Related Links
Attachments