|
@ -504,9 +504,12 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
} else { |
|
|
} else { |
|
|
//申请后工位任务
|
|
|
//申请后工位任务
|
|
|
TaskDto task2 = null; |
|
|
TaskDto task2 = null; |
|
|
|
|
|
List<String> getDeviceCodeList2 = this.getExtraDeviceCodes("get_device_code2"); |
|
|
|
|
|
//前工位放货关联设备
|
|
|
|
|
|
List<String> putDeviceCodeList2 = this.getExtraDeviceCodes("put_device_code2"); |
|
|
for (int i = 0; i < putDeviceCodeList.size(); i++) { |
|
|
for (int i = 0; i < putDeviceCodeList.size(); i++) { |
|
|
if (ObjectUtil.isNotEmpty(taskserver.queryTaskByDeviceCode(putDeviceCodeList.get(i).replace("\"", "")))) { |
|
|
if (ObjectUtil.isNotEmpty(taskserver.queryTaskByDeviceCode(getDeviceCodeList2.get(i).replace("\"", "")))) { |
|
|
task2 = taskserver.queryTaskByDeviceCode(putDeviceCodeList.get(i).replace("\"", "")).get(0); |
|
|
task2 = taskserver.queryTaskByDeviceCode(getDeviceCodeList2.get(i).replace("\"", "")).get(0); |
|
|
} |
|
|
} |
|
|
if (ObjectUtil.isNotEmpty(task2)) break; |
|
|
if (ObjectUtil.isNotEmpty(task2)) break; |
|
|
} |
|
|
} |
|
@ -588,22 +591,38 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// public void writing(String param, String value) {
|
|
|
|
|
|
//
|
|
|
|
|
|
// String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
|
|
|
|
|
// + "." + param;
|
|
|
|
|
|
//
|
|
|
|
|
|
// Map<String, Object> itemMap = new HashMap<String, Object>();
|
|
|
|
|
|
// itemMap.put(to_param, value);
|
|
|
|
|
|
//
|
|
|
|
|
|
// try {
|
|
|
|
|
|
// this.checkcontrol(itemMap);
|
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
|
// }
|
|
|
|
|
|
// logServer.deviceExecuteLog(this.device_code, "", "", to_param + " 写入 " + value);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void writing(String param, String value) { |
|
|
public void writing(String param, String value) { |
|
|
|
|
|
|
|
|
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() |
|
|
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() |
|
|
+ "." + param; |
|
|
+ "." + param; |
|
|
|
|
|
String opcservcerid = this.getDevice().getOpc_server_id(); |
|
|
|
|
|
Server server = ReadUtil.getServer(opcservcerid); |
|
|
Map<String, Object> itemMap = new HashMap<String, Object>(); |
|
|
Map<String, Object> itemMap = new HashMap<String, Object>(); |
|
|
itemMap.put(to_param, value); |
|
|
itemMap.put(to_param, value); |
|
|
|
|
|
|
|
|
try { |
|
|
ReadUtil.write(itemMap, server); |
|
|
this.checkcontrol(itemMap); |
|
|
server.disconnect(); |
|
|
} catch (Exception e) { |
|
|
logServer.deviceExecuteLog(this.device_code, "", "", param + " 写入 " + value); |
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
logServer.deviceExecuteLog(this.device_code, "", "", to_param + " 写入 " + value); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean exe_business() { |
|
|
public boolean exe_business() { |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
@ -945,10 +964,6 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi |
|
|
this.writing("to_target2", next_addr); |
|
|
this.writing("to_target2", next_addr); |
|
|
this.writing("to_task2", dto.getInstruction_code()); |
|
|
this.writing("to_task2", dto.getInstruction_code()); |
|
|
this.writing("to_command2", "1"); |
|
|
this.writing("to_command2", "1"); |
|
|
this.writing("to_onset2", start_addr); |
|
|
|
|
|
this.writing("to_target2", next_addr); |
|
|
|
|
|
this.writing("to_task2", dto.getInstruction_code()); |
|
|
|
|
|
this.writing("to_command2", "1"); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|