Пример #1
0
        public static String createCmd(String cmd)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("Cmd", cmd);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.CMD), creator.getDataBytes()));
        }
Пример #2
0
        public static String createOKResponse()
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("Result", "OK");
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.RESPONSE), creator.getDataBytes()));
        }
Пример #3
0
        public static String createStopMsg(int moduleNum)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "Stop");
            creator.addKeyPair("moduleNum", moduleNum.ToString());
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }
Пример #4
0
        public static String createODReport(String OD)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("ReportType", "OD");
            creator.addKeyPair("OD", OD);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.REPORT), creator.getDataBytes()));
        }
Пример #5
0
        public static String createDeployStatus(String LHS_PlateStatus)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "LHS_PlateStatus");
            creator.addKeyPair("LHS_PlateStatus", LHS_PlateStatus);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }
Пример #6
0
        public static String createSetMode(String s)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "Mode");
            creator.addKeyPair("Mode", s);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }
Пример #7
0
        public static String createSetSystem(String Mode, String Command)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "System");
            creator.addKeyPair("Sys_Mode", Mode);
            creator.addKeyPair("Sys_Command", Command);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }
Пример #8
0
        public static String createWeiZhiConfirmMsg(String LHS_LiquidPosition, String LHS_DischargePosition)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "weiZhiSheZhi");
            creator.addKeyPair("LHS_LiquidPosition", LHS_LiquidPosition);
            creator.addKeyPair("LHS_DischargePosition", LHS_DischargePosition);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }
Пример #9
0
        public static String createSetMianJiLowAndUpp(String Lower, String Upper)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "MianJiShaiXuan");
            creator.addKeyPair("MianJi_Max", Upper);
            creator.addKeyPair("MianJi_Min", Lower);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }
Пример #10
0
        public static String createCodeReport(String Add_Num, String Rem_Num)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("ReportType", "Code");
            creator.addKeyPair("Add_Num", Add_Num);
            creator.addKeyPair("Rem_Num", Rem_Num);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.REPORT), creator.getDataBytes()));
        }
Пример #11
0
        public static String createSetLight(String pwm, String allightText)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "Light");
            creator.addKeyPair("Light_pwm", pwm);
            creator.addKeyPair("Light_allighText", allightText);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }
Пример #12
0
        public static String createSuDuConfirmMsg(String LHS_LiquidRate, String LHS_DischargeRate)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "suDuSheZhi");
            creator.addKeyPair("LHS_LiquidRate", LHS_LiquidRate);
            creator.addKeyPair("LHS_DischargeRate", LHS_DischargeRate);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }
Пример #13
0
        public static String createSystemReport(String DeviceInfo, String Status, String Batch_Info)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("ReportType", "System");
            creator.addKeyPair("Sys_DeviceInfo", DeviceInfo);
            creator.addKeyPair("Sys_Status", Status);
            creator.addKeyPair("Sys_Batch_Info", Batch_Info);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.REPORT), creator.getDataBytes()));
        }
Пример #14
0
        public static String createMuBiaoConfirmMsg(String LHS_SuctionPlate, String LHS_TargetPlate, String LHS_Imbitition)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "yiYeWeiZhi");
            creator.addKeyPair("LHS_SuctionPlate", LHS_SuctionPlate);
            creator.addKeyPair("LHS_TargetPlate", LHS_TargetPlate);
            creator.addKeyPair("LHS_Imbitition", LHS_Imbitition);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }
Пример #15
0
        public static String createSetMotor(String text_speed, String elecspeed, String slope)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "Motor");
            creator.addKeyPair("Motor_text_speed", text_speed);
            creator.addKeyPair("Motor_elecspeed", elecspeed);
            creator.addKeyPair("Motor_slope", slope);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }
Пример #16
0
        public static String createResponseMsg(int moduleNum, int tpR, int phR, int doR)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "Response");
            creator.addKeyPair("moduleNum", moduleNum.ToString());
            creator.addKeyPair("tpR", tpR.ToString());
            creator.addKeyPair("phR", phR.ToString());
            creator.addKeyPair("doR", doR.ToString());
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.RESPONSE), creator.getDataBytes()));
        }
Пример #17
0
        public static String createMotorReport(String Status, String text_speed, String elecspeed, String Power)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("ReportType", "Motor");
            creator.addKeyPair("Motor_Status", Status);
            creator.addKeyPair("Motor_text_speed", text_speed);
            creator.addKeyPair("Motor_elecspeed", elecspeed);
            creator.addKeyPair("Motor_Power", Power);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.REPORT), creator.getDataBytes()));
        }
