| | |
| | | public OptimizeHeatLayout selectHeatLayoutInfo(String engineerId, Integer temperingid) { |
| | | |
| | | QueryWrapper<OptimizeHeatLayout> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("Top 1 *").eq("project_no", engineerId) |
| | | wrapper.eq("project_no", engineerId) |
| | | .eq("layout_id", temperingid); |
| | | return baseMapper.selectOne(wrapper); |
| | | } |
| | |
| | | if (CollectionUtils.isEmpty(loadStationList)) { |
| | | log.info("1号上片位生成调度任务"); |
| | | RawGlassStorageDetails rawDetails = getRawGlassStorageDetailsBySize(usageVOS.get(0), usageVOS.size()); |
| | | if (CollectionUtils.isEmpty(loadStationList)) { |
| | | if (rawDetails == null) { |
| | | log.info("仓库内无匹配的玻璃"); |
| | | return Boolean.FALSE; |
| | | } |
| | |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | northGlassMes: |
| | | url: jdbc:mysql://10.153.19.150:3306/north_glass_mes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://10.153.19.150:3306/north_glass_mes?serverTimezone=GMT%2b8&allowMultiQueries=true |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | |
| | | // log.info("{}上片线,处于离线状态:{},结束本地上片请求", deviceId, task.getInkageState()); |
| | | return; |
| | | } |
| | | if (s7DataSP.getTaskRunning().toString().equals(Const.ENGINEERING_RUNNING)) { |
| | | if (s7DataSP.getTaskRunning()) { |
| | | // if (task.getTaskRunning().equals(Const.ENGINEERING_RUNNING)) { |
| | | log.info("{}上片线,有正在执行的任务,结束本地上片请求", deviceId); |
| | | return; |
| | |
| | | strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
| | | datasource: |
| | | northGlassMes: |
| | | url: jdbc:mysql://10.153.19.150:3306/north_glass_mes?serverTimezone=GMT%2b8 |
| | | url: jdbc:mysql://10.153.19.150:3306/north_glass_mes?serverTimezone=GMT%2b8&allowMultiQueries=true |
| | | username: root |
| | | password: beibo.123/ |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| New file |
| | |
| | | package com.mes.config; |
| | | |
| | | import com.github.xingshuangs.iot.protocol.modbus.service.ModbusTcp; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | | * @Date: 2025/4/30 13:50 |
| | | * @Description: |
| | | */ |
| | | @Configuration |
| | | public class ModbusConfig { |
| | | @Bean("tempModbusTcp") |
| | | public ModbusTcp modbusTcp() { |
| | | // return new ModbusTcp("127.0.0.1"); |
| | | return new ModbusTcp("192.168.20.80"); |
| | | } |
| | | } |
| | |
| | | @Bean(name = "s7SerializerGHOne") |
| | | public S7Serializer s7SerializerGHOne() { |
| | | S7PLC s7PLC = new S7PLC(EPlcType.S1500, "192.168.20.180"); |
| | | // S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191"); |
| | | return S7Serializer.newInstance(s7PLC); |
| | | } |
| | | |
| | | @Bean(name = "s7SerializerGHTwo") |
| | | public S7Serializer s7SerializerGHTwo() { |
| | | S7PLC s7PLC = new S7PLC(EPlcType.S1500, "192.168.20.180"); |
| | | // S7PLC s7PLC = new S7PLC(EPlcType.S1500, "10.153.19.191"); |
| | | return S7Serializer.newInstance(s7PLC); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.github.xingshuangs.iot.protocol.modbus.service.ModbusTcp; |
| | | import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer; |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | |
| | | @Qualifier("s7SerializerGHOne") |
| | | private S7Serializer s7SerializerGHOne; |
| | | |
| | | @Autowired |
| | | ModbusTcp tempModbusTcp; |
| | | |
| | | private Integer offset = 40001; |
| | | |
| | | /** |
| | | * 摆片台请求进片逻辑处理 |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void requestTemperingTask() throws Exception { |
| | | S7DataGHOne s7DataGHOne=s7SerializerGHOne.read(S7DataGHOne.class); |
| | | S7DataGHOne s7DataGHOne = s7SerializerGHOne.read(S7DataGHOne.class); |
| | | log.info("读取到的GH1S7.GH1S7数据:{}", s7DataGHOne); |
| | | // ReadWriteEntity requestInTempering = miloService.readFromOpcUa("GH1S7.GH1S7.requestInTempering");//请求进片 |
| | | // ReadWriteEntity requestTemperingId = miloService.readFromOpcUa("GH1S7.GH1S7.requestTemperingId");//请求进片 炉号ID |
| | | // Integer request = Integer.parseInt(requestInTempering.getValue().toString()); |
| | | // Integer id = Integer.parseInt(requestTemperingId.getValue().toString()); |
| | | Integer request = (int)s7DataGHOne.getRequestInTempering(); |
| | | Integer id = (int)s7DataGHOne.getRequestTemperingId(); |
| | | Integer request = (int) s7DataGHOne.getRequestInTempering(); |
| | | Integer id = (int) s7DataGHOne.getRequestTemperingId(); |
| | | if (request == 0) { |
| | | // miloService.writeToOpcUa(generateReadWriteEntity("GH1S7.GH1S7.responseInTempering", 0));//允许送片清零 |
| | | s7SerializerGHOne.write( |
| | | S7DataGHOne.builder().responseInTempering((short)0).build() |
| | | S7DataGHOne.builder().responseInTempering(0).build() |
| | | ); |
| | | } else { |
| | | if (id == 0){ |
| | | if (id == 0) { |
| | | log.info("炉号不能为0"); |
| | | return; |
| | | } |
| | |
| | | if (Integer.parseInt(placedNumber) == glassList.size()) { |
| | | // miloService.writeToOpcUa(generateReadWriteEntity("GH1S7.GH1S7.responseInTempering", 1));//写入允许送片 |
| | | s7SerializerGHOne.write( |
| | | S7DataGHOne.builder().responseInTempering((short)1).build() |
| | | S7DataGHOne.builder().responseInTempering(1).build() |
| | | ); |
| | | } else { |
| | | // miloService.writeToOpcUa(generateReadWriteEntity("GH1S7.GH1S7.responseInTempering", 2));//不满足进炉条件 |
| | | s7SerializerGHOne.write( |
| | | S7DataGHOne.builder().responseInTempering((short)2).build() |
| | | S7DataGHOne.builder().responseInTempering(2).build() |
| | | ); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void loadTemperingTask() throws Exception { |
| | | S7DataGHOne s7DataGHOne=s7SerializerGHOne.read(S7DataGHOne.class); |
| | | // ReadWriteEntity loadTemperingId = miloService.readFromOpcUa("GH1S7.GH1S7.loadTemperingId");//进片完成 炉号ID |
| | | // getNewTemperingID(Integer.parseInt(loadTemperingId.getValue().toString()));//进片完成 下发参数 |
| | | String loadTemperingId=s7DataGHOne.getLoadTemperingId().toString();//进片完成 炉号ID |
| | | getNewTemperingID(Integer.parseInt(loadTemperingId));//进片完成 下发参数 |
| | | S7DataGHOne s7DataGHOne = s7SerializerGHOne.read(S7DataGHOne.class); |
| | | log.info("读取到的GH1S7.GH1S7数据:{}", s7DataGHOne); |
| | | Integer loadTemperingId = s7DataGHOne.getLoadTemperingId();//进片完成 炉号ID |
| | | getNewTemperingID(loadTemperingId);//进片完成 下发参数 |
| | | // ReadWriteEntity loadTemperingId = miloService.readFromOpcUa("GH1S7.GH1S7.loadTemperingId");//进片完成 炉号ID |
| | | // getNewTemperingID(Integer.parseInt(loadTemperingId.getValue().toString()));//进片完成 下发参数 |
| | | // getNewTemperingID(19); |
| | | } |
| | | |
| | | /** |
| | | * 更新钢化小片表内的玻璃状态 |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | |
| | | */ |
| | | @Scheduled(fixedDelay = 5000) |
| | | public void updateTemperingTask() throws Exception { |
| | | ReadWriteEntity furanchiIdEntity = miloService.readFromOpcUa("GH1.GH1.Furanch1Id");//进片完成 炉号ID |
| | | if (StringUtils.isNotBlank(furanchiIdEntity.getValue()+"")){ |
| | | int temperingid = Integer.parseInt(furanchiIdEntity.getValue().toString()); |
| | | int furanchiIdEntity = tempModbusTcp.readUInt16(40461 - offset); |
| | | if (StringUtils.isNotBlank(furanchiIdEntity + "")) { |
| | | int temperingid = furanchiIdEntity; |
| | | // ReadWriteEntity furanchiIdEntity = miloService.readFromOpcUa("GH1.GH1.Furanch1Id");//进片完成 炉号ID |
| | | // if (StringUtils.isNotBlank(furanchiIdEntity.getValue()+"")){ |
| | | // int temperingid = Integer.parseInt(furanchiIdEntity.getValue().toString()); |
| | | temperingAgoService.update(new LambdaUpdateWrapper<TemperingGlassInfo>().set(TemperingGlassInfo::getState, Const.TEMPERING_START) |
| | | .in(TemperingGlassInfo::getState, Const.TEMPERING_OUT, Const.TEMPERING_DROP).eq(TemperingGlassInfo::getTemperingLayoutId,temperingid)); |
| | | .in(TemperingGlassInfo::getState, Const.TEMPERING_OUT, Const.TEMPERING_DROP).eq(TemperingGlassInfo::getTemperingLayoutId, temperingid)); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | //获取到炉号id执行参数下发任务 |
| | | private void getNewTemperingID(Integer temperingid) throws Exception { |
| | | ReadWriteEntity autoStatus = miloService.readFromOpcUa("GH1.GH1.AutoStatus"); |
| | | if (1 != Integer.parseInt(autoStatus.getValue().toString())) { |
| | | int autoStatus = tempModbusTcp.readUInt16(40451 - offset); |
| | | if (1 != autoStatus) { |
| | | // ReadWriteEntity autoStatus = miloService.readFromOpcUa("GH1.GH1.AutoStatus"); |
| | | // if (1 != Integer.parseInt(autoStatus.getValue().toString())) { |
| | | log.info("当前为非联机状态,结束钢化下发参数任务"); |
| | | return; |
| | | } |
| | | ReadWriteEntity QandA = miloService.readFromOpcUa("GH1.GH1.QandA"); |
| | | ReadWriteEntity RecipeStatus = miloService.readFromOpcUa("GH1.GH1.RecipeStatus"); |
| | | if (1 == Integer.parseInt(QandA.getValue().toString()) && 2 == Integer.parseInt(RecipeStatus.getValue().toString())) { |
| | | int QandA = tempModbusTcp.readUInt16(40422 - offset); |
| | | int RecipeStatus = tempModbusTcp.readUInt16(40456 - offset); |
| | | if (1 == QandA && 2 == RecipeStatus) { |
| | | // ReadWriteEntity QandA = miloService.readFromOpcUa("GH1.GH1.QandA"); |
| | | // ReadWriteEntity RecipeStatus = miloService.readFromOpcUa("GH1.GH1.RecipeStatus"); |
| | | // if (1 == Integer.parseInt(QandA.getValue().toString()) && 2 == Integer.parseInt(RecipeStatus.getValue().toString())) { |
| | | log.info("版面信息已经下发,并且已经匹配参数,结束钢化下发参数任务"); |
| | | return; |
| | | } |
| | |
| | | shape = shape > 10000 ? 10000 : shape; |
| | | int workmode = 0; //工位数 |
| | | int furmode = 0; //双室/联室 |
| | | tempModbusTcp.writeUInt16(40408 - offset, temperingid); |
| | | tempModbusTcp.writeUInt16(40409 - offset, glasstype); |
| | | tempModbusTcp.writeUInt16(40411 - offset, process); |
| | | tempModbusTcp.writeUInt16(40412 - offset, thiness); |
| | | tempModbusTcp.writeUInt16(40413 - offset, loadingRate); |
| | | tempModbusTcp.writeUInt16(40414 - offset, shape); |
| | | tempModbusTcp.writeUInt16(40415 - offset, workmode); |
| | | tempModbusTcp.writeUInt16(40416 - offset, furmode); |
| | | |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.TemperingId", temperingid));//写入炉号 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.GlassType", glasstype));//写入玻璃类型 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.Process", process));//写入钢化类型 全钢 半钢 防火 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.Thickness", thiness));//写入厚度 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.LoadingRate", loadingRate));//写入装载率 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.Shape", shape));//写入大片比例 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.WorkMode", workmode));//写入工位数 |
| | | miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.FurnaceMode", furmode));//写入炉体工作方式 |
| | | // miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.TemperingId", temperingid));//写入炉号 |
| | | // miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.GlassType", glasstype));//写入玻璃类型 |
| | | // miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.Process", process));//写入钢化类型 全钢 半钢 防火 |
| | | // miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.Thickness", thiness));//写入厚度 |
| | | // miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.LoadingRate", loadingRate));//写入装载率 |
| | | // miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.Shape", shape));//写入大片比例 |
| | | // miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.WorkMode", workmode));//写入工位数 |
| | | // miloService.writeToOpcUa(generateReadWriteEntity("GH1.GH1.FurnaceMode", furmode));//写入炉体工作方式 |
| | | log.info("炉号" + temperingid + "版面信息尝试下发"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer; |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.largenscreen.entity.PieChartVO; |
| | | import com.mes.s7.entity.S7DataGHTwo; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.tools.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | @Autowired |
| | | private DamageService damageService; |
| | | |
| | | @Autowired |
| | | @Qualifier("s7SerializerGHTwo") |
| | | private S7Serializer s7SerializerGHTwo; |
| | | |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | |
| | | private List<TemperingGlassInfo> selectWaitingGlassByOpc() { |
| | | //获取等待进炉中的玻璃信息 |
| | | try { |
| | | S7DataGHTwo s7DataGHTwo = s7SerializerGHTwo.read(S7DataGHTwo.class); |
| | | String engineerEntity = s7DataGHTwo.getF09EngineerId(); |
| | | Integer temperingLayoutIdEntity = s7DataGHTwo.getF09TemperingLayoutId(); |
| | | // ReadWriteEntity engineerEntity = miloService.readFromOpcUa("GH2S7.GH2S7.F09_ENGINEER_ID"); |
| | | // ReadWriteEntity temperingLayoutIdEntity = miloService.readFromOpcUa("GH2S7.GH2S7.F09_TEMPERING_LAYOUT_ID"); |
| | | |
| | | if (null == engineerEntity || null == temperingLayoutIdEntity) { |
| | | engineerEntity = s7DataGHTwo.getF08EngineerId(); |
| | | temperingLayoutIdEntity = s7DataGHTwo.getF08TemperingLayoutId(); |
| | | // engineerEntity = miloService.readFromOpcUa("GH2S7.GH2S7.F08_ENGINEER_ID"); |
| | | // temperingLayoutIdEntity = miloService.readFromOpcUa("GH2S7.GH2S7.F08_TEMPERING_LAYOUT_ID"); |
| | | if (null == engineerEntity || null == temperingLayoutIdEntity) { |
| | | log.info("获取参数异常,结束本次任务"); |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | return temperingAgoService.list(new LambdaQueryWrapper<TemperingGlassInfo>() |
| | | .eq(TemperingGlassInfo::getEngineerId, engineerEntity) |
| | | .eq(TemperingGlassInfo::getTemperingLayoutId, temperingLayoutIdEntity)); |
| | | } catch (Exception e) { |
| | | log.info("获取钢化参数异常:{}", e); |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void temperingGlassHome() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //正在等待进片的玻璃 |
| | | List<TemperingGlassInfo> waitingGlass = temperingAgoService.selectWaitingGlassByOpc(); |
| | | List<TemperingGlassInfo> waitingGlass = selectWaitingGlassByOpc(); |
| | | // List<TemperingGlassInfo> waitingGlass = temperingAgoService.selectWaitingGlassByOpc(); |
| | | if (waitingGlass != null) { |
| | | jsonObject.append("waitingGlass", waitingGlass); |
| | | } |
| | |
| | | //大屏钢化信息 |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingAgoService.list( |
| | | new QueryWrapper<TemperingGlassInfo>() |
| | | .select("engineer_id" ,"tempering_layout_id") |
| | | .select("engineer_id", "tempering_layout_id") |
| | | .eq("state", Const.TEMPERING_START) |
| | | .gt("create_time", startOfToday) |
| | | .groupBy("engineer_id" ,"tempering_layout_id") |
| | | .groupBy("engineer_id", "tempering_layout_id") |
| | | ); |
| | | jsonObject.append("temperingGlassInfoList", temperingGlassInfoList.size()); |
| | | //大屏钢化信息 |
| | |
| | | |
| | | import com.github.xingshuangs.iot.protocol.common.enums.EDataType; |
| | | import com.github.xingshuangs.iot.protocol.s7.serializer.S7Variable; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class S7DataGHOne { |
| | | |
| | | |
| | | @S7Variable(address = "DB99.0", type = EDataType.INT16) |
| | | private Short requestInTempering; |
| | | @S7Variable(address = "DB99.0", type = EDataType.UINT16) |
| | | private Integer requestInTempering; |
| | | |
| | | @S7Variable(address = "DB99.2", type = EDataType.INT16) |
| | | private Short requestTemperingId; |
| | | @S7Variable(address = "DB99.2", type = EDataType.UINT16) |
| | | private Integer requestTemperingId; |
| | | |
| | | @S7Variable(address = "DB99.4", type = EDataType.INT16) |
| | | private Short placedNumber; |
| | | @S7Variable(address = "DB99.4", type = EDataType.UINT16) |
| | | private Integer placedNumber; |
| | | |
| | | @S7Variable(address = "DB99.6", type = EDataType.INT16) |
| | | private Short responseInTempering; |
| | | @S7Variable(address = "DB99.6", type = EDataType.UINT16) |
| | | private Integer responseInTempering; |
| | | |
| | | @S7Variable(address = "DB99.8", type = EDataType.INT16) |
| | | private Short loadTemperingId; |
| | | @S7Variable(address = "DB99.8", type = EDataType.UINT16) |
| | | private Integer loadTemperingId; |
| | | |
| | | } |
| | |
| | | public class S7DataGHTwo { |
| | | |
| | | |
| | | @S7Variable(address = "DB110.80", type = EDataType.INT16) |
| | | private Short mesControl; |
| | | @S7Variable(address = "DB110.32", type = EDataType.UINT16) |
| | | private Integer f08TemperingLayoutId; |
| | | |
| | | @S7Variable(address = "DB110.80", type = EDataType.INT16) |
| | | private Short requestMes; |
| | | @S7Variable(address = "DB110.80", type = EDataType.UINT16) |
| | | private Integer f09TemperingLayoutId; |
| | | |
| | | @S7Variable(address = "DB110.34", type = EDataType.STRING,count = 10) |
| | | private Short MesReply; |
| | | private String f08EngineerId; |
| | | |
| | | @S7Variable(address = "DB110.82", type = EDataType.STRING,count = 10) |
| | | private Short From1; |
| | | private String f09EngineerId; |
| | | |
| | | } |
| | |
| | | // ReadWriteEntity fromOpcUa = miloService.readFromOpcUa("DLP2A.DLP2A.FROM1"); |
| | | String fromOpcUa = s7DataZKDLPOne.getFrom1().toString(); |
| | | List<String> glassIdList = new ArrayList<>(); |
| | | List<Short> requestWords = s7DataZKDLPOne.getStates(); |
| | | List<Integer> requestWords = s7DataZKDLPOne.getStates(); |
| | | for (int i = 1; i <= 6; i++) { |
| | | // ReadWriteEntity requestWord = miloService.readFromOpcUa("DLP2A.DLP2A.DI" + i); |
| | | Short requestWord = requestWords.get(i - 1); |
| | | Integer requestWord = requestWords.get(i - 1); |
| | | // if (null != requestWord.getValue()) { |
| | | if (null != requestWord) { |
| | | BigStorageCageTask task = new BigStorageCageTask(); |
| | |
| | | //向plc发送报警:同一车进片玻璃存在相同 |
| | | // miloService.writeToOpcWord(generateReadWriteEntity("DLP2A.DLP2A.alarmSignal", 2)); |
| | | s7DataZKDLPOne = new S7DataZKDLPOne(); |
| | | s7DataZKDLPOne.setAlramSignal((short) 2); |
| | | s7DataZKDLPOne.setAlramSignal(2); |
| | | s7SerializerZKDLPOne.write(s7DataZKDLPOne); |
| | | return; |
| | | } |
| | |
| | | //向plc发送报警:理片笼存在相同的进片玻璃 |
| | | // miloService.writeToOpcWord(generateReadWriteEntity("DLP2A.DLP2A.alarmSignal", 4)); |
| | | s7DataZKDLPOne = new S7DataZKDLPOne(); |
| | | s7DataZKDLPOne.setAlramSignal((short) 4); |
| | | s7DataZKDLPOne.setAlramSignal(4); |
| | | s7SerializerZKDLPOne.write(s7DataZKDLPOne); |
| | | return; |
| | | } |
| | |
| | | //向plc发送报警:进片任务数量与系统查询到的玻璃数量不匹配 |
| | | // miloService.writeToOpcWord(generateReadWriteEntity("DLP2A.DLP2A.alarmSignal", 8)); |
| | | s7DataZKDLPOne = new S7DataZKDLPOne(); |
| | | s7DataZKDLPOne.setAlramSignal((short) 8); |
| | | s7DataZKDLPOne.setAlramSignal(8); |
| | | s7SerializerZKDLPOne.write(s7DataZKDLPOne); |
| | | return; |
| | | } |
| | |
| | | //向plc发送报警:笼内格子剩余数量不足 |
| | | // miloService.writeToOpcWord(generateReadWriteEntity("DLP2A.DLP2A.alarmSignal", 16)); |
| | | s7DataZKDLPOne = new S7DataZKDLPOne(); |
| | | s7DataZKDLPOne.setAlramSignal((short) 16); |
| | | s7DataZKDLPOne.setAlramSignal(16); |
| | | s7SerializerZKDLPOne.write(s7DataZKDLPOne); |
| | | return; |
| | | } |
| | |
| | | //向plc发送报警:直通片台存在玻璃,无法继续直通 |
| | | // miloService.writeToOpcWord(generateReadWriteEntity("DLP2A.DLP2A.alarmSignal", 64)); |
| | | s7DataZKDLPOne = new S7DataZKDLPOne(); |
| | | s7DataZKDLPOne.setAlramSignal((short) 64); |
| | | s7DataZKDLPOne.setAlramSignal(64); |
| | | s7SerializerZKDLPOne.write(s7DataZKDLPOne); |
| | | return; |
| | | } |
| | |
| | | // miloService.writeToOpcWord(list); |
| | | s7DataZKDLPOne = new S7DataZKDLPOne(); |
| | | for (int i = 0; i < inTaskList.size() && i < 6; i++) { |
| | | short value = (short) Integer.parseInt(inTaskList.get(i).getTargetSlot().toString()); |
| | | Integer value = inTaskList.get(i).getTargetSlot(); |
| | | switch (i) { |
| | | case 0: |
| | | s7DataZKDLPOne.setTo1(value); |
| | |
| | | // list.add(generateReadWriteEntity("DLP2A.DLP2A.MesReply", 0)); |
| | | // miloService.writeToOpcWord(list); |
| | | s7DataZKDLPOne = new S7DataZKDLPOne(); |
| | | s7DataZKDLPOne.setTo1((short) 0); |
| | | s7DataZKDLPOne.setTo2((short) 0); |
| | | s7DataZKDLPOne.setTo3((short) 0); |
| | | s7DataZKDLPOne.setTo4((short) 0); |
| | | s7DataZKDLPOne.setTo5((short) 0); |
| | | s7DataZKDLPOne.setTo6((short) 0); |
| | | s7DataZKDLPOne.setMesReply((short) 0); |
| | | s7DataZKDLPOne.setTo1(0); |
| | | s7DataZKDLPOne.setTo2(0); |
| | | s7DataZKDLPOne.setTo3(0); |
| | | s7DataZKDLPOne.setTo4(0); |
| | | s7DataZKDLPOne.setTo5(0); |
| | | s7DataZKDLPOne.setTo6(0); |
| | | s7DataZKDLPOne.setMesReply(0); |
| | | s7SerializerZKDLPOne.write(s7DataZKDLPOne); |
| | | } |
| | | |
| | |
| | | //向opc发送启动信号 |
| | | // miloService.writeToOpcWord(generateReadWriteEntity("DLP2B.DLP2B.MesReply", 0)); |
| | | s7DataZKDLPTwo = new S7DataZKDLPTwo(); |
| | | s7DataZKDLPTwo.setMesReply((short) 0); |
| | | s7DataZKDLPTwo.setMesReply(0); |
| | | s7SerializerZKDLPTwo.write(s7DataZKDLPTwo); |
| | | } |
| | | |
| | |
| | | //向plc发送报警:直通片台存在玻璃,无法继续直通 |
| | | // miloService.writeToOpcWord(generateReadWriteEntity("DLP1A.DLP1A.alarmSignal", 16)); |
| | | S7DataZKDLPOne s7DataZKDLPOne = new S7DataZKDLPOne(); |
| | | s7DataZKDLPOne.setAlramSignal((short) 16); |
| | | s7DataZKDLPOne.setAlramSignal(16); |
| | | s7SerializerZKDLPOne.write(s7DataZKDLPOne); |
| | | Assert.isFalse(storageCage == null, "任务调度没有多余格子,结束调度任务"); |
| | | } |
| | |
| | | try { |
| | | // miloService.writeToOpcWord(generateReadWriteEntity("DLP2B.DLP2B.MesReply", 1)); |
| | | S7DataZKDLPTwo s7DataZKDLPTwo = new S7DataZKDLPTwo(); |
| | | s7DataZKDLPTwo.setMesReply((short) 0); |
| | | s7DataZKDLPTwo.setMesReply(1); |
| | | s7SerializerZKDLPTwo.write(s7DataZKDLPTwo); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | @S7Variable(address = "DB3.8", type = EDataType.BOOL) |
| | | private Boolean mesControl; |
| | | |
| | | @S7Variable(address = "DB19.0", type = EDataType.INT16) |
| | | private Short requestMes; |
| | | @S7Variable(address = "DB19.0", type = EDataType.UINT16) |
| | | private Integer requestMes; |
| | | |
| | | @S7Variable(address = "DB19.2", type = EDataType.INT16) |
| | | private Short mesReply; |
| | | @S7Variable(address = "DB19.2", type = EDataType.UINT16) |
| | | private Integer mesReply; |
| | | |
| | | @S7Variable(address = "DB19.140", type = EDataType.INT16) |
| | | private Short from1; |
| | | @S7Variable(address = "DB19.140", type = EDataType.UINT16) |
| | | private Integer from1; |
| | | |
| | | @S7Variable(address = "DB19.142", type = EDataType.INT16) |
| | | private Short from2; |
| | | @S7Variable(address = "DB19.142", type = EDataType.UINT16) |
| | | private Integer from2; |
| | | |
| | | @S7Variable(address = "DB19.144", type = EDataType.INT16) |
| | | private Short from3; |
| | | @S7Variable(address = "DB19.144", type = EDataType.UINT16) |
| | | private Integer from3; |
| | | |
| | | @S7Variable(address = "DB19.146", type = EDataType.INT16) |
| | | private Short from4; |
| | | @S7Variable(address = "DB19.146", type = EDataType.UINT16) |
| | | private Integer from4; |
| | | |
| | | @S7Variable(address = "DB19.148", type = EDataType.INT16) |
| | | private Short from5; |
| | | @S7Variable(address = "DB19.148", type = EDataType.UINT16) |
| | | private Integer from5; |
| | | |
| | | @S7Variable(address = "DB19.150", type = EDataType.INT16) |
| | | private Short from6; |
| | | @S7Variable(address = "DB19.150", type = EDataType.UINT16) |
| | | private Integer from6; |
| | | |
| | | @S7Variable(address = "DB19.152", type = EDataType.INT16) |
| | | private Short to1; |
| | | @S7Variable(address = "DB19.152", type = EDataType.UINT16) |
| | | private Integer to1; |
| | | |
| | | @S7Variable(address = "DB19.154", type = EDataType.INT16) |
| | | private Short to2; |
| | | @S7Variable(address = "DB19.154", type = EDataType.UINT16) |
| | | private Integer to2; |
| | | |
| | | @S7Variable(address = "DB19.156", type = EDataType.INT16) |
| | | private Short to3; |
| | | @S7Variable(address = "DB19.156", type = EDataType.UINT16) |
| | | private Integer to3; |
| | | |
| | | @S7Variable(address = "DB19.158", type = EDataType.INT16) |
| | | private Short to4; |
| | | @S7Variable(address = "DB19.158", type = EDataType.UINT16) |
| | | private Integer to4; |
| | | |
| | | @S7Variable(address = "DB19.160", type = EDataType.INT16) |
| | | private Short to5; |
| | | @S7Variable(address = "DB19.160", type = EDataType.UINT16) |
| | | private Integer to5; |
| | | |
| | | @S7Variable(address = "DB19.162", type = EDataType.INT16) |
| | | private Short to6; |
| | | @S7Variable(address = "DB19.162", type = EDataType.UINT16) |
| | | private Integer to6; |
| | | |
| | | @S7Variable(address = "DB19.164", type = EDataType.INT16) |
| | | private Short state1; |
| | | @S7Variable(address = "DB19.164", type = EDataType.UINT16) |
| | | private Integer state1; |
| | | |
| | | @S7Variable(address = "DB19.166", type = EDataType.INT16) |
| | | private Short state2; |
| | | @S7Variable(address = "DB19.166", type = EDataType.UINT16) |
| | | private Integer state2; |
| | | |
| | | @S7Variable(address = "DB19.168", type = EDataType.INT16) |
| | | private Short state3; |
| | | @S7Variable(address = "DB19.168", type = EDataType.UINT16) |
| | | private Integer state3; |
| | | |
| | | @S7Variable(address = "DB19.170", type = EDataType.INT16) |
| | | private Short state4; |
| | | @S7Variable(address = "DB19.170", type = EDataType.UINT16) |
| | | private Integer state4; |
| | | |
| | | @S7Variable(address = "DB19.172", type = EDataType.INT16) |
| | | private Short state5; |
| | | @S7Variable(address = "DB19.172", type = EDataType.UINT16) |
| | | private Integer state5; |
| | | |
| | | @S7Variable(address = "DB19.174", type = EDataType.INT16) |
| | | private Short state6; |
| | | @S7Variable(address = "DB19.174", type = EDataType.UINT16) |
| | | private Integer state6; |
| | | |
| | | @S7Variable(address = "DB19.1246", type = EDataType.INT16) |
| | | private Short glassCount; |
| | | @S7Variable(address = "DB19.1246", type = EDataType.UINT16) |
| | | private Integer glassCount; |
| | | |
| | | @S7Variable(address = "DB19.8", type = EDataType.STRING, count = 22) |
| | | @S7Variable(address = "DB19.8", type = EDataType.STRING, count = 20) |
| | | private String id1; |
| | | |
| | | @S7Variable(address = "DB19.30", type = EDataType.STRING, count = 22) |
| | | @S7Variable(address = "DB19.30", type = EDataType.STRING, count = 20) |
| | | private String id2; |
| | | |
| | | @S7Variable(address = "DB19.52", type = EDataType.STRING, count = 22) |
| | | @S7Variable(address = "DB19.52", type = EDataType.STRING, count = 20) |
| | | private String id3; |
| | | |
| | | @S7Variable(address = "DB19.74", type = EDataType.STRING, count = 22) |
| | | @S7Variable(address = "DB19.74", type = EDataType.STRING, count = 20) |
| | | private String id4; |
| | | |
| | | @S7Variable(address = "DB19.96", type = EDataType.STRING, count = 22) |
| | | @S7Variable(address = "DB19.96", type = EDataType.STRING, count = 20) |
| | | private String id5; |
| | | |
| | | @S7Variable(address = "DB19.118", type = EDataType.STRING, count = 22) |
| | | @S7Variable(address = "DB19.118", type = EDataType.STRING, count = 20) |
| | | private String id6; |
| | | |
| | | @S7Variable(address = "MW1002", type = EDataType.INT16) |
| | | private Short alramSignal; |
| | | @S7Variable(address = "MW1002", type = EDataType.UINT16) |
| | | private Integer alramSignal; |
| | | |
| | | public List<Short> getStates() { |
| | | public List<Integer> getStates() { |
| | | return Arrays.asList(state1, state2, state3, state4, state5, state6); |
| | | } |
| | | |
| | |
| | | return Arrays.asList(id1, id2, id3, id4, id5, id6); |
| | | } |
| | | |
| | | public List<Short> getTos() { |
| | | public List<Integer> getTos() { |
| | | return Arrays.asList(to1, to2, to3, to4, to5, to6); |
| | | } |
| | | |
| | |
| | | @S7Variable(address = "DB3.8", type = EDataType.BOOL) |
| | | private Boolean mesControl; |
| | | |
| | | @S7Variable(address = "DB19.4", type = EDataType.INT16) |
| | | private Short requestMes; |
| | | @S7Variable(address = "DB19.4", type = EDataType.UINT16) |
| | | private Integer requestMes; |
| | | |
| | | @S7Variable(address = "DB19.6", type = EDataType.INT16) |
| | | private Short mesReply; |
| | | @S7Variable(address = "DB19.6", type = EDataType.UINT16) |
| | | private Integer mesReply; |
| | | |
| | | @S7Variable(address = "DB19.308", type = EDataType.INT16) |
| | | private Short from1; |
| | | @S7Variable(address = "DB19.308", type = EDataType.UINT16) |
| | | private Integer from1; |
| | | |
| | | @S7Variable(address = "DB19.310", type = EDataType.INT16) |
| | | private Short from2; |
| | | @S7Variable(address = "DB19.310", type = EDataType.UINT16) |
| | | private Integer from2; |
| | | |
| | | @S7Variable(address = "DB19.312", type = EDataType.INT16) |
| | | private Short from3; |
| | | @S7Variable(address = "DB19.312", type = EDataType.UINT16) |
| | | private Integer from3; |
| | | |
| | | @S7Variable(address = "DB19.314", type = EDataType.INT16) |
| | | private Short from4; |
| | | @S7Variable(address = "DB19.314", type = EDataType.UINT16) |
| | | private Integer from4; |
| | | |
| | | @S7Variable(address = "DB19.316", type = EDataType.INT16) |
| | | private Short from5; |
| | | @S7Variable(address = "DB19.316", type = EDataType.UINT16) |
| | | private Integer from5; |
| | | |
| | | @S7Variable(address = "DB19.318", type = EDataType.INT16) |
| | | private Short from6; |
| | | @S7Variable(address = "DB19.318", type = EDataType.UINT16) |
| | | private Integer from6; |
| | | |
| | | @S7Variable(address = "DB19.320", type = EDataType.INT16) |
| | | private Short to1; |
| | | @S7Variable(address = "DB19.320", type = EDataType.UINT16) |
| | | private Integer to1; |
| | | |
| | | @S7Variable(address = "DB19.322", type = EDataType.INT16) |
| | | private Short to2; |
| | | @S7Variable(address = "DB19.322", type = EDataType.UINT16) |
| | | private Integer to2; |
| | | |
| | | @S7Variable(address = "DB19.324", type = EDataType.INT16) |
| | | private Short to3; |
| | | @S7Variable(address = "DB19.324", type = EDataType.UINT16) |
| | | private Integer to3; |
| | | |
| | | @S7Variable(address = "DB19.326", type = EDataType.INT16) |
| | | private Short to4; |
| | | @S7Variable(address = "DB19.326", type = EDataType.UINT16) |
| | | private Integer to4; |
| | | |
| | | @S7Variable(address = "DB19.328", type = EDataType.INT16) |
| | | private Short to5; |
| | | @S7Variable(address = "DB19.328", type = EDataType.UINT16) |
| | | private Integer to5; |
| | | |
| | | @S7Variable(address = "DB19.330", type = EDataType.INT16) |
| | | private Short to6; |
| | | @S7Variable(address = "DB19.330", type = EDataType.UINT16) |
| | | private Integer to6; |
| | | |
| | | @S7Variable(address = "DB19.332", type = EDataType.INT16) |
| | | private Short state1; |
| | | @S7Variable(address = "DB19.332", type = EDataType.UINT16) |
| | | private Integer state1; |
| | | |
| | | @S7Variable(address = "DB19.334", type = EDataType.INT16) |
| | | private Short state2; |
| | | @S7Variable(address = "DB19.334", type = EDataType.UINT16) |
| | | private Integer state2; |
| | | |
| | | @S7Variable(address = "DB19.336", type = EDataType.INT16) |
| | | private Short state3; |
| | | @S7Variable(address = "DB19.336", type = EDataType.UINT16) |
| | | private Integer state3; |
| | | |
| | | @S7Variable(address = "DB19.338", type = EDataType.INT16) |
| | | private Short state4; |
| | | @S7Variable(address = "DB19.338", type = EDataType.UINT16) |
| | | private Integer state4; |
| | | |
| | | @S7Variable(address = "DB19.340", type = EDataType.INT16) |
| | | private Short state5; |
| | | @S7Variable(address = "DB19.340", type = EDataType.UINT16) |
| | | private Integer state5; |
| | | |
| | | @S7Variable(address = "DB19.342", type = EDataType.INT16) |
| | | private Short state6; |
| | | @S7Variable(address = "DB19.342", type = EDataType.UINT16) |
| | | private Integer state6; |
| | | |
| | | @S7Variable(address = "DB19.176", type = EDataType.STRING, count = 22) |
| | | @S7Variable(address = "DB19.176", type = EDataType.STRING, count = 20) |
| | | private String id1; |
| | | |
| | | @S7Variable(address = "DB19.198", type = EDataType.STRING, count = 22) |
| | | @S7Variable(address = "DB19.198", type = EDataType.STRING, count = 20) |
| | | private String id2; |
| | | |
| | | @S7Variable(address = "DB19.220", type = EDataType.STRING, count = 22) |
| | | @S7Variable(address = "DB19.220", type = EDataType.STRING, count = 20) |
| | | private String id3; |
| | | |
| | | @S7Variable(address = "DB19.242", type = EDataType.STRING, count = 22) |
| | | @S7Variable(address = "DB19.242", type = EDataType.STRING, count = 20) |
| | | private String id4; |
| | | |
| | | @S7Variable(address = "DB19.264", type = EDataType.STRING, count = 22) |
| | | @S7Variable(address = "DB19.264", type = EDataType.STRING, count = 20) |
| | | private String id5; |
| | | |
| | | @S7Variable(address = "DB19.286", type = EDataType.STRING, count = 22) |
| | | @S7Variable(address = "DB19.286", type = EDataType.STRING, count = 20) |
| | | private String id6; |
| | | |
| | | |