示例#1
0
        public static string WriteDQBH(string str)
        {
            byte[] databuff = new byte[1];
            byte[] buff     = new byte[2];
            string data     = "";

            data  = LConvert.int_hex(str);
            icdev = IC.ic_init(1, 9600);
            buff  = System.Text.Encoding.ASCII.GetBytes(data);
            IC.asc_hex(buff, databuff, 2);
            st = IC4442.swr_4442(icdev, 71, 1, databuff);
            if (st == 0)
            {
                return("写数据成功!" + data);
            }
            else
            {
                return("写数据失败!" + data);
            }
        }
示例#2
0
        public static string WriteRemainQL(string str)
        {
            byte[] databuff = new byte[3];
            byte[] buff     = new byte[6];
            string f_i      = "";
            string data     = "";

            f_i   = LConvert.float_int(str);
            data  = LConvert.int_hex(f_i);
            icdev = IC.ic_init(1, 9600);
            buff  = System.Text.Encoding.ASCII.GetBytes(data);
            IC.asc_hex(buff, databuff, 6);
            st = IC4442.swr_4442(icdev, 61, 3, databuff);
            if (st == 0)
            {
                return("写数据成功!" + data);
            }
            else
            {
                return("写数据失败!" + data);
            }
        }