Beispiel #1
0
        private void cmdDoorOpen_Click(object sender, EventArgs e)
        {
            int     vErrorCode = 0;
            Boolean vRet;

            lblMessage.Text = "Working...";
            Application.DoEvents();

            vRet = bpc.EnableDevice(Program.gMachineNumber, 0); // 0 : false
            if (!vRet)
            {
                lblMessage.Text = util.gstrNoDevice;
                return;
            }

            vRet = bpc.SetDoorStatus(Program.gMachineNumber, 3);
            if (vRet)
            {
                lblMessage.Text = "Door Open Success!";
            }
            else
            {
                bpc.GetLastError(ref vErrorCode);
                lblMessage.Text = util.ErrorPrint(vErrorCode);
            }

            bpc.EnableDevice(Program.gMachineNumber, 1); // 1 : true
            Application.DoEvents();
        }