Importing Multiple Gas Well Lab Results Files
The process to import individual gas compositions from a lab results CSV file is described in Importing Gas Composition Lab Results from a CSV File.
Some users may want to automate this process rather than uploading file manually. By using the process described in this topic, you can instruct VTScada to read any file placed in a particular directory on the server, uploading the gas configuration results from that file into the appropriate flow computer devices. A report is logged each time this takes place, and you can also configure the system to send an email containing the report to any interested parties.
Workflow Overview
One directory on your system must be designated as the source directory for the lab results CSV files. By default, the system looks for a directory called “Lab Results” within your application’s Data directory (e.g. C:\VTScada\MyAppName\Data\Lab Results). If you wish to use this service you must create this directory. If using an alternative location, you must edit the path stored in the OGLabImportDir application setting.
VTScada scans the specified directory every 10 seconds. If any files are detected in the directory, they will be read. Any gas composition entries that match one of the meter runs in the application will be written immediately to the appropriate flow computer. All of the files that were read will be moved from the source directory to an archive directory, or deleted if you prefer.
Reports
Each time a file is read, whether the read was successful or not, all actions taken are logged. By default, these logs are placed within an “Archive” directory underneath Lab Results (e.g. C:\VTScada\MyAppName\Data\Lab Results\Archive) but this can be changed to a different location using the OGLabImportLogDir application setting. The log files, as well as the archived copies of the original CSV files, are sorted by year and month. If more than one import is done in a day, the log will be appended to the end of the existing daily log file.
Optionally, a copy of the log file (or a shorter summary) can be emailed to any interested recipients. This email can be enabled using the OGEmailLabImportResults application setting, and the destination addresses can be configured using the OGGasCompReportEmail setting (multiple addresses should be separated by the “;” character). An email server must be configured, as described in Email Configuration for Alarms and Reports
Linking Meter Run Tags to the Lab Results
As described in Meter Run Tags, each meter run tag can be configured with three pieces of information relating to lab results: a file name, a file type, and a unique ID key.
The file name is used to link a meter run tag with its proper lab result during an import. When a file is detected in the source directory, VTScada tries to match its file name to the file name specified in each meter run. To allow for some variance in the lab file names, such as an optional date stamp, the meter run’s string need only match part of the actual file name. If, for example, the actual file name is “OAS Chart System 06082017.csv”, entering “OAS Chart System” or simply “OAS” in the meter run’s string would be enough to create a match. This matching is not case sensitive.
The file type is selected from a droplist of all of the currently supported lab results formats. When a file is found whose name matches what a meter run is looking for, VTScada will then analyze it based on the format chosen in this parameter.
These lab reports frequently contain more than one meter run’s worth of data. For this reason, each file type has one of its columns designated as a unique ID or key field. In order for the gas composition results to be uploaded to the flow computer, the value in this unique ID / key field must exactly match the Unique ID Key value that was used when configuring the meter runs in the Flow Computer tag. Refer to the following table for more information on the unique ID key fields for the various lab result formats. Any entries in the lab results that do not match one of the meter runs in the system are simply ignored.
File Type | Unique ID Key Column Number | Unique ID Key Column Name |
---|---|---|
AGAT | 3 | Sample Point Name |
Cygnet | 3 | ProTrend_MeterCode |
MaxxLink Common | (Row) 16 | Tag ID |
Netflow | 2 | Meter Code |
OAS Chart | 2 | Meter ID |
ProChart | 3 | Sample Point |
PVR | 3 | Sample Point |
PVR FDC | 5 | ProTrend Meter Code |
Application Configuration Settings for Importing Multiple Gas Well Lab Results Files
Setting Name | Default | Description |
---|---|---|
OGArchiveLabResultsFiles | 1 | Flag - True to archive a copy of the gas composition lab result CSV files after the data has been imported (instead of deleting them) |
OGEmailLabImportResults | 0 | Flag - True to email a copy of the gas composition lab import results (in addition to saving a local copy) |
OGEmailSummaryResultsOnly | 0 | Flag - True to limit the gas composition import results that are sent via email to a summary |
OGGasCompReportEmail | Email address that the gas composition lab import results are sent to | |
OGLabImportCheckPeriod | 10 | Rate in seconds at which to check for new gas composition lab results |
OGLabImportDir | AppPath\Data\Lab Results | Directory to monitor for new gas composition lab results |
OGLabImportLogDir | AppPath\Data\Lab Results\Archive | Directory in which to place the log files detailing what was done by the gas composition lab results import |