eip

package
v0.0.0-...-369238d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSenderContext = "PLC4X   "
	EmptySessionHandle   = uint32(0)
	EmptyInterfaceHandle = uint32(0)
)
View Source
const (
	TAG       = "tag"
	DATA_TYPE = "dataType"
	ARRAY     = "array"
)
View Source
const EipUdpDiscoveryDefaultPort = 44818

EipUdpDiscoveryDefaultPort is the UDP port EIP/CIP devices listen on for ListIdentity broadcast discovery requests (mirrors plc4j's Constants.EIPUDPDISCOVERYDEFAULTPORT).

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(_options ...options.WithOption) plc4go.PlcDriver

func NewLogixDriver

func NewLogixDriver(_options ...options.WithOption) plc4go.PlcDriver

NewLogixDriver is a thin alias over the EIP driver that registers the "logix" protocol code and forces little-endian wire encoding - the Logix family always speaks LE on CIP, whereas generic EIP devices may go either way (mirror of plc4j's LogixDriver).

Types

type Configuration

type Configuration struct {
	// contains filtered or unexported fields
}

func ParseFromOptions

func ParseFromOptions(localLogger zerolog.Logger, options map[string][]string) (Configuration, error)

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) Close

func (c *Connection) Close() error

func (*Connection) Connect

func (c *Connection) Connect(ctx context.Context) error

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 Discoverer

type Discoverer struct {
	// contains filtered or unexported fields
}

func NewDiscoverer

func NewDiscoverer(_options ...options.WithOption) *Discoverer

func (*Discoverer) Close

func (d *Discoverer) Close() error

func (*Discoverer) Discover

func (d *Discoverer) Discover(ctx context.Context, callback func(event apiModel.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error

type Driver

type Driver struct {
	_default.DefaultDriver
	// contains filtered or unexported fields
}

func (*Driver) Close

func (d *Driver) Close() error

func (*Driver) Discover

func (d *Driver) Discover(ctx context.Context, callback func(event apiModel.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error

func (*Driver) GetConnection

func (d *Driver) GetConnection(ctx context.Context, transportUrl url.URL, transports map[string]transports.Transport, driverOptions map[string][]string) (plc4go.PlcConnection, error)

func (*Driver) SetAwaitDisconnectComplete

func (d *Driver) SetAwaitDisconnectComplete(awaitComplete bool)

func (*Driver) SetAwaitSetupComplete

func (d *Driver) SetAwaitSetupComplete(awaitComplete bool)

func (*Driver) SupportsDiscovery

func (d *Driver) SupportsDiscovery() bool

type DriverContext

type DriverContext struct {
	Backplane int8
	Slot      int8
	// 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, byteOrder binary.ByteOrder, _options ...options.WithOption) *MessageCodec

func (*MessageCodec) GetCodec

func (m *MessageCodec) GetCodec() spi.MessageCodec

func (*MessageCodec) Receive

func (m *MessageCodec) Receive(ctx context.Context) (spi.Message, error)

func (*MessageCodec) Send

func (m *MessageCodec) Send(ctx context.Context, interactionInfo string, message spi.Message) error

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 PlcTag

type PlcTag interface {
	apiModel.PlcTag
	utils.Serializable

	GetTag() string
	GetType() readWriteModel.CIPDataTypeCode
	GetElementNb() uint16
	// GetSelection reports what the address selects, which drives the CIP path and the element
	// count. It is not what GetArrayInfo reports - see there.
	GetSelection() []apiModel.ArrayInfo
}

func NewTag

func NewTag(tag string, _type readWriteModel.CIPDataTypeCode, elementNb uint16) PlcTag

NewTag builds a tag selecting elementNb elements from the start of tag, which is the shape the element-count form described. An address selecting a range is built with NewTagWithSelection.

func NewTagWithSelection

func NewTagWithSelection(tag string, _type readWriteModel.CIPDataTypeCode, selection []apiModel.ArrayInfo) PlcTag

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(messageCodec spi.MessageCodec, tm transactions.RequestTransactionManager, configuration Configuration, sessionState *SessionState, _options ...options.WithOption) *Reader

func (*Reader) Read

func (m *Reader) Read(ctx context.Context, readRequest apiModel.PlcReadRequest) <-chan apiModel.PlcReadRequestResult

type SessionState

type SessionState struct {
	// contains filtered or unexported fields
}

SessionState is the per-connection EIP/CIP session context shared between the Connection (which fills it during the handshake) and Reader/Writer (which pick the messaging mode and addressing from it).

func NewSessionState

func NewSessionState(log zerolog.Logger, configuration Configuration) *SessionState

type TagHandler

type TagHandler struct {
	// contains filtered or unexported fields
}

func NewTagHandler

func NewTagHandler() TagHandler

func (TagHandler) ParseQuery

func (m TagHandler) ParseQuery(query string) (apiModel.PlcQuery, error)

func (TagHandler) ParseTag

func (m TagHandler) ParseTag(tagAddress string) (apiModel.PlcTag, error)

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(messageCodec spi.MessageCodec, tm transactions.RequestTransactionManager, configuration Configuration, sessionState *SessionState, _options ...options.WithOption) *Writer

func (*Writer) Write

func (m *Writer) Write(ctx context.Context, writeRequest apiModel.PlcWriteRequest) <-chan apiModel.PlcWriteRequestResult

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL