Skip to content

Modbus Slave Flux Asset

The Modbus Slave is a flux asset provided by Coreflux that enables seamless communication using the Modbus protocol. This guide will provide a comprehensive overview of the Modbus Slave asset, including its features, benefits, installation, configuration, and usage.

Introduction

What is Modbus?

Modbus is a communication protocol developed in 1979 for use with programmable logic controllers (PLCs). Over the years, it has become a standard communication protocol in the industry, connecting various electronic devices.

Configuration

The Modbus Slave asset allows for both Serial and TCP/IP communication. The configuration parameters determine the mode of communication and the specific settings for each mode.

Parameters

ModbusSlave Parameters

  • Interface: Determines the mode of communication. Set to 0 for Serial communication and 1 for TCP/IP communication.

    • Example for Serial: "Interface": 0
    • Example for TCP/IP: "Interface": 1
  • IP: Used when the interface is set to TCP/IP. Specifies the IP address of the Modbus Slave device.

    • Example: "IP": "127.0.0.1"
  • UnitIdentifier: Used to configure the Modbus Slave ID. This parameter specifies the unique identifier of the Modbus Slave device on the network.

    • Example: "UnitIdentifier": 1
  • Port: Used when the interface is set to TCP/IP. Specifies the port number for the Modbus Slave device.

    • Example: "Port": 502
  • SerialPort: Used when the interface is set to Serial. Specifies the serial port to which the Modbus Slave device is connected.

    • Example for Windows: "SerialPort": "COM1"
    • Example for Linux: "SerialPort": "/dev/ttyS0"
  • BaudRate: Represents the data transmission rate in bits per second (baud). Common values include 9600, 19200, 38400, 57600, and 115200.

  • Example: "BaudRate": 9600

  • Parity: Determines the parity bit used for error checking during data transmission.

    • None (0): No parity bit.
    • Odd (1): Odd number of 1s.
    • Even (2): Even number of 1s.
    • Mark (3): Parity bit always set to 1.
    • Space (4): Parity bit always set to 0.
    • Example: "Parity": 2
  • StopBits: Indicates the number of bits used to signify the end of a byte.

    • None (0): No stop bit.
    • One (1): One stop bit.
    • Two (2): Two stop bits.
    • OnePointFive (3): One and a half stop bits.
    • Example: "StopBits": 1

Example Configuration

{
  "ModbusSlave": {
    "Interface": 0,
    "IP": "127.0.0.1",
    "Port": 502,
    "SerialPort": "COM1",
    "BaudRate": 9600,
    "Parity": 2,
    "StopBits": 1
  }
}

Installation

Method 1: GUI

// Instructions for GUI installation

Method 2: Command-line

// Instructions for command-line installation

Running the Asset

To run the Modbus Slave asset, follow the specific instructions provided in your Coreflux documentation or interface.

Usage

Once the Modbus Slave asset is configured and running, you can use it to communicate with other Modbus devices or systems, either by reading data from them or sending commands to them.

FAQ

General Questions

What is the Modbus Slave Asset?

The Modbus Slave Asset is a flux asset provided by Coreflux that facilitates communication using the Modbus protocol. It can operate in either Serial or TCP/IP mode, depending on the configuration.

How do I configure the Modbus Slave Asset?

The Modbus Slave Asset is configured using a set of parameters that determine its mode of operation and specific settings for each mode. Detailed configuration instructions and examples can be found in the Configuration section.

Troubleshooting Questions

I'm having trouble communicating with my Modbus device. What should I do?

Ensure that the Modbus Slave asset is correctly configured. Check the interface, IP address, port, and other parameters to ensure they match the settings of the device you're trying to communicate with. If the problem persists, consult the troubleshooting section or seek assistance from Coreflux support.