Documentation ¶
Index ¶
- Constants
- func NewModbusPlcTagFromStrings(tagType TagType, addressString string, quantityString string, ...) (apiModel.PlcTag, error)
- func NewTag(tagType TagType, address uint16, quantity uint16, ...) apiModel.PlcTag
- type AsciiDriver
- type Connection
- func (c *Connection) GetConnection() plc4go.PlcConnection
- func (c *Connection) GetConnectionId() string
- func (c *Connection) GetMessageCodec() spi.MessageCodec
- func (c *Connection) GetMetadata() apiModel.PlcConnectionMetadata
- func (c *Connection) GetTracer() tracer.Tracer
- func (c *Connection) IsTraceEnabled() bool
- func (c *Connection) Ping() <-chan plc4go.PlcConnectionPingResult
- func (c *Connection) ReadRequestBuilder() apiModel.PlcReadRequestBuilder
- func (c *Connection) String() string
- func (c *Connection) WriteRequestBuilder() apiModel.PlcWriteRequestBuilder
- type MessageCodec
- func (m *MessageCodec) GetCodec() spi.MessageCodec
- func (m *MessageCodec) Receive() (spi.Message, error)
- func (m *MessageCodec) Send(message spi.Message) error
- func (d *MessageCodec) Serialize() ([]byte, error)
- func (d *MessageCodec) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (d *MessageCodec) String() string
- type Reader
- type RtuDriver
- type TagHandler
- type TagType
- type TcpDriver
- type ValueHandler
- type Writer
Constants ¶
View Source
const (
AddressOffset = 1
)
Variables ¶
This section is empty.
Functions ¶
func NewModbusPlcTagFromStrings ¶
func NewModbusPlcTagFromStrings(tagType TagType, addressString string, quantityString string, datatype readWriteModel.ModbusDataType, _options ...options.WithOption) (apiModel.PlcTag, error)
func NewTag ¶
func NewTag(tagType TagType, address uint16, quantity uint16, datatype readWriteModel.ModbusDataType) apiModel.PlcTag
Types ¶
type AsciiDriver ¶
type AsciiDriver struct { _default.DefaultDriver // contains filtered or unexported fields }
func NewModbusAsciiDriver ¶
func NewModbusAsciiDriver(_options ...options.WithOption) *AsciiDriver
func (AsciiDriver) GetConnectionWithContext ¶
func (d AsciiDriver) GetConnectionWithContext(ctx context.Context, transportUrl url.URL, transports map[string]transports.Transport, driverOptions map[string][]string) <-chan plc4go.PlcConnectionConnectResult
type Connection ¶
type Connection struct { _default.DefaultConnection // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(unitIdentifier uint8, messageCodec spi.MessageCodec, connectionOptions map[string][]string, tagHandler spi.PlcTagHandler, _options ...options.WithOption) *Connection
func (*Connection) GetConnection ¶
func (c *Connection) GetConnection() plc4go.PlcConnection
func (*Connection) GetConnectionId ¶
func (c *Connection) GetConnectionId() string
func (*Connection) GetMessageCodec ¶
func (c *Connection) GetMessageCodec() spi.MessageCodec
func (*Connection) GetMetadata ¶
func (c *Connection) GetMetadata() apiModel.PlcConnectionMetadata
func (*Connection) GetTracer ¶
func (c *Connection) GetTracer() tracer.Tracer
func (*Connection) IsTraceEnabled ¶
func (c *Connection) IsTraceEnabled() bool
func (*Connection) Ping ¶
func (c *Connection) Ping() <-chan plc4go.PlcConnectionPingResult
func (*Connection) ReadRequestBuilder ¶
func (c *Connection) ReadRequestBuilder() apiModel.PlcReadRequestBuilder
func (*Connection) String ¶
func (c *Connection) String() string
func (*Connection) WriteRequestBuilder ¶
func (c *Connection) WriteRequestBuilder() apiModel.PlcWriteRequestBuilder
type MessageCodec ¶
type MessageCodec struct { _default.DefaultCodec // contains filtered or unexported fields }
func NewMessageCodec ¶
func NewMessageCodec(transportInstance transports.TransportInstance, _options ...options.WithOption) *MessageCodec
func (*MessageCodec) GetCodec ¶
func (m *MessageCodec) GetCodec() spi.MessageCodec
func (*MessageCodec) Serialize ¶
func (d *MessageCodec) Serialize() ([]byte, error)
func (*MessageCodec) SerializeWithWriteBuffer ¶
func (d *MessageCodec) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*MessageCodec) String ¶
func (d *MessageCodec) String() string
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReader ¶
func NewReader(unitIdentifier uint8, messageCodec spi.MessageCodec, _options ...options.WithOption) *Reader
func (*Reader) Read ¶
func (m *Reader) Read(ctx context.Context, readRequest apiModel.PlcReadRequest) <-chan apiModel.PlcReadRequestResult
func (*Reader) ToPlc4xReadResponse ¶
func (m *Reader) ToPlc4xReadResponse(responseAdu readWriteModel.ModbusTcpADU, readRequest apiModel.PlcReadRequest) (apiModel.PlcReadResponse, error)
type RtuDriver ¶
type RtuDriver struct { _default.DefaultDriver // contains filtered or unexported fields }
func NewModbusRtuDriver ¶
func NewModbusRtuDriver(_options ...options.WithOption) *RtuDriver
type TagHandler ¶
type TagHandler struct {
// contains filtered or unexported fields
}
func NewTagHandler ¶
func NewTagHandler(_options ...options.WithOption) TagHandler
func (TagHandler) ParseQuery ¶
func (m TagHandler) ParseQuery(query string) (apiModel.PlcQuery, error)
type TcpDriver ¶
type TcpDriver struct { _default.DefaultDriver // contains filtered or unexported fields }
func NewModbusTcpDriver ¶
func NewModbusTcpDriver(_options ...options.WithOption) *TcpDriver
type ValueHandler ¶
type ValueHandler struct {
spiValues.DefaultValueHandler
}
func NewValueHandler ¶
func NewValueHandler(_options ...options.WithOption) ValueHandler
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func NewWriter ¶
func NewWriter(unitIdentifier uint8, messageCodec spi.MessageCodec, _options ...options.WithOption) Writer
func (Writer) ToPlc4xWriteResponse ¶
func (m Writer) ToPlc4xWriteResponse(requestAdu readWriteModel.ModbusTcpADU, responseAdu readWriteModel.ModbusTcpADU, writeRequest apiModel.PlcWriteRequest) (apiModel.PlcWriteResponse, error)
func (Writer) Write ¶
func (m Writer) Write(ctx context.Context, writeRequest apiModel.PlcWriteRequest) <-chan apiModel.PlcWriteRequestResult
Click to show internal directories.
Click to hide internal directories.