add:新增堆垛机,输送线待机后清除写入的信号

This commit is contained in:
2024-04-26 15:03:39 +08:00
parent 6ea2a98c1d
commit 073caafb3f
5 changed files with 77 additions and 49 deletions

View File

@@ -240,6 +240,9 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
if (mode != last_mode) {
requireSucess = false;
if(mode == 2){
clearWrite();
}
}
@@ -341,6 +344,31 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
}
public void clearWrite() {
List list = new ArrayList<>();
Map map = new HashMap<>();
map.put("code","to_target");
map.put("value","0");
list.add(map);
Map map2 = new HashMap<>();
map2.put("code","to_task");
map2.put("value","0");
list.add(map2);
Map map3 = new HashMap<>();
map3.put("code","to_command");
map3.put("value","0");
list.add(map3);
Map map4 = new HashMap<>();
map4.put("code","to_container_type");
map4.put("value","0");
list.add(map4);
this.writing(list);
message=null;
vehicle_code=null;
}
public void writing(int command) {
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()

View File

@@ -25,10 +25,6 @@ public class ItemProtocol {
public static String item_error = "error";
//物料
public static String item_material = "material";
//物料直径
public static String item_size = "size";
//物料长度
public static String item_len = "len";
//明细数量
public static String item_Itemized_qty = "Itemized_qty";
@@ -36,11 +32,9 @@ public class ItemProtocol {
public static String item_to_command = "to_command";
//下发物料类型
public static String item_to_material = "to_material";
//下发命令
public static String item_to_size = "to_size";
//下发命令
public static String item_to_len = "to_len";
//下发命令
//下发物料规格
public static String item_to_spec = "to_spec";
//下发物料数量
public static String item_to_qty = "to_qty";
private PaperTubePickSiteDeviceDriver driver;
@@ -75,13 +69,6 @@ public class ItemProtocol {
return this.getOpcStringValue(item_material);
}
public int getSize() {
return this.getOpcIntegerValue(item_size);
}
public int getLen() {
return this.getOpcIntegerValue(item_len);
}
public int getItemized_qty() {
return this.getOpcIntegerValue(item_Itemized_qty);
@@ -95,17 +82,6 @@ public class ItemProtocol {
return this.getOpcStringValue(item_to_material);
}
public int getTo_size() {
return this.getOpcIntegerValue(item_to_size);
}
public int getTo_len() {
return this.getOpcIntegerValue(item_to_len);
}
public int getTo_qty() {
return this.getOpcIntegerValue(item_to_qty);
}
Boolean isonline;
@@ -141,8 +117,6 @@ public class ItemProtocol {
list.add(new ItemDto(item_error, "报警", "DB1001.B4"));
list.add(new ItemDto(item_qty, "总数量", "DB1001.B5"));
list.add(new ItemDto(item_material, "物料类型", "DB1.B6"));
list.add(new ItemDto(item_size, "物料直径", "DB1.B7"));
list.add(new ItemDto(item_len, "物料长度", "DB1.B8"));
list.add(new ItemDto(item_Itemized_qty, "物料明细数量", "DB1.B9"));
return list;
}
@@ -151,8 +125,7 @@ public class ItemProtocol {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_command, "下发命令", "DB2.W0"));
list.add(new ItemDto(item_to_material, "下发物料类型", "DB2.W2"));
list.add(new ItemDto(item_to_size, "下发物料直径", "DB2.W4"));
list.add(new ItemDto(item_to_len, "下发物料长度", "DB2.W6"));
list.add(new ItemDto(item_to_spec, "下发物料规格", "DB2.W4"));
list.add(new ItemDto(item_to_qty, "下发物料数量", "DB2.W8"));
return list;
}

View File

@@ -73,12 +73,6 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
//物料类型
String material = null;
String last_material = null;
//物料直径
int size =0;
int last_size =0;
//物料长度
int len = 0;
int last_len = 0;
//物料明细数量
int Itemized_qty = 0;
int last_Itemized_qty = 0;
@@ -94,12 +88,9 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
//下发物料类型
String to_material =null;
String last_to_material =null;
//下发物料直径
int to_size = 0;
int last_to_size = 0;
//下发物料长度
int to_len=0;
int last_to_len=0;
//下发物料规格
int to_spec=0;
int last_to_spec=0;
//下发物料数量
int to_qty=0;
int last_to_qty=0;
@@ -141,10 +132,6 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
this.writing(0);
}
}
if (move != last_move) {
}
if (error != last_error) {
}
} catch (Exception var17) {
return;
}
@@ -196,7 +183,17 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
}
}
last_mode = mode;
last_action = action;
last_move = move;
last_qty = qty;
last_error =error;
last_material = material;
last_Itemized_qty = Itemized_qty;
last_to_command = to_command;
last_to_spec = to_spec;
last_to_material = to_material;
last_to_qty = to_qty;
}
protected void thingToNothing() {

View File

@@ -324,6 +324,9 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
if (!command.equals(last_command)){
requireSucess=true;
if (command==0){
clearWrite();
}
}
@@ -666,6 +669,33 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
}
}
public void clearWrite() {
List list = new ArrayList<>();
Map map = new HashMap<>();
map.put("code","to_x");
map.put("value","0");
list.add(map);
Map map2 = new HashMap<>();
map2.put("code","to_y");
map2.put("value","0");
list.add(map2);
Map map3 = new HashMap<>();
map3.put("code","to_z");
map3.put("value","0");
list.add(map3);
Map map4 = new HashMap<>();
map4.put("code","to_command");
map4.put("value","0");
list.add(map4);
Map map5 = new HashMap<>();
map4.put("code","to_task");
map4.put("value","0");
list.add(map4);
this.writing(list);
message=null;
}
private void updateData2(String poinCode, Instruction instruction, Device point, String[] split) {
Instruction instructionUpdate = checkInst();
TaskDto taskUpdate = new TaskDto();

View File

@@ -611,7 +611,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
String mode = "";
String move = "";
String action = "";
String walk_y = "";
String walkY = "";
if (this.getMode() == 0) {
mode = LangProcess.msg("universal_off-line");
} else if (this.getMode() == 1) {