EasyModbus
Implements a ModbusClient.
Constructor which determines the Master ip-address and the Master Port.
IP-Address of the Master device
Listening port of the Master device (should be 502)
Constructor which determines the Serial-Port
Serial-Port Name e.G. "COM1"
Parameterless constructor
Establish connection to Master device in case of Modbus TCP. Opens COM-Port in case of Modbus RTU
Establish connection to Master device in case of Modbus TCP.
Converts two ModbusRegisters to Float - Example: EasyModbus.ModbusClient.ConvertRegistersToFloat(modbusClient.ReadHoldingRegisters(19,2))
Two Register values received from Modbus
Connected float value
Converts two ModbusRegisters to Float, Registers can by swapped
Two Register values received from Modbus
Desired Word Order (Low Register first or High Register first
Connected float value
Converts two ModbusRegisters to 32 Bit Integer value
Two Register values received from Modbus
Connected 32 Bit Integer value
Converts two ModbusRegisters to 32 Bit Integer Value - Registers can be swapped
Two Register values received from Modbus
Desired Word Order (Low Register first or High Register first
Connecteds 32 Bit Integer value
Convert four 16 Bit Registers to 64 Bit Integer value Register Order "LowHigh": Reg0: Low Word.....Reg3: High Word, "HighLow": Reg0: High Word.....Reg3: Low Word
four Register values received from Modbus
64 bit value
Convert four 16 Bit Registers to 64 Bit Integer value - Registers can be swapped
four Register values received from Modbus
Desired Word Order (Low Register first or High Register first
Connected 64 Bit Integer value
Convert four 16 Bit Registers to 64 Bit double prec. value Register Order "LowHigh": Reg0: Low Word.....Reg3: High Word, "HighLow": Reg0: High Word.....Reg3: Low Word
four Register values received from Modbus
64 bit value
Convert four 16 Bit Registers to 64 Bit double prec. value - Registers can be swapped
four Register values received from Modbus
Desired Word Order (Low Register first or High Register first
Connected double prec. float value
Converts float to two ModbusRegisters - Example: modbusClient.WriteMultipleRegisters(24, EasyModbus.ModbusClient.ConvertFloatToTwoRegisters((float)1.22));
Float value which has to be converted into two registers
Register values
Converts float to two ModbusRegisters Registers - Registers can be swapped
Float value which has to be converted into two registers
Desired Word Order (Low Register first or High Register first
Register values
Converts 32 Bit Value to two ModbusRegisters
Int value which has to be converted into two registers
Register values
Converts 32 Bit Value to two ModbusRegisters Registers - Registers can be swapped
Double value which has to be converted into two registers
Desired Word Order (Low Register first or High Register first
Register values
Converts 64 Bit Value to four ModbusRegisters
long value which has to be converted into four registers
Register values
Converts 64 Bit Value to four ModbusRegisters - Registers can be swapped
long value which has to be converted into four registers
Desired Word Order (Low Register first or High Register first
Register values
Converts 64 Bit double prec Value to four ModbusRegisters
double value which has to be converted into four registers
Register values
Converts 64 Bit double prec. Value to four ModbusRegisters - Registers can be swapped
double value which has to be converted into four registers
Desired Word Order (Low Register first or High Register first
Register values
Converts 16 - Bit Register values to String
Register array received via Modbus
First Register containing the String to convert
number of characters in String (must be even)
Converted String
Converts a String to 16 - Bit Registers
Register array received via Modbus
Converted String
Calculates the CRC16 for Modbus-RTU
Byte buffer to send
Number of bytes to calculate CRC
First byte in buffer to start calculating CRC
Read Discrete Inputs from Server device (FC2).
First discrete input to read
Number of discrete Inputs to read
Boolean Array which contains the discrete Inputs
Read Coils from Server device (FC1).
First coil to read
Numer of coils to read
Boolean Array which contains the coils
Read Holding Registers from Master device (FC3).
First holding register to be read
Number of holding registers to be read
Int Array which contains the holding registers
Read Input Registers from Master device (FC4).
First input register to be read
Number of input registers to be read
Int Array which contains the input registers
Write single Coil to Master device (FC5).
Coil to be written
Coil Value to be written
Write single Register to Master device (FC6).
Register to be written
Register Value to be written
Write multiple coils to Master device (FC15).
First coil to be written
Coil Values to be written
Write multiple registers to Master device (FC16).
First register to be written
register Values to be written
Read/Write Multiple Registers (FC23).
First input register to read
Number of input registers to read
First input register to write
Values to write
Int Array which contains the Holding registers
Close connection to Master Device.
Destructor - Close connection to Master Device.
Returns "TRUE" if Client is connected to Server and "FALSE" if not. In case of Modbus RTU returns if COM-Port is opened
Gets or Sets the IP-Address of the Server.
Gets or Sets the Port were the Modbus-TCP Server is reachable (Standard is 502).
Gets or Sets the UDP-Flag to activate Modbus UDP.
Gets or Sets the Unit identifier in case of serial connection (Default = 0)
Gets or Sets the Baudrate for serial connection (Default = 9600)
Gets or Sets the of Parity in case of serial connection
Gets or Sets the number of stopbits in case of serial connection
Gets or Sets the connection Timeout in case of ModbusTCP connection
Gets or Sets the serial Port
Gets or Sets the Filename for the LogFile
Exception to be thrown if serial port is not opened
Exception to be thrown if Connection to Modbus device failed
Exception to be thrown if Modbus Server returns error code "Function code not supported"
Exception to be thrown if Modbus Server returns error code "quantity invalid"
Exception to be thrown if Modbus Server returns error code "starting adddress and quantity invalid"
Exception to be thrown if Modbus Server returns error code "Function Code not executed (0x04)"
Exception to be thrown if CRC Check failed
Modbus Protocol informations.
When making a server TCP listen socket, will listen to this IP address.
Listen to all network interfaces.
TCP port to listen
Listen to a specific network interface.
IP address of network interface to listen
TCP port to listen
Modbus TCP Server.
When creating a TCP or UDP socket, the local IP address to attach to.
Gets or Sets the Filename for the LogFile
Store Log-Data in a File
Private constructor; Ensures the access of the class only via "instance"
Returns the instance of the class (singleton)
instance (Singleton)
Store message in Log-File
Message to append to the Log-File
Store message in Log-File including Timestamp
Message to append to the Log-File
Timestamp to add to the same Row
Gets or Sets the Filename to Store Strings in a File