Versions in this module Expand all Collapse all v1 v1.0.1 Jan 9, 2025 Changes in this version + const S7AreaCT + const S7AreaDB + const S7AreaMK + const S7AreaPA + const S7AreaPE + const S7AreaTM + const S7WlBit + const S7WlByte + const S7WlChar + const S7WlCounter + const S7WlDint + const S7WlDword + const S7WlInt + const S7WlReal + const S7WlTimer + const S7WlWord type Client + WriteBit func(area int, dbNumber int, byteAddress int, bitAddress int, value bool) (err error) + WriteBytes func(area int, dbNumber int, start int, amount int, wordLen int, buffer []byte) (err error) v1.0.0 Jan 9, 2025 Changes in this version + func CPUError(err uint) int + func ErrorText(err int) string + type Client interface + AGReadAB func(start int, size int, buffer []byte) (err error) + AGReadCT func(start int, size int, buffer []byte) (err error) + AGReadDB func(dbNumber int, start int, size int, buffer []byte) (err error) + AGReadEB func(start int, size int, buffer []byte) (err error) + AGReadMB func(start int, size int, buffer []byte) (err error) + AGReadMulti func(dataItems []S7DataItem, itemsCount int) (err error) + AGReadTM func(start int, size int, buffer []byte) (err error) + AGWriteAB func(start int, size int, buffer []byte) (err error) + AGWriteCT func(start int, size int, buffer []byte) (err error) + AGWriteDB func(dbNumber int, start int, size int, buffer []byte) (err error) + AGWriteEB func(start int, size int, buffer []byte) (err error) + AGWriteMB func(start int, size int, buffer []byte) (err error) + AGWriteMulti func(dataItems []S7DataItem, itemsCount int) (err error) + AGWriteTM func(start int, size int, buffer []byte) (err error) + ClearSessionPassword func() error + DBFill func(dbnumber int, fillchar int) error + DBGet func(dbnumber int, usrdata []byte, size int) error + GetAgBlockInfo func(blocktype int, blocknum int) (info S7BlockInfo, err error) + GetCPInfo func() (info S7CpInfo, err error) + GetCPUInfo func() (info S7CpuInfo, err error) + GetOrderCode func() (info S7OrderCode, err error) + GetProtection func() (protection S7Protection, err error) + PGClockRead func(datetime time.Time) error + PGClockWrite func() (dt time.Time, err error) + PGListBlocks func() (list S7BlocksList, err error) + PLCColdStart func() error + PLCGetStatus func() (status int, err error) + PLCHotStart func() error + PLCStop func() error + Read func(variable string, buffer []byte) (value interface{}, err error) + SetSessionPassword func(password string) error + func NewClient(handler ClientHandler) Client + func NewClient2(packager Packager, transporter Transporter) Client + func TCPClient(address string, rack int, slot int) Client + func TCPClientWithConnectType(address string, rack int, slot int, connectType int) Client + type ClientHandler interface + type Helper struct + func (s7 *Helper) GetBoolAt(b byte, pos uint) bool + func (s7 *Helper) GetCharsAt(buffer []byte, pos int, Size int) string + func (s7 *Helper) GetCounter(value uint16) int + func (s7 *Helper) GetCounterAt(buffer []uint16, index int) int + func (s7 *Helper) GetDTLAt(buffer []byte, pos int) time.Time + func (s7 *Helper) GetDateAt(buffer []byte, pos int) time.Time + func (s7 *Helper) GetDateTimeAt(Buffer []byte, Pos int) time.Time + func (s7 *Helper) GetLDTAt(buffer []byte, pos int) time.Time + func (s7 *Helper) GetLRealAt(buffer []byte, pos int) float64 + func (s7 *Helper) GetLTODAt(Buffer []byte, Pos int) time.Time + func (s7 *Helper) GetRealAt(buffer []byte, pos int) float32 + func (s7 *Helper) GetS5TimeAt(buffer []byte, pos int) time.Duration + func (s7 *Helper) GetStringAt(buffer []byte, pos int) string + func (s7 *Helper) GetTODAt(buffer []byte, pos int) time.Time + func (s7 *Helper) GetValueAt(buffer []byte, pos int, value interface{}) + func (s7 *Helper) GetWStringAt(buffer []byte, pos int) string + func (s7 *Helper) SetBoolAt(b byte, bitPos uint, data bool) byte + func (s7 *Helper) SetCharsAt(buffer []byte, pos int, value string) + func (s7 *Helper) SetCounterAt(buffer []uint16, pos int, value int) []uint16 + func (s7 *Helper) SetDTLAt(buffer []byte, pos int, value time.Time) []byte + func (s7 *Helper) SetDateAt(buffer []byte, pos int, value time.Time) + func (s7 *Helper) SetDateTimeAt(buffer []byte, pos int, value time.Time) + func (s7 *Helper) SetLDTAt(buffer []byte, pos int, value time.Time) + func (s7 *Helper) SetLRealAt(Buffer []byte, Pos int, Value float64) + func (s7 *Helper) SetLTODAt(buffer []byte, pos int, value time.Time) + func (s7 *Helper) SetRealAt(buffer []byte, pos int, value float32) + func (s7 *Helper) SetS5TimeAt(buffer []byte, pos int, value time.Duration) []byte + func (s7 *Helper) SetStringAt(buffer []byte, pos int, maxLen int, value string) []byte + func (s7 *Helper) SetTODAt(buffer []byte, pos int, value time.Time) + func (s7 *Helper) SetValueAt(buffer []byte, pos int, data interface{}) + func (s7 *Helper) SetWStringAt(buffer []byte, pos int, maxLen int, value string) []byte + func (s7 *Helper) ToCounter(value int) uint16 + type Packager interface + Verify func(request []byte, response []byte) (err error) + type ProtocolDataUnit struct + Data []byte + func NewProtocolDataUnit(data []byte) ProtocolDataUnit + type S7BlockInfo struct + Author string + BlkFlags int + BlkLang int + BlkNumber int + BlkType int + CheckSum int + CodeDate string + Family string + Header string + IntfDate string + LoadSize int + LocalData int + MC7Size int + SBBLength int + Version int + type S7BlocksList struct + DBList []int + FBList []int + FCList []int + OBList []int + SDBList []int + SFBList []int + SFCList []int + type S7CpInfo struct + MaxBusRate int + MaxConnections int + MaxMpiRate int + MaxPduLength int + type S7CpuInfo struct + ASName string + Copyright string + ModuleName string + ModuleTypeName string + SerialNumber string + type S7DataItem struct + Amount int + Area int + Bit int + DBNumber int + Data []byte + Error string + Start int + WordLen int + type S7Error struct + High byte + Low byte + func (e *S7Error) Error() string + type S7OrderCode struct + Code string + V1 byte + V2 byte + V3 byte + type S7Protection struct + type S7SZL struct + Data []byte + Header SZLHeader + type S7SZLList struct + Data []uint16 + Header SZLHeader + type SZLHeader struct + LengthHeader uint16 + NumberOfDataRecord uint16 + type TCPClientHandler struct + func NewTCPClientHandler(address string, rack int, slot int) *TCPClientHandler + func NewTCPClientHandlerWithConnectType(address string, rack int, slot int, connectType int) *TCPClientHandler + func (mb *TCPClientHandler) Close() error + func (mb *TCPClientHandler) Connect() error + func (mb *TCPClientHandler) Send(request []byte) (response []byte, err error) + func (mb *TCPClientHandler) Verify(request []byte, response []byte) (err error) + type Transporter interface + Send func(request []byte) (response []byte, err error)