USB device command

Reply

Join Date: Mar 2005
Posts: 3
Reputation: choky is an unknown quantity at this point 
Solved Threads: 0
choky choky is offline Offline
Newbie Poster

USB device command

 
0
  #1
Mar 9th, 2005
Hello,

I would like to send a specific string of commands to a USB device connected to my computer. Is there a PHP function that allows this?

Thanks,

Choky
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: USB device command

 
0
  #2
Mar 9th, 2005
Serial communication has to be done fairly low level using Windows API's.

You can buy a wrapper component called ActiveComport (USB is just a much much faster RS232) here which gives you an interface you can manipulate in scripting languages.

I beleive on Linux it's simpler because everythings a file, so you just read and write your bits to the file that represents your USB port or device, if I find any leads in that direction I'll post them.
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 3
Reputation: choky is an unknown quantity at this point 
Solved Threads: 0
choky choky is offline Offline
Newbie Poster

Re: USB device command

 
0
  #3
Mar 9th, 2005
Thanks! But if it is possible to access USB devices then any webpage can just control your peripherals and cause a mess, no?
Secondly, can PHP give orders to ActiveComport? and if so, what functions can be used? I would like to use PHP for a new POS (point of sale) software I am developing for my shop. The problem is sending orders to the cash drawer/printer using php.


Originally Posted by hollystyles
Serial communication has to be done fairly low level using Windows API's.

You can buy a wrapper component called ActiveComport (USB is just a much much faster RS232) here which gives you an interface you can manipulate in scripting languages.

I beleive on Linux it's simpler because everythings a file, so you just read and write your bits to the file that represents your USB port or device, if I find any leads in that direction I'll post them.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: USB device command

 
0
  #4
Mar 9th, 2005
Any webpage cannot control your USB port, PHP is not just for web pages although that's where it is most commonly used. ActiveComport is a component that you will have to register with the windows registry on the machine on which you are executing your PHP script. I'm afraid I am not an authority on PHP as I have used it very little, and the site I gave does not mention PHP specifically. But if VBScript can use it I would be very surprised if PHP couldn't.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 355
Reputation: DanceInstructor is an unknown quantity at this point 
Solved Threads: 14
DanceInstructor's Avatar
DanceInstructor DanceInstructor is offline Offline
Posting Whiz

Re: USB device command

 
0
  #5
Mar 9th, 2005
I think this might help: PHP: Direct IO Functions

Dance
Clear Mind Hosting and Web Design

If I've helped you please consider adding to my reputation.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: USB device command

 
0
  #6
Mar 10th, 2005
Ooh nice, I could find some uses for that, thinking send/receive SMS text messages thru PDA phone.

Choky,
I take it your cash drawer has a USB interface, does it not have any software with it, perhaps the vendor or manufacturer have a development KIT ?
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 3
Reputation: choky is an unknown quantity at this point 
Solved Threads: 0
choky choky is offline Offline
Newbie Poster

Re: USB device command

 
0
  #7
Mar 10th, 2005
This is the printer I will use: http://www.orient-technologies.com/p...BTP-2002CP.pdf .
The cash drawer connects directly to the printer so when it gets a command to print, it tells the drawer to open. So really what I need is just communication with the printer.



Originally Posted by hollystyles
Ooh nice, I could find some uses for that, thinking send/receive SMS text messages thru PDA phone.

Choky,
I take it your cash drawer has a USB interface, does it not have any software with it, perhaps the vendor or manufacturer have a development KIT ?
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: USB device command

 
0
  #8
Mar 10th, 2005
Sorry, I'm really lost here.

Why do you want to mess about with low level stuff like communicating with a printer?

I take it this PHP POS software is going to run on a pc, on which the printer is installed as a device right?

so you just want to create a receipt document from your sales data and just put it in the print queue right ? let your OS worry about talking to the printer.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum


Views: 5619 | Replies: 7
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC