ModbusFrameCreator
Class Definition
ModbusFrameCreator gives static methods for creating frames deticated to Modbus protocole.
public class ModbusFrameCreator;
Methods
CreateFrame(int unitId, int functionId, params int[] dataForFunction)
Return type: byte[]
Create frame with given unit id of slave, function code, and data which is needed to givnen function.
ReadingPDU(int startAddress, int range, int functionCode)
Return type: byte[]
Create protocole data unit for reading functions of Modbus.
SingleWritingPDU(int address, int value, int functionCode)
Return type: byte[]
Create protocole data unit for writing one value on specific address.
MultipleWritingPDU(int startAddress, int range, int functionCode, int[] values)
Return type: byte[]
Create protocole data unit for writing multiple values with range, starting on specific address.
CreateMBAPHeader(int unitId, int dataLength)
Return type: byte[]
Create Modbus TCP protocol header called MBAP.
MakeModbusBytesConvention(int value)
Return type: byte[]
Correct reading bytes order in Modbus protocole.