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
-
PropertyChangedBaseModbusSerialMasterModuleBase
- Implements
-
INotifyPropertyChangedEx
- Derived
- Inherited Members
-
PropertyChangedBase.Refresh()PropertyChangedBase.IsNotifyingPropertyChangedBase.PropertyChanged
Properties
BaudRate
Gets or sets the serial baud rate.
[Configuration(9600, Unit = "baud")]
public int BaudRate { get; set; }
Property Value
DataBits
Gets or sets the standard length of data bits per byte.
public virtual int DataBits { get; set; }
Property Value
Parity
Gets or sets the parity-checking protocol.
[Configuration(Parity.Even)]
public Parity Parity { get; set; }
Property Value
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
StopBits
Gets or sets the standard number of stop bits per byte.
[Configuration(StopBits.One)]
public StopBits StopBits { get; set; }
Property Value
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
byteAddress of device to write values to.
address
ushortAddress to begin writing.
value
boolValue 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
byteAddress of device to write values to.
address
ushortAddress to begin writing.
value
ushortValues 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
byteAddress of device to read values from.
startAddress
ushortAddress 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
byteAddress of device to read values from.
startAddress
ushortAddress to begin writing.
values
IEnumerable<ushort>Values to write.