Skip to main content

Modbus and Serial Configuration

The Gateway has a very advanced Modbus Master is anmaster application thatwith allowsa fullconvenient operationgraphical interface. Below are the capabilities of devices connected to the gatewayapplication:

over
    Modbus TCP/IP and Modbus RTU andsupport. ModbusAny TCP/IP.number Also,of theserial applicationports allowsSupport sendingfor dataexternal toUSB/serial theinterfaces server via MQTT,JSON, TCP/IP JSON and savingMQTT string formation Data logging in the event of no connection to storage.
    a
    server

    Configuration

    Storage of all data in internal memory

    The Modbus Master

    Toapplication openis optimized for industrial use, allowing you to easily configure communication parameter, define polling schedules, and integrate Modbus master,data gointo your automation or monitoring workflows.

    A detailed guide to Modbus > Modbus Master

    Add Slave Device in Modbus Slave Devices

    ag-221-web-modbusmaster-start.png

    Enter a slave device name of your choice & Select communication protocol.

    AG-221-web-modbusmaster-advanceSettingsAlert.png

    Modbus RTU

    Need to enter the serial port configuration according to the slave device. In AG-221 is foravailable RS485 dev/ttyS1.

    /dev/ttyS1 = RS485

    ag-221-web-modbusmaster-serial.png

    Change the baud-rate according to your slave device requirement. In Modbus RTU 9600 baud-rate is most common used.

    AG-221-web-modbusmaster-baudrate.png

    Data bits are used to represent each character or data unit in a communication protocol. Select the appropriate setting.

    AG-221-web-modbusmaster-databit.png

    Parity is an error-checking mechanism to detect data transmission errors. Most devices use the None option.

    AG-221-web-modbusmaster-parity.png

    A stop bit signals the end of a data frame, helping the receiver recognize when one byte is complete.

      1 Stop Bit: For stable connections and higher speed. 2 Stop Bits: For increased reliability or when devices need more processing time.

      Select the option according to the slave device.

      AG-221-web-modbusmaster-stopbit.png

      Modbus TCP/IP

      In Modbus TCP/IP, only the IP address and port number (typically 502) are required for communication. 

      AG-221-web-modbusmaster-tcp.png

      Modbus slave

      After entering these parameters, the next configuration steps are the same for both Modbus TCP and Modbus RTU.

      You should enter the slave ID (1-255), polling interval, and request timeout according to your requirements.

      ag-221-web-modbusmaster-slaveidpollingrequest.png


      Query Configuration

      To make a Query, click on ADD QUERY

      AG-221-web-modbusmaster-rtu2.png

      Enter the Function code, Start Address, Register/Coil number as per the Slave documentation or instruction. Here 1-50 register/coil quantity is supported.

      AG-221-web-modbusmaster-Query1.png

      Parameter Configuration

      Enter and select the option as per your requirement.

      AG-221-web-modbusmaster-parameter2.png

      AG-221-web-modbusmaster-parameter1.png

      AG-221-web-modbusmaster-parameter.png

      Click on SAVE after entering and selecting the Parameters.

      This is how we can configure Modbus and view the details.
      And for another slave do the same process by click on ADD SLAVE DEVICE.

      ag-221-web-modbusmaster-save-modbusconfig.pnghere.


      Data output configuration

      Click on Output configuration. There are two option: 

        Save Data to File. Send Data to Server.

        We can choose both options and then the data is both sent to the server and saved locally.

        ag-221-web-modbusmaster-outputconfig.png

        If Save Data to File is selected, it is necessary to specify the folder path.

        Send data to server

        In Send Data to Server. There are 2 option:

          ATRA-DATA 3rd-PARTY-PLATFORM

          Atra-Data is Atreyo's system for quick and easy presentation of data in the cloud. In the case of 3rd-PARTY-PLATFORM, we can choose any data platform that communicates using one of the selected ports: HTTP, MQTT or TCP/IP.

          ATRA-DATA

          ATRA-DATA. In This Data is send direct to the ATRA server without any aditional configuration.

          ag-221-web-modbusmaster-outputconfig1.png

          3rd-PARTY-PLATFORM. 

          There are some parameter required to select protocol – HTTP, MQTT, TCP/IP.

          ag-221-web-modbusmaster-outputconfig-select.png

          HTTP(s)

          Enter the URL For HTTP Post and Header. Where able to Change default header or add new one if needed.

          ag-221-web-modbusmaster-outputconfig2.png

          Certificates

          To enhance security for data transmission, you can use certificate-based TLS along with credentials.
          Certificate-based TLS (Transport Layer Security) require CA(Certificate Authorities) file, Client Certificate and Private key 
          Credentials often require a username and password for authentication and access control in secure systems.

          ag-221-web-modbusmaster-outputconfig-certificates.png

          MQTT

          Enter the Server Hostname/IP, Server Port, Publish Topic and Subscribe Topic. Select QoS level as per requirement and Client ID it is Auto-generate.

          ag-221-web-modbusmaster-outputconfig-mqtt-cert.png

          QoS (Quality of Service) level

            QoS 0 (At most once): Fast, no acknowledgment, possible message loss. QoS 1 (At least once): Acknowledged, possible duplicates. QoS 2 (Exactly once): Highest reliability, no duplicates, uses a four-step handshake.