Script Definitions

SQL Tag Templates contain scripts for different types of data requests. Each script must return a specific type of data set, depending on the nature of the request. This section will cover the different types of scripts and their purposes, the requirements for each script and some examples, as well as using tokens in scripts for dynamic text-to-value substitution.

There are three basic script types: tag queries that are used by PARCview to get tag information, read data queries that return tag values for a given time frame, and write data queries that modify tag values in their source.

Required script**    Recommended script*

Tag Scripts

 

Tag List**

Returns list of tags used by the template

Tag Info**

Returns tag information

Limit

Returns tag limits

Max

Returns plot max for specified tag (legacy, use Tag Info instead)

Min

Returns plot min for specified tag (legacy, use Tag Info instead)

 

Read Data Scripts

 

Current*

Returns current value

Data**

Returns raw data for specified time period

Data Prior*

Returns value just prior to start time for use as start bound point

Data After

Returns value just after end time for use as end bound point

Projection

Returns projected (future) data

Data Plot

Returns plot-reduced data set for trends

Data Aggregate

Returns aggregated data

 

Write Data Scripts

 

Insert

Writes single time-based value for specified tag

Update

Updates record at given time for specified tag

Delete

Deletes single record at given time for specified tag

Delete Range

Deletes all records over given interval for specified tag

 

Other Scripts

 

Detail

Future use. Not currently supported for SQL.NET sources.