.NET ModbusServer – Properties

Namespace:  EasyModbus
Class:  ModbusServer

public HoldingRegisters holdingRegisters

provides access to the Holding Registers e.g. holdingRegisters[5]


 

public InputRegisters inputRegisters

provides access to the Input Registers e.g. inputRegisters[10]


 

public Coils coils

provides access to the coils


 

public DiscreteInputs discreteInputs

provides access to the discrete Inputs e.g. discreteInputs[8]


public int NumberOfConnections

returns the number of connected Clients


public ModbusProtocol[] ModbusLogData

returns some protocol data about Modbus communication


public int Port

gets or sets the Port the Server listens to in case of Modbus-TCP or Modbus-RTU (Standard is 502)


public bool UDPFlag

Enables Modbus-UDP and Disables Modbus-TCP if TRUE


public bool SerialFlag

Enables Modbus-RTU and Disables Modbus-TCP if TRUE


public int Baudrate

gets or sets the Baudrate for serial connection if Modbus-RTU is enabled (Standard: 9600)


 

public System.IO.Ports.Parity Parity

gets or sets the parity for serial connection if Modbus-RTU is enabled (Standard: even)


public System.IO.Ports.StopBits StopBits

gets or sets the Stopbits for serial connection if Modbus-RTU is enabled (Standard: one)


public string SerialPort

gets or sets the serial port for Modbus-RTU. Providing a serial port automatically enables Modbus-RTU and disables Modbus-TCP


 

public byte UnitIdentifier

gets or sets the unit identifier (Slave-ID). Normally only nessesary for Modbus-RTU (Standard is 1)


 

public string LogFileFilename

gets or sets the Filename to Log data for troubleshooting. Providing a Filename automatically enables logging


 

public string MqttBrokerAddress

gets or sets the MQTT Broker address to Publish the Server values – Providing a Broker Address automatically starts publishing values to the Broker on change.


public string MqttRootTopic

Gets or Sets the Mqtt Root Topic – Standard is “easymodbusserver”


public string MqttUserName

Gets or Sets the Username for the MQTT-Broker (if nessesary) default is “null”


public string MqttPassword

Gets or Sets the Password for the MQTT-Broker (if nessesary) default is “null”


public bool MqttRetainMessages

Disables or Enables to Retain the Messages in the Broker – default is TRUE (Enabled)


public int MqttBrokerPort

Gets or Sets the MQTT Broker Port (Standard is 1883)