Пример #1
0
        private void EEPROM_Load(object sender, EventArgs e)
        {
            byte[] byLibVersion = new byte[EEPROM_API.IMC_LIB_VERSION_SIZE];
            LastErrCode = EEPROM_API.GetLibVersion(byLibVersion);
            if (LastErrCode != IMCAPIErrCode.IMC_ERR_NO_ERROR)
            {
                MessageBox.Show("Fails to get library version " + LastErrCode.ToString("X4"));
                return;
            }

            int nRealSize;

            textBoxLibVersion.Text = ConvertByte2String(byLibVersion, byLibVersion.Length, out nRealSize);

            LastErrCode = EEPROM_API.GetEEPROMSize(out ROMSize);
            if (LastErrCode != IMCAPIErrCode.IMC_ERR_NO_ERROR)
            {
                MessageBox.Show("Fails to get EERPOM size version " + LastErrCode.ToString("X4"));
                return;
            }
            textBoxEEPROMSize.Text = ROMSize.ToString();

            LastErrCode = EEPROM_API.Initialize();
            if (LastErrCode != IMCAPIErrCode.IMC_ERR_NO_ERROR)
            {
                MessageBox.Show("Fails to Initialize the EEPROM library" + LastErrCode.ToString("X4"));
                return;
            }
        }