package
0.0.5
Repository: https://github.com/bleethnie/go-driver.git
Documentation: pkg.go.dev

# Functions

BytesToUint16 converts a big endian array of bytes to an array of unit16s.
GetException retunrns the Modbus exception or Success (indicating not exception).
NewClient creates a new modbus client with given backend handler.
NewClient2 creates a new modbus client with given backend packager and transporter.
NewRTUFrame converts a packet to a Modbus TCP frame.
NewServer creates a new Modbus server (slave).
NewTCPClientHandler allocates a new TCPClientHandler.
NewTCPFrame converts a packet to a Modbus TCP frame.
ReadCoils function 1, reads coils from internal memory.
ReadDiscreteInputs function 2, reads discrete inputs from internal memory.
ReadHoldingRegisters function 3, reads holding registers from internal memory.
ReadInputRegisters function 4, reads input registers from internal memory.
RegisterAddressAndNumber from Frame to register address and number.
No description provided by the author
SetDataWithRegisterAndNumber sets the RTUFrame Data byte field to hold a register and number of registers.
SetDataWithRegisterAndNumberAndBytes sets the TCPFrame Data byte field to hold a register and number of registers and coil bytes.
SetDataWithRegisterAndNumberAndValues sets the TCPFrame Data byte field to hold a register and number of registers and values.
TCPClient creates TCP client with default handler and given connect string.
Uint16ToBytes converts an array of uint16s to a big endian array of bytes.
WithCoils sets the Coils data for the Server.
WithDiscreteInputs sets the DiscreteInputs data for the Server.
WithHoldingRegisters sets the HoldingRegisters data for the Server.
WithInputRegisters sets the InputRegisters data for the Server.
WithLogger sets the logger for the Server.
WithRegisterFunction registers a custom function handler for a specific function code.
WriteHoldingRegister function 6, write a holding register to internal memory.
WriteHoldingRegisters function 16, writes holding registers to internal memory.
WriteMultipleCoils function 15, writes holding registers to internal memory.
WriteSingleCoil function 5, write a coil to internal memory.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Bit access.
No description provided by the author
No description provided by the author
16-bit access.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

AcknowledgeSlave has accepted request and is processing it, but a long duration of time is required.
GatewayPathUnavailable Specialized for Modbus gateways.
GatewayTargetDeviceFailedtoRespond Specialized for Modbus gateways.
IllegalDataAddress data address of some or all the required entities are not allowed or do not exist in slave.
IllegalDataValue value is not accepted by slave.
IllegalFunction function code received in the query is not recognized or allowed by slave.
MemoryParityError Slave detected a parity error in memory.
NegativeAcknowledge Slave cannot perform the programming functions.
SlaveDeviceBusy is engaged in processing a long-duration command.
SlaveDeviceFailure Unrecoverable error occurred while slave was attempting to perform requested action.
Success operation successful.

# Structs

ModbusError implements error interface.
ProtocolDataUnit (PDU) is independent of underlying communication layers.
Request contains the connection and Modbus frame.
RTUFrame is the Modbus TCP frame.
Server is a Modbus slave with allocated memory for discrete inputs, coils, etc.
TCPClientHandler implements Packager and Transporter interface.
TCPFrame is the Modbus TCP frame.

# Interfaces

No description provided by the author
ClientHandler is the interface that groups the Packager and Transporter methods.
Framer is the interface that wraps Modbus frames.
Packager specifies the communication layer.
Transporter specifies the transport layer.

# Type aliases

Exception codes.
OptionFunc is a function type used to configure options for the Server.