omron

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package omron assists in deciphering omron communication protocol message.

This package is written by inspecting messages from the Chiltrix CX34.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	// String returns a human readable explanation of the command.
	String() string
	// contains filtered or unexported methods
}

Command is an interface implemented by all values of ParsedCommand.

type CommandFrame

type CommandFrame struct {
	NodeNumber    uint8
	HeaderCode    HeaderCode
	Text          string
	Check         uint8
	ParsedCommand Command
}

CommandFrame is described here: https://paginas.fe.up.pt/~pfs/recursos/plcs/omron/cqm1/sbc_manual/sec4.pdf 4-4-1

func ParseCommandFrame

func ParseCommandFrame(line string) (*CommandFrame, error)

ParseCommandFrame returns a CommandFrame parsed from a line of text.

type DMAreaReadCommand

type DMAreaReadCommand struct {
	// First word to read 0000-6655
	BeginningWord uint16
	// Number of words to read
	NumberOfWords uint16
}

func (*DMAreaReadCommand) String

func (r *DMAreaReadCommand) String() string

type DMAreaReadResponse

type DMAreaReadResponse struct {
	EndCode EndCode
	// Words of data.
	Data []uint16
}

func (*DMAreaReadResponse) String

func (r *DMAreaReadResponse) String() string

type DMAreaWriteCommand

type DMAreaWriteCommand struct {
	// First word to read 0000-6655
	BeginningWord uint16
	// Words to write starting at BeginningWord.
	Data []uint16
}

func (*DMAreaWriteCommand) String

func (r *DMAreaWriteCommand) String() string

type DMAreaWriteResponse

type DMAreaWriteResponse struct {
	EndCode EndCode
	// Words of data.
	Data []uint16
}

func (*DMAreaWriteResponse) String

func (r *DMAreaWriteResponse) String() string

type EndCode

type EndCode uint8
const (
	OK EndCode = 0
)

Valid end codes.

func (EndCode) String

func (c EndCode) String() string

type HeaderCode

type HeaderCode string

HeaderCode is one of the codes from 4-4-3 of https://paginas.fe.up.pt/~pfs/recursos/plcs/omron/cqm1/sbc_manual/sec4.pdf. and https://assets.omron.eu/downloads/manual/en/w364_cqm1h_series_programming_manual_en.pdf.

const (
	RD HeaderCode = "RD" // DM AREA READ
	WD HeaderCode = "WD" // DM AREA WRITE
)

Valid header codes.

func (HeaderCode) Valid

func (hc HeaderCode) Valid() bool

Jump to

Keyboard shortcuts

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