Genuen Blog

Creating a Background Task in VeriStand

Written by Roy Krans | July 25, 2016

You can create a periodic background task to perform various tasks on the real-time controller by creating a low priority alarm with a delay and it limits always tripped.

Below is an example (using System Explorer).  An alarm called BackgroundTaskAlarm is defined having an upper limit of -1.000 and a lower limit of 1.000. This causes the alarm to continually trip, but by setting the Delay Duration (sec) to 1.000 seconds, the alarm will trip once a second and thereby run its alarm action every second. It is also important to assign a priority that is not being used by actual alarms; in this case I chose a priority of 5. This example creates a new procedure called MyBackGroundTask which is where you add any procedure steps you want to execute for this task.

Next we want to make sure this background task doesn’t interfere with actual alarms, so we move the alarm to a group that doesn’t have any important alarms in it. The group window is accessed by clicking on the Alarms parent in System Explorer – simply drag you alarm’s red bar to the desired group.

The last thing we need to do is configure our Alarm Responses in the project. We need to make sure any existing Alarm Responses do not show a dialog for our priority and do not produce log every time the alarm trips (unless that is desired). An example Alarm Response is shown below, but you may also have to edit any existing ones so they don’t include your alarm priority.

Want to learn more about using INERTIA? Fast-track your knowledge of INERTIA software with this video library, including six video tutorials specifically designed to help a new user get accustomed to the interface, features, and tools.