Пример #18
0
        public static String createSetMieJun(String arg1, String arg2, String arg3, String arg4, String arg5)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "MieJunHeQingXi");
            creator.addKeyPair("JiaReShiJian", arg1);
            creator.addKeyPair("QingXiCiShu", arg2);
            creator.addKeyPair("LengQueShiJian", arg3);
            creator.addKeyPair("QingXiShiJian", arg4);
            creator.addKeyPair("ChouQiShiJian", arg5);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }
Пример #19
0
        public static String createJianCeZhiReport(int b, float[] v)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("ReportType", "Value");
            for (int i = 0; i < v.Length; i++)
            {
                creator.addKeyPair("v" + b, v[i].ToString());
                b++;
            }
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.REPORT), creator.getDataBytes()));
        }
Пример #20
0
        public static String createSettingMsg(int moduleNum, int speed, int temp, int time, int air, int pressure)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "Setting");
            creator.addKeyPair("moduleNum", moduleNum.ToString());
            creator.addKeyPair("speed", speed.ToString());
            creator.addKeyPair("temp", temp.ToString());
            creator.addKeyPair("time", time.ToString());
            creator.addKeyPair("air", air.ToString());
            creator.addKeyPair("pressure", pressure.ToString());
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }
Пример #21
0
        public static String createTHReport(String temperature1,
                                            String temperature2,
                                            String temperature3,
                                            String humidity1,
                                            String humidity2)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("ReportType", "TH");
            creator.addKeyPair("TH_temperature1", temperature1);
            creator.addKeyPair("TH_temperature2", temperature2);
            creator.addKeyPair("TH_temperature3", temperature3);
            creator.addKeyPair("TH_humidity1", humidity1);
            creator.addKeyPair("TH_humidity2", humidity2);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.REPORT), creator.getDataBytes()));
        }
Пример #22
0
        public static String createKongBanReport(bool YouKongBan, String TiaoMaHao)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("ReportType", "YouKongBan");
            String f = "";

            if (YouKongBan)
            {
                f = "1";
            }
            else
            {
                f = "0";
            }
            creator.addKeyPair("Flag", f);
            if (YouKongBan)
            {
                creator.addKeyPair("TiaoMaHao", TiaoMaHao);
            }
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.REPORT), creator.getDataBytes()));
        }
Пример #23
0
        public static String createSetTH_1(String tempset,
                                           String htempchaval,
                                           String ltempchaval,
                                           String syso_change,
                                           String htempalarmval,
                                           String ltempalarmval,
                                           String compressormode,
                                           String compressorsituation)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "TH_1");
            creator.addKeyPair("TH_htempchaval", htempchaval);
            creator.addKeyPair("TH_tempset", tempset);
            creator.addKeyPair("TH_ltempchaval", ltempchaval);
            creator.addKeyPair("TH_syso_change", syso_change);
            creator.addKeyPair("TH_htempalarmval", htempalarmval);
            creator.addKeyPair("TH_ltempalarmval", ltempalarmval);
            creator.addKeyPair("TH_compressormode", compressormode);
            creator.addKeyPair("TH_compressorsituation", compressorsituation);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }
Пример #24
0
        public static String createSetTH_2(String def_interval,
                                           String def_span,
                                           String hottube,
                                           String humi_con_mod,
                                           String humi_con_sit,
                                           String hum_set,
                                           String hum_alarm_val,
                                           String add_hum,
                                           String remo_hum)
        {
            ModbusMessageDataCreator creator = new ModbusMessageDataCreator();

            creator.addKeyPair("SetType", "TH_2");
            creator.addKeyPair("TH_def_interval", def_interval);
            creator.addKeyPair("TH_def_span", def_span);
            creator.addKeyPair("TH_hottube", hottube);
            creator.addKeyPair("TH_humi_con_mod", humi_con_mod);
            creator.addKeyPair("TH_humi_con_sit", humi_con_sit);
            creator.addKeyPair("TH_hum_set", hum_set);
            creator.addKeyPair("TH_hum_alarm_val", hum_alarm_val);
            creator.addKeyPair("TH_add_hum", add_hum);
            creator.addKeyPair("TH_remo_hum", remo_hum);
            return(ModbusMessageHelper.createModbusMessage(ModbusMessage.messageTypeToByte(ModbusMessage.MessageType.SET), creator.getDataBytes()));
        }