Exemple #1
0
        private bool Send_Write_to_GUI(byte flag)
        {
            byte[]  TempData = BitConverter.GetBytes(flag);
            HDLC_tx TempFreq = new HDLC_tx();

            TempFreq.cmd  = 0xFF;
            TempFreq.Data = new List <byte>(TempData);
            TempFreq.CreateHDLC();
            Globals.Serial.Write(TempFreq.Buffer, 0, TempFreq.Buffer.Length);
            return(Aknowledged());
        }
Exemple #2
0
        private bool SendScale(Byte s)
        {
            byte[]  TempData = BitConverter.GetBytes(s);
            HDLC_tx TempFreq = new HDLC_tx();

            TempFreq.cmd  = 0x06;
            TempFreq.Data = new List <byte>(TempData);
            TempFreq.CreateHDLC();
            Globals.Serial.Write(TempFreq.Buffer, 0, TempFreq.Buffer.Length);
            return(Aknowledged());
        }
Exemple #3
0
        /// <summary>
        /// Send Output Voltage Range Variable
        /// </summary>
        /// <returns>Returns true if the PIC Acknowledges</returns>
        private bool SendStart()
        {
            List <byte> TempData = new List <byte> {
            };
            HDLC_tx TempFreq     = new HDLC_tx();

            TempFreq.cmd  = 0x02;
            TempFreq.Data = TempData;
            TempFreq.CreateHDLC();
            Globals.Serial.Write(TempFreq.Buffer, 0, TempFreq.Buffer.Length);
            return(Aknowledged());
        }
Exemple #4
0
        /// <summary>
        /// Send Settling Time Cycles
        /// </summary>
        /// <returns>Returns true if the PIC acknowledges the command</returns>
        private bool SendCoef(byte[] coef)
        {
            HDLC_tx TempFreq = new HDLC_tx();

            TempFreq.cmd  = 0x01;
            TempFreq.Data = new List <byte>(coef);
            TempFreq.CreateHDLC();
            try
            {
                Globals.Serial.Write(TempFreq.Buffer, 0, TempFreq.Buffer.Length);
            }
            catch (Exception)
            {
                return(false);
            }
            return(Aknowledged());
        }