Siemens S7 API reference
Siemens S7 connector programming specifications
FairCom provides specific API actions to configure the Siemens S7 connector. Be sure to enable the Siemens S7 service before requesting data from a Siemens S7 server.
Request examples
Note
The FairCom createInput JSON action is used to define the specifics of a connector device and the desired data.
Minimal request
{ "authToken": "<yourAuthTokenHere>", "api": "hub", "action": "createInput", "params": { "inputName": "mySiemensS7", "serviceName": "siemensS7", "settings": { "ipAddress": "127.0.0.1", "rack": 0, "slot": 2, "dataCollectionIntervalMilliseconds": 5000, "propertyMapList": [ { "propertyPath": "flag1", "memoryArea": "db", "dataBlockNumber": 1, "offset": 0, "dataType": "word" } ] }, "tableName": "siemensS7Table" } }
{ "authToken": "<yourAuthTokenHere>", "api": "hub", "action": "createInput", "params": { "inputName": "mysiemensS7", "serviceName": "siemensS7", "settings": { "ipAddress": "127.0.0.1", "rack": 0, "slot": 2, "packageSize": 500, "dataCollectionIntervalMilliseconds": 1000, "dataCollectionBufferCount": 5, "propertyMapList": [ { "propertyPath": "status", "memoryArea": "db", "dataBlockNumber": 1, "offset": 0, "amount": 1, "dataType": "bit", "bitPosition": 3 }, { "propertyPath": "nerrors", "memoryArea": "db", "dataBlockNumber": 1, "offset": 2, "amount": 3, "dataType": "doubleword" }, { "propertyPath": "temperature", "memoryArea": "db", "dataBlockNumber": 1, "offset": 20, "amount": 2, "dataType": "real" } ] }, "databaseName": "ctreeSQL", "ownerName": "admin", "tableName": "siemensS7Table", "retentionPolicy": "autoPurge", "retentionPeriod": 30, "retentionUnit": "day", "metadata": { } } }
A response to a request is "0" when successful. A non-zero value response indicates an error occurred.
{ "result": {}, "requestId": "00000007", "errorCode": 0, "errorMessage": "" }
Not yet available.
Siemens S7 connector programming specifications for FairCom Edge
The "params"
property is an object that contains an action's parameters. Each action defines its own required and optional properties.
Note
See createInput for "params" properties that are common to all connectors.
Property | Description | Default | Type | Limits (inclusive) | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
serviceName | specifies which type of input to create | Required | string |
| |||||||||||||||||||||||
settings | specifies properties needed to configure the data source of the input | Required - No default value | array of objects | ||||||||||||||||||||||||
| specifies the number of times the collector retrieves and caches data from the device before writing the data to the integration table. This option combines multiple data collection events and inserts them into the integration table as one MQTT message. If this value is more than 1, the connector converts each set of collected data into a JSON object and adds the object to an array inside a JSON document. When the count is reached, the connector writes the JSON document to the source_payload field of a record it inserts into the integration table. | Optional | integer |
| |||||||||||||||||||||||
| specifies how often in milliseconds the connector requests data. | Optional: | integer |
| |||||||||||||||||||||||
| specifies the PLC/Equipment IPV4 Address. | Required - No default value | string | ||||||||||||||||||||||||
| specifies the package size in bytes used to communicate with the PLC. Higher numbers allow the connector to retrieve more data in fewer requests. | Optional. If not specified, the PLD PDU size is used. | integer |
| |||||||||||||||||||||||
| specifies which data the connector requests and where to put it in the generated JSON. | Required - No default value | array of objects | ||||||||||||||||||||||||
| specifies the number of consecutive The connector retrieves 3 one-byte values when The connector retrieves 2 four-byte values when If | Optional: | integer |
| |||||||||||||||||||||||
| If | Optional | integer |
| |||||||||||||||||||||||
| specifies the number of the Data Block memory area where the connector retrieves data. It is ignored unless | Required if | integer |
| |||||||||||||||||||||||
| specifies the data type of memory retrieved by the connector. If If | Required - No default value | string enum |
| |||||||||||||||||||||||
| specifies the type of memory area where the connector retrieves data. | Required - No default value | string enum |
| |||||||||||||||||||||||
| specifies the offset to the starting byte in the memory area where the connector retrieves data. | Required - No default value | integer |
| |||||||||||||||||||||||
| specifies the JSON path where the connector stores collected data. Example: | Required - No default value | string | ||||||||||||||||||||||||
| specifies the PLC Rack number. | Required - No default value | integer |
| |||||||||||||||||||||||
| specifies the PLC Slot number. | Required - No default value | integer |
|
How to horizontally scroll a table
To scroll the table right or left, mouse over the table, hold down shift , and move the mouse wheel down or up.