Browse Source

修改

炒锅机器人_一拖多
liup 2 months ago
parent
commit
486b047967
4 changed files with 98 additions and 93 deletions
  1. +75
    -86
      app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java
  2. +20
    -5
      app/src/main/java/com/bonait/bnframework/modbus/ModbusCenter.java
  3. +1
    -0
      app/src/main/java/com/bonait/bnframework/newui/dialog/control/WokControlDialog.java
  4. +2
    -2
      app/src/main/java/com/bonait/bnframework/newui/widget/FireControlView.java

+ 75
- 86
app/src/main/java/com/bonait/bnframework/common/constant/ConfigName.java View File

@@ -91,26 +91,26 @@ public class ConfigName {

//硬件设备 初始化
add(new Res_PLCADDRESS("硬件设备", "-------------", 0, 0));
add(new Res_PLCADDRESS("初始化", "M10.0", 1, 1));
add(new Res_PLCADDRESS("急停", "M10.1", 1, 1));
add(new Res_PLCADDRESS("初始化", "M10.0", 0, 1));
add(new Res_PLCADDRESS("急停", "M10.1", 0, 1));
add(new Res_PLCADDRESS("复位", "M10.2", 0, 1));

//搅拌模型
add(new Res_PLCADDRESS("模型控制", "-------------", 0, 0));
add(new Res_PLCADDRESS("搅拌", "M10.3", 1, 1));
add(new Res_PLCADDRESS("搅拌速度", "VW102", 1, 1));
add(new Res_PLCADDRESS("搅拌速度", "VW102", 0, 1));

//翻转正转模型
add(new Res_PLCADDRESS("翻转正转", "M10.4", 0, 1));
add(new Res_PLCADDRESS("翻转反转", "M10.5", 0, 1));
add(new Res_PLCADDRESS("转动速度", "VW104", 1, 1));
add(new Res_PLCADDRESS("转动速度", "VW104", 0, 1));


//加热模型
add(new Res_PLCADDRESS("加热", "M10.6", 0, 1));
add(new Res_PLCADDRESS("加热功率", "VW100", 1, 1));
add(new Res_PLCADDRESS("温控开关", "M17.6", 1, 1));
add(new Res_PLCADDRESS("暂停开关", "M17.7", 1, 1));
add(new Res_PLCADDRESS("加热功率", "VW100", 0, 1));
add(new Res_PLCADDRESS("温控开关", "M17.6", 0, 1));
add(new Res_PLCADDRESS("暂停开关", "M17.7", 0, 1));


//抽水放水
@@ -139,59 +139,59 @@ public class ConfigName {

//深度清洗功能
add(new Res_PLCADDRESS("深度清洗功能", "-------------", 0, 0));
add(new Res_PLCADDRESS("清洗抽水量", "VW122", 1, 1));
add(new Res_PLCADDRESS("清洗时间", "VW1150", 1, 1));
add(new Res_PLCADDRESS("倒水减速角度", "VW1152", 1, 1));
add(new Res_PLCADDRESS("清洗抽水量", "VW122", 0, 1));
add(new Res_PLCADDRESS("清洗时间", "VW1150", 0, 1));
add(new Res_PLCADDRESS("倒水减速角度", "VW1152", 0, 1));
add(new Res_PLCADDRESS("深度清洗", "M13.6", 0, 1));
add(new Res_PLCADDRESS("编码器复位", "M13.7", 0, 1));

//液体料模型
add(new Res_PLCADDRESS("料仓校准", "-------------", 0, 0));
add(new Res_PLCADDRESS("校准时间", "VW112", 1, 1));
add(new Res_PLCADDRESS("校准时间", "VW112", 0, 1));
add(new Res_PLCADDRESS("料仓1校准开关", "M12.3", 0, 1));
add(new Res_PLCADDRESS("料仓1校准值", "VW114", 1, 1));
add(new Res_PLCADDRESS("料仓1校准值", "VW114", 0, 1));
add(new Res_PLCADDRESS("料仓2校准开关", "M12.4", 0, 1));
add(new Res_PLCADDRESS("料仓2校准值", "VW116", 1, 1));
add(new Res_PLCADDRESS("料仓2校准值", "VW116", 0, 1));
add(new Res_PLCADDRESS("料仓3校准开关", "M12.5", 0, 1));
add(new Res_PLCADDRESS("料仓3校准值", "VW118", 1, 1));
add(new Res_PLCADDRESS("料仓3校准值", "VW118", 0, 1));
add(new Res_PLCADDRESS("料仓4校准开关", "M13.5", 0, 1));
add(new Res_PLCADDRESS("料仓4校准值", "VW120", 1, 1));
add(new Res_PLCADDRESS("料仓4校准值", "VW120", 0, 1));
add(new Res_PLCADDRESS("开始校正", "M12.6", 0, 1));

add(new Res_PLCADDRESS("料仓自动", "-------------", 0, 0));
add(new Res_PLCADDRESS("料仓1需求值", "VW106", 1, 1));
add(new Res_PLCADDRESS("料仓1需求值", "VW106", 0, 1));
add(new Res_PLCADDRESS("料仓1下料", "M11.1", 0, 1));
add(new Res_PLCADDRESS("料仓2需求值", "VW108", 1, 1));
add(new Res_PLCADDRESS("料仓2需求值", "VW108", 0, 1));
add(new Res_PLCADDRESS("料仓2下料", "M11.2", 0, 1));
add(new Res_PLCADDRESS("料仓3需求值", "VW110", 1, 1));
add(new Res_PLCADDRESS("料仓3需求值", "VW110", 0, 1));
add(new Res_PLCADDRESS("料仓3下料", "M11.3", 0, 1));
add(new Res_PLCADDRESS("料仓4需求值", "VW122", 1, 1));
add(new Res_PLCADDRESS("料仓4需求值", "VW122", 0, 1));
add(new Res_PLCADDRESS("料仓4下料", "M13.4", 0, 1));

add(new Res_PLCADDRESS("料仓手动", "-------------", 0, 0));
add(new Res_PLCADDRESS("料仓1手动开关", "M13.1", 1, 1));
add(new Res_PLCADDRESS("料仓2手动开关", "M13.2", 1, 1));
add(new Res_PLCADDRESS("料仓3手动开关", "M13.3", 1, 1));
add(new Res_PLCADDRESS("料仓4手动开关", "M10.7", 1, 1));
add(new Res_PLCADDRESS("料仓1手动开关", "M13.1", 0, 1));
add(new Res_PLCADDRESS("料仓2手动开关", "M13.2", 0, 1));
add(new Res_PLCADDRESS("料仓3手动开关", "M13.3", 0, 1));
add(new Res_PLCADDRESS("料仓4手动开关", "M10.7", 0, 1));

//上下限
add(new Res_PLCADDRESS("位置上下限", "-------------", 0, 0));
add(new Res_PLCADDRESS("原点位置下限", "VD150", 1, 1));
add(new Res_PLCADDRESS("原点位置上限", "VD154", 1, 1));
add(new Res_PLCADDRESS("洗锅位置下限", "VD158", 1, 1));
add(new Res_PLCADDRESS("洗锅位置上限", "VD162", 1, 1));
add(new Res_PLCADDRESS("倒菜位置下限", "VD166", 1, 1));
add(new Res_PLCADDRESS("倒菜位置上限", "VD170", 1, 1));
add(new Res_PLCADDRESS("抽调料位置下限", "VD174", 1, 1));
add(new Res_PLCADDRESS("抽调料位置上限", "VD178", 1, 1));
add(new Res_PLCADDRESS("1#炒制位置下限", "VD182", 1, 1));
add(new Res_PLCADDRESS("1#炒制位置上限", "VD186", 1, 1));
add(new Res_PLCADDRESS("2#炒制位置下限", "VD190", 1, 1));
add(new Res_PLCADDRESS("2#炒制位置上限", "VD194", 1, 1));
add(new Res_PLCADDRESS("3#炒制位置下限", "VD198", 1, 1));
add(new Res_PLCADDRESS("3#炒制位置上限", "VD202", 1, 1));
add(new Res_PLCADDRESS("炒锅工作范围下限", "VD206", 1, 1));
add(new Res_PLCADDRESS("炒锅工作范围上限", "VD210", 1, 1));
add(new Res_PLCADDRESS("原点位置下限", "VD150", 0, 1));
add(new Res_PLCADDRESS("原点位置上限", "VD154", 0, 1));
add(new Res_PLCADDRESS("洗锅位置下限", "VD158", 0, 1));
add(new Res_PLCADDRESS("洗锅位置上限", "VD162", 0, 1));
add(new Res_PLCADDRESS("倒菜位置下限", "VD166", 0, 1));
add(new Res_PLCADDRESS("倒菜位置上限", "VD170", 0, 1));
add(new Res_PLCADDRESS("抽调料位置下限", "VD174", 0, 1));
add(new Res_PLCADDRESS("抽调料位置上限", "VD178", 0, 1));
add(new Res_PLCADDRESS("1#炒制位置下限", "VD182", 0, 1));
add(new Res_PLCADDRESS("1#炒制位置上限", "VD186", 0, 1));
add(new Res_PLCADDRESS("2#炒制位置下限", "VD190", 0, 1));
add(new Res_PLCADDRESS("2#炒制位置上限", "VD194", 0, 1));
add(new Res_PLCADDRESS("3#炒制位置下限", "VD198", 0, 1));
add(new Res_PLCADDRESS("3#炒制位置上限", "VD202", 0, 1));
add(new Res_PLCADDRESS("炒锅工作范围下限", "VD206", 0, 1));
add(new Res_PLCADDRESS("炒锅工作范围上限", "VD210", 0, 1));

//反馈信号
add(new Res_PLCADDRESS("反馈信号", "-------------", 0, 0));
@@ -207,68 +207,57 @@ public class ConfigName {
add(new Res_PLCADDRESS("倒菜位反馈", "M40.7", 1, 0));
add(new Res_PLCADDRESS("投料位反馈", "M41.0", 1, 0));
add(new Res_PLCADDRESS("清洗位反馈", "M41.1", 1, 0));
add(new Res_PLCADDRESS("料仓1下料完成", "M41.2", 1, 0));
add(new Res_PLCADDRESS("料仓2下料完成", "M41.3", 1, 0));
add(new Res_PLCADDRESS("料仓3下料完成", "M41.4", 1, 0));
add(new Res_PLCADDRESS("料仓4下料完成", "M42.0", 1, 0));
add(new Res_PLCADDRESS("炒锅清洗反馈", "M41.5", 1, 0));
add(new Res_PLCADDRESS("出餐启动反馈", "M41.6", 1, 0));
add(new Res_PLCADDRESS("炒锅倒菜减速位", "M41.7", 1, 0));
// add(new Res_PLCADDRESS("平移轴在1号位", "M43.0", 1, 0));
// add(new Res_PLCADDRESS("平移轴在2号位", "M43.1", 1, 0));
// add(new Res_PLCADDRESS("平移轴在3号位", "M43.2", 1, 0));
// add(new Res_PLCADDRESS("平移轴在4号位", "M43.3", 1, 0));
// add(new Res_PLCADDRESS("翻转轴在1号位", "M44.0", 1, 0));
// add(new Res_PLCADDRESS("翻转轴在2号位", "M44.1", 1, 0));
// add(new Res_PLCADDRESS("翻转轴在3号位", "M44.2", 1, 0));
// add(new Res_PLCADDRESS("翻转轴在4号位", "M44.3", 1, 0));
add(new Res_PLCADDRESS("翻转轴在1号吸料位", "M44.3", 1, 0));
add(new Res_PLCADDRESS("翻转轴在2号吸料位", "M72.0", 1, 0));
add(new Res_PLCADDRESS("翻转轴在3号吸料位", "M72.1", 1, 0));
add(new Res_PLCADDRESS("翻转轴在4号吸料位", "M72.2", 1, 0));

add(new Res_PLCADDRESS("倒菜完成", "M44.4", 1, 0));
add(new Res_PLCADDRESS("料仓1下料完成", "M41.2", 0, 0));
add(new Res_PLCADDRESS("料仓2下料完成", "M41.3", 0, 0));
add(new Res_PLCADDRESS("料仓3下料完成", "M41.4", 0, 0));
add(new Res_PLCADDRESS("料仓4下料完成", "M42.0", 0, 0));
add(new Res_PLCADDRESS("炒锅清洗反馈", "M41.5", 0, 0));
add(new Res_PLCADDRESS("出餐启动反馈", "M41.6", 0, 0));
add(new Res_PLCADDRESS("炒锅倒菜减速位", "M41.7", 0, 0));


add(new Res_PLCADDRESS("倒菜完成", "M44.4", 0, 0));
add(new Res_PLCADDRESS("心跳位", "VW1000", 0, 1));

add(new Res_PLCADDRESS("温度模拟输入量", "-------------", 0, 0));
add(new Res_PLCADDRESS("温度模拟量上限", "VW1050", 1, 1));
add(new Res_PLCADDRESS("温度模拟量下限", "VW1052", 1, 1));
add(new Res_PLCADDRESS("温度模拟量", "VW1054", 1, 1));
add(new Res_PLCADDRESS("温度量程上限", "VD1060", 1, 1));
add(new Res_PLCADDRESS("温度量程下限", "VD1056", 1, 1));
add(new Res_PLCADDRESS("温度模拟量上限", "VW1050", 0, 1));
add(new Res_PLCADDRESS("温度模拟量下限", "VW1052", 0, 1));
add(new Res_PLCADDRESS("温度模拟量", "VW1054", 0, 1));
add(new Res_PLCADDRESS("温度量程上限", "VD1060", 0, 1));
add(new Res_PLCADDRESS("温度量程下限", "VD1056", 0, 1));

add(new Res_PLCADDRESS("电流模拟输入量", "-------------", 0, 0));
add(new Res_PLCADDRESS("电流模拟量上限", "VW1070", 1, 1));
add(new Res_PLCADDRESS("电流模拟量下限", "VW1072", 1, 1));
add(new Res_PLCADDRESS("电流模拟量", "VW1074", 1, 1));
add(new Res_PLCADDRESS("电流量程上限", "VD1080", 1, 1));
add(new Res_PLCADDRESS("电流量程下限", "VD1076", 1, 1));
add(new Res_PLCADDRESS("电流报警设置", "VW1092", 1, 1));
add(new Res_PLCADDRESS("电流模拟量上限", "VW1070", 0, 1));
add(new Res_PLCADDRESS("电流模拟量下限", "VW1072", 0, 1));
add(new Res_PLCADDRESS("电流模拟量", "VW1074", 0, 1));
add(new Res_PLCADDRESS("电流量程上限", "VD1080", 0, 1));
add(new Res_PLCADDRESS("电流量程下限", "VD1076", 0, 1));
add(new Res_PLCADDRESS("电流报警设置", "VW1092", 0, 1));
add(new Res_PLCADDRESS("异常加热故障信息", "M42.1", 1, 1));

//检测信号
add(new Res_PLCADDRESS("监测信号", "-------------", 0, 0));
add(new Res_PLCADDRESS("当前锅底温度", "VD300", 1, 0));
add(new Res_PLCADDRESS("炒锅搅拌转速", "VD304", 1, 0));
add(new Res_PLCADDRESS("当前加热档位", "VD308", 1, 0));
add(new Res_PLCADDRESS("炒锅当前电压", "VD312", 1, 0));
add(new Res_PLCADDRESS("炒锅当前电流", "VD316", 1, 0));
add(new Res_PLCADDRESS("炒锅当前功率", "VD320", 1, 0));
add(new Res_PLCADDRESS("搅拌频率", "VW324", 1, 0));
add(new Res_PLCADDRESS("搅拌电机电流", "VW326", 1, 0));
add(new Res_PLCADDRESS("搅拌电机电压", "VW328", 1, 0));
add(new Res_PLCADDRESS("搅拌变频器温度", "VW330", 1, 0));
add(new Res_PLCADDRESS("翻转频率", "VW332", 1, 0));
add(new Res_PLCADDRESS("翻转电机电流", "VW334", 1, 0));
add(new Res_PLCADDRESS("翻转电机电压", "VW336", 1, 0));
add(new Res_PLCADDRESS("翻转变频器温度", "VW338", 1, 0));
add(new Res_PLCADDRESS("编码器当前位值", "VD340", 1, 0));
add(new Res_PLCADDRESS("炒锅搅拌转速", "VD304", 0, 0));
add(new Res_PLCADDRESS("当前加热档位", "VD308", 0, 0));
add(new Res_PLCADDRESS("炒锅当前电压", "VD312", 0, 0));
add(new Res_PLCADDRESS("炒锅当前电流", "VD316", 0, 0));
add(new Res_PLCADDRESS("炒锅当前功率", "VD320", 0, 0));
add(new Res_PLCADDRESS("搅拌频率", "VW324", 0, 0));
add(new Res_PLCADDRESS("搅拌电机电流", "VW326", 0, 0));
add(new Res_PLCADDRESS("搅拌电机电压", "VW328", 0, 0));
add(new Res_PLCADDRESS("搅拌变频器温度", "VW330", 0, 0));
add(new Res_PLCADDRESS("翻转频率", "VW332", 0, 0));
add(new Res_PLCADDRESS("翻转电机电流", "VW334", 0, 0));
add(new Res_PLCADDRESS("翻转电机电压", "VW336", 0, 0));
add(new Res_PLCADDRESS("翻转变频器温度", "VW338", 0, 0));
add(new Res_PLCADDRESS("编码器当前位值", "VD340", 0, 0));

//状态上报
add(new Res_PLCADDRESS("状态上报", "-------------", 0, 0));
add(new Res_PLCADDRESS("搅拌电机", "VW350", 1, 0));
add(new Res_PLCADDRESS("翻转电机", "VW352", 1, 0));
add(new Res_PLCADDRESS("炒锅", "VW354", 1, 0));
add(new Res_PLCADDRESS("炒锅", "VW354", 0, 0));

}};



+ 20
- 5
app/src/main/java/com/bonait/bnframework/modbus/ModbusCenter.java View File

@@ -90,6 +90,11 @@ public class ModbusCenter {
TempControl(1);
ReadPLCStatus(1);
}
if (Wok2ModbusTcpServer.get().plcIsConnect) {
WritePlc(2,"心跳位", 0, null);
TempControl(2);
ReadPLCStatus(2);
}
try{
if(WokModbusTcpServer.get().plcIsConnect){
int i = 0;
@@ -140,6 +145,11 @@ public class ModbusCenter {
TempControl(1);
ReadPLCStatus(1);
}
if (Wok2ModbusTcpServer.get().plcIsConnect) {
WritePlc(2,"心跳位", 0, null);
TempControl(2);
ReadPLCStatus(2);
}

b = System.currentTimeMillis();
LogUtils.d("//////////time 4"+(b-a));
@@ -151,17 +161,17 @@ public class ModbusCenter {
});
ThreadManager.get().StartLong("炒锅2PLC设备数据监听", true, () -> {
try {
if (WokModbusTcpServer.get().plcIsConnect) {
WritePlc(1,"心跳位", 0, null);
TempControl(1);
ReadPLCStatus(1);
}
if (Wok2ModbusTcpServer.get().plcIsConnect) {
WritePlc(2,"心跳位", 0, null);
TempControl(2);
ReadPLCStatus(2);
}
try{
if (Wok2ModbusTcpServer.get().plcIsConnect) {
WritePlc(2,"心跳位", 0, null);
TempControl(2);
ReadPLCStatus(2);
}
if(Wok2ModbusTcpServer.get().plcIsConnect){
for (Res_PLCADDRESS item : ConfigName.getInstance().PlcAddress_Wok) {
if(item!=null){
@@ -197,6 +207,11 @@ public class ModbusCenter {
}catch (Exception ex){
LogUtils.d("异常信息:" + ex.getMessage());
}
if (WokModbusTcpServer.get().plcIsConnect) {
WritePlc(1,"心跳位", 0, null);
TempControl(1);
ReadPLCStatus(1);
}
if (Wok2ModbusTcpServer.get().plcIsConnect) {
WritePlc(2,"心跳位", 0, null);
TempControl(2);


+ 1
- 0
app/src/main/java/com/bonait/bnframework/newui/dialog/control/WokControlDialog.java View File

@@ -148,6 +148,7 @@ public class WokControlDialog extends DialogFragment {
if(!ConfigName.getInstance().fanchaoSpeed.isEmpty()){
viewBinding.tvSpeed.setText(ConfigName.getInstance().fanchaoSpeed);
}
viewBinding.fireControl.deviceNum = deviceNum;
if(!ConfigName.getInstance().fireNum.isEmpty()){
viewBinding.fireControl.SetLevel(Integer.parseInt(ConfigName.getInstance().fireNum));
}


+ 2
- 2
app/src/main/java/com/bonait/bnframework/newui/widget/FireControlView.java View File

@@ -66,7 +66,7 @@ public class FireControlView extends LinearLayout {

private View root;

public int DeviceNum=0;
public int deviceNum = 1;

public FireControlView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
@@ -129,7 +129,7 @@ public class FireControlView extends LinearLayout {
return;
}
}
Object OBJ = ModbusCenter.getListingValue("搅拌");
Object OBJ = ModbusCenter.getWokListingValue(deviceNum,"搅拌");
if (!(OBJ != null && (boolean) OBJ)) {
NewToastUtil.getInstance().showToast("请先打开搅拌!");
return;


Loading…
Cancel
Save