constvar/const.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
model/common/common.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
model/device_plc.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
constvar/const.go
@@ -20,6 +20,18 @@ PlcStartAddressTypeTotalNumberWrite PlcStartAddressType = 3 ) type EndianType string const ( EndianTypeBig EndianType = "big" EndianTypeLittle EndianType = "little" EndianTypeMix EndianType = "mix" ) func (t EndianType) Valid() bool { return t == EndianTypeBig || t == EndianTypeLittle || t == EndianTypeMix } type PlcStartAddressValueType string const ( model/common/common.go
@@ -90,12 +90,13 @@ } PlcAddress struct { DeviceID string `json:"deviceID"` // 设备id Channel int `json:"channel"` // 生产通道on,一个机器可能有多个机位,需要分别配置plc地址 StartAddress int `json:"startAddress"` // 数据起始地址 Length int `json:"length"` // 数据长度 Type string `json:"type"` // 数据类型 FieldName constvar.PlcStartAddressType `json:"fieldName"` // 对应系统字段,完成量或总量 DeviceID string `json:"deviceID"` // 设备id Channel int `json:"channel"` // 生产通道on,一个机器可能有多个机位,需要分别配置plc地址 StartAddress int `json:"startAddress"` // 数据起始地址 Length int `json:"length"` // 数据长度 Type string `json:"type"` // 数据类型 FieldName constvar.PlcStartAddressType `json:"fieldName"` // 对应系统字段,完成量或总量 Endian constvar.EndianType `json:"endian" gorm:"type:varchar(255)"` // 字节存储顺序,big(ABCD)/little(CDBA)/mix(CDAB) } ) model/device_plc.go
@@ -41,6 +41,7 @@ Length int `json:"length"` // 数据长度 Type constvar.PlcStartAddressValueType `json:"type"` // 数据类型 FieldName constvar.PlcStartAddressType `json:"fieldName"` // 对应系统字段 Endian constvar.EndianType `json:"endian"` // 字节存储顺序,big(ABCD)/little(CDBA)/mix(CDAB) } DevicePlcSearch struct {