| | |
| | | } |
| | | for _, addressItem := range plcConfig.Details { |
| | | if addressItem.FieldName == constvar.PlcStartAddressTypeFinishNumber { |
| | | value, err := service.PlcReadDirect(plcConfig, addressItem.StartAddress, addressItem.Length, addressItem.Type) |
| | | value, err := service.PlcReadDirect(plcConfig, addressItem) |
| | | if err != nil { |
| | | logx.Infof("plc read finish number err: %v", err) |
| | | continue |
| | |
| | | } |
| | | for _, addressItem := range plcConfig.Details { |
| | | if addressItem.FieldName == constvar.PlcStartAddressTypeTotalNumber { |
| | | value, err := service.PlcReadDirect(plcConfig, addressItem.StartAddress, addressItem.Length, addressItem.Type) |
| | | value, err := service.PlcReadDirect(plcConfig, addressItem) |
| | | if err != nil { |
| | | logx.Infof("plc read total number err: %v", err) |
| | | continue |
| | |
| | | |
| | | if isMaster { |
| | | s.Every(20).Seconds().Do(SyncProductionProgress) //同步生产数据 |
| | | //s.Every(30).Seconds().Do(SyncTaskStatus) //同步任务状态 |
| | | s.Every(10).Seconds().Do(CheckNsqConn) //查询nsq连接 |
| | | s.Every(30).Seconds().Do(ReportData) //上报数据 |
| | | s.Every(30).Seconds().Do(SyncTaskStatus) //同步任务状态 |
| | | s.Every(10).Seconds().Do(CheckNsqConn) //查询nsq连接 |
| | | s.Every(30).Seconds().Do(ReportData) //上报数据 |
| | | } |
| | | |
| | | s.Every(20).Seconds().Do(QueryClusterStatus) //查询集群节点数量 |