Startup configuration
Verify that the SLMP service is enabled in the FairCom Edge server:
- Edit the services.json file in the config folder.
- Locate the
"integrationServices"object of the service for the desired platform. - Set
"enabled"totruefor the SLMP service- Windows Example
"integrationServices": [ { "serviceName": "slmp", "serviceLibrary": "slmpservice.dll", "schemaName": "slmp", "enabled": true },- Unix/Linux Example
"integrationServices": [ { "serviceName": "slmp", "serviceLibrary": "libslmpservice.so", "schemaName": "slmp", "enabled": true },
- Save any changes.
Windows Tutorial
Prerequisites
Install FairCom Edge
Run the SLMP (CC-Link) server simulator
- Open a command prompt.
- Navigate to the simulator in the <FairCom Folder>/server/slmp/test folder, such as C:\FairCom\FairCom-Edge.windows.64bit.v4.2.0.173\server\slmp\test\<OS>
- Execute slmp_server_simulator.bat. Leave it running.
Create an Integration Table for SLMP (CC-Link) data
This procedure creates an Integration Table named slmpTable in the faircom database to store data received from a SLMP (CC-Link) source. The Integration Table automatically creates the ts_index, error, and source_payload JSON fields. The jsonToTableFields transform extracts values from source_payload and stores them in the D200 and SD210 fields defined in the request.
- Run FairCom user interface. Open a Google Chrome web browser and enter a URL like the following: https://localhost:8443/. As needed, change localhost to the server hostname where you installed FairCom Edge.
- At Code/API Console, paste the following to Request and click Run.
{ "api": "hub", "action": "createIntegrationTable", "params": { "tableName": "slmpTable1", "fields": [ { "propertyPath": "prop_D200", "name": "D200", "type": "integer" }, { "propertyPath": "prop_SD210", "name": "SD210", "type": "integer" } ], "transformSteps": [ { "transformStepMethod": "jsonToTableFields", "mapOfPropertiesToFields": [ { "fieldName": "D200", "recordPath": "source_payload.prop_D200" }, { "fieldName": "SD210", "recordPath": "source_payload.prop_SD210" } ] } ] }, "authToken": "replaceWithAuthTokenFromCreateSession" }
- Observe the response at Output and ensure the action is completed successfully.
Note
"errorCode"with a value of0indicates success."errorCode"with a non-zero value indicates a failure. See Errors and contact FairCom for more information about an error.
Capture SLMP (CC-Link) data in the Integration Table
This procedure creates an input that captures data from a SLMP (CC-Link) source and writes the incoming data to the slmpTable1 Integration Table for subsequent processing.
- Run FairCom user interface.
- At Code/API Console, paste the following to Request and click Run.
{ "api":"hub", "action":"createInput", "params":{ "inputName":"input1", "serviceName":"slmp", "tableName":"slmpTable1", "dataCollectionIntervalMilliseconds":1000, "settings":{ "slmpProtocol":"tcp", "slmpIpAddress":"127.0.0.1", "slmpPort": 2000, "slmpMonitoringTimerMilliseconds":1000, "propertyMapList":[ { "propertyPath":"prop_D200", "slmpHeadDeviceNumber":200, "slmpDeviceCode": "D", "slmpNumberOfPoints": 1, "slmpDataType": "short" }, { "propertyPath":"prop_SD210", "slmpHeadDeviceNumber":210, "slmpDeviceCode": "SD", "slmpNumberOfPoints": 1, "slmpDataType": "short" } ] } }, "authToken": "replaceWithAuthTokenFromCreateSession" }
- Observe the response at Output and ensure the action is completed successfully.
View SLMP (CC-Link) data
View the slmptable1 table in the faircom database for the transformed data
- At Data/Integration Tables, view the
slmptable1table to see data being collected. -
- Perform a SQL query against the data. At Data/SQL Commands, write the following statement, for example:
select * from slmptable1 where D200 > 100. - Click Run to get the result.
- Observe the response and ensure the action is completed successfully.
