13.07.2015 Views

TRABAJO DE GRADUACIÓN - DSpace Universidad Don Bosco

TRABAJO DE GRADUACIÓN - DSpace Universidad Don Bosco

TRABAJO DE GRADUACIÓN - DSpace Universidad Don Bosco

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

A = A + 1Timer1.Enabled = TruefrmRFID.Timer1.Enabled = FalseEnd Sub'Rutina que se ejecuta al darse el evento timer.'Detecta si la tarjeta se ha desconectado y tambien detecta'los tags que se han deslizado por la tarjeta para introducir'el tag maestro.Private Sub Timer1_Timer()'Rutina que detecta si la tarjeta se ha desconectado.If Not frmRFID.HIDComm1.Connected ThenfrmRFID.Visible = FalsefrmConexion.Visible = TruefrmPass.Visible = FalsefrmConexion.Label1.Caption = "Por favor conecte la tarjeta"frmRFID.HIDComm1.ConnectExit SubEnd If'rutina que envia los tags deslizados al campo de contasena.'esperando el tag maestro.frmRFID.HIDComm1.TimeOut = 10BufferSize = 6Buffer = frmRFID.HIDComm1.ReadFrom(BufferSize)If BufferSize < 6 ThenExit SubEnd Iftxtpass.Text = Format(Hex(Buffer(0)), "00") & Format(Hex(Buffer(1)), "00") & _Format(Hex(Buffer(2)), "00") & Format(Hex(Buffer(3)), "00") & _Format(Hex(Buffer(4)), "00")texto = txtpass.TextA = A + 1'Rutina que se ejecuta cuando los numeros coinciden'Habilita la forma principal del programa.If (usb = texto) Then'Rutina que presenta en pantalla un message box que desaparece despues de'1 segundo y automaticamente carga la forma principal.SetTimer hWnd, NV_CLOSEMSGBOX, 1000&, AddressOf TimerProcCall MessageBox(hWnd, "Etiqueta de Administracion Correcta", _"AutoCerrado", MB_ICONQUESTION Or MB_TASKMODAL)'Continuacion de la rutina que habilita la forma principalTimer1.Enabled = FalsefrmRFID.Timer1.Enabled = TruefrmRFID.HIDComm1.TimeOut = 10frmRFID.lblTag.Caption = "Deslizar un TAG"frmRFID.Visible = TruefrmConexion.Visible = FalsefrmPass.Visible = Falsetxtpass.Text = ""'Rutina que se ejecuta cuando no hay ningun tag maestro agregado'habilita la forma principal haciendo un recordatorio'que todavia no hay ningun tag maestro agregado.'el tag maestro se guarda en la ultima localidad de memoria.ElseIf (usb = "FFFFFFFFFF") ThenTimer1.Enabled = FalsefrmRFID.Timer1.Enabled = TruefrmRFID.HIDComm1.TimeOut = 10MsgBox "Todavia no ha agregado ningun TAG maestro. Agreguelo en este momento.", _vbInformation, "Importante"frmRFID.lblTag.Caption = "Deslizar un TAG"frmRFID.Visible = TruefrmConexion.Visible = FalsefrmPass.Visible = Falsetxtpass.Text = ""'Rutina que se ejecuta cuando no hay match entre numero y tag maestroElseMsgBox "La contraseña es incorrecta o el TAG no es valido", vbCritical, "ERROR"txtpass.Text = ""End IfEnd Sub- 151 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!