Beispiel #1
0
 //****************************************//
 //        Programming Fuctions            //
 //****************************************//
 public void ProgrammerInit(byte IO_VOLTAGE, byte PortEnables)
 {
     //mut.WaitOne();
     if (m_MPQIO.SelectProgrammer(m_Address))
     {
         if (!m_MPQIO.SetVoltage(m_Address, IO_VOLTAGE))
         {
             throw new Exception("Error in Set Voltage: " + m_MPQIO.m_LastError);
         }
         if (!m_MPQIO.SelectMode(m_Address, PROGRMMING_MODE))
         {
             throw new Exception("Error in SelectMode: " + m_MPQIO.m_LastError);
         }
         if (!m_MPQIO.EnablePorts(m_Address, PortEnables))
         {
             throw new Exception("Error in EnablePorts: " + m_MPQIO.m_LastError);
         }
     }
     else
     {
         m_MPQIO.CloseComm();
         throw new Exception("Cannot accsess to MPQ: " + m_MPQIO.m_LastError);
         //OnMPQMessage(new MPQMessageEventArgs("Cannot accsess to MPQ:" + m_Address.ToString()));
     }
     //mut.ReleaseMutex();
 }
Beispiel #2
0
 //****************************************//
 //    Open RS232 Port for MPQ device      //
 //****************************************//
 public void PortInit(String ConnectString)
 {
     if (m_MPQIO == null)
     {
         m_MPQIO = new MPQIO();
         m_MPQIO.CloseComm();
         if (!m_MPQIO.OpenComm(ConnectString))
         {
             throw new Exception("Error in OpenComm: " + m_MPQIO.m_LastError);
         }
         else
         {
             OnMPQMessage(new MPQMessageEventArgs("MPQ_OpenComm: Success"));
         }
     }
 }
Beispiel #3
0
 //****************************************//
 //    Open RS232 Port for MPQ device      //
 //****************************************//
 public void PortInit(String ConnectString)
 {
     if (m_MPQIO == null)
     {
         m_MPQIO = new MPQIO();
         m_MPQIO.CloseComm();
         if (!m_MPQIO.OpenComm(ConnectString))
             throw new Exception("Error in OpenComm: " + m_MPQIO.m_LastError);
         else
             OnMPQMessage(new MPQMessageEventArgs("MPQ_OpenComm: Success"));
     }
 }