Modbus connector concepts

The FairCom Modbus connector service allows reading and writing data tags to and from industrial devices, such as PLCs, that use the Modbus communication protocol. Once the FairCom server collects data from a Modbus device, it automatically stores it for later use in analytics, forward the data to dashboards or other devices, or transform the data into a format compatible with devices that use a different protocol. This functionality turns raw data into a powerful asset that data scientists and engineers can use for a wide range of sophisticated applications that move beyond basic monitoring.

Note A tag is a named data point. For example, a tag named temperature represents the location in a  device where the temperature value can be collected from or delivered to. FairCom Edge also associates each tag with an integration table. When a data point is collected, FairCom Edge stores the tag in a newly inserted, timestamped record in the table. A tag is always stored in the record as a JSON property in the source_payload field, such as "temperature": 70. The FairCom server automatically delivers the contents of the source_payload  field as an MQTT message to the table's MQTT topic. Additionally, the tag may be optionally stored as a field in the table, such a field named temperature. This is useful for engineers who run SQL queries on the collected data for analytics.

 

Delivering data to Modbus devices

Upon collection, FairCom Edge can instantly deliver the processed data to multiple destinations, such as publishing MQTT messages to various topics, sending data to REST endpoints, writing to other devices, or delivering to cloud platforms.

Because FairCom's Modbus connector can write to devices, you can use any FairCom connector to write to an Modbus device. 

  • You can use SQL or FairCom's JSON DB API to insert a record into a table connected to an Modbus device and that data will be written to the device. This enables data scientists and software to write enriched data back to devices to improve processes, change recipes, provide guidance to operators, troubleshoot issues, etc.
  • You can take messages sent to an MQTT topic, transform them, and write their data to an Modbus device. This empowers you to automate a factory by sending MQTT commands to devices.
  • You can OPC UA, Modbus, EtherNet/IP, MTConnect, and so forth, to collect data from a device, transform the data, and write it into a table that immediately sends the data to an Modbus device where it can change a recipe, alter recipe parameters, change configuration, etc.

 

Sampling of devices that support Modbus

FairCom Edge integrates with devices that support the Modbus protocol, including devices from the companies in the following table.

Type of Device Sample Companies with Modbus Devices
PLCs Allen-Bradley, AutomationDirect, Delta, Mitsubishi, Motors, Omron, Rockwell Automation, Schneider Electric, Raspberry Pi, Siemens, etc.
Actuators  Badger Meter, Belimo, Emerson AVENTICS, Flowserve Limitorque, LINAK, Novanta IMS, Parker Hannifin Exlar, Rotork, Valworx,  WITTENSTEIN, etc.
Energy Storage Systems BMZ Group, GoodWe, Eaton, Hitachi Energy, Huawei, SMA Solar, Victron Energy, etc.
HMIs  AutomationDirect C-More, Maple Systems, Weintek, Unitronics, Red Lion, EZAutomation EZTouch, Pro-face, Schneider Electric Magelis, ICP DAS, Veichi, etc.
Power Inverters GoodWe, Huawei, OutBack Power, SMA Solar, Victron Energy, etc.
Power Meters Accuenergy Acuvim series, Eaton Power Xpert Meter, E-Mon D-Mon PowerSmart series, Schneider Electric PowerLogic, Siemens SENTRON series, Socomec DIRIS series, etc.
Temperature Sensors DataNab MBus, InfraSensing, ControlByWeb, EBYTE, etc.
Pressure Sensors ANDIVI, Rheonics DV, SensorsONE, S+S Regeltechnik PREMASGARD, etc.
Flow Sensors AW-Lake Edge, Turbines Inc., Ubidots, etc.
Vibration Sensors Broadsens SVT, Erbessd Phantom, Ubidots, etc.
Ultrasonic Sensors APG LOE-7126, TrenaTech MNU, etc.
Valves  Badger Meter, Belimo, Bürkert, Flowserve Limitorque, Rotork, SMC Corporation, Valworx, etc.
VFDs  ABB, AutomationDirect, Control Techniques, Danfoss/Vacon, KEB America, Lenze, Schneider Electric Altivar series, SEW-EURODRIVE, Toshiba, Yaskawa, etc.

 

Use Modbus to convert collected integers to floating point numbers

Modbus devices prefer to store integer numbers in their registers, but a machine often needs to deliver floating point numbers to the customer. Modbus devices typically use one of four techniques to represent a floating point number:

  1. Store an integer number in a register and let the customer divide it by a number, such as 7014 divided by 100 to create 70.14.
  2. Store two integer numbers in two registers, such as 70 and 14, and let the customer append them to create 70.14.
  3. Same as #2 but the registers are in reverse order.
  4. Store the bytes of an IEEE Floating point number in multiple registers, and let the customer combine them, such as 0x428C47AE representing 70.14.

FairCom's Modbus connector supports all four techniques when it collects data from registers and converts it into JSON numbers.

 

