FieldTalk Modbus Master Library for .NET
FieldTalk Modbus Master Library for .NET
Namespaces
FieldTalk.Modbus.Master
MbusRtuMasterProtocol Class
MbusRtuMasterProtocol Constructor
MbusRtuMasterProtocol Properties
MbusRtuMasterProtocol Methods

# MbusRtuMasterProtocol Class

Modbus RTU Master Protocol class
Inheritance Hierarchy
System
Object
FieldTalk.Modbus.Master
MbusMasterFunctions
FieldTalk.Modbus.Master
MbusSerialClientBase
FieldTalk.Modbus.Master
MbusRtuMasterProtocol
FieldTalk.Modbus.Master
MbusElamMasterProtocol

Namespace: FieldTalk.Modbus.Master
Assembly: FieldTalk.Modbus.Master (in FieldTalk.Modbus.Master.dll) Version: 2.15.2-eval+3d8362b4bb861c05760d48b11d303e954bb8597c
Syntax
C#
VB
C++
Copy

    public class MbusRtuMasterProtocol : MbusSerialClientBase

    Public Class MbusRtuMasterProtocol
    	Inherits MbusSerialClientBase

    public ref class MbusRtuMasterProtocol : public MbusSerialClientBase

The MbusRtuMasterProtocol type exposes the following members.

Constructors

| Name | Description
--- | --- | ---
| MbusRtuMasterProtocol | Creates new instance

Top
Properties

| Name | Description
--- | --- | ---
| baudRate | Baud rate property in bps (Inherited from MbusSerialClientBase.)
| dataBits | Data bits property (Inherited from MbusSerialClientBase.)
| parity | Parity property (Inherited from MbusSerialClientBase.)
| pollDelay | Poll delay property (Inherited from MbusMasterFunctions.)
| retryCnt | Retry count property (Inherited from MbusMasterFunctions.)
| stopBits | Stop bits property (Inherited from MbusSerialClientBase.)
| timeout | Time-out port property (Inherited from MbusMasterFunctions.)

Top
Methods

