hola tengo una pregunta sobre un problema que tengo
he realizado un programa en access y para terminarlo debo de conectarle un cajon portamonedas y una impresora he probado con varios codigos pero no consigo que el cajon se habra si alguien seria tan amable de ayudarme
el cajon esta conectado a la impresora de tickets mediante un cable creo que llamado dk
gracias
cajon portamonedas
Moderador: Moderadores
Re: cajon portamonedas
Este codigo funciona con cajones conectados a impresoras de tickets a traves de un conector rj45.espero q t valga
Private sub AbrirCajon
Dim strPuerto As String
Dim lnManip As Integer
strPuerto = GetSetting("TPV", "Configuracion", "Puerto")
If Len(strPuerto) > 0 Then
Select Case CInt(strPuerto)
Case 0: strPuerto = "COM1:"
Case 1: strPuerto = "COM2:"
Case 2: strPuerto = "LPT1:"
Case 3: strPuerto = "USB:"
Case 4: strPuerto = ""
End Select
End If
On Error GoTo salir
lnManip = FreeFile
If strPuerto <> "" Then
On Error Resume Next
Open strPuerto For Output As 1
Print #1, Chr(27) & Chr(112) & Chr(48);
Close 1
Open strPuerto For Output As 1
Print #1, Chr(27) & Chr(112) & Chr(48);
Close 1
Err.Clear
End If
Err.Clear
salir:
Err.Clear
end sub
Private sub AbrirCajon
Dim strPuerto As String
Dim lnManip As Integer
strPuerto = GetSetting("TPV", "Configuracion", "Puerto")
If Len(strPuerto) > 0 Then
Select Case CInt(strPuerto)
Case 0: strPuerto = "COM1:"
Case 1: strPuerto = "COM2:"
Case 2: strPuerto = "LPT1:"
Case 3: strPuerto = "USB:"
Case 4: strPuerto = ""
End Select
End If
On Error GoTo salir
lnManip = FreeFile
If strPuerto <> "" Then
On Error Resume Next
Open strPuerto For Output As 1
Print #1, Chr(27) & Chr(112) & Chr(48);
Close 1
Open strPuerto For Output As 1
Print #1, Chr(27) & Chr(112) & Chr(48);
Close 1
Err.Clear
End If
Err.Clear
salir:
Err.Clear
end sub