Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 28th, 2013, 02:18 PM
dcboje dcboje is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 2 dcboje User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 27 m 23 sec
Reputation Power: 0
Open cash register

Please forgive me if this shows up twice. I tried posting a few mins ago but was unsuccessful.

I have written a pos application for a Pizza Restaurant I own and now I'm finally ready to talk the cash drawer into opening.

The cash drawer is plugged into the receipt printer which is plugged into Com2 of the POS terminal.

I've looked at a few sites and found code that should work but it doesn't for me (could be entirely my fault of course).

The following code is supposed to work but I get a 'file doesn't exist' msg. Perhaps something was left unsaid on the site where I found it.

var
MyFile: TextFile;
begin
AssignFile(MyFile,'com2');
Rewrite(MyFile);
WriteLn(MyFile, CHR(27)+CHR(112)+CHR(0)+
CHR(10)+CHR(100));
System.CloseFile(MyFile);

Any help would be much appreciated.

Thanks,

Don

Reply With Quote
  #2  
Old February 6th, 2013, 03:23 PM
dcboje dcboje is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 2 dcboje User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 27 m 23 sec
Reputation Power: 0
Solution

Here is the solution for anyone who also has this problem.

procedure TaaFrmPaymentMethod.OpenCashDrawer;
var
CDFile: TextFile;
begin
AssignFile(CDFile,'com2');
Rewrite(MyFile);
Write(CDFile,CHR(27)+CHR(112)+CHR(0)+CHR(10)
+CHR(100));
System.CloseFile(CDFile);
end;

My cash drawer was attached to com2. Replace this with whatever port your cash drawer plugs into.

Be sure and use "Write" and not "Writeln". You will not have much success with Writeln.

Don

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Open cash register

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap