Michelle wrote:
[Quoted Text] > Hello, I work with a system that prints out receipts on a dedicated little > printer whenever there is a transaction. > > I want to be able to capture the information onto a laptop that I plug in > instead of the printer, and end up with it all in Access. > > The printer connects to a multi-pin socket that looks like a COM port. > The data comes out (and I don't know what any of this means) as RS232, 1200 > baud rate, with 8 data bits, 1 stop bit and no parity. > > Can I get it dumped to disk in a format that Access can read? > > Should I have posted this in another newsgroup? If so, can anyone tell me > which one - I am a complete beginner when it comes to this kind of thing. > > Many thanks > >
It look like a comm port because it is. From want you have said, the printer is connected to a serial port just as a modem would be connected to a serial port except for the assignments of the pins (wires) which could be up to 25 depending on how the cable was made.
Quick lesson. 1. The connector is called a DB25 connector. 2. How the pins are used or layer 1 of the OSI 7 layer model is called RS232. 3. There are 2 types of equipment connected to the cable. DTE and DCE. The original design of RS232 states that a DTE, using a straight 25 pin cable is connected to a DCE. An example of this is a computer connected to a modem. A modem internally control the clocking, checking the status of the equipment and switches the pins that data is transmitted and received on. 4. A DTE is called Data Terminal Equipment and a DCE is called Data Communications Equipment. 5. When a DTE is connected to a DTE, a crossover or null modem cable is used so the equipment will work thinking they each are connected to a modem.
To answer your question: 1. You MAY be able to connect the laptop to the cable that is connected to the printer. 2. You may need to used what is called a gender bender which will allow you to change the end of the cable from a female or male to the other gender. Another option for this is to use what is called a breakout box. The PC connects to the cable, the cable is connected to the breakout box, the break is connected to the printer.
The breakout creates a T-connection allowing you to connect the laptop and copy the data sent to the printer. By using little wires or jumpers that come with the breakout box, you can program the breakout box so that the laptop and the printer will see the data correctly and operate correctly. 3. You will need to write a communications program to read the data from the comm port in the laptop and format and store the data to disk.
Another Option: 1. Change the settings in the PC and print to a file vs printing to a printer port. This will save the output from the computer to disk. 2. You will need to write a program (for the PC) to read the print file and format the data as required.
The problem with what you are trying to do will be the control characters added to your printed output which tell the printer what to do for line feeds, form feeds and so on. You may be printing 100 or 200 characters for your receipt, but the number of characters sent to the printer may be in the 1000's because of all of the control characters. The adding of control characters is controlled by the printer driver in the PC. Printer drivers are what allows users to connect many different types of printers to the computer and print correctly without having to change the programs in the computer, such as Access or Excel or Word or even a custom written program.
One last point, even of the connections are correct, all of the equipment must be set using the same communications settings such as 1200 baud rate, with 8 data bits, 1 stop bit and no parity. The equipment will not see the data correctly if the settings are wrong or not the same.
Another Option: You may want to look around to see if you can purchase a data analyzer program that will run on your laptop and capture the data to disk. Even if this is several thousand dollars, it may be cheaper and quicker than writting your own program.
I hope this helps to point you in the right direction. This is all air memory, so I hope I didn't leave something important out.
Ron
|