Documentation ¶
Index ¶
- Constants
- func NewDriver(_options ...options.WithOption) plc4go.PlcDriver
- type Configuration
- type Connection
- func (c *Connection) ConnectWithContext(ctx context.Context) <-chan plc4go.PlcConnectionConnectResult
- 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) ReadRequestBuilder() apiModel.PlcReadRequestBuilder
- func (c *Connection) String() string
- func (c *Connection) WriteRequestBuilder() apiModel.PlcWriteRequestBuilder
- type ControllerType
- type Driver
- type DriverContext
- 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 PlcStringTag
- func (m PlcStringTag) GetAddressString() string
- func (m PlcStringTag) GetArrayInfo() []apiModel.ArrayInfo
- func (m PlcStringTag) GetBitOffset() uint8
- func (m PlcStringTag) GetBlockNumber() uint16
- func (m PlcStringTag) GetByteOffset() uint16
- func (m PlcStringTag) GetDataType() readWriteModel.TransportSize
- func (m PlcStringTag) GetMemoryArea() readWriteModel.MemoryArea
- func (m PlcStringTag) GetNumElements() uint16
- func (m PlcStringTag) GetQuantity() uint16
- func (m PlcStringTag) GetValueType() apiValues.PlcValueType
- func (m PlcStringTag) Serialize() ([]byte, error)
- func (m PlcStringTag) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (m PlcStringTag) String() string
- type PlcTag
- type Reader
- type TagHandler
- type TagType
- type TpduGenerator
- type ValueHandler
- type Writer
Constants ¶
View Source
const ( ControllerType_UNKNOWN = -0x1 ControllerType_ANY = 0x0 ControllerType_S7_200 = 0x5 ControllerType_S7_300 = 0x1 ControllerType_S7_400 = 0x2 ControllerType_S7_1200 = 0x3 ControllerType_S7_1500 = 0x4 ControllerType_LOGO = 0x5 )
View Source
const ( DATA_TYPE = "dataType" STRING_LENGTH = "stringLength" TRANSFER_SIZE_CODE = "transferSizeCode" BLOCK_NUMBER = "blockNumber" BYTE_OFFSET = "byteOffset" BIT_OFFSET = "bitOffset" NUM_ELEMENTS = "numElements" MEMORY_AREA = "memoryArea" )
Variables ¶
This section is empty.
Functions ¶
func NewDriver ¶
func NewDriver(_options ...options.WithOption) plc4go.PlcDriver
Types ¶
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
func ParseFromOptions ¶
type Connection ¶
type Connection struct { _default.DefaultConnection // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(messageCodec spi.MessageCodec, configuration Configuration, driverContext DriverContext, tagHandler spi.PlcTagHandler, tm transactions.RequestTransactionManager, connectionOptions map[string][]string, _options ...options.WithOption) *Connection
func (*Connection) ConnectWithContext ¶
func (c *Connection) ConnectWithContext(ctx context.Context) <-chan plc4go.PlcConnectionConnectResult
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) 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 ControllerType ¶
type ControllerType int
type Driver ¶
type Driver struct { _default.DefaultDriver // contains filtered or unexported fields }
func (*Driver) GetConnectionWithContext ¶
func (*Driver) SetAwaitDisconnectComplete ¶
func (*Driver) SetAwaitSetupComplete ¶
type DriverContext ¶
type DriverContext struct { PassiveMode bool CallingTsapId uint16 CalledTsapId uint16 CotpTpduSize model.COTPTpduSize PduSize uint16 MaxAmqCaller uint16 MaxAmqCallee uint16 ControllerType ControllerType // contains filtered or unexported fields }
func NewDriverContext ¶
func NewDriverContext(configuration Configuration) (DriverContext, error)
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 PlcStringTag ¶
type PlcStringTag struct {
// contains filtered or unexported fields
}
func NewStringTag ¶
func NewStringTag(memoryArea readWriteModel.MemoryArea, blockNumber uint16, byteOffset uint16, bitOffset uint8, numElements uint16, stringLength uint16, datatype readWriteModel.TransportSize) PlcStringTag
func (PlcStringTag) GetAddressString ¶
func (m PlcStringTag) GetAddressString() string
func (PlcStringTag) GetArrayInfo ¶
func (PlcStringTag) GetBitOffset ¶
func (m PlcStringTag) GetBitOffset() uint8
func (PlcStringTag) GetBlockNumber ¶
func (m PlcStringTag) GetBlockNumber() uint16
func (PlcStringTag) GetByteOffset ¶
func (m PlcStringTag) GetByteOffset() uint16
func (PlcStringTag) GetDataType ¶
func (m PlcStringTag) GetDataType() readWriteModel.TransportSize
func (PlcStringTag) GetMemoryArea ¶
func (m PlcStringTag) GetMemoryArea() readWriteModel.MemoryArea
func (PlcStringTag) GetNumElements ¶
func (m PlcStringTag) GetNumElements() uint16
func (PlcStringTag) GetQuantity ¶
func (m PlcStringTag) GetQuantity() uint16
func (PlcStringTag) GetValueType ¶
func (m PlcStringTag) GetValueType() apiValues.PlcValueType
func (PlcStringTag) Serialize ¶
func (m PlcStringTag) Serialize() ([]byte, error)
func (PlcStringTag) SerializeWithWriteBuffer ¶
func (m PlcStringTag) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (PlcStringTag) String ¶
func (m PlcStringTag) String() string
type PlcTag ¶
type PlcTag interface { apiModel.PlcTag utils.Serializable GetDataType() readWriteModel.TransportSize GetNumElements() uint16 GetBlockNumber() uint16 GetMemoryArea() readWriteModel.MemoryArea GetByteOffset() uint16 GetBitOffset() uint8 }
func NewTag ¶
func NewTag(memoryArea readWriteModel.MemoryArea, blockNumber uint16, byteOffset uint16, bitOffset uint8, numElements uint16, datatype readWriteModel.TransportSize) PlcTag
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReader ¶
func NewReader(tpduGenerator *TpduGenerator, messageCodec spi.MessageCodec, tm transactions.RequestTransactionManager, _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(response readWriteModel.S7Message, readRequest apiModel.PlcReadRequest) (apiModel.PlcReadResponse, error)
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 TpduGenerator ¶
type TpduGenerator struct {
// contains filtered or unexported fields
}
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(tpduGenerator *TpduGenerator, messageCodec spi.MessageCodec, tm transactions.RequestTransactionManager, _options ...options.WithOption) Writer
func (Writer) ToPlc4xWriteResponse ¶
func (m Writer) ToPlc4xWriteResponse(response readWriteModel.S7Message, 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.