Documentation ¶
Index ¶
Constants ¶
View Source
const ( SUB_HEADER = "5000" // 3Eフレームでは固定 HEALTH_CHECK_COMMAND = "1906" // binary mode expression. if ascii mode then 0619 HEALTH_CHECK_SUBCOMMAND = "0000" READ_COMMAND = "0104" // binary mode expression. if ascii mode then 0401 READ_SUB_COMMAND = "0000" BIT_READ_SUB_COMMAND = "0100" WRITE_COMMAND = "0114" // binary mode expression. if ascii mode then 1401 WRITE_SUB_COMMAND = "0000" BIT_WRITE_SUB_COMMAND = "0100" MONITORING_TIMER = "1000" // 3[sec] )
Variables ¶
View Source
var DeviceCodes = map[string]string{
"X": "9C",
"Y": "9D",
"M": "90",
"L": "92",
"F": "93",
"V": "94",
"B": "A0",
"W": "B4",
"D": "A8",
}
DeviceCodes is device name and hex value map
Functions ¶
func NewStation ¶
func NewStation(networkNum, pcNum, unitIONum, unitStationNum string) *station
Types ¶
type AccessRoute ¶
type AccessRoute struct { Sts station Code Code }
func (*AccessRoute) AsciiRoute ¶
func (r *AccessRoute) AsciiRoute() []byte
func (*AccessRoute) BinaryRoute ¶
func (r *AccessRoute) BinaryRoute() []byte
func (*AccessRoute) Len ¶
func (r *AccessRoute) Len() int64
type Client ¶
type Client interface { Read(deviceName string, offset, numPoints int64) ([]byte, error) BitRead(deviceName string, offset, numPoints int64) ([]byte, error) Write(deviceName string, offset, numPoints int64, writeData []byte) ([]byte, error) BitWrite(deviceName string, offset, numPoints int64, writeData []byte) ([]byte, error) HealthCheck() error ShutDown() Reconnect() error Connect() error }
type Response ¶
type Response struct { // Sub header SubHeader string // network number NetworkNum string // PC number PCNum string // Request Unit I/O number UnitIONum string // Request Unit station number UnitStationNum string // Response data length DataLen string // Response data code EndCode string // Response data Payload []byte // error data ErrInfo []byte }
Response represents mcp response
Click to show internal directories.
Click to hide internal directories.