- Print
- DarkLight
API Keys
- Print
- DarkLight
This section provides a demonstration of the capabilities of FactoryTX. You will configure the three major components of FactoryTX to initiate data acquisition from two different data sources. You will be using the FactoryTX UI for all the configuration requirements. You will also need access to a Sight Machine cloud environment if you want to see raw data transmitted to the platform (ask your Sight Machine contact for details). The guide uses sample data from an imaginary manufacturing startup that specializes in safari park vehicles. Given the nature of modern auto manufacturing, the supply chain is distributed all over the globe and raw data is stored in the cloud. The data is stored using two services, each with data related to different manufacturing processes. FactoryTX will be configured to collect data from an MS SQL Server and an Azure Data Lake, apply some light data transformations, and upload data as records to a Sight Machine cloud instance.
Getting an API key
FactoryTX and the Sight Machine Manufacturing Data Platform (MDP) use secure authentication to verify the identity of the raw data source. In order to initiate the data upload process, an Edge API key will need to be generated and saved to the FactoryTX configuration.
Edge API keys are created and managed in MDP. To view and manage them, navigate to your MDP web UI in a browser.
Select Factory CONNECT from the Platform navigation menu
A list of Edge API keys will be displayed in the table. To create a new key, select the + icon in the upper right corner of the UI.
Running FactoryTX
There are a few ways to run FactoryTX:
- locally with docker-compose;
- on an appliance (IPC) managed by Sight Machine;
- on a FactoryTX Virtual Machine (VM) managed by Sight Machine;
- in Kubernetes (i.e. FactoryTX Cloud)
If you don’t have access to a working FactoryTX installation, please refer to the guide on setting up Local FactoryTX with Docker Compose.
Otherwise, please navigate to the FactoryTX Configuration Editor.
Configuring FactoryTX
In the Configuration Editor, replace the existing configuration with the following configuration:
{
"data_receiver": [
{
"data_receiver_name": "SQL Plugin 1",
"protocol": "sql",
"poll_interval": 10,
"connections": [
{
"database_type": "mssql",
"host": "35.233.132.166",
"port": 1433,
"username": "rexy",
"password": "islaNublar93",
"database_name": "Demo",
"ssl": false,
"connection_name": "Nedry"
}
],
"streams": [
{
"asset": "lasercut",
"stream_type": "mssql",
"state_fields": [
{
"column_name": "timestamp",
"data_type": "timestamp",
"initial_value": "2018-10-22 10:29:00"
}
],
"query": "SELECT * FROM ca_lasercut\nWHERE timestamp > :timestamp\nORDER BY timestamp;"
},
{
"asset": "diecast",
"stream_type": "mssql",
"state_fields": [
{
"column_name": "TIMESTAMP",
"data_type": "timestamp",
"initial_value": "2018-10-22 12:29:00"
}
],
"query": "SELECT * FROM hk_diecast\nWHERE TIMESTAMP > :TIMESTAMP\nORDER BY TIMESTAMP;"
},
{
"asset": "fusion",
"stream_type": "mssql",
"state_fields": [
{
"column_name": "timestamp",
"data_type": "timestamp",
"initial_value": "2018-10-22 02:28:00"
}
],
"query": "SELECT * FROM tl_fusion WHERE timestamp > :timestamp ORDER BY timestamp;"
}
]
},
{
"data_receiver_name": "azure_receiver_1",
"protocol": "azure_data_lake",
"poll_interval": 5,
"connections": [
{
"tenant_id": "beb1d7f9-8e2e-4dc4-83be-190ebceb70ea",
"client_id": "b8d454e3-67ec-4f2f-8dcb-a5d6f87abbc6",
"client_secret": "BdgGBpZ7pS.Ogf..7PpT0JVLXes.i1uh",
"store_name": "factorytxreceivertest",
"data_directory": "directory-1",
"max_files_per_request": 1,
"connection_name": "Blue"
}
],
"parsers": [
{
"parser_name": "CSV_Parser_1",
"parser_type": "csv"
}
],
"streams": [
{
"asset": "spraypaint",
"stream_type": "azure_lake",
"file_filter": [
"*.csv"
],
"parser": "CSV_Parser_1"
}
]
}
],
"transforms": [
{
"transform_name": "Rename 1",
"transform_type": "rename",
"filter_stream": [
"diecast:mssql"
],
"renames": [
{
"from": "TIMESTAMP",
"to": "timestamp"
}
]
},
{
"transform_name": "Rename 2",
"transform_type": "rename",
"filter_stream": [
"spraypaint:azure_lake"
],
"renames": [
{
"from": "Timestamp",
"to": "timestamp"
}
]
},
{
"transform_name": "Time Converter 1",
"transform_type": "convert_timestamps",
"filter_stream": [
"spraypaint:*"
],
"field_names": [
"timestamp"
],
"timezone": "Asia/Tokyo"
},
{
"transform_name": "Time Converter 2",
"transform_type": "convert_timestamps",
"filter_stream": [
"lasercut:mssql"
],
"field_names": [
"timestamp"
],
"timezone": "America/New_York"
},
{
"transform_name": "Time Converter 3",
"transform_type": "convert_timestamps",
"filter_stream": [
"diecast:mssql"
],
"field_names": [
"timestamp"
],
"timezone": "Asia/Hong_Kong"
},
{
"transform_name": "Time Converter 4",
"transform_type": "convert_timestamps",
"filter_stream": [
"fusion:mssql"
],
"field_names": [
"timestamp"
],
"timezone": "Europe/Paris"
}
],
"data_transmit": [
{
"transmit_name": "MyTransmit_1",
"transmit_type": "remotedatapost"
}
]
}
IMPORTANT: You’ll need to configure SM Cloud Credentials with values that you generated in your MDP environment. Please refer to the Getting an API key section for reference on how to create API keys.
In the exemplified configuration file, FactoryTX is collecting data from our international factories from two remote data sources: an MS SQL Server and an Azure Data Lake instance.
The MS SQL Server has three tables in the Demo database that we want:
- “ca_lasercut”: The table contains information from 6 laser cutting machines at our factory in Carmel, Indiana. These machines create molds for our car parts.
- “hk_diecast”: The table contains information from 3 die casting machines at our factory in Hong Kong, China. These machines pour molten compounds into the molds created by the laser cutting machines.
- “tl_fusion”: The table contains information from our 1 fusion machine at our factory in Toulouse, France. The fusion machine assembles the separate parts into the whole car.
The Azure Data Lake instance has CSV files of data from our machines in Tokyo, Japan, which apply a few coats of spray paint to the exterior of our cars.
Before transmitting the data to the Sight Machine cloud, FactoryTX will apply some light data transformations, such as renaming a SQL table column and converting timestamps into the factory’s time zone.
To get more details about the configuration file and what each of its sections mean, please refer to the Receivers and Transforms and Transmits article.
Click the submit button in the FactoryTX Controller to save the configuration and FactoryTX will automatically begin collecting, transforming, and transmitting data to the Sight Machine cloud.