File Scanner Tag

Help Contents

Introduction

The File Scanner Tag File Scanner Icon represents an external data file.

File Scanner Operation

The File Scanner Tag:

Configuration Properties

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.

FileName Property

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:

FileType Property

The FileType configuration property defines the format of the external data file. These data file formats are supported:

ValueFormatDescription
0 CSV Comma separated variables conforming to RFC 4180.
1 JSON JavaScript Object Notation conforming to ECMA-404.

RetryAttempts & RetryInterval Properties

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 can not read the Data File after using all of the retry attempts, an alarm will be raised. If the driver can not 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.

UpdateFileName Property

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.

Dynamic Properties

The File Scanner supports the dynamic properties of the Alarm Tag, plus these additional dynamic 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:

ServerStateDescription
0Initial state before the driver has started
1The driver was unable to open the data file
15The data file was successfully read

Tag Commands

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 all 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.

Relationships to Other Tag Types

The File Scanner Tag builds on the features of these tag types:

Further Information

Interval and Offset

To learn how activities are scheduled using Interval and Offset.

I/O Analog Data Point Tag

To learn about the I/O Analog Data Point Tag that can be associated with the File Scanner Tag.

I/O Digital Data Point Tag

To learn about the I/O Digital Data Point Tag that can be associated with the File Scanner Tag.

I/O String Data Point Tag

To learn about the I/O String Data Point Tag that can be associated with the File Scanner Tag.

I/O Word Data Point 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 Driver

For an overview of the Data File Driver.

Glossary

For the meaning of terms used in Fernhill SCADA.