'----****
'----**** MyBusiness POS V20
'----**** Version del script: 1.0
'----**** 19/02/2020
'----****
Public Sub Main()
' Si la mauiquina pide configurar el puerto
if Ambiente.Tag = "CONFIGURANDO" Then
Configurando
else
ProcesaString
end if
End Sub
Public Sub Configurando
if Ambiente.Lector.PortOpen Then
Ambiente.Lector.PortOpen = False
end if
Select Case Trim(Ambiente.rstEstacion("plector"))
Case "COM1"
Ambiente.Lector.CommPort = 1
Case "COM2"
Ambiente.Lector.CommPort = 2
Case "COM3"
Ambiente.Lector.CommPort = 3
Case "COM4"
Ambiente.Lector.CommPort = 4
Case "COM5"
Ambiente.Lector.CommPort = 5
Case else
Ambiente.Lector.CommPort = 1
End Select
if Ambiente.Lector.PortOpen Then
Exit Sub
end if
Ambiente.Tag = ""
Ambiente.Lector.Settings = "9600,E,7,1"
Ambiente.Lector.RTSEnable = True
Ambiente.Lector.PortOpen = True
TimerLector.Enabled = True
End Sub
Public Sub ProcesaString()
Dim a
a = Lector.Input
if Len(a) > 0 Then
Teclado.SendKeys (a)
end if
End Sub
Relacionado