| | |
| | | |
| | | const ( |
| | | PlcMethodModbusTCP PlcMethod = "modbusTCP" |
| | | PlcMethodModbusRTU PlcMethod = "modbusRTU" |
| | | PlcMethodSerial PlcMethod = "serial" |
| | | PlcMethodModbusTCPChinese PlcMethod = "网络" |
| | | PlcMethodSerialChinese PlcMethod = "串口" |
| | |
| | | } |
| | | |
| | | func (slf *PlcMethod) Valid() bool { |
| | | return *slf == PlcMethodModbusTCP || *slf == PlcMethodSerial |
| | | return *slf == PlcMethodModbusTCP || *slf == PlcMethodSerial || *slf == PlcMethodModbusRTU |
| | | } |
| | | |
| | | const ( |
| | |
| | | TaskModeCurrent TaskMode = 2 //未开始的和进行中的 |
| | | TaskModeLastFinished TaskMode = 3 //上一个结束的 |
| | | ) |
| | | |
| | | type Parity int |
| | | |
| | | const ( |
| | | ParityEven Parity = 1 //奇校验 |
| | | ParityOdd Parity = 2 //偶校验 |
| | | ParityNull Parity = 3 //无校验 |
| | | ) |
| | | |
| | | func (p Parity) String() string { |
| | | switch p { |
| | | case ParityEven: |
| | | return "E" |
| | | case ParityOdd: |
| | | return "O" |
| | | case ParityNull: |
| | | return "N" |
| | | } |
| | | return "" |
| | | } |