基本信息
源码名称:山特UPS通讯程序
源码大小:0.07M
文件格式:.zip
开发语言:C#
更新时间:2018-09-03
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 1 元 
   源码介绍

使用Q1<CR>通讯,从VS 2012例子

if (serialPort1.BytesToRead == 47)
            {
                serialPort1.Read(receiveQ1, 0, 47);

                if (receiveQ1[0] == '(')
                {
                    txtReceive.Text = "";
                    textBox1.Text = "";
                    textBox2.Text = "";
                    textBox3.Text = "";
                    textBox4.Text = "";
                    textBox5.Text = "";
                    textBox6.Text = "";
                    textBox7.Text = "";
                    textBox8.Text = "";
                    for (int i = 0; i < 47; i )
                    {
                        txtReceive.Text = txtReceive.Text receiveQ1[i];
                        if (receiveQ1[i] == ' ')
                        {
                            x ;
                        }
                        else
                        {                            
                            if (i > 0 && x == 0)
                            {
                                textBox1.Text = textBox1.Text receiveQ1[i];
                            }
                            if (i > 0 && x == 1)
                            {
                                textBox2.Text = textBox2.Text receiveQ1[i];
                            }
                            if (i > 0 && x == 2)
                            {
                                textBox3.Text = textBox3.Text receiveQ1[i];
                            }
                            if (i > 0 && x == 3)
                            {
                                textBox4.Text = textBox4.Text receiveQ1[i];
                            }
                            if (i > 0 && x == 4)
                            {
                                textBox5.Text = textBox5.Text receiveQ1[i];
                            }
                            if (i > 0 && x == 5)
                            {
                                textBox6.Text = textBox6.Text receiveQ1[i];
                            }
                            if (i > 0 && x == 6)
                            {
                                textBox7.Text = textBox7.Text receiveQ1[i];
                            }
                            if ( i > 0 && x == 7 && j == 0 )
                            {
                                //textBox8.Text = textBox8.Text receiveQ1[i];
                                if (receiveQ1[i] == '0')
                                {
                                    textBox8.Text = "市电";
                                }
                                else
                                {
                                    textBox8.Text = "电池";
                                }
                                j ;                                
                            }
                        }
                    }