Пример #1
0
        private Boolean CheckStatus1(uint hDevice, ref string errStr)
        {
            MC07_S_RESULT sResult = new MC07_S_RESULT(0);
            ushort        Cmd     = 0;
            ushort        Status1 = 0;
            ushort        Data1   = 0;

            //*** CHECK STATUS1 BUSY BIT = 0 (WAIT TIME = 1000ms)***
            if (MC07.BWaitDriveCommand(hDevice, 1000, ref sResult) == false)
            {
                errStr = "It failed in MC07.BWaitDriveCommand() : MC07.Result(1)=" + sResult.MC07_Result[1].ToString();
                return(false);
            }

            //*** READ STATUS1 ***
            if (MC07.BRStatus1(hDevice, ref Status1, ref sResult) == false)
            {
                errStr = "It failed in MC07.BRStatus1() : MC07.Result(1)=" + sResult.MC07_Result[1].ToString();
                return(false);
            }

            //*** CHECK STATUS1 ERROR BIT = 0 ***
            if ((Status1 & 0x0010) != 0)
            {
                //*** READ ERROR STATUS ***
                Cmd = 0xD1;
                if (MC07.BWDriveCommand(hDevice, ref Cmd, ref sResult) == false)
                {
                    errStr = "It failed in MC07.BWDriveCommand(H'" + Cmd.ToString("X") + ") : MC07.Result(1)=" + sResult.MC07_Result[1].ToString();
                    return(false);
                }

                if (MC07.BRDriveData1(hDevice, ref Data1, ref sResult) == false)
                {
                    errStr = "It failed in MC07.BRDriveData1(): MC07.Result(1) = " + sResult.MC07_Result[1].ToString();
                    return(false);
                }

                errStr = "STATUS1 ERROR = 1 : ERROR STATUS = H'" + Data1.ToString("X") + "\r\n Please click 'Clear Error'";

                return(false);
            }

            return(true);
        }