Transform method concepts
FairCom Edge data transformation concepts that make factory data more useful
You can configure FairCom Edge to automatically transform data each time it collects tags from a device or receives an MQTT message, or when a software system inserts a record into FairCom Edge.
Transforming data into your factory's standard format is vital to making data usable by equipment and software such as SCADA, MES, and ERP systems. Transforming data is required to implement your factory's unified namespace.
FairCom Edge provides several transform methods you can use to reformat, reshape, and enrich collected data.
The
"javascript"
transform method runs JavaScript code to do anything you want with incoming data.For example, you can create functions to enrich data with calculated values, such as converting temperature from Celsius to Fahrenheit or adding alert properties to the JSON output when a device exceeds thresholds.
JavaScript is the easiest way to reshape JSON data. You can rename properties, nest properties inside other properties, remove properties, and calculate new values and add them as new properties.
JavaScript is also the easiest way to reformat JSON data into another format, such as comma-separated values and descriptive text. For example, you can take JSON, determine if its values exceed thresholds, and replace the JSON with an operator-friendly alert message.
The
"jsonToTableFields"
transform method converts JSON into table fields so data scientists and data engineers can easily process the data using SQL.The
"jsonToDifferentTableFields"
transform method converts JSON into table fields in another table.You can use this feature to write data to tables in a different database with a different retention policy designed for data scientists and engineers to process the data without affecting the performance of data collection in the original tables.
You can also use this feature to create a chain of events. For example, if you publish an MQTT message to a topic, FairCom Edge automatically inserts a message record into the topic's table. If you configure that table to run the
"jsonToDifferentTableFields"
transform method, FairCom Edge automatically inserts a record into another table. If that table is associated with a MQTT topic, FairCom Edge publishes the message to that MQTT topic. Thus, you can use the"jsonToDifferentTableFields"
transform method to route messages to multiple topics. The same technique applies to writing data to multiple output devices.
The
"siemensUdt2Json"
transform method converts binary data from Siemens PLCs into JSON for easy processing. Once data is formatted as JSON, you can use a JavaScript transform method to reformat, reshape, and enrich the data.The
"tableFieldsToJson"
transform method reads specific columns from an integration table record, converts them into a JSON object, and stores the object in a specified column in the same table.
If you need faster processing or capabilities not available to JavaScript, you can create your own transform methods in C and C++ using FairCom's plugin system. Contact FairCom for specifications and examples you can use to create your own plugins.
FairCom's professional services can write JavaScript code and create custom plugins for you.