Documentation ¶
Index ¶
- Constants
- type Address
- type Boolean
- type Byte
- type Float32
- type Float64
- type Modbus
- func (m *Modbus) Connect() error
- func (m *Modbus) Disconnect() error
- func (m *Modbus) GetError() error
- func (m *Modbus) IsError() bool
- func (m *Modbus) Read(address Address, quantity Quantity, valueType string) string
- func (m *Modbus) Read16Bit(address Address, quantity Quantity, regType modbus.RegType) U16Bit
- func (m *Modbus) Read16BitHolding(address Address, quantity Quantity) U16Bit
- func (m *Modbus) Read16BitInput(address Address, quantity Quantity) U16Bit
- func (m *Modbus) Read32Bit(address Address, quantity Quantity, regType modbus.RegType) U32Bit
- func (m *Modbus) Read32BitHolding(address Address, quantity Quantity) U32Bit
- func (m *Modbus) Read32BitInput(address Address, quantity Quantity) U32Bit
- func (m *Modbus) Read64Bit(address Address, quantity Quantity, regType modbus.RegType) U64Bit
- func (m *Modbus) Read64BitHolding(address Address, quantity Quantity) U64Bit
- func (m *Modbus) Read64BitInput(address Address, quantity Quantity) U64Bit
- func (m *Modbus) ReadBool(address Address, quantity Quantity) Boolean
- func (m *Modbus) ReadByte(address Address, quantity Quantity, regType modbus.RegType) Byte
- func (m *Modbus) ReadByteHolding(address Address, quantity Quantity) Byte
- func (m *Modbus) ReadByteInput(address Address, quantity Quantity) Byte
- func (m *Modbus) ReadDiscreteInput(address Address, quantity Quantity) Boolean
- func (m *Modbus) ReadFloat32(address Address, quantity Quantity, regType modbus.RegType) Float32
- func (m *Modbus) ReadFloat32Holding(address Address, quantity Quantity) Float32
- func (m *Modbus) ReadFloat32Input(address Address, quantity Quantity) Float32
- func (m *Modbus) ReadFloat64(address Address, quantity Quantity, regType modbus.RegType) Float64
- func (m *Modbus) ReadFloat64Holding(address Address, quantity Quantity) Float64
- func (m *Modbus) ReadFloat64Input(address Address, quantity Quantity) Float64
- func (m *Modbus) ReadHolding(address Address, quantity Quantity, valueType string) string
- func (m *Modbus) SetAuth(username string, password string) error
- func (m *Modbus) SetBigEndian()
- func (m *Modbus) SetHighWordFirst()
- func (m *Modbus) SetLittleEndian()
- func (m *Modbus) SetLog(log cmdLog.Log)
- func (m *Modbus) SetLowWordFirst()
- type Quantity
- type U16Bit
- type U32Bit
- type U64Bit
- type Value
Constants ¶
View Source
const ( TypeSigned8Bit = "S8" TypeSigned16Bit = "S16" TypeSigned32Bit = "S32" TypeSigned64Bit = "S64" TypeUnsigned8Bit = "U8" TypeUnsigned16Bit = "U16" TypeUnsigned32Bit = "U32" TypeUnsigned64Bit = "U64" TypeFloat32Bit = "F32" TypeFloat64Bit = "F64" TypeString = "UTF-8" )
View Source
const (
DefaultPort = "502"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Modbus ¶
type Modbus struct { ClientId string `json:"client_id"` Username string `json:"username"` Password string `json:"password"` Host string `json:"host"` Port string `json:"port"` Timeout time.Duration `json:"timeout"` ServerCert string `json:"server_cert"` ClientCert string `json:"client_cert"` ClientKey string `json:"client_key"` LogLevel string `json:"log_level"` // contains filtered or unexported fields }
func (*Modbus) Disconnect ¶
func (*Modbus) Read16BitHolding ¶
func (*Modbus) Read16BitInput ¶
func (*Modbus) Read32BitHolding ¶
func (*Modbus) Read32BitInput ¶
func (*Modbus) Read64BitHolding ¶
func (*Modbus) Read64BitInput ¶
func (*Modbus) ReadByteHolding ¶
func (*Modbus) ReadByteInput ¶
func (*Modbus) ReadDiscreteInput ¶
func (*Modbus) ReadFloat32 ¶
func (*Modbus) ReadFloat32Holding ¶
func (*Modbus) ReadFloat32Input ¶
func (*Modbus) ReadFloat64 ¶
func (*Modbus) ReadFloat64Holding ¶
func (*Modbus) ReadFloat64Input ¶
func (*Modbus) ReadHolding ¶
func (*Modbus) SetBigEndian ¶
func (m *Modbus) SetBigEndian()
func (*Modbus) SetHighWordFirst ¶
func (m *Modbus) SetHighWordFirst()
func (*Modbus) SetLittleEndian ¶
func (m *Modbus) SetLittleEndian()
func (*Modbus) SetLowWordFirst ¶
func (m *Modbus) SetLowWordFirst()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.