Dividing collected integers

The machine stores an integer number in a register and requires the customer to divide it by a number, such as 10, 100, or 1000, to create a floating-point number.

  1. FairCom's Modbus connector uses the following JSON configuration to convert the integer value 7014 in register address 2000 into 70.14.
    {
      "propertyPath": "temperature",
      "modbusDataAddress": 2000,
      "modbusDataAccess": "holdingregister",
      "modbusUnitId": 5,
      "modbusDataLen": 1,
      "modbusRegisterType": "int16SignedAB",
      "modbusConvertToFloat": "divideByInteger",
      "modbusDivisor": 100
    }
  1. To configure the Modbus connector to convert an integer into a floating point number, add the "modbusConvertToFloat": "divideByInteger" and "modbusDivisor": 100 settings to the configuration. You can set "modbusDivisor" to 10, 100, 1000, 10000, or another integer number. The connector reads the value of the Modbus register, divides it by the integer number in the "modbusDivisor" property, and stores the result at the "propertyPath" location in the JSON document it generates.

 

Storing two separate integers

The machine stores two integer numbers in two registers to represent one floating point number.

  1. FairCom's Modbus connector uses the following JSON configuration to convert the integer value 70 in the specified register and 14 in the next register into 70.14. FairCom's Modbus connector always considers the decimal number as positive. So, if the value read is -14, for example, it will be converted to 14.
    {
      "propertyPath": "temperature",
      "modbusDataAddress": 2000,
      "modbusDataAccess": "holdingregister",
      "modbusUnitId": 5,
      "modbusDataLen": 1,
      "modbusRegisterType": "int16SignedAB",
      "modbusDecimalDigits":2,
      "modbusConvertToFloat": "appendAdjacentRegisters"
    },
  1. To configure the Modbus connector to convert integers in successive registers into a floating point number, add the "modbusConvertToFloat": "appendAdjacentRegisters " setting to the configuration. The connector reads the value of the specified Modbus register and the next register and appends them with a decimal point between them. It stores the result at the "propertyPath" location in the JSON document it generates.
  2. If you are using this configuration with a createOutput command, it is necessary to change "modbusDecimalDigits" to properly convert the float number to two integers. The default value is 2.

 

Storing two separate integers in reverse order

Store two integer numbers in two registers to represent one floating point number, but the fractional part is in the first register.

  1. FairCom's Modbus connector uses the following JSON configuration to convert the integer value 14 in the specified register and 70 in the next register into 70.14.
    {
      "propertyPath": "temperature",
      "modbusDataAddress": 2000,
      "modbusDataAccess": "holdingregister",
      "modbusUnitId": 5,
      "modbusDataLen": 1,
      "modbusRegisterType": "int16SignedAB",
      "modbusDecimalDigits":2,
      "modbusConvertToFloat": "appendAdjacentRegistersReversed"
    },
  1. To configure the Modbus connector to convert integers in successive registers into a floating point number, add the "modbusConvertToFloat": "appendAdjacentRegisters" setting to the configuration. The connector reads the value of the specified Modbus register and the next register and appends them with a decimal point between them. It stores the result at the "propertyPath" location in the JSON document it generates.
  2. If you are using this configuration with a createOutput command, it is necessary to change "modbusDecimalDigits" to properly convert the float number to two integers. The default value is 2.

 

Storing the bytes of an IEEE floating point number

Store the bytes of an IEEE Floating point number in multiple registers.

  1. FairCom's Modbus connector uses the following JSON configuration to convert the IEEE bytes stored in two registers. For example, the first two bytes, 0x428C, can be stored in register 2000, and the bytes 0x47AE can be stored in register 2001. The connector reads the bytes in both registers, combines them into four bytes, and treats them as an IEEE floating point number representing 70.14.
    {
      "propertyPath": "temperature",
      "modbusDataAddress": 2000,
      "modbusDataAccess": "holdingregister",
      "modbusUnitId": 5,
      "modbusDataLen": 2,
      "modbusRegisterType": "ieeefloat32ABCD"
    },
  1. To configure the Modbus connector to convert the bytes of an IEEE floating point number in successive registers into a floating point number, add the "modbusRegisterType": "ieeefloat32ABCD" setting to the configuration. You can assign any of the following values to "modbusRegisterType" to specify different byte orders and sizes of IEEE floating point numbers:
"ieeeFloat32ABCD"
"ieeeFloat32CDAB"
"ieeeFloat32DCBA"
"ieeeFloat32BADC"
"ieeeFloat64ABCDEFGH"
"ieeeFloat64BADCFEHG"
"ieeeFloat64CDABGHEF"
"ieeeFloat64DCBAHGFE"
"ieeeFloat64HGFEDCBA"
"ieeeFloat64GHEFCDAB"
"ieeeFloat64FEHGBADC"
"ieeeFloat64EFGHABCD"