hobby-cnc

Welcome to my
Hobby CNC Engraving site.

HELP !!!! We want to translate our site to different languages, so we can help people who can’t read english. Please translate 1 page or more to your language and help other hobby people. Look here for more information

 

Top Product
OverzichtDCNCFreesmotor_t
Click here for more information

 

LPT port under Win 95 to Win ME with Visual Basic

I have made this site for all the people who want to learn about How to send and get Binairy data from your LPT Port with Basic and/or Visual Basic.

We are NOT RESPONSEBLE for any damage on your computer.

1. When you put something on your LPT Port , please do your computer off first
2. Don't put the out ports together.
3. On dataline in only 0 or +5V and absolute not more.

So , i shall try to explaine what the meaning is of this site.
Example.

I want to make a contoling center for my house.
That means :

----I want to click with my mouse and the light in the kitchen will be on.-----or at 7.00 AM my coffee will be hot
----or my radio will be on at 5.00 AM
----or ......     ( everything is possible )

When you want to do this , you need some things :
----A computer
----Basic or Visual Basic
----Electronic components for a Printboard
( i shall explain how to make one )

Ad1 : Computer.
          This can be an old one . example If you want to use Visual Basic a 486 with windows 95.
          or a 8088 for normal Basic.

Ad2 : The programm language Basic or Visual Basic. This is a very easy to learn and to handle.

 Ad3 : The printer board is also easy.
          Look at to my
Stepperdriver board with ULN2803 for it.

 

Here is some Info about your LPT Port.

Pin nr
25pins

2
3
4
5
6
7
8
9

15
13
12
10
11

1
14
16
17

Pin nr
36pins

name

2
3
4
5
6
7
8
9

32
13
12
10
11

1
14
31
36

Data line 0
Data line 1
Data line 2
Data line 3
Data line 4
Data line 5
Data line 6
Data line 7

Error
Select
PE
Ack
Busy

Strobe
Auto Feed
Init
SLCT IN

Address

Data Direction

Basic Address , Bit 0
Basic Address , Bit 1
Basic Address , Bit 2
Basic Address , Bit 3
Basic Address , Bit 4
Basic Address , Bit 5
Basic Address , Bit 6
Basic Address , Bit 7

Basic Address +1 , Bit 3
Basic Address +1 , Bit 4
Basic Address +1 , Bit 5
Basic Address +1 , Bit 6
Basic Address +1 , Bit 7

 Basic Address +2 , Bit 0
Basic Address +2 , Bit 1
Basic Address +2 , Bit 2
Basic Address +2 , Bit 3

Out
Out
Out
Out
Out
Out
Out
Out

In
In
In
In
In, Inverted

In / Out , Inverted
In / Out , Inverted
In / Out
In / Out , Inverted

First you need a DLL to use your Lpt Port with Visual Basic.

My fiend wrote that piece of software for you ( not for windows2000).   poort.dll (196kb) and it is legal.

 Place this DLL in the windows directory.
Then you must make a Module to declare your variables.
Put this in your Module:

Declare Function SchrijfLPT Lib "poort.dll" (ByVal PortAddress As Integer, ByVal PortData As Integer) As Integer

Declare Function LeesLPT Lib "poort.dll" (ByVal PortAddress As Integer) As Integer

 

Now you must use them.

The data you get and put to LPT Ports are always Binairy.
 That means :

Dec        Binair
   1  =  0000 0001 
Data line 1 will be high
   2  =  0000 0010  Data line 2 will be high
   3  =  0000 0011  Data line 1 and 2 will be high
   4  =  0000 0100  Data line 3 will be high
and so on.

example 1. The value of textbox 1 will be send to LPT1.
                  to get the value use the function Val and the LPT1 port has the address 888.

Make a button and an inputtextbox.
Dubbelclick at the button.
Write the following text:
Dim answer as integer
answer = SchrijfLPT( 888 , val(text1.text))

vbprog1.zip ( 2 kb ). 

 

 example 2. The value of LPT1 will be put in Textbox 1.
                  to get the value use the function LeesLPT .

 Make a button and an inputtextbox.
Dubbelclick at the button.
Write the following text:
text1.text  = str$(LeesLPT( 888 ))

 

 Some one has send me this program port.dll . I don't know if it's legal. port.zip(26KB)
The declaraions are in the .bas file.

The next program i have write for you is vbprog3.( 29 KB )
You can see on your screen 12 lamps and you can click on one of the lamps.
When you do that you will see that one of the pins of your lpt port wil be high.
Look to the program source and see how easy it is.

Now i show you how to controle a steppermotor .

If you want to controle it , you must know how they works.

The most steppers have 4,5,6,8 or 10 wires.
I shall show you how 5 and more wire steppers works.( Unipolair Stepper )

Data line 1
Data line 2
Data line 3
Data line 4

ULN2803

A
B
C
D

