The URL Scanner Tag :
Uses of URL Scanner Tag include:
For an example of retrieving weather data see Fernhill SCADA Connection to OpenWeatherMap.
The File Tag supports the configuration properties of the Alarm Tag plus these properties:
Property | Type | Version | Description |
---|---|---|---|
ReadInterval | TIME | 3.33 | The interval between each read. An interval value of zero (T#0s) disables periodic query execution. See Interval and Offset for information on how timed activities are scheduled. |
ReadOffset | TIME | 3.33 | The offset added to the ReadInterval to get the actual read time. See Interval and Offset for information on how timed activities are scheduled. |
ReadTimeout | TIME | 3.33 | The maximum time allowed to read the file from the URL. |
URL | WSTRING | 3.33 | The URL of the file to read. |
URLOptions | WSTRING | 3.39 | The URL Options to apply to the file transfer. |
FileType | USINT | 3.33 | The format of the data file. 0 = CSV, 1 = JSON. |
AlarmSeverity | UINT | 3.33 | The severity of the alarm raised when the data file cannot be read. |
Password | WSTRING | 3.33 | An optional password value to send in the request. Note: The password value is encrypted and not stored as plain text. |
UserName | WSTRING | 3.33 | An optional username to send in the request to read the file. |
The URL configuration property tells the driver where to locate the data file on the Internet or Intranet. The following example shows how to retrieve a file using the HTTP protocol:
http://example.com/folder/data-file.csv
You can also use the https protocol for secure transfer:
https://example.com/folder/data-file.csv
You can also use FTP:
ftp://example.com/folder/data-file.csv
Note: Use the UserName and Password configuration properties to set the login credentials for the FTP service.
With some remote services the URL is not fixed. For example, the URL may require a formatted date component based on the current date and time. In this situation consider using a IEC 61131-3 Program Tag with the following:
The FileType configuration property tells the driver the format of the Data File. These formats are supported:
Value | Format | Description |
---|---|---|
0 | CSV | Comma separated variables conforming to RFC 4180. |
1 | JSON | JavaScript Object Notation conforming to ECMA-404. |
The service providing the file may require authentication. Use the UserName and Password configuration properties to provide the login credentials for the service.
The URL Scanner supports the data properties of the Alarm Tag, plus these additional data properties:
Property | Type | Description |
---|---|---|
FileState | UINT | A code indicating the state of the external data File. The value 15 shows the data file was successfully read. Other values indicate an error. The ErrorMessage property may give additional information. |
ErrorMessage | WSTRING | An error message providing additional information. |
ReadTimer | TimerStatus | The status of the read timer. |
The FileState property can be used to diagnose problems with the data file:
ServerState | Description |
---|---|
0 | Initial state before the driver has started |
1 | The driver was unable to open the data file |
15 | The data file was successfully read |
The URL Scanner Tag supports the tag commands of the Alarm Tag plus these tag commands:
Tag Command | Version | Description |
---|---|---|
Refresh | 1.6 | Requests an immediate read of the tags associated with this URL Scanner. |
Note: Event triggered data reads (from the Refresh Tag Command) and periodic data reads (defined by the ReadInterval property) are independent. You can use the Refresh Tag Command, or the ReadInterval property, or both to determine when the tags are read.
The URL Scanner Tag builds on the features of these tag types:
Fernhill SCADA Connection to OpenWeatherMap
To learn how to retrieve data from the OpenWeatherMap service.
To learn how activities are scheduled using Interval and Offset.
To learn about the I/O Analog Data Point Tag that can be associated with the URL Scanner Tag.
To learn about the I/O Digital Data Point Tag that can be associated with the URL Scanner Tag.
To learn about the I/O String Data Point Tag that can be associated with the URL Scanner Tag.
To learn about the I/O Word Data Point Tag that can be associated with the URL Scanner Tag.
I/O Double Word Data Point Tag
To learn about the I/O Double Word Data Point Tag that can be associated with the URL Scanner Tag.
Data File DriverFor an overview of the Data File Driver.
For the meaning of terms used in Fernhill SCADA.