| Name | Description
--- | --- | ---
| closeProtocol | Closes an open protocol including any associated communication resources (COM ports or sockets). (Inherited from MbusMasterFunctions.)
| configureBigEndianInts | Configures 32-bit int data type functions to do a word swap (Inherited from MbusMasterFunctions.)
| configureBigEndianInts(Int32) | Configures 32-bit int data type functions to do a word swap on a per slave basis (Inherited from MbusMasterFunctions.)
| configureCountFromOne | Configures the reference counting scheme to start with one for all slaves. (Inherited from MbusMasterFunctions.)
| configureCountFromOne(Int32) | Configures the reference counting scheme to start with one for a slave. (Inherited from MbusMasterFunctions.)
| configureCountFromZero | Configures the reference counting scheme to start with zero for all slaves. (Inherited from MbusMasterFunctions.)
| configureCountFromZero(Int32) | Configures the reference counting scheme to start with zero for a slave. (Inherited from MbusMasterFunctions.)
| configureEnron32BitMode | Configures all slaves for Daniel/ENRON 32-bit Mode. (Inherited from MbusMasterFunctions.)
| configureEnron32BitMode(Int32) | Configures a slave for Daniel/ENRON 32-bit Mode. (Inherited from MbusMasterFunctions.)
| configureIeeeFloats | Configures float data type functions NOT to do a word swap (Inherited from MbusMasterFunctions.)
| configureIeeeFloats(Int32) | Configures float data type functions NOT to do a word swap on a per slave basis (Inherited from MbusMasterFunctions.)
| configureLittleEndianInts | Configures 32-bit int data type functions NOT to do a word swap (Inherited from MbusMasterFunctions.)
| configureLittleEndianInts(Int32) | Configures 32-bit int data type functions NOT to do a word swap on a per slave basis (Inherited from MbusMasterFunctions.)
| configureStandard32BitMode | Configures all slaves for Standard 32-bit Mode. (Inherited from MbusMasterFunctions.)
| configureStandard32BitMode(Int32) | Configures a slave for Standard 32-bit Mode. (Inherited from MbusMasterFunctions.)
| configureSwappedFloats | Configures float data type functions to do a word swap (Inherited from MbusMasterFunctions.)
| configureSwappedFloats(Int32) | Configures float data type functions to do a word swap on a per slave basis (Inherited from MbusMasterFunctions.)
| customFunction | User Defined Function Code (Inherited from MbusMasterFunctions.)
| Dispose | Releases any associated communication resources (serial ports or sockets). (Inherited from MbusMasterFunctions.)
| enableRs485Mode | Enables RS485 mode (Inherited from MbusSerialClientBase.)
| forceMultipleCoils(Int32, Int32, Boolean ) | Modbus function 15 (0F hex), Force Multiple Coils. (Inherited from MbusMasterFunctions.)
| forceMultipleCoils(Int32, Int32, Boolean , Int32) | Modbus function 15 (0F hex), Force Multiple Coils. (Inherited from MbusMasterFunctions.)
| getPollDelay | Returns the poll delay time (Inherited from MbusMasterFunctions.)
| getRetryCnt | Returns the automatic retry count (Inherited from MbusMasterFunctions.)
| getSuccessCounter | Returns how often a message transfer was successful (Inherited from MbusMasterFunctions.)
| getTimeout | Returns the current time-out setting (Inherited from MbusMasterFunctions.)
| getTotalCounter | Returns how often a message transfer has been executed (Inherited from MbusMasterFunctions.)
| isOpen | Returns whether the protocol is open or not. (Inherited from MbusMasterFunctions.)
| maskWriteRegister | Modbus function 22 (16 hex), Mask Write Register. (Inherited from MbusMasterFunctions.)
| openProtocol | Opens a serial Modbus protocol and the associated serial port with the port parameters configured via properties (Inherited from MbusSerialClientBase.)
| openProtocol(String, Int32, Int32, Int32, Int32) | Opens a serial Modbus protocol and the associated serial port with the port parameters configured via properties (Inherited from MbusSerialClientBase.)
| readCoils(Int32, Int32, Boolean ) | Modbus function 1 (01 hex), Read Coil Status/Read Coils. (Inherited from MbusMasterFunctions.)
| readCoils(Int32, Int32, Boolean , Int32) | Modbus function 1 (01 hex), Read Coil Status/Read Coils. (Inherited from MbusMasterFunctions.)
| readDeviceIdentification | Modbus function 43 (hex 2B) subfunction 14 (hex 0E), Read Device Identification (Inherited from MbusMasterFunctions.)
| readExceptionStatus | Modbus function 7 (07 hex), Read Exception Status. (Inherited from MbusMasterFunctions.)
| readFileRecord(Int32, MbusMasterFunctions FileSubRequest ) | Modbus function 20, Read File Record. (Inherited from MbusMasterFunctions.)
| readFileRecord(Int32, Int32, Int32, Int32, Int16 ) | Modbus function 20, Read File Record. (Inherited from MbusMasterFunctions.)
| readInputDiscretes(Int32, Int32, Boolean ) | Modbus function 2 (02 hex), Read Inputs Status/Read Input Discretes. (Inherited from MbusMasterFunctions.)
| readInputDiscretes(Int32, Int32, Boolean , Int32) | Modbus function 2 (02 hex), Read Inputs Status/Read Input Discretes. (Inherited from MbusMasterFunctions.)
| readInputMod10000(Int32, Int32, Int32 ) | Modbus function 4 (04 hex) for 32-bit modulo-10000 long int data types, Read Input Registers as modulo-10000 long int data. (Inherited from MbusMasterFunctions.)
| readInputMod10000(Int32, Int32, Int32 , Int32) | Modbus function 4 (04 hex) for 32-bit modulo-10000 long int data types, Read Input Registers as modulo-10000 long int data. (Inherited from MbusMasterFunctions.)
| readInputRegisters(Int32, Int32, Array) | Modbus function 4 (04 hex), Read Input Registers (16-bit, 32-bit, 64-bit and floating point single and double). (Inherited from MbusMasterFunctions.)
| readInputRegisters(Int32, Int32, Array, Int32) | Modbus function 4 (04 hex), Read Input Registers (16-bit, 32-bit, 64-bit and floating point single and double). (Inherited from MbusMasterFunctions.)
| readMultipleMod10000(Int32, Int32, Int32 ) | Modbus function 3 (03 hex) for 32-bit modulo-10000 long int data types, Read Holding Registers/Read Multiple Registers as modulo-10000 long int data. (Inherited from MbusMasterFunctions.)
| readMultipleMod10000(Int32, Int32, Int32 , Int32) | Modbus function 3 (03 hex) for 32-bit modulo-10000 long int data types, Read Holding Registers/Read Multiple Registers as modulo-10000 long int data. (Inherited from MbusMasterFunctions.)
| readMultipleRegisters(Int32, Int32, Array) | Modbus function 3 (03 hex), Read Holding Registers (16-bit, 32-bit, 64-bit and floating point single and double). (Inherited from MbusMasterFunctions.)
| readMultipleRegisters(Int32, Int32, Array, Int32) | Modbus function 3 (03 hex), Read Holding Registers (16-bit, 32-bit, 64-bit and floating point single and double). (Inherited from MbusMasterFunctions.)
| readWriteRegisters(Int32, Int32, Int16 , Int32, Int16 ) | Modbus function 23 (17 hex), Read/Write Registers. (Inherited from MbusMasterFunctions.)
| readWriteRegisters(Int32, Int32, Int16 , Int32, Int32, Int16 , Int32) | Modbus function 23 (17 hex), Read/Write Registers. (Inherited from MbusMasterFunctions.)
| resetSuccessCounter | Resets successful message transfer counter (Inherited from MbusMasterFunctions.)
| resetTotalCounter | Resets total message transfer counter (Inherited from MbusMasterFunctions.)
| restartCommunicationsOption | Modbus function code 8, sub-function 01, Restart Communications Option (Inherited from MbusMasterFunctions.)
| returnQueryData | Modbus function code 8, sub-function 00, Return Query Data. (Inherited from MbusMasterFunctions.)
| setPollDelay | Poll delay property (Inherited from MbusMasterFunctions.)
| setRetryCnt | Configures the automatic retry setting (Inherited from MbusMasterFunctions.)
| setTimeout | Configures time-out (Inherited from MbusMasterFunctions.)
| writeCoil | Modbus function 5 (05 hex), Force Single Coil/Write Coil. (Inherited from MbusMasterFunctions.)
| writeFileRecord(Int32, MbusMasterFunctions FileSubRequest ) | Modbus function 21, Write File Record. (Inherited from MbusMasterFunctions.)
| writeFileRecord(Int32, Int32, Int32, Int32, Int16 ) | Modbus function 21, Write File Record. (Inherited from MbusMasterFunctions.)
| writeMultipleMod10000(Int32, Int32, Int32 ) | Modbus function 16 (10 hex) for 32-bit modulo-10000 long int data types, Preset Multiple Registers/Write Multiple Registers with modulo-10000 long int data. (Inherited from MbusMasterFunctions.)
| writeMultipleMod10000(Int32, Int32, Int32 , Int32) | Modbus function 16 (10 hex) for 32-bit modulo-10000 long int data types, Preset Multiple Registers/Write Multiple Registers with modulo-10000 long int data. (Inherited from MbusMasterFunctions.)
| writeMultipleRegisters(Int32, Int32, Array) | Modbus function 16 (10 hex), Write Multiple Registers (16-bit, 32-bit, 64-bit and floating point single and double). (Inherited from MbusMasterFunctions.)
| writeMultipleRegisters(Int32, Int32, Array, Int32) | Modbus function 16 (10 hex), Write Multiple Registers (16-bit, 32-bit, 64-bit and floating point single and double). (Inherited from MbusMasterFunctions.)
| writeSingleRegister(Int32, Int32, Int16) | Modbus function 6 (06 hex), Preset Single Register/Write Single Register. (Inherited from MbusMasterFunctions.)
| writeSingleRegister(Int32, Int32, UInt16) | Modbus function 6 (06 hex), Preset Single Register/Write Single Register. (Inherited from MbusMasterFunctions.)

Top
Remarks
This class realizes the Modbus RTU master protocol. It provides functions to open and to close serial port as well as data and control functions which can be used at any time after the protocol has been opened. The data and control functions are organized into different conformance classes.

It is possible to instantiate multiple instances of this class for establishing multiple connections on different serial ports (They should be executed in separate threads).

See Also

#### Reference

FieldTalk.Modbus.Master Namespace

#### Other Resources

Data and Control Functions for all Modbus Protocol Flavours
Serial Protocols
FieldTalk Modbus Master Library for .NET
Library version 2.15.2