Many industrial systems 'speak' through files - CSV, TXT etc.. This article describes how to install a file-based R/W machine driver
Overview
Supported File Types
Alleantia enables data exchange with various file types, including:
- CSV
- XML
- INI
- Properties
- TXT
Limitations:
- We cannot read files without one of such extensions or other extensions.
- Extension must be the same for read (from machine to IoT Gateway) and write (from IoT Gateway to machine) files
- For each machine, the machine driver can only read one file in Read Mode at a time. If the machine generates multiple files in output, there must be configured as many devices as the number of files to read.
- For each machine, the machine driver can only create one file in Write Mode at a time. If the machine expects multiple files in input, there must be configured as many devices as the number of files to send.
- Nevertheless, it is possible to create an integrated driver using data export via MQTT or OPCUA and reading from them (ask us for support).
Supported File Exchange Protocols
Alleantia supports various network protocols to access shared folders containing files. These protocols include:
- Samba
- FTP (File Transfer Protocol)
- Folder access
- SFTP (SSH File Transfer Protocol)
Create a File-Based Machine Driver
Driver editor will be ready soon. Contact Alleantia for
File Management
To manage properly the machine input and output files, it is essential to understand the various possible operations and file structures.
Reading
Reading All Rows at a time:
- It is necessary to know in advance the maximum number of file rows, that should be read.
- The number of variables used in ISC is the Cartesian product of rows and columns. E.g. a file with 8 rows and 20 columns will consume 8x20 = 160 variables
Reading a Single Row file :
- Configuration of the command to parse the row directly on the driver is required.
Reading a Multi-Row file (append), one row at a Time:
- Involves reading one row at a time and updating the read value each time.
Reading XML files:
- It is necessary to know the XML tag path to be inserted into the driver.
For INI and Properties files:
- Configuration of the parameter to be read directly on the driver is required.
- Knowledge of the file structure is essential for correct reading.
Writing
- It is possible to add variables to the driver for writing to the generated file.
- The management system must write the required variables to be written along with the variable containing the filename (including the extension) and a trigger variable.
- The trigger variable is necessary to be written after the others to avoid inconsistent writes.
- The "trigger" variable is not among the parameters provided by the machine but represents an additional element to be defined within the editor. Once mapped in the editor, this variable plays a key role in the process of generating the file intended for the machine. After completing the definition of the machine variables and assigning them the appropriate values, activating the "trigger" variable enables the creation of the final file to be supplied to the machine, containing the desired values.
Driver Installation and Configuration
Network Paths and Credentials
Ensure that you have detailed information about the network paths of shared folders and their corresponding access credentials. This information is essential to ensure reliable connectivity and proper file access.
Configuration of 'Read' File
After installing the new device using the file-based driver, clicking the 'Param' button. The following mask opens, where to configure protocol, machine IP address and folder, and file type
Please note that if after reading, Alleantia ISC is set to delete the file, a backup is possible (see below) .
Writing Configuration
Clicking the 'Param' button, this mask opens where to configure protocol, machine IP address and folder path, access credentials, file type for writing to the machine.
File Backup
In case the reading procedure includes file deletion, the backup configuration can define a storage procedure for the old read files.