| | |
| | | public R monitorLedError(@RequestParam("ledId") Integer ledId) { |
| | | String errorMsg = ""; |
| | | for (LedSlave slave : slaveProperties.getLed()) { |
| | | if (slave.getStaArr().contains(ledId)) { |
| | | if (slave.getId().equals(ledId)) { |
| | | LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, slave.getId()); |
| | | if (null != ledThread) { |
| | | errorMsg = ledThread.getErrorMsg().toString(); |
| | |
| | | staProtocol.setWorkNo((short) 9999); |
| | | staProtocol.setStaNo(inSta.getBackSta().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | |
| | | // led 异常显示 |
| | | if (ledThread != null) { |
| | | String errorMsg = jsonObject.getString("msg"); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(5, errorMsg)); |
| | | } |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | |
| | | log.error("写入工作号命令失败。堆垛机plc编号={},站点数据={},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount); |
| | | } |
| | | } |
| | | Thread.sleep(200); |
| | | if (!staNoFlag) { |
| | | write1 = siemensS7Net.Write("DB100." + (index * 6 + 4), staProtocol.getStaNo()); // 目标站 |
| | | if (write1.IsSuccess) { |
| | |
| | | if (wrkNoFlag && staNoFlag) { |
| | | break; |
| | | } |
| | | Thread.sleep(200); |
| | | } while (writeCount < 20); |
| | | |
| | | if (!write.IsSuccess) { |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | int i=1; |
| | | do { |
| | | System.out.println(i); |
| | | i++; |
| | | if (i==4){ |
| | | break; |
| | | } |
| | | |
| | | }while (i<6); |
| | | StaProtocol staProtocol = new StaProtocol(); |
| | | staProtocol.setWorkNo((short) 6071); |
| | | short i = (short) 6071; |
| | | System.out.println(staProtocol.getWorkNo().equals(i)); |
| | | //short i = (short) 6071; |
| | | //System.out.println(staProtocol.getWorkNo().equals(i)); |
| | | // System.out.println(staNos1.indexOf(129)); |
| | | // System.out.println(staNos1.size()); |
| | | // for (int i = 0; i < staNos1.size(); i++) { |
| | |
| | | # field-strategy: 0 |
| | | |
| | | logging: |
| | | path: /stock/out/@pom.build.finalName@/logs |
| | | path: stock/out/@pom.build.finalName@/logs |
| | | |
| | | super: |
| | | pwd: xltys1995 |
| | |
| | | ip: 10.10.10.248 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 108 |
| | | staArr: 101 |
| | | # LED3 |
| | | led[2]: |
| | | id: 3 |
| | |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 117 |
| | | # LED4 |
| | | led[3]: |
| | | id: 4 |
| | | ip: 10.10.10.246 |
| | | port: 5005 |
| | | devpPlcId: ${wcs-slave.devp[0].id} |
| | | staArr: 126 |
| | | # # LED4 |
| | | # led[3]: |
| | | # id: 4 |
| | | # ip: 10.10.10.246 |
| | | # port: 5005 |
| | | # devpPlcId: ${wcs-slave.devp[0].id} |
| | | # staArr: 126 |
| | | # # LED5 |
| | | # led[4]: |
| | | # id: 5 |
| | |
| | | |
| | | <!--info级别--> |
| | | <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${LOG_PATH}/${datetime}/info.log</file> |
| | | <file>${LOG_PATH}/info.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <FileNamePattern>${LOG_PATH}/${datetime}/info_%d{yyyy-MM-dd}.%i.log</FileNamePattern> |
| | | <FileNamePattern>${LOG_PATH}/info_%d{yyyy-MM-dd}.%i.log</FileNamePattern> |
| | | <maxHistory>3600</maxHistory> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>10MB</maxFileSize> |
| | |
| | | <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
| | | <level>ERROR</level> |
| | | </filter> |
| | | <file>${LOG_PATH}/${datetime}/error.log</file> |
| | | <file>${LOG_PATH}/error.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <FileNamePattern>${LOG_PATH}/${datetime}/error_%d{yyyy-MM-dd}.%i.log</FileNamePattern> |
| | | <FileNamePattern>${LOG_PATH}/error_%d{yyyy-MM-dd}.%i.log</FileNamePattern> |
| | | <maxHistory>3600</maxHistory> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>10MB</maxFileSize> |