#
luxiaotao1123
2022-11-09 81e09b127a9169756fde3fb8fc9ce2a73e670fdd
src/main/java/com/zy/core/thread/SteThread.java
@@ -5,6 +5,7 @@
import HslCommunication.Profinet.Siemens.SiemensPLCS;
import HslCommunication.Profinet.Siemens.SiemensS7Net;
import com.alibaba.fastjson.JSON;
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
@@ -137,6 +138,14 @@
                if (waitingRes.IsSuccess) {
                    steProtocol.setWaiting(waitingRes.Content);
                }
                OperateResultExOne<Boolean> inEmptyRes = siemensS7Net.ReadBool("V2001.2");
                if (inEmptyRes.IsSuccess) {
                    steProtocol.setInEmpty(inEmptyRes.Content);
                }
                OperateResultExOne<Boolean> outEmptyRes = siemensS7Net.ReadBool("V2001.3");
                if (outEmptyRes.IsSuccess) {
                    steProtocol.setOutEmpty(outEmptyRes.Content);
                }
                steProtocol.setAlarm(siemensS7Net.getByteTransform().TransInt16(result.Content, 6));
                steProtocol.setAlarm0(siemensS7Net.getByteTransform().TransInt16(result.Content, 8));
                steProtocol.setCharge(siemensS7Net.getByteTransform().TransSingle(result.Content, 10));
@@ -171,6 +180,8 @@
                // 复位信号
                if (steProtocol.getWaiting()) {
                    log.error("-------------------------------------------第一步、[穿梭车号:{}, 工作号:{}]==>> 状态为3,等待WCS确认!!",
                            slave.getId(),steProtocol.getTaskNo());
                    if (resetFlag) {
                        SteCommand steCommand = new SteCommand();
                        steCommand.setComplete(true);
@@ -297,7 +308,9 @@
        if (result != null && result.IsSuccess) {
            // 维护数据库排列层
            if (!steProtocol.getWaiting()) {
                this.modifyPos(command.getRow().intValue(), command.getBay().intValue(), command.getLev().intValue());
                if (!Cools.isEmpty(command.getRow(), command.getBay(), command.getLev())) {
                    this.modifyPos(command.getRow().intValue(), command.getBay().intValue(), command.getLev().intValue());
                }
            }
            log.info("穿梭车命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));