| | |
| | | // DevicePlc 设备的PLC配置 |
| | | DevicePlc struct { |
| | | gorm.Model |
| | | Brand string `gorm:"type:varchar(191);comment:PLC品牌" json:"brand"` |
| | | Method constvar.PlcMethod `gorm:"type:varchar(191);comment:接口方式" json:"method"` |
| | | //PortName string `gorm:"type:varchar(191);comment:端口名称" json:"portName"` |
| | | //Frequency int `gorm:"comment:数据更新频率 0-实时更新 1-1次/秒" json:"frequency"` |
| | | Address string `gorm:"type:varchar(191);comment:PLC地址" json:"address"` //plc ip地址, method = modbusTCP用 |
| | | Port int `gorm:"comment:端口" json:"port"` //plc 端口号, method = modbusTCP用 |
| | | BaudRate int `gorm:"comment:波特率" json:"baudRate"` //串口波特率, method = serial时 用 |
| | | SerialName string `gorm:"comment:串口名称" json:"serialName"` //串口名称,method = serial时 用 |
| | | IsOpen bool `gorm:"comment:是否开启" json:"isOpen"` |
| | | Detail string `gorm:"type:varchar(2048);comment:数据详情" json:"-"` |
| | | Brand string `gorm:"type:varchar(191)" json:"brand"` |
| | | Method constvar.PlcMethod `gorm:"type:varchar(191)" json:"method"` |
| | | Address string `gorm:"type:varchar(191)" json:"address"` //plc ip地址, method = modbusTCP用 |
| | | Port int `json:"port"` //plc 端口号, method = modbusTCP用 |
| | | BaudRate int `json:"baudRate"` //串口波特率, method = serial时 用 |
| | | SerialName string `json:"serialName"` //串口名称,method = serial时 用 |
| | | IsOpen bool `json:"isOpen"` |
| | | Detail string `gorm:"type:varchar(2048)" json:"-"` |
| | | |
| | | Details []*DevicePlcAddress `gorm:"-" json:"details"` |
| | | |