The File Scanner Tag
represents an external data file.
The File Scanner Tag:
The File Tag supports the configuration properties of the Alarm Tag plus these properties:
Property | Type | Version | Description |
---|---|---|---|
ReadInterval | TIME | 1.6 | 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 | 1.6 | The offset added to the ReadInterval to get the actual read time. See Interval and Offset for information on how timed activities are scheduled. |
FileName | WSTRING | 1.6 | The name of the data file to read. |
FileType | USINT | 3.33 | The format of the data file. 0 = CSV, 1 = JSON. |
RetryAttempts | UINT | 1.6 | The maximum number of consecutive file open failures before a file access attempt is considered failed. |
RetryInterval | TIME | 1.6 | The interval between consecutive file open attempts. |
AlarmSeverity | UINT | 1.6 | The severity of the alarm raised when all attempts to read the data file have failed. |
UpdateFileName | WSTRING | 1.6 | The name of the optional CSV update file. Write requests to tags are appended to this file. If write operations are not required, this field can be left blank. |
With some files the file name is not fixed. For example, the file name 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 defines the format of the external data file. These data file 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 driver expects the Data File and Update File to be occasionally not accessible. This might be caused an external program is accessing these file(s). To avoid false alarms, the File Scanner will try up to RetryAttempts to open the external file before reporting an error. The delay between retry attempts is configured by the RetryInterval property.
If the driver cannot read the Data File after using all the retry attempts, an alarm will be raised. If the driver cannot access the Update File after using all of the retry attempts, the write request(s) will be failed.
When Fernhill SCADA reads the Data file, it will be temporarily locked to prevent updates. Any external program generating the Data File should be written to handle the file being locked.
The Data File driver can support write operations using an update file. When a write request is made on a tag, a new line is appended to the update file. The format of the new line is:
TagName=Value
The tag name is taken from the WriteTagName property of the tag. To complete the write request, an external program should periodically read and delete the CSV update file.
The File 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 File Scanner 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 File 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 File Scanner Tag builds on the features of these tag types:
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 File Scanner Tag.
To learn about the I/O Digital Data Point Tag that can be associated with the File Scanner Tag.
To learn about the I/O String Data Point Tag that can be associated with the File Scanner Tag.
To learn about the I/O Word Data Point Tag that can be associated with the File 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 File Scanner Tag.
Data File DriverFor an overview of the Data File Driver.
For the meaning of terms used in Fernhill SCADA.