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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling lpt

Status
Not open for further replies.

Nifrabar

Programmer
Mar 16, 2003
1,343
NL
Hi.
Is it possible to control a LPT by VFP?
-Bart
 
What's the device you want to control? Unidirectional (printing) or bidirectional (some device sending back output to LPT)?

LPT is just a printer port. You can use the Generic/Text printer driver and set it up to use the LPT port, that's the easiest scenario to print to LPT.

Bye, Olaf.
 
Bart,

You can send data to an LTP port via certain DOS commands. For example, [tt]COPY MyFile LPT1[/tt] can send an entire file to the port. You can also re-direct output from most DOS commands. For example, [tt]TYPE MyFile >LPT1[/tt]. And you can run these commands from within VFP via the RUN command.

That said, I'm not sure why you would want to do this. As Olaf mentioned, the LPT port is really just a printer port, so you can use any of VFP's printing features to send data to it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi,
As a site-step of my heater-program I'm working on a project to monitor internal and outside temp in a small cottage. (Chalet).
I intend to do the monitoring (trending) with VFP (as my best known language).
Part of the project is remote monitoring using webcam.
The webcam can be remote viewed over the internet using webcamxp9.

As I currently don't have a cam with pan/tilt I like to create an own interface which might be controlled using PC's LPT.
Meanwhile other controls might be doen using this way of 'remote control'
(startup heater etc.)
I just found out that thereis an inpout32.dll which I need to investigate yet.


-Bart
 
I don't know in detail, bu would expect such devices, eg camera movement, should be available as USB devices, perhaps integrated part of the camera itself. Devices are all USB today. You might find older stuff using RS232 COM ports, but less the parallel printer port, I don't even have a computer having a 24 pin parallel port, just a 9 pin COM.

You can address such ports via VFP CommTools, for example.

Bye, Olaf.
 
ts said:
As I currently don't have a cam with pan/tilt I like to create an own interface which might be controlled using PC's LPT.

You will find the the interface easier to make if you use RS232 connection instead of LPT. Actually if you use PLC and not creating the interface from scratch, you'll find it very easy (assuming you have basic-to-intermediate electronic skill).

Good luck anyway :)

foxyland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top