Photomechanics API
IModbusListener Interface Reference

Represents listener which periodically updates provided registers. More...

Inheritance diagram for IModbusListener:
[legend]

Public Member Functions

void AddRegistersToObserve (IEnumerable< IObservableRegister > registerDescriptors)
 Add registers which will be periodically read from slave. More...
 
Task WriteRegistersAsync (params(IObservableRegister register, UInt16 newValue)[] registers)
 Write new values to the given registers. More...
 
Task WaitInitialRegistersUpdate ()
 Wait for registers to be updated. Used if needed to ensure registers update before other actions. More...
 

Properties

IModbusMaster ModbusMaster [get]
 Modbus master. More...
 
Byte SlaveAddress [get]
 SlaveID. More...
 
- Properties inherited from IAsyncDisposableExtended
Boolean IsDisposed [get]
 Determines whether the object is being disposed or already disposed and no longer functional. More...
 
ILogger Logger [get]
 Logger associated with this instance. This way extension methods can use logging without requiring it as parameter. More...
 

Additional Inherited Members

- Events inherited from IAsyncDisposableExtended
AsyncTypedEventHandler< IAsyncDisposableExtendedDisposed
 Occurs when object is disposed. It should be invoked at the end of IAsyncDisposable.DisposeAsync implementation in a Fire-and-Forget fashion (non-blocking).
 

Detailed Description

Represents listener which periodically updates provided registers.

Member Function Documentation

◆ AddRegistersToObserve()

void IModbusListener.AddRegistersToObserve ( IEnumerable< IObservableRegister registerDescriptors)

Add registers which will be periodically read from slave.

Implemented in ModbusListener.

◆ WriteRegistersAsync()

Task IModbusListener.WriteRegistersAsync ( params(IObservableRegister register, UInt16 newValue)[]  registers)

Write new values to the given registers.

Attempts to write multiple registers at once if addresses are sequentional. Used by modbus commands.

Implemented in ModbusListener.

◆ WaitInitialRegistersUpdate()

Task IModbusListener.WaitInitialRegistersUpdate ( )

Wait for registers to be updated. Used if needed to ensure registers update before other actions.

Implemented in ModbusListener.

Property Documentation

◆ ModbusMaster

IModbusMaster IModbusListener.ModbusMaster
get

Modbus master.

Implemented in ModbusListener.

◆ SlaveAddress

Byte IModbusListener.SlaveAddress
get

SlaveID.

Implemented in ModbusListener.