解决信号未全部下发设备 手持指令管理没有数据 新需求

This commit is contained in:
张江玮
2023-01-11 09:25:49 +08:00
parent 5c0ac90817
commit e749e23a93
5 changed files with 26 additions and 5 deletions

View File

@@ -139,6 +139,10 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
task2 = this.itemProtocol.getTask2(); task2 = this.itemProtocol.getTask2();
if (mode != last_mode) { if (mode != last_mode) {
if (mode == 0) {
this.setRequireHeadSucess(false);
this.setRequireBackSucess(false);
}
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
} }
@@ -219,6 +223,10 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
this.writing("to_onset1", "0"); this.writing("to_onset1", "0");
this.writing("to_target1", "0"); this.writing("to_target1", "0");
this.writing("to_task1", "0"); this.writing("to_task1", "0");
this.writing("to_command1", "0");
this.writing("to_onset1", "0");
this.writing("to_target1", "0");
this.writing("to_task1", "0");
} }
} }
} }
@@ -258,6 +266,10 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
this.writing("to_onset2", "0"); this.writing("to_onset2", "0");
this.writing("to_target2", "0"); this.writing("to_target2", "0");
this.writing("to_task2", "0"); this.writing("to_task2", "0");
this.writing("to_command2", "0");
this.writing("to_onset2", "0");
this.writing("to_target2", "0");
this.writing("to_task2", "0");
} }
} }
} }
@@ -271,7 +283,7 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
if (startDevice.getDeviceDriver() instanceof HfStationDeviceDriver) { if (startDevice.getDeviceDriver() instanceof HfStationDeviceDriver) {
hfStationDeviceDriver = (HfStationDeviceDriver) startDevice.getDeviceDriver(); hfStationDeviceDriver = (HfStationDeviceDriver) startDevice.getDeviceDriver();
int move = hfStationDeviceDriver.getMove(); int move = hfStationDeviceDriver.getMove();
if (move == 1) { if (move != 0) {
logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "RGV前工位取货时,开始反馈电气信号"); logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "RGV前工位取货时,开始反馈电气信号");
this.writing("to_command1", "2"); this.writing("to_command1", "2");
} else { } else {
@@ -305,7 +317,7 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
if (startDevice.getDeviceDriver() instanceof HfStationDeviceDriver) { if (startDevice.getDeviceDriver() instanceof HfStationDeviceDriver) {
hfStationDeviceDriver = (HfStationDeviceDriver) startDevice.getDeviceDriver(); hfStationDeviceDriver = (HfStationDeviceDriver) startDevice.getDeviceDriver();
int move = hfStationDeviceDriver.getMove(); int move = hfStationDeviceDriver.getMove();
if (move == 1) { if (move != 0) {
logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "RGV后工位取货时,开始反馈电气信号"); logServer.deviceInfo("反馈电气信号", this.getDevice_code(), "RGV后工位取货时,开始反馈电气信号");
this.writing("to_command2", "2"); this.writing("to_command2", "2");
} else { } else {
@@ -627,6 +639,10 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
this.writing("to_target1", next_addr); this.writing("to_target1", next_addr);
this.writing("to_task1", dto.getInstruction_code()); this.writing("to_task1", dto.getInstruction_code());
this.writing("to_command1", "1"); this.writing("to_command1", "1");
this.writing("to_onset1", start_addr);
this.writing("to_target1", next_addr);
this.writing("to_task1", dto.getInstruction_code());
this.writing("to_command1", "1");
logServer.deviceInfo("RGV申请前工位任务", this.getDevice_code(), "RGV前工位任务指令创建成功,信号写入成功"); logServer.deviceInfo("RGV申请前工位任务", this.getDevice_code(), "RGV前工位任务指令创建成功,信号写入成功");
} }
@@ -644,6 +660,10 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
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");
logServer.deviceInfo("RGV申请后工位任务", this.getDevice_code(), "RGV后工位任务指令创建成功,信号写入成功"); logServer.deviceInfo("RGV申请后工位任务", this.getDevice_code(), "RGV后工位任务指令创建成功,信号写入成功");
} }
@@ -671,7 +691,7 @@ public class HfTwoRGVDeviceDriver extends AbstractOpcDeviceDriver implements Dev
String opcservcerid = this.getDevice().getOpc_server_id(); String opcservcerid = this.getDevice().getOpc_server_id();
Server server = ReadUtil.getServer(opcservcerid); 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, Integer.parseInt(value));
ReadUtil.write(itemMap, server); ReadUtil.write(itemMap, server);
logServer.writeLog("下发电气信号", this.getDevice_code(), "下发信号:" + to_param + "信号值:" + value); logServer.writeLog("下发电气信号", this.getDevice_code(), "下发信号:" + to_param + "信号值:" + value);

View File

@@ -192,7 +192,7 @@ public class InstructionDto implements Serializable {
/** /**
* 是否删除 * 是否删除
*/ */
private String is_delete; private String is_delete = "0";
/** /**
* 创建者 * 创建者

View File

@@ -58,6 +58,8 @@
OPTION 输入.region_code <> "" OPTION 输入.region_code <> ""
p.region_code = 输入.region_code p.region_code = 输入.region_code
ENDOPTION ENDOPTION
ORDER BY
p.point_code DESC
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF

View File

@@ -208,7 +208,6 @@ public class HnjSendMaterialTask extends AbstractAcsTask {
pointTab.update(jsonEnd); pointTab.update(jsonEnd);
} }
} }
} }
} }