- 30 Jan 2024
- Print
- PDF
ReadRawTags
- Updated on 30 Jan 2024
- Print
- PDF
The general query structure is as follows:
SELECT
tagName,
timestamp ,
value, --value as a double
lValue, --value as a long
sValue, --value as a string
quality, --numeric opc da quality (0 = bad, >= 64 = uncertain, >= 192 = good)
squality, --string quality (good, bad, uncertain)
historianQuality, --numeric historian quality
sHistorianQuality --string historian quality (raw, calculated, interpolated, nobound, etc)
FROM
ctc_fn_PARCdata_ReadRawTags
(
'Plantname.Sample.1,Plantname.Sample.2 ', --tag list. The last parameter passed is the character used to separate the tags
GetDate ()-1, --read start date (either a string or datetime value)
GetDate (), --read end date (either a string or datetime value)
1, --includebounds
',' --tag delimiter in tag list
)
The arguments for the function are:
TagList (string): List of tags for which to get raw data. If there is more than one, use the Delimiter argument.
StartDate (datetime): Start time of the query.
EndDate (datetime): Endtime of query.
IncludeBound (integer): A value of 1 will include one point prior to the start time and one point after the end time, if available. A value of 0 will include data at the start time but only up to the end time.
Delimiter (string): The character used to separate the tags in the TagList argument.
Results come back ordered by tag then by timestamp if no ORDER BY clause is specified.
Sample output:
tagName | timestamp | value | lValue | sValue | quality | squality | historianQuality | sHistorianQuality |
---|---|---|---|---|---|---|---|---|
Camas.Sample.1 | 11/11/15 15:26 | 4.8144 | 5 | 4.8144 | 192 | good | 262336 | Raw |
Camas.Sample.1 | 11/11/15 15:27 | 4.6190 | 5 | 4.6190 | 192 | good | 262336 | Raw |
Camas.Sample.1 | 11/11/15 15:28 | 4.4169 | 4 | 4.4169 | 192 | good | 262336 | Raw |
Camas.Sample.1 | 11/11/15 15:29 | 4.2102 | 4 | 4.2102 | 192 | good | 262336 | Raw |
Camas.Sample.1 | 11/11/15 15:30 | 4.0012 | 4 | 4.0012 | 0 | bad | 262144 | Raw |
Camas.Sample.1 | 11/11/15 15:31 | 3.7922 | 4 | 3.7922 | 0 | bad | 262144 | Raw |