Documentation ¶
Index ¶
- Constants
- func AlarmDesc(alarm AlarmValue) string
- type AI
- type AIAlarmConfig
- type AIConfig
- type AO
- type AOConfig
- type Addr
- type AlarmItem
- type AlarmValue
- type Connector
- type DI
- type DIConfig
- type DO
- type DOConfig
- type Device
- func (device *Device) Close()
- func (device *Device) Connect(ctx context.Context, address string) error
- func (device *Device) GetAI(index int) (*AI, error)
- func (device *Device) GetAO(index int) (*AO, error)
- func (device *Device) GetAddr() (*Addr, error)
- func (device *Device) GetCHNum(flush bool) (*CHNum.Data, error)
- func (device *Device) GetCHValue(tag string) (value map[string]interface{}, err error)
- func (device *Device) GetDI(index int) (*DI, error)
- func (device *Device) GetDO(index int) (*DO, error)
- func (device *Device) GetDOFromTag(tag string) (*DO, error)
- func (device *Device) GetModel() (*Model, error)
- func (device *Device) GetRealTimeData() (*realtime.Data, error)
- func (device *Device) GetStatus() lang.StrIndex
- func (device *Device) GetStatusTitle() string
- func (device *Device) IsConnected() bool
- func (device *Device) Reset(otherFN ...func())
- func (device *Device) SetCHValue(tag string, value interface{}) error
- func (device *Device) SetConnector(connector Connector)
- type IPAddr
- type MAC
- type Model
- type TCPConnector
Constants ¶
View Source
const ( CHBlockSize = 256 AIValueStartAddress = 96 AIAlarmStartAddress = 48 )
View Source
const ( None = iota Control Alarm )
View Source
const ( AOCHStartAddress = 28672 AOValueStartAddress = 0 )
View Source
const ( DOCHStartAddress = 20480 ON = 0xFF00 OFF = 0x0000 )
View Source
const (
DICHStartAddress = 12288
)
Variables ¶
This section is empty.
Functions ¶
func AlarmDesc ¶
func AlarmDesc(alarm AlarmValue) string
Types ¶
type AI ¶
type AI struct { Index int // contains filtered or unexported fields }
func (*AI) CheckAlarm ¶
func (ai *AI) CheckAlarm(val float32) (AlarmValue, float32)
func (*AI) GetAlarmState ¶
func (ai *AI) GetAlarmState() (AlarmValue, error)
type AIAlarmConfig ¶
type AlarmValue ¶
type AlarmValue int
const ( AlarmInvalid AlarmValue = 0xFF AlarmError AlarmValue = 0xFE AlarmNormal AlarmValue = 0x0 AlarmHF AlarmValue = 0x10 AlarmHH AlarmValue = 0x0c AlarmHI AlarmValue = 0x04 AlarmLO AlarmValue = 0x01 AlarmLL AlarmValue = 0x03 AlarmLF AlarmValue = 0x20 )
type Connector ¶
func NewTCPConnector ¶
func NewTCPConnector() Connector
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
func (*Device) GetCHValue ¶
func (*Device) GetStatusTitle ¶
func (*Device) IsConnected ¶
func (*Device) SetCHValue ¶
func (*Device) SetConnector ¶
Click to show internal directories.
Click to hide internal directories.