Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
POS open cashier
Message
De
03/05/2007 03:50:18
 
 
À
03/05/2007 03:27:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01222098
Message ID:
01222102
Vues:
19
To open a cash drawer, you usually send a chr(7) to it. Something like
Set printer to lpt1: && or whatever port is used
???chr(7)
Or you can create a file with only a chr(7) in it
strtofile(chr(7),'cashopen.txt')
To open the drawer using this file
Copy file cashopen.txt to lpt1: && or whatever port is used
>Hi everyone,
>
>I have a question for programing with POS cashier
>
>I have some simple code ( VB code ) as below :
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>for POS Cashier,
> ' open drawer
> Dim hSerialPort, hParallelPort As IntPtr
> Dim Success As Boolean
> Dim BytesWritten, BytesRead As Int32
> Dim Buffer() As Byte
> 'Declare variables to use for encoding.
> Dim oEncoder As New System.Text.ASCIIEncoding
> Dim oEnc As System.Text.Encoding =
>oEncoder.GetEncoding(1252)
>
> 'for star mode
> Buffer = oEnc.GetBytes(Chr(28))
>
> hParallelPort = CreateFile("LPT1", GENERIC_READ Or
>GENERIC_WRITE, 0, IntPtr.Zero, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
>IntPtr.Zero)
> Success = WriteFile(hParallelPort, Buffer, Buffer.Length,
>BytesWritten, IntPtr.Zero)
> Success = CloseHandle(hParallelPort)
> 'MsgBox("open drawer")
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>This VB code is copy from our old system, its work in order.
>
>Please exchage the code into VFP command.
>** above code looks quite long, i want to open cashier only **
>
>Thank a lot.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform