Engineering Tip
AUTOMATIC RE-ENABLE OF A TASK
It is common when developing a FactoryLink application that you may wish to disable a process. Some examples of this are disabling alarms to do maintenance, reads from a PLC, or communication to a database Historian. This is easy to do, but it is equally as easy to forget to re-enable them. To prevent that from happening, use the Counter Task to automatically re-enable the process after a certain time period.
Below you will find an example of a Counter routine that will re-enable alarms that have been disabled by the "alarmhide" tag. In this example, the disabled period will be 15 seconds. If you desire a longer period, change the value in the "Preset Value" column. This must be an integer value and cannot be made variable at run-time. The tag "timeleft" could also be added to your drawings to inform the operator of the amount of time remaining before the process is re-enabled.


CAUTION: In the Program Arguments portion of the System Configuration panel there is a -t argument for the Counter Task. This program argument sets the Positive Output and Negative Output tags to their cleared values at startup. For Positive Output, this would be a 0. For Negative Output, the value is a 1. This means that the ALARMS WOULD BE DISABLED AT STARTUP. This is probably not desirable. To fix this, take the -t out of the program arguments column for the Counter Task. This will only affect the Negative Output tags. Be sure that you are not already using the Counter task in another portion of your application where it might be affected.
When taking this approach, you must add a Run flag to the Counter Task in the System Configuration table.