Example #1
0
        private void btnReadAll_Click(object sender, EventArgs e)
        {
            if (dongle.IsOpen)
            {
                Register tempReg;
                byte[]   tempRegBytes;
                for (int ix = 0; ix < regAddrList.Count; ix++)
                {
                    tempReg      = regMap[regAddrList[ix]];
                    tempRegBytes = new byte[tempReg.ByteCount];
                    if (dongle.readRegBurst(tempReg.RegAddress, tempRegBytes, tempRegBytes.Length))
                    {
                        //for (int ix_byteCount = 0; ix_byteCount < tempRegBytes.Length; ix_byteCount++)
                        tempReg.ByteValue = tempRegBytes;

                        // Update new value to GUI display
                        UpdateRegValueCell(tempReg);
                    }
                }
            }
        }
Example #2
0
        private void btn_Reg04_Read_Click(object sender, EventArgs e)
        {
            byte length       = 0x00;
            byte startAddress = 0x00;

            byte[] tempData;
            this.richTextBox_Reg_Window.Text = "";

            startAddress = Convert.ToByte(textBox_Reg_StartAddr.Text, 16);
            length       = Convert.ToByte(textBox_Reg_Length.Text, 16);

            tempData = new byte[length];

            myDongle.readRegBurst(startAddress, tempData, length);

            for (int i = 0; i < length - 1; i++)
            {
                this.richTextBox_Reg_Window.Text = tempData[i].ToString("X2") + "-";
            }
            this.richTextBox_Reg_Window.Text = tempData[length - 1].ToString("X2");
        }