#
lsh
2024-06-27 e47b30ba51de51df6210910e50d790614a9b30e1
src/main/java/com/zy/core/thread/JarThread.java
@@ -20,7 +20,6 @@
import com.zy.core.enums.SlaveType;
import com.zy.core.model.JarSlave;
import com.zy.core.model.Task;
import com.zy.core.model.command.CrnCommand;
import com.zy.core.model.command.JarCommand;
import com.zy.core.model.protocol.JarProtocol;
import lombok.Data;
@@ -64,7 +63,7 @@
                        break;
                    // 写数据 ID+目标站
                    case 2:
                        write(null);
                        write((JarCommand) task.getData());
                        break;
                    default:
                        break;
@@ -118,6 +117,9 @@
     */
    private void readStatus(){
        try {
            if (slave.getId()>4){
                return;
            }
            OperateResultExOne<byte[]> result = siemensS7Net.Read("V300", (short) 26);
            if (result.IsSuccess) {
                if (null == jarProtocol) {
@@ -152,6 +154,16 @@
                jarProtocol.setStatus(siemensS7Net.getByteTransform().TransInt16(result.Content, 16));//状态
                jarProtocol.setAutoing(siemensS7Net.getByteTransform().TransInt16(result.Content, 12) == 2);//自动
//
//                jarProtocol.setMode(2);//模式
//                jarProtocol.setStatus((short)1);//状态
//                jarProtocol.setLeftDoorOpen(0);//open the left door  //进料门
//                jarProtocol.setLeftDoorClose(0);//close the left door  //进料门
//                jarProtocol.setRightDoorOpen(0);//open the right door  //出料门
//                jarProtocol.setRightDoorClose(0);//close the right door  //出料门
                // 根据实时信息更新数据库
                BasJarService service = SpringUtils.getBean(BasJarService.class);
                if (null != service) {