| | |
| | | // DevicePlc 设备的PLC配置 |
| | | DevicePlc struct { |
| | | gorm.Model |
| | | DeviceID string `gorm:"column:device_id;type:varchar(255);not null;unique_index" json:"deviceID"` //设备编号 |
| | | DeviceID string `gorm:"column:device_id;type:varchar(255);not null;unique" json:"deviceID"` //设备编号 |
| | | 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:"-"` |
| | | |
| | | 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 `json:"isOpen"` |
| | | Detail string `gorm:"type:varchar(2048)" json:"-"` |
| | | |
| | | Details []*DevicePlcAddress `gorm:"-" json:"details"` |
| | | |