Scheduled Tasks

You can schedule a task in Windows to automatically run the Tag Discovery application at specified intervals.

Note: You will need a separate scheduled task for each adaptor used. The number of scheduled tasks required depends on the number of adaptors needed to fetch new tags regularly.

To do this:

1. On the P2 Server host machine, open the Windows Task Scheduler (Control Panel > Administrative Tools > Task Scheduler).

2. Click Create Task in the Actions panel on the right.

The Create Task window opens.

3. In the General tab:

  1. Name: Type the name of the scheduled task.
  2. Description: Type a description.
  3. Security Options: Assign the appropriate user account (click Change User or Group if necessary).
  4. Select Run whether user is logged on or not.
  5. Select Run with highest privileges.

4. In the Triggers tab, click New to create a new trigger.

5. In the New Trigger window, configure the Trigger as follows:

  1. Settings: Select the appropriate frequency for how often you want the scheduled task to run, and specify a start date.
  2. Advanced settings: Update settings as required.
  3. Enabled: Select the Enabled check box, otherwise the task will not run.
  4. Click OK to close the trigger setup and continue.

6. In the Actions tab, click New to create a new action.

7. In the New Action window, configure the action as follows:

  1. Action: Ensure Start a program is selected.
  2. Program/Script: Enter the location of the P2 Server Tag Discovery executable file e.g. C:\Program Files\P2 Energy Solutions\P2 Server\Data Broker
  3. Add arguments: Enter the datasource name along with the desired parameters e.g. datasource="[DataSourceName]" /silent /winAuth

See Time Series Tag Fetch for a list of available parameters.

8. Click OK to close the Action setup and continue.

9. In the Conditions tab, in the Power section, ensure the following are selected:

  • Start the task only if the computer is on AC power
  • Stop if the computer switches to battery power

10. In the Settings tab, ensure the following are selected:

  • Allow task to be run on demand
  • Stop the task if it runs longer than: 3 days
  • If the running task does not end when requested, force it to stop

11. Click OK to create the task and close the window.

12. Run the scheduled task to confirm it is working as expected, and also check the P2 Log Viewer to confirm there are no issues logged under the adaptor.

 

Comments are closed