Table of Contents

Class ModbusSerialMasterModuleBase

Namespace
Loehnert.Lisrt.Communication.Modbus
Assembly
Loehnert.Lisrt.Communication.Modbus.dll

Represents a Modbus master module base that can communicate with slaves (server) via a serial communication interface.

public abstract class ModbusSerialMasterModuleBase : ModbusMasterModuleBase, ICompositeModule, ILisrtModule, IModbusMaster, IInitializable, INotifyPropertyChangedEx, INotifyPropertyChanged, IHasServiceView
Inheritance
PropertyChangedBase
ModbusSerialMasterModuleBase
Implements
INotifyPropertyChangedEx
Derived
Inherited Members
PropertyChangedBase.Refresh()
PropertyChangedBase.IsNotifying
PropertyChangedBase.PropertyChanged

Properties

BaudRate

Gets or sets the serial baud rate.

[Configuration(9600, Unit = "baud")]
public int BaudRate { get; set; }

Property Value

int

DataBits

Gets or sets the standard length of data bits per byte.

public virtual int DataBits { get; set; }

Property Value

int

Parity

Gets or sets the parity-checking protocol.

[Configuration(Parity.Even)]
public Parity Parity { get; set; }

Property Value

Parity

PortName

Gets or sets the name for the communication port (e. g. 'COM1').

[Configuration("", Description = "e.g. 'COM1'")]
public string PortName { get; set; }

Property Value

string

StopBits

Gets or sets the standard number of stop bits per byte.

[Configuration(StopBits.One)]
public StopBits StopBits { get; set; }

Property Value

StopBits

Methods

Exit()

De-initializes the module.

public override void Exit()

Initialize()

Initializes the module.

public override void Initialize()

ShowServiceView()

Shows the service window.

public virtual void ShowServiceView()

WriteCoil(byte, ushort, bool)

Writes single coil status (FC 05).

public override void WriteCoil(byte slaveAddress, ushort address, bool value)

Parameters

slaveAddress byte

Address of device to write values to.

address ushort

Address to begin writing.

value bool

Value to write.

WriteHoldingRegister(byte, ushort, ushort)

Writes a single holding register (FC 06).

public override void WriteHoldingRegister(byte slaveAddress, ushort address, ushort value)

Parameters

slaveAddress byte

Address of device to write values to.

address ushort

Address to begin writing.

value ushort

Values to write.

WriteMultipleCoils(byte, ushort, IEnumerable<bool>)

Writes multiple coils status (FC 15).

public override void WriteMultipleCoils(byte slaveAddress, ushort startAddress, IEnumerable<bool> values)

Parameters

slaveAddress byte

Address of device to read values from.

startAddress ushort

Address to begin writing.

values IEnumerable<bool>

Values to write.

WriteMultipleHoldingRegisters(byte, ushort, IEnumerable<ushort>)

Writes a block of contiguous registers (FC 16).

public override void WriteMultipleHoldingRegisters(byte slaveAddress, ushort startAddress, IEnumerable<ushort> values)

Parameters

slaveAddress byte

Address of device to read values from.

startAddress ushort

Address to begin writing.

values IEnumerable<ushort>

Values to write.