Visual Basic - como abrir cajón portamonedas con Epsom TM-M88IV

Life is soft - evento anual de software empresarial
 
Vista:

como abrir cajón portamonedas con Epsom TM-M88IV

Publicado por willy (1 intervención) el 19/08/2014 14:56:45
Hola

Tengo instalado el Windows 7, y el programa TPV 123 genérico, también tengo una Epsom TM-T88IV con los drivers APD_501 y APD_455d, el caso es que la impresora imprime el ticket aunque lento, peeeeeero no me abre el cajón portamonedas, la impresora está conectada en puerto serie COM1, y el TPV tiene las siguientes secuencias:
27-112-0-9-9 y 27-7-50-30-28 que no se pueden cambiar, también hay otra secuencia en blanco la cual le he metido la secuencia: 27-112-48-55-121 pero nada, ya me estoy cagando en la tecnología, y antes de que siga haciéndolo...a ver si me podéis ayudar porfaaaaaa

Muchas gracias

Willy
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

como abrir cajón portamonedas con Epsom TM-M88IV

Publicado por Diego (34 intervenciones) el 19/08/2014 19:29:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Public Structure SECURITY_ATTRIBUTES
        Private nLength As Integer
        Private lpSecurityDescriptor As Integer
        Private bInheritHandle As Integer
    End Structure
 
    Public Const GENERIC_WRITE = &H40000000
    Public Const OPEN_EXISTING = 3
    Public Const FILE_SHARE_WRITE = &H2
    Dim SA As SECURITY_ATTRIBUTES
    Dim outFile As FileStream
    Dim Safe As Microsoft.Win32.SafeHandles.SafeFileHandle
    Public LPTPORT As String
    Dim hPort As Integer
    Dim hPortP As IntPtr
    Dim retval As Integer
    Public Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Integer, ByVal dwShareMode As Integer, ByRef lpSecurityAttributes As SECURITY_ATTRIBUTES, ByVal dwCreationDisposition As Integer, ByVal dwFlagsAndAttributes As Integer, ByVal hTemplateFile As Integer) As Integer
    Public Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Integer) As Integer
 
 
 
 
 
hPort = CreateFile(COM1, GENERIC_WRITE, FILE_SHARE_WRITE, SA, OPEN_EXISTING, 0, 0)
                        hPortP = New IntPtr(hPort) 'Convierte Integer to IntPtr
                        Safe = New Microsoft.Win32.SafeHandles.SafeFileHandle(hPortP, True)
                        If Not Safe.IsInvalid Then
                            outFile = New System.IO.FileStream(Safe, IO.FileAccess.Write)
                            fw = New System.IO.StreamWriter(outFile)
                            fw.AutoFlush = True
                            fw.WriteLine(cadena)
                            fw.Close()
 
                        End If
                        CloseHandle(hPort)
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar