Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make my program listen to LPT1

Status
Not open for further replies.

vpaladan

Programmer
Nov 13, 2002
13
PH
Hi

My client had Panasonic PABX Telephone system. All calls made (info e.g. local no., duration of call, Tel. No.) are transmitted to a printer through a rs-232 cable.

My query is that :
1. Can I redirect all the info to a computer/database (instead of to the printer)by replacing the cable (Male-Female) to Lap-Link cable(Male-Male)?

2. if 1 is possible, how can i make my program listen to LPT1 port?

Please help.

Vic
 
Hi

1. I have not done what you are talking about. But I can give you helpful clues as I understand it.
2. Instead of sending it to a printer, It is quite easy to redirect the printer output to a TextFile.
3. This then is your input text file and you can import it a database at your convenience. :)
This could be easier than.. capturing data from LPT1. Though I say this, once you find a way.. everything will look easy at the end. !

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Good Day Ramani,

Thanks for the clues.

Actually, my plan is to redirect the printer out put to a text file and process it at the end of the day. but the only way to do that is to listen to the PABX device output through LPT1 or any Comm. Port.

Based on MSDN, FGETS function returns a series of bytes from a file or comm. port opened with a low-level file function. But my problem is that i don't know how to open that port.

Any idea Thanks in advance?

Vic
 
Dear Vic,

I have not try the situation before.

However, RS232 is a serial interface.
I guess the printer connected to PABX is a serial printer.

So, try connect RS232 to your PC's com1 port.
Of course you must sort out the "DB25/DB9, male/female" problem by using suitable converter.

Then, in VFP
FOPEN("COM1:")
and FREAD, FGET.... to listen to the data

Hope that it could help.

Norman
 
Good Day Norman,

Thanks.[thumbsup2]

Will try to test the code.

Vic
 
For serial comunication I used succesfully "MSCOMM32.OCX". It's very simply to use it.
Best regards,
Eugen
 
Vic, Norman,
I wouldn't bother with the FOPEN() routine (this was only valid in DOS), while it may work in Win 9x OS's, it probably won't in NT /2000/ XP, as they restrict direct access to the ports. Eugen's suggestion of using MSCOMM32.OCX is the way to go.

Some sample code for accessing serial data in VFP using MSCOMM32 can be found in the following:
- HOWTO: Receive from the Serial Port by Using MScomm32.ocx.
Also useful may be
- HOWTO: Send to the Serial Port by Using Mscomm32.ocx.
And of course,
- HOWTO: Transmit and Receive Binary Data using MSCOMM32.

If MSCOMM32 doesn't provide you with enough control, you'll need to find another 3rd party control to handle the serial communication.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top