Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about Cash Drawers & Customer Display

Status
Not open for further replies.

csvideo

Programmer
Oct 19, 2001
74
0
0
BB
I'm writing a POS system an I would like to know exact how Cash Drawers & Customer Displays work? (What ports do there connect to and what are an example of some of the commands I would use to operate these devices?)
 
These devices are usually connected to COM ports. In VFP you'll probably want to use MSCOMM32 to access them.

Some sample code for accessing serial data in VFP using MSCOMM32 can be found in the following:
- HOWTO: Receive from the Serial Port by Using MScomm32.ocx.
Also useful may be
- HOWTO: Send to the Serial Port by Using Mscomm32.ocx.
And of course,
- HOWTO: Transmit and Receive Binary Data using MSCOMM32.

If MSCOMM32 doesn't provide you with enough control, you'll need to find another 3rd party control to handle the serial communication. Remember that in the Windows environment, it controls the I/O ports - you can't do it directly - especially in WinNT, Win2000 and XP.

Rick
 
chrisman,

The best way will be contacting these computer cash
register suppliers. I think they would be more than
happy to provide you the info. Everybody got there
own way!!!
 
I write a POS application in Foxpro. My Cashdrawers and Customer Displays are controlled by OPOS programs. You need to know if your equipment have OPOS drivers. If they do they are very easy to use.
 
Hi debbo,

I am developing POS application too and like to use OPOS,
but their example had to access the registry to read the
printer name, can I insteads use VFP function to get the printer name for the OPOS activex use ?

I had problem with opening drawer using ??? command
since it always print a blank line

The registry example and explanation in the MSDN is not very helpful for me.

Do you mind senting me a sample copy of your code
for my reference, thank in advance


 
We have used OPOS for our POS system for quite some time.
Our currently commercial product was written in VFP and I am now working on making it work in our new product written in VB.
Working with OPOS is quite the same in VB as in VFP (besides the syntax differences).

To control/open a device, you only need to call three methods of the OPOS object:
OpenDevice &&This is where you need the device name from the registry
ClaimDevice &&Claim the device for exlusive use
Enabled &&property to enable the device

You need not concern yourself about what port the device is attached to, this is all handled by OPOS.
Of course, your user, dealer or you need to define the device in OPOS, give it a logical device name (LDN) and assign it to a comm port. But once this is done, opos will handle port communication for you.

You only need to read the registry to know what device to start (The device name).

Actually you only need these functions to do this:
DECLARE Integer RegOpenKeyEx IN Win32API ;
Integer nKey, String @cSubKey, Integer nReserved,;
Integer nAccessMask, Integer @nKeyHandle

DECLARE Integer RegQueryValueEx IN Win32API ;
Integer nKey, String cValueName, Integer nReserved,;
Integer @nType, String @cBuffer, Integer @nBufferSize

and if there are more say f.i. line displays:
DECLARE Integer RegEnumKeyEx IN Win32API ;
Integer nKey, Integer nIndex, String @cName, Integer @nNameSize, Integer nReserved,;
String @cBufferClass, Integer @nBufferSize, Integer @dLastWrittenTo

These are just the declarations in VFP syntax. You can find more info in the MSDN on line about these functions.

For UPOS (Unified OPOS):

The documentation is quite clear about how to talk to the opos object and once you got the hang of it, it is very easy.

HTH,
Weedz (Edward W.F. Veld)
My private project:Download the CrownBase source code !!
 
An example:

Install the latest UPOS drivers (I use 1.6) (like in my previous message) and the OPOS drivers from you linedisplay manufacturer (in my case I use the EPSON 1.92e drivers because I use an epson DM-D202 line display, available from the epson homepage).
Create a form.
Drop an activeX control and choose the OPOS linedisplay control. Name the control 'oLineDisplay'.

Drop a command button on the form.

Be sure you have defined a linedisplay in the opos settings.
Say it's name is for example:
DM-D202 (in my case I use this device which is an epson line display).
In your command buttons click event write the following code:

WITH THISFORM.oLineDisplay
.Open('DM-D202')
.ClaimDevice(100)
.DeviceEnabled = .T.
.CheckHealth(2)
ENDWITH

If everything is going OK it should perform the health check on your line display.

Just tried it, and it works (it's nice to be in VFP once more ;-) )

HTH,
Weedz (Edward W.F. Veld)
My private project:Download the CrownBase source code !!
 
Hi,

Thank to both of you for your advise and help.
Sorry for my ignorant, but is it safe to
use UnifiedPOS when I don't see Epson and Star
as one of the hardware supporter of UPOS.

What is the different between OPOS and UPOS ?

If I use UPOS, do my printer from Epson and
Star work ?

Next, how do I check for printer cable unplug , offline
and out of paper for my POS application in VFP using
OPOS or UPOS. Any code example in VFP ?

For the OPOS, can I just use the GETPRINTER()
command for the oPOS.Devicename use ?
I don't understand the Registry example in VFP
under the MSDN.

Do you had any example for my reference.

Thank to both of you for being so helpful








 
Please download the documentation and read it. Believe me, I did and it made me understand.
UPOS is just a general interface to OPOS whereas OPOS is made by the manufacturer. UPOS works with Epson and Star, they work for us and our customers.

When using OPOS you do not need to do anything concerning hardware through VFP. Everything is done via the OPOS drivers.

Have you tried my example ?


Weedz (Edward W.F. Veld)
My private project:Download the CrownBase source code !!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top