Data selection configuration
- Last UpdatedSep 25, 2025
- 6 minute read
Once a data source is configured for a instance, create a data selection configuration file to specify the data for the 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 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.
-
Using any text editor, create a file that contains a data selection in 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.
-
Update the parameters as needed.
-
Save the file to the device with installed with the name Modbus1DataSelection..json.
-
Use any tool capable of making requests to execute a 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 request using , 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 storage for the data specified in the configuration, run the following 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 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 |
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 |
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:
|
|
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 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:
|
|
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, 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 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 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 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.
|
Each object in the file represents a measurement. Add additional objects in the file for each measurement to collect. Modify the fields in each object to configure the measurement parameters.
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 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
}
]