Serial Port (COM-port) Communication using VBA?

geralf

Registered User.
Local time
Today, 16:05
Joined
Nov 15, 2002
Messages
212
I have a printer connected to the COM port that I need to send control characters to using VBA. What is the easiest way to do so, using VBA, that is - if it's possible?


TIA
 
Last edited:
Well you could try searching programmers heaven, planetsourcecode and other programming sites for VB6 code. Quite a lot of VB 6 code works in VBA.
 
If you know the name of the COM port (normally, "COM:"...), you can open it as you would open any other text file.

Just remember to close it when you are done with it.
 
The_Doc_Man said:
If you know the name of the COM port (normally, "COM:"...), you can open it as you would open any other text file.

Just remember to close it when you are done with it.


Does this mean you can view data if it is stored in a machine connected to a COM port? The reason I ask is that I was asked if i'd make a database to show stocks/sales for a bar. They had electronic EPOS tills which stored the data but only gave very limited reports. The company that owned the tills sold their own reporting software which was terrible which was why I was asked to create a customised solution. Anyway in the end there was no way I could get the data out of the till. I tried using Laplink and PC anywhere but nothing worked. Could I have viewed the data by connecting the till to the COM port and using VBA?

Thanks, Tom
 
I've seen this with a low end pos where the system only exports a minimum amout of data - basically useless. I would think that trying to extract additional data via the com would be pointless because you would be at the mercy of what the system exposes to the serial port. In other words, I doubt you would be able to see anything except what has been pre-programmed to be sent to the port.

Now if you're a hardware hacker, you may be able to get into the system to see if the unit is pc based and come up with something from that angle...

???
ken
 
Now if you're a hardware hacker...

Unfortunately i'm not!

In a last ditch effort I rang the company that supplied the EPOS and fessed up to what I was trying to do. I explained that their software was "lovely" but 99% irrelevant and that I wanted to create a custom solution for the bar owner. They offered me access to the data for £1k (the full software package only cost £1200!) and offered me a job working for them if I could get the data out without their interface. Although I love a challenge I couldn't do it and had to give up. I know the till is PC based but didn't even know where to start to get the info out. I looked at the legal issue because I thought that the bar owned the data and not the till company and also found some law basically stating that any software/hardware product must make reasonable provision for it to be interfaced with another product if the new products intentions are sufficiently different from the original.

The bar manager didn't want to persue that angle though so we had to admit defeat. :mad:
 
Will it do exactly what you want? How long would it take to pay for itself?

kh
 
It would give us access to all the transaction data which is what we need. I personally think it would have been worth it because I don't know how the hell he runs his business without ANY information (sales trends, stock control etc) and a fairly simple analysis/reporting DB would probably bowl him over but with that initial cost plus the cost of me creating the DB he didn't want to go for it. Also the EPOS retailers shut up shop after that and said that even if we shelled out for the interface they wouldn't give even basic support and wouldn't tell me how the data would come out so I couldn't give 100% certainty that we could actually use the information. If it came out encrypted or something we'd be in trouble!

Tom
 
Sounds like you guys should zing 'em with a letter to Consumer Reports, their competitors, and maybe Clark Howard...


???
ken
 
Don't know who Clark Howard is (American?) but a letter to the other two might have done the trick! I've put the project on hold for now but it's definitely something i want to persevere with eventually because I have a lot of contacts in the hospitality trade and could generate quite a lot of work if I found a good till system that would let me do what I want with the transaction data.
Thanks for your help...

Watch this space ;)
 

Users who are viewing this thread

Back
Top Bottom