| | |
| | | Method constvar.PlcMethod `gorm:"type:varchar(191)" json:"method"` //comment:接口方式 |
| | | Address string `gorm:"type:varchar(191)" json:"address"` //plc ip地址, method = modbusTCP用 |
| | | Port int `gorm:"type:int(11)" json:"port"` //plc 端口号, method = modbusTCP用 |
| | | BaudRate int `gorm:"type:int(11)" json:"baudRate"` //串口波特率, method = serial时 用 |
| | | SerialName string `gorm:"type:int(11)" json:"serialName"` //串口名称,method = serial时 用 |
| | | BaudRate int `gorm:"type:int(11)" json:"baudRate"` //串口波特率, method = serial或modbusRTU 时用 |
| | | SerialName string `gorm:"type:int(11)" json:"serialName"` //串口名称,method = serial或modbusRTU 时用 |
| | | DataBit int `gorm:"type:int(11)" json:"dataBit"` //数据位,method = modbusRTU 用 |
| | | StopBit int `gorm:"type:int(11)" json:"stopBit"` //停止位,method = modbusRTU 用 |
| | | Parity constvar.Parity `gorm:"type:int(11)" json:"parity"` //校验方式,method = modbusRTU 用 |
| | | IsOpen bool `gorm:"type:tinyint(1)" json:"isOpen"` |
| | | Detail string `gorm:"type:varchar(2048)" json:"-"` |
| | | Details []*PlcAddress `gorm:"-" json:"details"` |
| | |
| | | ID string `gorm:"comment:主键ID;primaryKey;type:varchar(191);" json:"id"` |
| | | DeviceProcedureAttr []*DeviceProcedureAttr `json:"deviceProcedureAttr"` // 设备工序属性列表 |
| | | ExtChannelAmount int `gorm:"type:tinyint;comment:额外的通道数量;default:0;" json:"extChannelAmount"` |
| | | DeviceName string `json:"deviceName"` |
| | | DeviceMac string `json:"deviceMac"` |
| | | PlcAddressList []*PlcAddress |
| | | PlcConfig *PlcConfig |
| | | } |
| | |
| | | type PullDataType string |
| | | |
| | | const ( |
| | | PullDataTypeProcessModel = "process_model" |
| | | PullDataTypeDevice = "device" |
| | | PullDataTypeProcessModel = "process_model" |
| | | PullDataTypeDevice = "device" |
| | | PullDataTypeProcessModelPlcAddress = "process_model_plc_address" |
| | | ) |
| | | |
| | | // MsgPullDataRequest 拉取云端数据 |
| | |
| | | DataType PullDataType `json:"dataType"` //要拉取的数据类型 |
| | | Data interface{} //返回的数据 |
| | | } |
| | | |
| | | type RTUConfig struct { |
| | | BaudRate int `json:"baudRate"` //串口波特率, method = serial时 用 |
| | | SerialName string `json:"serialName"` //串口名称,method = serial时 用 |
| | | DataBit int `gorm:"type:int(11)" json:"dataBit"` //数据位,method = modbusRTU 用 |
| | | StopBit int `gorm:"type:int(11)" json:"stopBit"` //停止位,method = modbusRTU 用 |
| | | Parity constvar.Parity `gorm:"type:int(11)" json:"parity"` //校验方式,method = modbusRTU 用 |
| | | } |
| | | |
| | | // MsgReportData 数据上报 |
| | | type MsgReportData struct { |
| | | ReportType constvar.ReportType `json:"reportType"` //上报类型 |
| | | Content string `json:"Content"` |
| | | } |