• 沒有找到結果。

Configure a Modbus TCP source

在文檔中 AWS IoT SiteWise (頁 131-134)

You can use the AWS IoT SiteWise console or a gateway capability to define and add a Modbus TCP source to your gateway. This source represents a local Modbus TCP server.

Note

• Gateways running on AWS IoT Greengrass V2 currently don't support Modbus TCP sources.

• You must install the AWS IoT SiteWise connector to use a Modbus TCP source.

You can use the Modbus TCP source to convert the data type from your source into a different data type when it's received on your gateway. The source data type determines the data types that you can choose for your destination data. You can also choose to swap bytes using the Modbus TCP source. The following table provides more information on the source data types, destination data types, and swap modes that are compatible.

For more information about swap modes, see the How Real (Floating Point) and 32-bit Data is Encoded in Modbus RTU Messages article on Modbus message encoding.

Source data type Compatible

destination data types Compatible swap

modes Compatible connector

versions

ASCII String noSwap 2

UTF8 String noSwap 2

ISO8859 String noSwap 2

Int16 Integer, Double, String noSwap 1 and 2

Int32 Integer, Double, String noSwap,

byteWordSwap,

Boolean Boolean noSwap 1 and 2

Hex-dump String noSwap 1 and 2

Topics

• Configure a Modbus TCP source (console) (p. 125)

• Configure a Modbus TCP source (CLI) (p. 126)

Using a gateway

Configure a Modbus TCP source (console)

To configure a Modbus TCP source

1. Navigate to the AWS IoT SiteWise console.

2. In the left navigation pane, choose Gateways.

3. On the gateway you want to create a source for, choose Manage, and then choose View details.

4. Choose New source in the upper-right corner.

5. For Protocol options, choose Modbus TCP.

6. For Modbus TCP source configuration, enter a Name for the source.

7. For IP address, enter the IP address for the data source server.

8. (Optional) Enter the Port and Unit ID for the source server.

9. (Optional) For Minimum inter-request duration, enter the time interval between subsequent requests sent to your server. Your gateway automatically calculates the minimum allowable interval based on your device and the number of registers you have.

10. For Property groups, enter a Name.

11. For Properties:

a. For Tag, enter a property alias for your register set. For example, TT-001.

b. For Register address, enter the register address that starts the register set.

c. For Source data type, choose the Modbus TCP data type you want to convert data from. This defaults to Hex dump.

Note

The source data type you choose determines the data size, destination data type, and swap mode you can choose. For more information, see the section called “Configure a Modbus TCP source” (p. 124).

d. For Data size, enter the number of registers to read when starting from the Register address.

This is determined by the source data type you choose for this source.

e. For Destination data type, choose the AWS IoT SiteWise data type that you want your data to be converted to. The default is String. The destination type must be compatible with the source data type you choose for this source. For more information, see the section called “Configure a Modbus TCP source” (p. 124).

f. For Swap mode, choose the data swap mode you want to use to read data from your register set. The swap mode must be compatible with the source data type you choose for this source.

Using a gateway

Note

You must choose AWS IoT SiteWise as your source destination if you want to process data from this source at the edge with AWS IoT SiteWise. For more information about processing data at the edge, see the section called “Enabling edge data processing” (p. 133).

To send your data to another destination:

a. For Destination options, choose Other destinations.

b. For Greengrass stream name, enter the exact name of your AWS IoT Greengrass stream.

Note

You can use a stream that you've already created, or you can create a new AWS IoT Greengrass stream to export your data. If you want to use an existing stream, you must enter the exact name of the stream or a new stream will be created.

For more information about working with AWS IoT Greengrass streams, see Manage data streams in the AWS IoT Greengrass developer guide.

14. Choose Add source.

AWS IoT SiteWise deploys the gateway configuration to your AWS IoT Greengrass core. You don't need to manually trigger a deployment.

Configure a Modbus TCP source (CLI)

You can define Modbus TCP data sources in a gateway capability. You must define all of your Modbus TCP sources in a single capability configuration.

For more information about defining sources with the AWS CLI, see the section called “Configuring data sources (AWS CLI)” (p. 130).

Note

You must install the AWS IoT SiteWise connector to use a Modbus TCP source.

This capability has the following versions.

Version Namespace

1 iotsitewise:modbuscollector:1

Modbus TCP capability configuration parameters

When you define Modbus TCP sources in a capability configuration, you must specify the following information in the capabilityConfiguration JSON document:

sources

A list of Modbus-TCP source definition structures that each contain the following information:

name

A unique, friendly name for the source.

measurementDataStreamPrefix

(Optional) A string to prepend to all data streams from the source. The gateway adds this prefix to all data streams from this source. Use a data stream prefix to distinguish between data streams that have the same name from different sources. Each data stream should have a unique name within your account.

Using a gateway

destination

A destination structure that contains the following information:

type

The type of the destination.

streamName

The name of the AWS IoT Greengrass stream.

streamBufferSize

The size of the stream buffer.

endpoint

An endpoint structure that contains the following information:

ipAddress

The IP address of the Modbus TCP source.

port

(Optional) The port of the Modbus TCP source.

unitId

(Optional) The unitId. This defaults to a value of 1.

minimumInterRequestDuration

The minimum duration between each request in milliseconds.

propertyGroups

The list of property groups that define the tag definition requested by the protocol.

name

The name of the property group. This should be a unique identifier.

tagPathDefinitions

The location of the measurement within the source. For example, the byte and word order, address, and transformation type. The structure of each MeasurementPathDefinition is defined by the connector.

scanMode

Defines the scan mode behavior and configurable parameters for the source.

在文檔中 AWS IoT SiteWise (頁 131-134)