admin
2025-04-09 9a0334b6e46d9503246d99be0a3a79945dee7919
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -127,13 +127,19 @@
                        }
                    }else {//自动工位
                        //所有进站将进站时间写给PLC
                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                        String currentDate = dateFormat.format(new Date());
                        miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".StartTime").value(currentDate).build());
                        Object snCodeObject = miloService.readFromOpcUa(thoroughfare + "." + device + ".SNCode").getValue();
                        if (ObjectUtil.isNull(snCodeObject)){
                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(12).build());
                        }else{
                            //所有进站将进站时间写给PLC
                            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                            String currentDate = dateFormat.format(new Date());
                            miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".StartTime").value(currentDate).build());
                        Integer recordDataDone = 11;
                        miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(recordDataDone).build());
                            Integer recordDataDone = 11;
                            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(recordDataDone).build());
                        }
                    }
                } else if(Constants.TWO.equals(valueString)){//出站