Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Oct 23, 2017 6:36 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Open Cash Drawer
PostPosted: Fri Jan 18, 2013 8:31 pm 
Offline
User avatar

Joined: Wed Sep 20, 2006 5:12 pm
Posts: 680
Location: Puerto Rico
This VB
If Trim(SysDevices.CashDrawer) = "Y" Then
Open "LPT1:" For Output As #1
Print #1, Chr(27) + Chr(112) + Chr(0) + Chr(25) + Chr(250)
Close #1
End If

How i do this in RealBasic

:idea:

_________________
Thanks for any contribution and God blesses all (I start Using RS in 10/12/2010)
Mac Mini with Lion v10.7.5 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 Personal and Linux RS2012r1 Personal Register user
my Hobbies R/C Turbines Jets Models


Top
 Profile  
Reply with quote  
 Post subject: Re: Open Cash Drawer
PostPosted: Fri Jan 18, 2013 10:59 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
jetpr wrote:
This VB
If Trim(SysDevices.CashDrawer) = "Y" Then
Open "LPT1:" For Output As #1
Print #1, Chr(27) + Chr(112) + Chr(0) + Chr(25) + Chr(250)
Close #1
End If

How i do this in RealBasic

:idea:


The cash drawer hooks to a parallel port ?

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Open Cash Drawer
PostPosted: Fri Jan 18, 2013 11:32 pm 
Offline
User avatar

Joined: Thu Aug 26, 2010 6:57 am
Posts: 569
Location: Sydney Australia
I would say the receipt printer hooks to the parallel port and the printer triggers the cash drawer - very common setup in POS land. Either way it just looks like a serial connection and can easily be done using serial classes

_________________
Regards

Chris Musty
http://www.specialised.net.au
-----------------------------------------------
if date.shortdate >= 4/6/2013 then
msgbox "I am using Xojo - YAY!!!"
else
msgbox "I am still using RS 12r2.1 - BOO!!!"
end if

Win 8 Pro, Ubuntu 13.04, Mint and Debian(gnome and KDE)
AWS for Hosting and TKL for AMI's


Top
 Profile  
Reply with quote  
 Post subject: Re: Open Cash Drawer
PostPosted: Sat Jan 19, 2013 12:30 am 
Offline
User avatar

Joined: Wed Sep 20, 2006 5:12 pm
Posts: 680
Location: Puerto Rico
yes the cash drawer is connect to the Printer usb or parallel

is some one have i small code to use the serial please paste

thanks

_________________
Thanks for any contribution and God blesses all (I start Using RS in 10/12/2010)
Mac Mini with Lion v10.7.5 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 Personal and Linux RS2012r1 Personal Register user
my Hobbies R/C Turbines Jets Models


Top
 Profile  
Reply with quote  
 Post subject: Re: Open Cash Drawer
PostPosted: Sat Jan 19, 2013 6:56 pm 
Offline
User avatar

Joined: Thu Aug 26, 2010 6:57 am
Posts: 569
Location: Sydney Australia
So many variables but basically

If MySerialPort.Open then
MySerialPort.Write(Chr(27) + Chr(112) + Chr(0) + Chr(25) + Chr(250))
Else
// Serial not open - handle error here
End if


I know nothing about your setup so I am guessing you will have additional questions...
There are things like baud rate etc to set up and which serial port to use.
You should reference http://docs.realsoftware.com/index.php/Serial for all (most) of the info you need.

_________________
Regards

Chris Musty
http://www.specialised.net.au
-----------------------------------------------
if date.shortdate >= 4/6/2013 then
msgbox "I am using Xojo - YAY!!!"
else
msgbox "I am still using RS 12r2.1 - BOO!!!"
end if

Win 8 Pro, Ubuntu 13.04, Mint and Debian(gnome and KDE)
AWS for Hosting and TKL for AMI's


Top
 Profile  
Reply with quote  
 Post subject: Re: Open Cash Drawer
PostPosted: Sat Jan 19, 2013 7:32 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
You might look here
http://www.lvr.com/parport.htm#inpout32dll
for a dll to access the parallel port

there's also a vb project that could be converted

aaron used to have code that I have a copy of
pm me your email & I'll send it to you

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group