Documentation
¶
Index ¶
- Constants
- func DisableLog()
- func FlushLog()
- func SetLogWriter(writer io.Writer) error
- func UseLogger(newLogger seelog.LoggerInterface)
- type ADSAddDeviceNotification
- type ADSNotification
- type ADSRead
- type ADSReadDeviceInfo
- type ADSReadState
- type ADSSymbol
- func (symbol *ADSSymbol) AddDeviceNotification(callback func(*ADSSymbol))
- func (data *ADSSymbol) Find(name string) (list []*ADSSymbol)
- func (data *ADSSymbol) FindChanged() (changed []*ADSSymbol)
- func (symbol *ADSSymbol) Read()
- func (data *ADSSymbol) Walk()
- func (symbol *ADSSymbol) Write(value string) error
- type ADSSymbolUploadDataType
- type ADSSymbolUploadInfo
- type ADSSymbolUploadSymbol
- type AMSAddress
- type Connection
- func (conn *Connection) AddDeviceNotification(group uint32, offset uint32, length uint32, transmissionMode uint32, ...) (response ADSAddDeviceNotification, err error)
- func (conn *Connection) Close()
- func (conn *Connection) Connect()
- func (conn *Connection) DeleteDeviceNotification(handle uint32)
- func (conn *Connection) DeviceNotification(in []byte)
- func (conn *Connection) Find(name string) (list []*ADSSymbol)
- func (conn *Connection) ParseTPY(path string) (symbols map[string]ADSSymbol)
- func (conn *Connection) Read(group uint32, offset uint32, length uint32) (response ADSRead, err error)
- func (conn *Connection) ReadDeviceInfo() (response ADSReadDeviceInfo, err error)
- func (conn *Connection) ReadState() (response ADSReadState, err error)
- func (conn *Connection) ReadWrite()
- func (conn *Connection) Set(name, value string)
- func (conn *Connection) UploadSymbolInfo() (symbols map[string]ADSSymbol, structs map[string]ADSSymbolUploadDataType)
- func (conn *Connection) UploadSymbolInfoDataTypes(length uint32)
- func (conn *Connection) UploadSymbolInfoSymbols(length uint32)
- func (conn *Connection) Value(name string) (value string)
- func (conn *Connection) Wait()
- func (conn *Connection) Write(group uint32, offset uint32, data []byte)
- func (conn *Connection) WriteControl()
Constants ¶
const ( ADS_NoTransmission = 0 ADS_ClientCycle = 1 ADS_ClientOnChange = 2 ADS_ServerCycle = 3 ADS_ServerOnChange = 4 ADS_Client1Reqest = 5 )
}}} AddDeviceNotification - ADS command id: 6/*{{{*/
Variables ¶
This section is empty.
Functions ¶
func SetLogWriter ¶
SetLogWriter uses a specified io.Writer to output library log. Use this func if you are not using Seelog logging system in your app.
func UseLogger ¶
func UseLogger(newLogger seelog.LoggerInterface)
UseLogger uses a specified seelog.LoggerInterface to output library log. Use this func if you are using Seelog logging system in your app.
Types ¶
type ADSAddDeviceNotification ¶
type ADSAddDeviceNotification struct {
Handle uint32
}
type ADSNotification ¶
type ADSNotification struct {
// contains filtered or unexported fields
}
type ADSReadDeviceInfo ¶
type ADSReadDeviceInfo struct { MajorVersion uint8 MinorVersion uint8 BuildVersion uint16 DeviceName string }
ReadDeviceInfo - ADS command id: 1/*{{{*/
type ADSReadState ¶
}}} ReadState - ADS command id: 4/*{{{*/
type ADSSymbol ¶
type ADSSymbol struct { Self *ADSSymbol FullName string Name string DataType string Comment string Area uint32 Offset uint32 Length uint32 Value string Valid bool Changed bool Childs map[string]ADSSymbol // contains filtered or unexported fields } /*}}}*/
func (*ADSSymbol) AddDeviceNotification ¶
func (*ADSSymbol) FindChanged ¶
return } [>}}}<]
type ADSSymbolUploadDataType ¶
type ADSSymbolUploadDataType struct { Name string Area uint32 Offset uint32 DataType string Comment string Value string Changed bool Childs map[string]ADSSymbolUploadDataType In1 uint32 Decoration uint32 In3 uint32 Size uint32 In6 uint32 In7 uint32 ArrayLevels uint16 In8 uint16 // contains filtered or unexported fields } /*}}}*/
func (*ADSSymbolUploadDataType) DebugWalk ¶
func (data *ADSSymbolUploadDataType) DebugWalk()
type ADSSymbolUploadInfo ¶
type ADSSymbolUploadSymbol ¶
type ADSSymbolUploadSymbol struct { Name string DataType string Comment string Area uint32 Offset uint32 Length uint32 Extra1 uint32 Extra2 uint32 Childs map[string]ADSSymbolUploadDataType // contains filtered or unexported fields } /*}}}*/
func (*ADSSymbolUploadSymbol) DebugWalk ¶
func (data *ADSSymbolUploadSymbol) DebugWalk()
Print the whole symbol and data type lists
type AMSAddress ¶
type AMSAddress struct {
// contains filtered or unexported fields
}
type Connection ¶
type Connection struct { WaitGroup sync.WaitGroup WaitGroupFinal sync.WaitGroup // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(ip string, netid string, port uint16) (conn *Connection, err error)
Connection
func (*Connection) AddDeviceNotification ¶
func (conn *Connection) AddDeviceNotification(group uint32, offset uint32, length uint32, transmissionMode uint32, maxDelay uint32, cycleTime uint32, callback func([]byte)) (response ADSAddDeviceNotification, err error)
func (*Connection) Close ¶
func (conn *Connection) Close()
func (*Connection) Connect ¶
func (conn *Connection) Connect()
func (*Connection) DeleteDeviceNotification ¶
func (conn *Connection) DeleteDeviceNotification(handle uint32)
}}} DeleteDeviceNotification - ADS command id: 7/*{{{*/
func (*Connection) DeviceNotification ¶
func (conn *Connection) DeviceNotification(in []byte)
}}} DeviceNotification - ADS command id: 8/*{{{*/
func (*Connection) Find ¶
func (conn *Connection) Find(name string) (list []*ADSSymbol)
func (*Connection) ParseTPY ¶
func (conn *Connection) ParseTPY(path string) (symbols map[string]ADSSymbol)
func (*Connection) ReadDeviceInfo ¶
func (conn *Connection) ReadDeviceInfo() (response ADSReadDeviceInfo, err error)
func (*Connection) ReadState ¶
func (conn *Connection) ReadState() (response ADSReadState, err error)
func (*Connection) ReadWrite ¶
func (conn *Connection) ReadWrite()
}}} ReadWrite TODO - ADS command id: 9/*{{{*/
func (*Connection) Set ¶
func (conn *Connection) Set(name, value string)
func (*Connection) UploadSymbolInfo ¶
func (conn *Connection) UploadSymbolInfo() (symbols map[string]ADSSymbol, structs map[string]ADSSymbolUploadDataType)
func (*Connection) UploadSymbolInfoDataTypes ¶
func (conn *Connection) UploadSymbolInfoDataTypes(length uint32)
func (*Connection) UploadSymbolInfoSymbols ¶
func (conn *Connection) UploadSymbolInfoSymbols(length uint32)
func (*Connection) Value ¶
func (conn *Connection) Value(name string) (value string)
func (*Connection) Wait ¶
func (conn *Connection) Wait()
func (*Connection) Write ¶
func (conn *Connection) Write(group uint32, offset uint32, data []byte)
}}} Write - ADS command id: 3/*{{{*/
func (*Connection) WriteControl ¶
func (conn *Connection) WriteControl()
}}} WriteControl TODO - ADS command id: 5/*{{{*/