8. Configuring a Data Receiver
This article contains the following sections:
- Configuring a SQL Receiver
- Configuring an OPC UA Receiver
- Configuring a File-Based Receiver
Each data receiver protocol has different requirements. Consider the following:
Configuring a SQL Receiver
The customer may have machine data that is already being aggregated into a SQL database. The preferred handoff to Sight Machine is through a FactoryTX receiver that receives the SQL data, parses it into the JSON format, and saves it so it can be transmitted properly.
SQL FTX Configuration File Sample
Creating a Polling Query and Adding Keywords
You will want the design of the SQL query to be as efficient as possible.
- Wherever possible, you want to use an index in your WHERE function to reduce load.
- In order to see if you are using an index, you may want to test your query using the EXPLAIN function. Use these references:
Configuring an OPC UA Receiver
The customer may have data from OPC UA sources.
OPC Unified Architecture (OPC UA) is a machine-to-machine communication protocol for industrial automation that provides a secure and reliable mechanism for moving data between enterprise-type systems and the kinds of controls, monitoring devices, and sensors that interact with real-world data.
The most important enhancement from classic OPC to the newer OPC UA is that OPC UA does not rely on Microsoft technology (OLE or DCOM) so it can be implemented on any platform (Apple, Linux, Windows). In addition, UA makes it possible to use structures or models so data tags or points can be grouped and given context to simplify system management and maintenance.
For more information about the OPC UA paradigm, go here.
OPC UA FTX Configuration File Sample
Configuring a File-Based Receiver
The customer may have data from local machines. A file-based receiver could be a CSV file, logfiles, Excel file, etc.
File-Based FTX Configuration File Sample
The PARSE function allows for all of the functionality for Pandas. This is a powerful toolset that should handle many of the cases of differences in the CSV file format.
For more information, refer to:
Managing the Completed/Incoming Folder
Before pandas.read_csv is called, the file is copied locally to a temporary file.
You can see which files have been completed in the completed folder. By default, this is located in: /var/spool/sightmachine/factorytx/databuffer/completed
If you do not have delete_completed enabled, you need to keep all files in the completed folder so that FTX knows which ones have already been processed.
If you have delete_completed enabled, you can rotate files using a tool such as Logrotate.