Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Edge Data Store

Data selection configuration

  • Last UpdatedSep 25, 2025
  • 6 minute read

Once a data source is configured for a Modbus TCP instance, create a data selection configuration file to specify the data for the Modbus TCP EDS (Edge Data Store) adapter instance to collect from the data source.

Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

Configure Modbus TCP data selection

To configure Modbus TCP data selection:

Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

  1. Using any text editor, create a file that contains a Modbus TCP data selection in JSON (JavaScript Object Notation) form.

    Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

  2. Update the parameters as needed.

  3. Save the file to the device with EDS (Edge Data Store) installed with the name Modbus1DataSelection..json.

  4. Use any tool capable of making HTTP (Hypertext Transfer Protocol) requests to execute a POST command with the contents of that file to the following endpoint: http://localhost:<port_number>/api/v1/configuration/<EDS adapterId>/DataSelection/.

    Definition: The POST method is used to create new resources.

    The following example shows the HTTPS (Hypertext Transfer Protocol - Secure) request using cURL (Client for URL), which must be run from the same directory where the file is located, and uses the adapter instance created during installation, which is Modbus1:

    curl -d "@ModbusDataSelection..json" -H "Content-Type: application/json" "http://localhost:5590/api/v1/configuration/Modbus1/DataSelection"

    edgecmd set dataSelection -cid Modbus1 -file Modbus1DataSelection..json

    To see the streams that have been created in EDS (Edge Data Store) storage for the data specified in the configuration, run the following cURL (Client for URL) script:

    curl http://localhost:5590/api/v1/tenants/default/namespaces/default/streams/

Parameters for Modbus TCP data selection

The following parameters are available for configuring Modbus TCP data selection.

Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

Parameter

Required

Type

Nullable

Description

DeviceId

Required

string

No

Specifies the DataSource device that this data selection item is read from. The value must match one of the <Id> values specified in the DataSource Devices configuration.

Selected

Optional

Boolean

No

Used to select or clear a measurement. To select an item, set to true. To remove an item, leave the field empty or set to false. If not configured, the default value is true.

Name

Optional

string

Yes

The optional friendly name of the data item collected from the data source. If not configured, the default value will be the stream ID.

UnitId

Required

number

No

Modbus TCP slave device unit ID. This must be a value between 0 and 247, inclusively.

Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

RegisterType

Required

number or string

No

Modbus TCP register type. Supported types are Coil, Discrete, Input16, Input32, Holding16 and Holding32.

Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

Input16 and Holding16 are used to read registers that have a size of 16 bits. For registers that have a size of 32 bits, use the Input32 and Holding32 register types. To represent the types, type the register type ID or the exact name:

  • 1 or Coil (Read Coil Status)

  • 2 or Discrete (Read Discrete Input Status)

  • 3 or Holding16 (Read 16-bit Holding Registers)

  • 4 or Holding32 (Read 32-bit Holding Registers)

  • 6 or Input16 (Read 16-bit Input Registers)

  • 7 or Input32 (Read 32-bit Input Registers)

RegisterOffset

Required

number

No

The 0 relative offset to the starting register for this measurement. For example, if the Holding registers start at base register 40001, the offset to this register is 0. For 40002, the offset to this register is 1.

DataTypeCode

Required

number

No

Represents the data type that Modbus TCP EDS (Edge Data Store) adapter will read starting at the register specified by the offset.

Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

Supported data types are:

  • 1 = Boolean

  • 10 = Int16

  • 20 = UInt16

  • 30 = Int32

  • 31 = Int32ByteSwap

  • 100 = Float32

  • 101 = Float32ByteSwap

  • 110 = Float64

  • 111 = Float64ByteSwap

  • 1001 - 1250 = String

  • 2001 - 2250 = StringByteSwap

ScanRate

Required

number

No

Defines how often this measurement is read from the device in milliseconds. Acceptable values are from 0 to 86400000. If 0 ms is specified, Modbus TCP EDS (Edge Data Store) adapter will scan for data as fast as possible.

Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

BitMap

Optional

string

Yes

Bitmap used to extract and reorder bits from a word register. The format of the bitmap is uuvvwwxxyyzz, where uu, vv, ww, yy, and zz each refer to a single bit. A leading zero is required if the referenced bit is less than 10. The low-order bit is 01 and high-order bit is either 16 or 32. Up to 16 bits can be referenced for a 16-bit word (data types 10 and 20) and up to 32 bits can be referenced for a 32-bit word (data type 30 and 31). The bitmap 0307120802 will map the second bit of the original word to the first bit of the new word, the eighth bit to the second bit, the twelfth bit to the third bit, and so on. The high-order bits of the new word are padded with zeros if they are not specified.

ConversionFactor

Optional

number

Yes

Used to scale the raw response received from the Modbus TCP device. If this is specified, regardless of the specified data type, the value will be promoted to a float32 (single) when stored. [Result = (Value / Conversion Factor)]

Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

ConversionOffset

Optional

number

Yes

Used to apply an offset to the response received from the Modbus TCP device. If this is specified, regardless of the specified data type, the value will be promoted to a float32 (single) when stored. [Result = (Value - Conversion Offset)]

Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

StreamID

Optional

string

Yes

The custom stream ID that will be used to create the streams. If not specified, the Modbus TCP EDS (Edge Data Store) adapter will generate a default stream ID based on the measurement configuration. A properly configured custom stream ID follows these rules:

Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

  • Is not case-sensitive.

  • Can contain spaces.

  • Cannot start with two underscores ("__").

  • Can contain a maximum of 100 characters.

  • Cannot use the following characters: / : ? # [ ] @ ! $ & ' ( ) \ * + , ; = % < > |

  • Cannot start or end with a period.

  • Cannot contain consecutive periods.

  • Cannot consist of only periods.

Each JSON (JavaScript Object Notation) object in the file represents a measurement. Add additional JSON (JavaScript Object Notation) objects in the file for each measurement to collect. Modify the fields in each object to configure the measurement parameters.

Modbus TCP data selection examples

Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

The following are examples of valid Modbus TCP data selection configurations.

Definition: Modbus TCP, Transmission Control Protocol, is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It does not require a checksum calculation, as lower layers already provide checksum protection.

Minimum data selection configuration:

[

{

"DeviceId": "Device1",

"UnitId": 1,

"RegisterType": 3,

"RegisterOffset": 122,

"DataTypeCode": 20,

"ScanRate": 1000

}

]

Maximum data selection configuration:

[

{

"DeviceId": "Device1",

"Selected": true,

"Name": "MyDataItem",

"UnitId": 1,

"RegisterType": 3,

"RegisterOffset": 123,

"DataTypeCode": 20,

"ScanRate": 300,

"StreamId": "stream.1",

"BitMap": "020301",

"ConversionFactor": 12.3,

"ConversionOffset": 14.5

}

]

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in