omron

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Codes = []protocol.Code{
	{"D", "DM Area"},
	{"C", "CIO Area"},
	{"W", "Work Area"},
	{"H", "Holding Bit Area"},
	{"A", "Auxiliary Bit Area"},
}
View Source
var DescHostlink = protocol.Protocol{
	Name:    "OmronHostlink",
	Version: "1.0",
	Label:   "Omron Hostlink",
	Codes:   Codes,
	Factory: NewHostLink,
}
View Source
var DescTCP = protocol.Protocol{
	Name:    "OmronFinsTCP",
	Version: "1.0",
	Label:   "Omron FINS TCP",
	Codes:   Codes,
	Factory: NewFinsTCP,
}
View Source
var DescUDP = protocol.Protocol{
	Name:    "OmronFinsUDP",
	Version: "1.0",
	Label:   "Omron FINS UDP",
	Codes:   Codes,
	Factory: NewFinsUDP,
}

Functions

func NewFinsTCP added in v1.0.2

func NewFinsTCP(link connect.Link, opts protocol.Options) protocol.Adapter

func NewFinsUDP added in v1.0.2

func NewFinsUDP(link connect.Link, opts protocol.Options) protocol.Adapter
func NewHostLink(link connect.Link, opts protocol.Options) protocol.Adapter

func ParseAddress

func ParseAddress(addr string) (protocol.Addr, error)

Types

type Address

type Address struct {
	Code   byte
	Offset uint16
	Bits   uint8
	IsBit  bool
}

func (*Address) Diff added in v1.0.2

func (a *Address) Diff(base protocol.Addr) int

func (*Address) String added in v1.0.2

func (a *Address) String() string

type Command

type Command struct {
	BitCode  byte
	WordCode byte
}

type Fins

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

func (*Fins) Address added in v1.0.2

func (f *Fins) Address(addr string) (protocol.Addr, error)

func (*Fins) Handshake

func (f *Fins) Handshake() error

func (*Fins) Immediate added in v1.0.2

func (f *Fins) Immediate(station int, addr protocol.Addr, size int) ([]byte, error)

func (*Fins) Read

func (f *Fins) Read(station int, address protocol.Addr, size int) ([]byte, error)

func (*Fins) Write

func (f *Fins) Write(station int, address protocol.Addr, values []byte) error
type FinsHostLink struct {
	// contains filtered or unexported fields
}

func (*FinsHostLink) Address added in v1.0.2

func (f *FinsHostLink) Address(addr string) (protocol.Addr, error)

func (*FinsHostLink) Immediate added in v1.0.2

func (f *FinsHostLink) Immediate(station int, addr protocol.Addr, size int) ([]byte, error)

func (*FinsHostLink) Read

func (f *FinsHostLink) Read(station int, address protocol.Addr, size int) ([]byte, error)

func (*FinsHostLink) Write

func (f *FinsHostLink) Write(station int, address protocol.Addr, values []byte) error

type FinsUdp

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

func (*FinsUdp) Address added in v1.0.2

func (f *FinsUdp) Address(addr string) (protocol.Addr, error)

func (*FinsUdp) Immediate added in v1.0.2

func (f *FinsUdp) Immediate(station int, addr protocol.Addr, size int) ([]byte, error)

func (*FinsUdp) Read

func (f *FinsUdp) Read(station int, address protocol.Addr, size int) ([]byte, error)

func (*FinsUdp) Write

func (f *FinsUdp) Write(station int, address protocol.Addr, values []byte) error

type UdpFrame

type UdpFrame struct {
	// 信息控制字段,默认0x80
	ICF byte // 0x80

	// 系统使用的内部信息
	RSV byte // 0x00

	// 网络层信息,默认0x02,如果有八层消息,就设置为0x07
	GCT byte // 0x02

	// PLC的网络号地址,默认0x00
	DNA byte // 0x00

	// PLC的节点地址,这个值在配置了ip地址之后是默认赋值的,默认为Ip地址的最后一位
	DA1 byte // 0x13

	// PLC的单元号地址
	DA2 byte // 0x00

	// 上位机的网络号地址
	SNA byte // 0x00

	// 上位机的节点地址,假如你的电脑的Ip地址为192.168.0.13,那么这个值就是13
	SA1 byte

	// 上位机的单元号地址
	SA2 byte

	// 设备的标识号
	SID byte // 0x00
}

Jump to

Keyboard shortcuts

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