Here you can see how to connect a stepper to your computer.
See what happen when you makes Dataline 1 High and then  Dataline 2 High and then Dataline 3 High and so on.

Fig. 1

Fig. 2

Fig. 3

The motor turns to the right. This is Full Step.
There is also a posibility to make half step.
Fig 4 is dataline1 high . Fig 5 is dataline1and dataline 2 high.Fig 6 is dataline2 high  enz.

Fig. 4

Fig.6

Fig. 8

Fig. 5

Fig. 7

Fig. 9

This is the source code for fig 1 - fig 3 with Visual Basic.
LPT 1 address is 888 and is the same as H278

SchrijfLPT( 888 , 1)
SchrijfLPT( 888 , 2)
SchrijfLPT( 888 , 4)
SchrijfLPT( 888 , 8)

 in Basic

out 888 , 1
out 888 , 2
out 888 , 4
out 888 , 8

Most steppers are 180 steps / 360 grd. That means that you must repeat this program 180/4 = 45 times.

This is the source code for fig 4 - fig 9.

 SchrijfLPT( 888 , 1)
SchrijfLPT( 888 , 3)
SchrijfLPT( 888 , 2)
SchrijfLPT( 888 , 6)
SchrijfLPT( 888 , 4)
SchrijfLPT( 888 , 12)
SchrijfLPT( 888 , 8)
SchrijfLPT( 888 , 9)

Most steppers are 180 steps / 360 grd. That means that you must repeat this program 180/4 = 45 times.

 

copyright © 2000 - 2006 Majosoft
www.majosoft.com

- Home - - Router Motor for hobby cnc engraving machine - - Tips and tricks - - End switches - - How to make a Cutter of an old drill - - self made parts - - Drawings of an selfmade cnc engraving machine - - cas - - choice - - visitor experience - - hobby cnc engraving machine p van der ende - - hobby cnc engraving machine stinissen - - hobby cnc engraving machine f de beer - - hobby cnc engraving machine jim netherland - - hobby cnc engraving machine W Jansen - - hobby cnc engraving machine Pascal - - hobby cnc engraving machine Dirk Verbeek - - hobby cnc engraving machine cees - - hobby_cnc_engraving_machine_jaak_claesen - - Home made cnc engraving machine of Adam Gulczynski - - Home made cnc engraving machine of Arjen van der Linden - - Home made cnc engraving machine of Hennie Vos - - Home made cnc engraving machine of Peter Moers - - Home made cnc engraving machine of Graeme Matthewson - - hobby cnc patrick lafond - - hobby cnc peter guns - - hobby cnc Roberto Martinez - - Hobby cnc noel derks - - Home made cnc engraving machine of Mohammad nasiri - - Home made cnc engraving machine of Humphry - - Home made cnc plasma cutting machine of rene verbruggen - - VEJEN Wooden engraving machine - - Home made cnc engraving machine of claes custaaf - - Home made cnc engraving machine of Albert Bogema - - hobby cnc cutter spindel arie peperkamp - - Home made cnc engraving machine of Stasha - - Home made cnc engraving machine of Seppo - - Home made cnc engraving machine of  H de Zwart - - Home made cnc router of claudio fernandez - - Home made cnc engraving machine of Fernando Piffari - - Home made cnc engraving machine of Mark Fendall - - wooden hobby cnc engraving machine - - engraving machine 5 - - engraving machine 4 - - engraving machine 3 - - engraving machine 2 - - engraving machine 1 - - Free Cad Cam Software - - Majosoft Free engraving software for windows - - Free engraving software - - Free Software Tools - - Anatomy of an Engraving Cutter - - Burnishing - - Color Filling - - Engraving Overview - - Rotary of an Engraving Tool - - Sharpened Tools - - Simple steppermotor guidelines - - Simple Stepper driver guidelines - - Conrad Stepper Driver smc800 en smc1500 - - Stepper driver board with ULN2803 - - Stepper driver board with L297 and L6203 - - Stepper driver cnc 3d 4d uwe wulf - - Making PLT files for circuit board milling - - tutorial - mastercam - - lessons - how to work with G-Code - - How to use AlphaCam as Engraving software - - Trace with Type3 - - Trace with Adobe Streamline - - cheap cad cam - - Trace a bitmap to a vector art with Corel Trace - - Engraving and Metalworking Books - - Datasheets for stepperdriver - - Printer to plotter - - copy machine - - body_hobby_cnc_links.html - - Home made cnc engraving machine of vedran siforija - - Home made cnc engraving machine of Krzysztof - - Home made cnc engraving machine of Jaap Rademaker - - Hobby cnc Proxxon MF 70 mit SMC 800 Gerrit Hepcke - - Het automatiseren ( CNC ) van een proxxon freesmachine door Henk van Broekhuyzen - - Selfmade Lineair Guides - - How to make Clamping Devices -