go_cip

package module
v0.0.0-...-345a570 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 8 Imported by: 0

README

go-cip

If u can read source code, please diy otherwise u need wait for one week. building!

Documentation

Index

Constants

View Source
const ReplyTooLarge typedef.Usint = 0x06
View Source
const ServiceReadFragmentedTag = 0x52
View Source
const ServiceReadTag = 0x4c
View Source
const ServiceWriteTag = 0x4d

Variables

View Source
var TypeMap map[DataType]reflect.Kind

Functions

func DataBuild

func DataBuild(tp DataTypes, data []byte, padded bool) []byte

func LogicalBuild

func LogicalBuild(tp LogicalType, address uint32, padded bool) []byte

func Paths

func Paths(arg ...[]byte) []byte

func PortBuild

func PortBuild(link []byte, portID uint16, padded bool) []byte

Types

type Controller

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

func NewControllerFromClient

func NewControllerFromClient(device *eip.Device, slot uint8) *Controller

func NewControllerFromIP

func NewControllerFromIP(addr string, slot uint8, config *eip.Config) (*Controller, error)

func (*Controller) AllTags

func (c *Controller) AllTags() (TagMap, error)

func (*Controller) GetAttributeAll

func (c *Controller) GetAttributeAll() error

func (*Controller) SetTimeout

func (c *Controller) SetTimeout(timeTicks typedef.Usint, timeoutTicks typedef.Usint)

func (*Controller) UCMM

type DataType

type DataType uint16
const (
	NULL   DataType = 0x00
	BOOL   DataType = 0xc1
	SINT   DataType = 0xc2
	INT    DataType = 0xc3
	DINT   DataType = 0xc4
	LINT   DataType = 0xc5
	USINT  DataType = 0xc6
	UINT   DataType = 0xc7
	UDINT  DataType = 0xc8
	ULINT  DataType = 0xc9
	REAL   DataType = 0xca
	LREAL  DataType = 0xcb
	STRING DataType = 0xfce
)

func (DataType) GetDims

func (n DataType) GetDims() uint8

func (DataType) String

func (n DataType) String() string

type DataTypes

type DataTypes typedef.Usint
const (
	DataTypeSimple DataTypes = 0x0
	DataTypeANSI   DataTypes = 0x11
)

type LogicalType

type LogicalType typedef.Usint
const (
	LogicalTypeClassID     LogicalType = 0 << 2
	LogicalTypeInstanceID  LogicalType = 1 << 2
	LogicalTypeMemberID    LogicalType = 2 << 2
	LogicalTypeConnPoint   LogicalType = 3 << 2
	LogicalTypeAttributeID LogicalType = 4 << 2
	LogicalTypeSpecial     LogicalType = 5 << 2
	LogicalTypeServiceID   LogicalType = 6 << 2
)

type SegmentType

type SegmentType typedef.Usint
const (
	SegmentTypePort      SegmentType = 0 << 5
	SegmentTypeLogical   SegmentType = 1 << 5
	SegmentTypeNetwork   SegmentType = 2 << 5
	SegmentTypeSymbolic  SegmentType = 3 << 5
	SegmentTypeData      SegmentType = 4 << 5
	SegmentTypeDataType1 SegmentType = 5 << 5
	SegmentTypeDataType2 SegmentType = 6 << 5
)

type Tag

type Tag struct {
	InstanceID uint32

	Name string
	Type DataType

	Onchange func()
	// contains filtered or unexported fields
}

func (*Tag) Read

func (t *Tag) Read() error

func (*Tag) ReadParser

func (t *Tag) ReadParser(buf *bytes.Buffer)

func (*Tag) Value

func (t *Tag) Value() interface{}

func (*Tag) Write

func (t *Tag) Write() error

type TagMap

type TagMap map[string]*Tag

type UnConnectedSend

type UnConnectedSend struct {
	TimeTick           typedef.Usint
	TimeOutTicks       typedef.Usint
	MessageRequestSize typedef.Uint
	MessageRequest     *eip.MessageRouterRequest
	Pad                typedef.Usint
	RouterPathSize     typedef.Usint
	Reserved           typedef.Usint
	RouterPath         []byte
}

func (*UnConnectedSend) Encode

func (u *UnConnectedSend) Encode() []byte

Jump to

Keyboard shortcuts

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