diff --git a/astro.sidebar.ts b/astro.sidebar.ts index 60d35b6be0..8da5c794fd 100644 --- a/astro.sidebar.ts +++ b/astro.sidebar.ts @@ -3520,6 +3520,7 @@ export const gwSidebar: SidebarConfig = [ 'docs/iot-gateway/config/modbus', 'docs/iot-gateway/config/opc-ua', 'docs/iot-gateway/config/bacnet', + 'docs/iot-gateway/config/s7', 'docs/iot-gateway/config/rest', 'docs/iot-gateway/config/request', 'docs/iot-gateway/config/ble', diff --git a/src/assets/images/gateway/get-set-connector-rpc/s7-logo-get-set-rpc-1.png b/src/assets/images/gateway/get-set-connector-rpc/s7-logo-get-set-rpc-1.png new file mode 100644 index 0000000000..841e4da9e7 Binary files /dev/null and b/src/assets/images/gateway/get-set-connector-rpc/s7-logo-get-set-rpc-1.png differ diff --git a/src/assets/images/gateway/get-set-connector-rpc/s7-logo-get-set-rpc-2.png b/src/assets/images/gateway/get-set-connector-rpc/s7-logo-get-set-rpc-2.png new file mode 100644 index 0000000000..2af928d440 Binary files /dev/null and b/src/assets/images/gateway/get-set-connector-rpc/s7-logo-get-set-rpc-2.png differ diff --git a/src/assets/images/gateway/get-set-connector-rpc/s7-plc-get-set-rpc-1.png b/src/assets/images/gateway/get-set-connector-rpc/s7-plc-get-set-rpc-1.png new file mode 100644 index 0000000000..c52e126794 Binary files /dev/null and b/src/assets/images/gateway/get-set-connector-rpc/s7-plc-get-set-rpc-1.png differ diff --git a/src/assets/images/gateway/get-set-connector-rpc/s7-plc-get-set-rpc-2.png b/src/assets/images/gateway/get-set-connector-rpc/s7-plc-get-set-rpc-2.png new file mode 100644 index 0000000000..65e84a581d Binary files /dev/null and b/src/assets/images/gateway/get-set-connector-rpc/s7-plc-get-set-rpc-2.png differ diff --git a/src/content/_includes/docs/iot-gateway/config/s7.mdx b/src/content/_includes/docs/iot-gateway/config/s7.mdx new file mode 100644 index 0000000000..02f935598c --- /dev/null +++ b/src/content/_includes/docs/iot-gateway/config/s7.mdx @@ -0,0 +1,625 @@ +import DocLink from '@components/DocLink.astro'; +import { Aside } from '@astrojs/starlight/components'; +import ImageGallery from '@components/ImageGallery.astro'; +import Tabs from '@components/Tabs.astro'; +import TabItem from '@components/TabItem.astro'; + +This documentation will help you configure the S7 protocol for your IoT gateway. We'll explain the +configuration parameters in simple terms to make it easy for you to understand and follow. The S7 +protocol is commonly used for communication with Siemens PLCs. Follow the steps below to set up +the S7 protocol in your IoT gateway. Use +general configuration to enable this extension. + +The S7 connector allows you to connect to Siemens S7 PLCs and collect data from them. It +supports both S7-300 and S7-400 series PLCs, as well as the newer S7-1200 and S7-1500 series. +Also, Siemenst Logo! PLCs are supported. The connector uses the S7 protocol to communicate +with the PLCs and retrieve data. + + + +## General settings + +This configuration section contains general connector settings, such as: + +- **Name** - connector name used for logs and saving to persistent devices; +- **Logs configuration** - settings for local and remote logging: + - **Enable remote logging** - enables remote logging for the connector; + - **Logging level** - logging level for local and remote logs: NONE, ERROR, CRITICAL, WARNING, INFO, DEBUG, TRACE; +- **Report strategy** - strategy for sending data to ThingsBoard: + - **Report period** - period for sending data to ThingsBoard in milliseconds; + - **Type** - type of the report strategy: + - **On report period** - sends data to ThingsBoard after the report period; + - **On value change** - sends data to ThingsBoard when the value changes; + - **On value change or report period** - sends data to ThingsBoard when the value changes or after the report period; + - **On received** - sends data to ThingsBoard after receiving data from the device (default strategy). + + + +## Configuration + +Connector can be configured in "**Advanced**" configuration mode only for now. +Below is a full example of the configuration file: + +```json maxLines=20 collapsible +{ + "devices": [ + { + "type": "PLC", + "address": "127.0.0.1", + "port": 1102, + "rack": 0, + "slot": 1, + "deviceName": "S7 PLC", + "deviceProfileName": "default", + "autoReconnect": true, + "maxRetries": 3, + "retryDelay": 1.0, + "maxDelay": 30.0, + "heartbeatInterval": 0, + "pollPeriod": 30000, + "attributes": [], + "timeseries": [ + { + "type": "data", + "key": "light", + "dataType": "bool", + "dbNumber": 0, + "start": 0, + "size": 1, + "bit": 1 + }, + { + "type": "tag", + "key": "raw_data", + "tag": "DB0.DBB100:STRING[37]" + } + ], + "attributeUpdates": [ + { + "key": "light", + "type": "data", + "dataType": "bool", + "dbNumber": 0, + "start": 0, + "size": 1, + "bit": 1 + } + ], + "serverSideRpc": [ + { + "method": "set_light", + "requestType": "write", + "type": "data", + "dataType": "bool", + "dbNumber": 0, + "start": 0, + "size": 1, + "bit": 1 + }, + { + "method": "get_light", + "requestType": "read", + "type": "data", + "dataType": "bool", + "dbNumber": 0, + "start": 0, + "size": 1, + "bit": 1 + } + ] + }, + { + "type": "LOGO", + "address": "127.0.0.1", + "port": 102, + "tsapSnap7": 20, + "tsapLogo": 30, + "deviceName": "LOGO", + "deviceProfileName": "default", + "pollPeriod": 1000, + "attributes": [], + "timeseries": [ + { + "type": "vm", + "key": "temperature", + "vmAddress": "VW30" + }, + { + "type": "vm", + "key": "humidity", + "vmAddress": "VW0" + } + ] + } + ] +} +``` + +## Device types + +Connector supports the following device types: + +- **PLC** - Siemens S7 PLCs (S7-300, S7-400, S7-1200, S7-1500); +- **LOGO** - Siemens Logo! PLCs. + +In the configuration file, you can specify the device type using the "**type**" parameter. +The connector will use this parameter to determine how to communicate with the device. +Also, each device type has its own set of parameters that can be configured. For example, +the "**PLC**" device type has parameters for the rack and slot, while the "**LOGO**" device type has +parameters for the TSAP. + +## Devices + +This configuration section contains the list of devices that the connector will connect to. +Each device has its own configuration, including the device type, address, port, and other +settings. The connector supports both S7 PLCs and Siemens Logo! PLCs. + +Configuration parameters for devices: + +| Parameter | Default value | Description | +|-----------|---------------|-------------| +| `devices[].type` | | Device type: **PLC** or **LOGO**. | +| `devices[].address` | | Device IP address or hostname. | +| `devices[].port` | | Device port number. | +| `devices[].rack` | 0 | Rack number for S7 PLCs (only for **PLC** type). | +| `devices[].slot` | 1 | Slot number for S7 PLCs (only for **PLC** type). | +| `devices[].autoReconnect` | `true` | Enable automatic reconnection to the device (only for **PLC** type). | +| `devices[].maxRetries` | 3 | Maximum number of reconnection attempts (only for **PLC** type). | +| `devices[].retryDelay` | 1.0 | Delay between reconnection attempts in seconds (only for **PLC** type). | +| `devices[].maxDelay` | 30.0 | Maximum delay between reconnection attempts in seconds (only for **PLC** type). | +| `devices[].heartbeatInterval` | 0 | Heartbeat interval in seconds (only for **PLC** type). | +| `devices[].tsapSnap7` ** | 0 | TSAP for S7 PLCs (only for **LOGO** type). | +| `devices[].tsapLogo` ** | 0 | TSAP for Siemens Logo! PLCs (only for **LOGO** type). | +| `devices[].deviceName` | | Device name in ThingsBoard. | +| `devices[].deviceProfileName` | | Device profile name in ThingsBoard. | +| `devices[].pollPeriod` | 1000 | Polling period in milliseconds for reading data from the device. | +| `devices[].reportPeriod` | 1000 | (Optional) Report strategy object using for configuring report strategy for device. | + + + +Example of the **PLC** configuration: + +```json +{ + "devices": [ + { + "type": "PLC", + "address": "127.0.0.1", + "port": 1102, + "rack": 0, + "slot": 1, + "deviceName": "S7 PLC", + "deviceProfileName": "default", + "autoReconnect": true, + "maxRetries": 3, + "retryDelay": 1.0, + "maxDelay": 30.0, + "heartbeatInterval": 0, + "pollPeriod": 30000, + ... + } + ] +} +``` + +Example of the **LOGO** configuration: + +```json +{ + "devices": [ + { + "type": "LOGO", + "address": "127.0.0.1", + "port": 102, + "tsapSnap7": 20, + "tsapLogo": 30, + "deviceName": "LOGO", + "deviceProfileName": "default", + "pollPeriod": 1000, + ... + } + ] +} +``` + +## Data mapping + +In the data mapping, you can specify how the connector will interact with the +device and what data it will read. You can also use this section to configure +which data will be sent as device attributes or telemetry. Data mapping contains +all the necessary settings for flexible data management. + +### Attributes and Time series + +The configuration in this unit provides settings for data processing. These +settings will be interpreted in ThingsBoard platform instance as attributes/time +series of the device. + + + + + +PLC device data can be read in two ways: using **data** or **tag** parameters. + +Use the following parameters for reading values from S7 PLCs by `data` type request: + +| Parameter | Description | +|-----------|-------------| +| `devices[].attributes[].type` | Type of the parameter: **data**. | +| `devices[].attributes[].key` | Key name of the attribute parameter. | +| `devices[].attributes[].dataType` | Data type of the parameter. Please, refer to the [Supported data types](#supported-data-types) section. | +| `devices[].attributes[].dbNumber` | DB number for S7 PLCs. | +| `devices[].attributes[].start` | Start address for S7 PLCs. | +| `devices[].attributes[].size` | Size of the parameter in bytes for S7 PLCs. | +| `devices[].attributes[].bit` | Bit number for S7 PLCs. Only for boolean values. | +| `devices[].timeseries[].type` | Type of the parameter: **data**. | +| `devices[].timeseries[].key` | Key name of the time series parameter. | +| `devices[].timeseries[].dataType` | Data type of the parameter. Please, refer to the [Supported data types](#supported-data-types) section. | +| `devices[].timeseries[].dbNumber` | DB number for S7 PLCs. | +| `devices[].timeseries[].start` | Start address for S7 PLCs. | +| `devices[].timeseries[].size` | Size of the parameter in bytes for S7 PLCs. | +| `devices[].timeseries[].bit` | Bit number for S7 PLCs. Only for boolean values. | + +Configuration example for reading values from S7 PLCs by `data` type request: + +```json +{ + "attributes": [ + { + "type": "data", + "key": "status", + "dataType": "bool", + "dbNumber": 0, + "start": 0, + "size": 1, + "bit": 1 + } + ], + "timeseries": [ + { + "type": "data", + "key": "temperature", + "dataType": "float", + "dbNumber": 0, + "start": 2, + "size": 4 + } + ] +} +``` + +Use the following parameters for reading values from S7 PLCs by `tag` type request: + +| Parameter | Description | +|-----------|-------------| +| `devices[].attributes[].type` | Type of the parameter: **tag**. | +| `devices[].attributes[].key` | Key name of the attribute or time series parameter. | +| `devices[].attributes[].tag` | Tag name for S7 PLCs. Please, refer to the [Supported tag formats](#tag-syntax) section. | + +Configuration example for reading values from S7 PLCs by `tag` type request: + +```json +{ + "attributes": [ + { + "type": "tag", + "key": "raw_data", + "tag": "DB0.DBB100:STRING[37]" + } + ], + "timeseries": [ + { + "type": "tag", + "key": "temperature", + "tag": "DB0.DBD104:REAL" + } + ] +} +``` + + + + +The following parameters are used to configure device attributes and time series: + +| Parameter | Description | +|-----------|-------------| +| `devices[].attributes[].type` | Type of the parameter: **vm**. | +| `devices[].attributes[].key` | Key name of the attribute. | +| `devices[].attributes[].vmAddress` | VM address for Siemens Logo! PLCs. | +| `devices[].timeseries[].type` | Type of the parameter: **vm**. | +| `devices[].timeseries[].key` | Key name of the time series parameter. | +| `devices[].timeseries[].vmAddress` | VM address for Siemens Logo! PLCs. | + +Example of the attributes and telemetry configuration for Siemens Logo! PLCs: + +```json +{ + "attributes": [ + { + "type": "vm", + "key": "temperature", + "vmAddress": "VW30" + } + ], + "timeseries": [ + { + "type": "vm", + "key": "humidity", + "vmAddress": "VW0" + } + ] +} +``` + + + + + +## Requests mapping + +The Requests mapping section allows you to configure how the ThingsBoard platform +instance will interact with the devices. That is, how the platform will request data +from the devices, how it will update device attributes, and how it will send RPC +commands to the devices. + +S7 connector supports the following requests mapping: +- **Attribute updates** - allows update device nodes values from ThingsBoard platform instance. +- **RPC methods** - allows sending RPC commands to devices. Using RPC methods, you can get or set values of the PLC. S7 connector supports different types of RPC methods, such as: + - **Reserved GET/SET methods** - these methods are automatically created for each attribute and time series parameter. You can use them to get or set values of the PLC device. + - **Configurable RPC methods to device** - these methods allow you to configure custom RPC commands in connector configuration that can be sent to the devices. + +### Attribute updates + +This subsection contains configuration for attribute updates request from ThingsBoard platform instance. + +ThingsBoard allows the provisioning of device attributes and fetches some of them from the device application. +You can treat this as a remote configuration for devices, enabling them to request shared attributes from +ThingsBoard. See [user guide](/docs/user-guide/digital-twins/attributes/#attribute-scopes) for more details. + +The following parameters are used to configure attribute updates: + + + + +Same as reading atttributes/time series, the S7 PLCs can be configured to update device attributes using **data** or **tag** parameters. + +Use the following parameters to configure attribute updates for S7 PLCs by `data` type request: + +| Parameter | Description | +|-----------|-------------| +| `devices[].attributeUpdates[].type` | Type of the parameter: **data**. | +| `devices[].attributeUpdates[].key` | Key name of the attribute parameter. | +| `devices[].attributeUpdates[].dataType` | Data type of the parameter. Please, refer to the [Supported data types](#supported-data-types) section. | +| `devices[].attributeUpdates[].dbNumber` | DB number for S7 PLCs. | +| `devices[].attributeUpdates[].start` | Start address for S7 PLCs. | +| `devices[].attributeUpdates[].size` | Size of the parameter in bytes for S7 PLCs. | +| `devices[].attributeUpdates[].bit` | Bit number for S7 PLCs. Only for boolean values. | + +Configuration example for attribute updates for S7 PLCs by `data` type request: + +```json +{ + "attributeUpdates": [ + { + "type": "data", + "key": "isOpen", + "dataType": "bool", + "dbNumber": 1, + "start": 2, + "size": 1, + "bit": 1 + } + ] +} +``` + +Use the following parameters to configure attribute updates for S7 PLCs by `tag` type request: + +| Parameter | Description | +|-----------|-------------| +| `devices[].attributeUpdates[].type` | Type of the parameter: **tag**. | +| `devices[].attributeUpdates[].key` | Key name of the attribute parameter. | +| `devices[].attributeUpdates[].tag` | Tag name for S7 PLCs. Please, refer to the [Supported tag formats](#tag-syntax) section. | + +Configuration example for attribute updates for S7 PLCs by `tag` type request: + +```json +{ + "attributeUpdates": [ + { + "type": "tag", + "key": "isOpen", + "tag": "DB1.DBX2.0" + } + ] +} +``` + + + + +The following parameters are used to configure attribute updates for Siemens Logo! PLCs: + +| Parameter | Description | +|-----------|-------------| +| `devices[].attributeUpdates[].type` | Type of the parameter: **vm**. | +| `devices[].attributeUpdates[].key` | Key name of the attribute parameter. | +| `devices[].attributeUpdates[].vmAddress` | VM address for Siemens Logo! PLCs. | + +Configuration example for attribute updates for Siemens Logo! PLCs: + +```json +{ + "attributeUpdates": [ + { + "type": "vm", + "key": "lightLevel", + "vmAddress": "VW30" + } + ] +} +``` + + + + +### RPC methods + +ThingsBoard allows sending [RPC commands](/docs/reference/mqtt-api/rpc/) to the device that is connected +to ThingsBoard directly or via Gateway. +Configuration, provided in this section is used for sending RPC requests from ThingsBoard to device. + + + +The following parameters are used to configure RPC methods: + + + + +Same as reading atttributes/time series, the S7 PLCs can be configured to receive RPC commands using **data** or **tag** parameters. + +Use the following parameters to configure RPC methods for S7 PLCs by `data` type request: + +| Parameter | Description | +|-----------|-------------| +| `devices[].serverSideRpc[].method` | RPC method name. | +| `devices[].serverSideRpc[].requestType` | RPC request type: **read** or **write**. | +| `devices[].serverSideRpc[].type` | Type of the parameter: **data**. | +| `devices[].serverSideRpc[].dataType` | Data type of the parameter. Please, refer to the [Supported data types](#supported-data-types) section. | +| `devices[].serverSideRpc[].dbNumber` | DB number for S7 PLCs. | +| `devices[].serverSideRpc[].start` | Start address for S7 PLCs. | +| `devices[].serverSideRpc[].size` | Size of the parameter in bytes for S7 PLCs. | +| `devices[].serverSideRpc[].bit` | Bit number for S7 PLCs. Only for boolean values. | + +Configuration example for RPC methods for S7 PLCs by `data` type request: + +```json +{ + "serverSideRpc": [ + { + "method": "set_light", + "requestType": "write", + "type": "data", + "dataType": "bool", + "dbNumber": 0, + "start": 0, + "size": 1, + "bit": 1 + }, + { + "method": "get_light", + "requestType": "read", + "type": "data", + "dataType": "bool", + "dbNumber": 0, + "start": 0, + "size": 1, + "bit": 1 + } + ] +} +``` + +Use the following parameters to configure RPC methods for S7 PLCs by `tag` type request: + +| Parameter | Description | +|-----------|-------------| +| `devices[].serverSideRpc[].method` | RPC method name. | +| `devices[].serverSideRpc[].requestType` | RPC request type: **read** or **write**. | +| `devices[].serverSideRpc[].type` | Type of the parameter: **tag**. | +| `devices[].serverSideRpc[].tag` | Tag name for S7 PLCs. Please, refer to the [Supported tag formats](#tag-syntax) section. | + +Configuration example for RPC methods for S7 PLCs by `tag` type request: + +```json +{ + "serverSideRpc": [ + { + "method": "set_light", + "requestType": "write", + "type": "tag", + "tag": "DB0.DBX0.0" + }, + { + "method": "get_light", + "requestType": "read", + "type": "tag", + "tag": "DB0.DBX0.0" + } + ] +} +``` + + + +The following parameters are used to configure RPC methods for Siemens Logo! PLCs: + +| Parameter | Description | +|-----------|-------------| +| `devices[].serverSideRpc[].method` | RPC method name. | +| `devices[].serverSideRpc[].requestType` | RPC request type: **read** or **write**. | +| `devices[].serverSideRpc[].type` | Type of the parameter: **vm**. | +| `devices[].serverSideRpc[].vmAddress` | VM address for Siemens Logo! PLCs.| + +Configuration example for RPC methods for Siemens Logo! PLCs: + +```json +{ + "serverSideRpc": [ + { + "method": "set_light", + "requestType": "write", + "type": "vm", + "vmAddress": "VW30" + }, + { + "method": "get_light", + "requestType": "read", + "type": "vm", + "vmAddress": "VW30" + } + ] +} +``` + + + + +## Additional information + +### Tag syntax + +S7 connector supports PLC4X / Siemens STEP7 dialect tag syntax. The following table contains the supported tag syntax for S7 PLCs: + +| Tag | Description | +|-----------|-------------| +| DB1.DBX0.0:BOOL | Bit in data block | +| DB1.DBB10:BYTE | Byte in data block | +| DB1.DBW10:INT | Word (2 bytes) | +| DB1.DBD10:REAL | Double word (4 bytes) | +| DB1:10:INT | Short form (DB 1, offset 10) | +| DB1:10:STRING[20] | Variable-length string | +| DB1:10:REAL[5] | Array of 5 REALs | +| M10.5:BOOL | Merker bit | +| MW20:WORD | Merker word | +| I0.0:BOOL | Input bit | +| Q0.0:BOOL | Output bit | + +### Supported data types + +S7 connector supports the following data types for both uplink and downlink: + +`boolean/bool`, `string/str/s7string`, `raw/bytes`, `bit`, `byte`, `usint`, +`uint8`, `sint`, `int8`, `int`, `int16`, `short`, `uint`, `uint16`, `word`, +`dint`, `int32`, `udint`, `uint32`, `dword`, `real`, `float`, `float32`, +`lreal`, `double`, `float64`. diff --git a/src/content/_includes/docs/iot-gateway/connectors.mdx b/src/content/_includes/docs/iot-gateway/connectors.mdx index f8d978d826..0d34fa6857 100644 --- a/src/content/_includes/docs/iot-gateway/connectors.mdx +++ b/src/content/_includes/docs/iot-gateway/connectors.mdx @@ -19,6 +19,10 @@ import DocLink from '@components/DocLink.astro'; - Integrate BACnet/IP building automation devices + + - Connect to Siemens S7 PLCs + + - Expose REST API endpoints on the gateway diff --git a/src/content/_includes/docs/iot-gateway/features/reserved-rpc.mdx b/src/content/_includes/docs/iot-gateway/features/reserved-rpc.mdx index 578808b332..3f0e3e7cf5 100644 --- a/src/content/_includes/docs/iot-gateway/features/reserved-rpc.mdx +++ b/src/content/_includes/docs/iot-gateway/features/reserved-rpc.mdx @@ -343,6 +343,196 @@ The following connectors support built-in GET/SET RPC methods: }, ]} /> + + + Reserved GET/SET RPC methods work differently depending on the PLC family. S7 PLCs support both + `data` and `tag` addressing, while Siemens Logo! PLCs are addressed using `vmAddress`. + + + + #### GET + + ##### `data` type addressing + + Read a value from an S7 PLC using `data` type addressing: + + ```bash + get type=data;dbNumber=;start=;dataType=;size=;bit=; + ``` + + | Parameter | Description | + |-----------|-------------| + | `dbNumber` | DB number for S7 PLCs | + | `start` | Start address for S7 PLCs | + | `dataType` | Data type of the value to read | + | `size` | Size of the parameter in bytes for S7 PLCs | + | `bit` | Bit number for S7 PLCs. **Only for boolean values** | + + Example — read a boolean status flag from DB0, byte 0, bit 1: + + ```bash + get type=data;dbNumber=0;start=0;dataType=bool;size=1;bit=1; + ``` + + Response: + + ```json + {"result": true} + ``` + + + + ##### `tag` type addressing + + Read a value from an S7 PLC using `tag` type addressing: + + ```bash + get type=tag;tag=; + ``` + + | Parameter | Description | + |-----------|-------------| + | `tag` | Tag address for S7 PLCs | + + Example: + + ```bash + get type=tag;tag=DB0.DBD104:REAL; + ``` + + #### SET + + ##### `data` type addressing + + Write a value to an S7 PLC using `data` type addressing: + + ```bash + set type=data;dbNumber=;start=;dataType=;size=;bit=;value=; + ``` + + | Parameter | Description | + |-----------|-------------| + | `dbNumber` | DB number for S7 PLCs | + | `start` | Start address for S7 PLCs | + | `dataType` | Data type of the value to write | + | `size` | Size of the parameter in bytes for S7 PLCs | + | `bit` | Bit number for S7 PLCs. **Only for boolean values** | + | `value` | Value that will be written to the device| + + Example — set a boolean status flag at DB0, byte 0, bit 1 to `false`: + + ```bash + set type=data;dbNumber=0;start=0;dataType=bool;size=1;bit=1;value=false; + ``` + + Response: + + ```json + {"result":{"success":"Successfully wrote value bytearray(b'\\x00') to device S7 PLC for RPC method set"}} + ``` + + + + ##### `tag` type addressing + + Write a value to an S7 PLC using `tag` type addressing: + + ```bash + set type=tag;tag=;value=; + ``` + + | Parameter | Description | + |-----------|-------------| + | `tag` | Tag address for S7 PLCs | + | `value` | Value that will be written to the device| + + Example: + + ```bash + set type=tag;tag=DB0.DBD104:REAL;value=12345; + ``` + + + + #### GET + + Read a value from a Siemens Logo! PLC by VM address: + + ```bash + get type=vm;vmAddress=; + ``` + + | Parameter | Description | + |-----------|-------------| + | `vmAddress` | VM address for Siemens Logo! PLCs | + + Example — read the temperature at `VW30`: + + ```bash + get type=vm;vmAddress=VW30; + ``` + + Response: + + ```json + {"result":12} + ``` + + + + #### SET + + Write a value to a Siemens Logo! PLC by VM address: + + ```bash + set type=vm;vmAddress=;value=; + + ``` + | Parameter | Description | + |-----------|-------------| + | `vmAddress` | VM address for Siemens Logo! PLCs | + | `value` | Value that will be written to the device| + + Example — set the temperature at `VW30` to `35`: + + ```bash + set type=vm;vmAddress=VW30;value=35; + ``` + + Response: + + ```json + {"result":{"success":"Successfully wrote value 35 to device LOGO for RPC method set"}} + ``` + + + + + #### GET diff --git a/src/content/_includes/docs/iot-gateway/getting-started.mdx b/src/content/_includes/docs/iot-gateway/getting-started.mdx index 5379f41e95..84ce8d4422 100644 --- a/src/content/_includes/docs/iot-gateway/getting-started.mdx +++ b/src/content/_includes/docs/iot-gateway/getting-started.mdx @@ -937,6 +937,7 @@ connect to different devices. You can find more information about connectors in - MQTT connector - OPC-UA connector - Modbus connector +- S7 connector - BLE connector - Request connector - REST connector diff --git a/src/content/_includes/docs/iot-gateway/what-is-thingsboard-iot-gateway.mdx b/src/content/_includes/docs/iot-gateway/what-is-thingsboard-iot-gateway.mdx index d4202e0c42..10b1cc23e6 100644 --- a/src/content/_includes/docs/iot-gateway/what-is-thingsboard-iot-gateway.mdx +++ b/src/content/_includes/docs/iot-gateway/what-is-thingsboard-iot-gateway.mdx @@ -69,6 +69,7 @@ It also collects and periodically reports runtime statistics (connected devices, - OPC-UA Connector: Integrate industrial equipment and SCADA systems using the OPC-UA standard. - Modbus Connector: Collect data from PLCs, sensors, and meters via Modbus TCP/RTU. - BACnet Connector: Bridge building automation and control networks into ThingsBoard. +- S7 Connector: Connect to Siemens S7 PLCs. - BLE Connector: Collect data from Bluetooth Low Energy sensors and beacons. - CAN Connector: Read and decode CAN bus frames from automotive and industrial equipment. - SNMP Connector: Monitor network devices and infrastructure using SNMP traps and polling. diff --git a/src/content/docs/docs/iot-gateway/config/s7.mdx b/src/content/docs/docs/iot-gateway/config/s7.mdx new file mode 100644 index 0000000000..fb85de3e3f --- /dev/null +++ b/src/content/docs/docs/iot-gateway/config/s7.mdx @@ -0,0 +1,8 @@ +--- +title: S7 +description: Configure the S7 Connector to integrate Siemens S7 PLCs with ThingsBoard IoT Gateway. +--- +import S7Config from '@includes/docs/iot-gateway/config/s7.mdx' +import { Products } from '~/models/site.models' + +