Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PORT32.DLL how to use it in VB6.0

Status
Not open for further replies.

hbaocr

Full Member level 4
Full Member level 4
Joined
May 13, 2007
Messages
232
Helped
25
Reputation
48
Reaction score
4
Trophy points
1,298
Location
Hochiminh City university of technology (VietNam)
Activity points
2,765
port32.dll

Please help me , how to use "port32.dll" in VB6
please send to me port32.dll file or link of it that I can download it from internet into my computer
And I don't know how many functions were supported by port32.dll
And how to declare those funnction in VB 6, If you don't mind, You can send me some example about it ( such as Vb module file(*.bas) ..,etc ..)
And I don't know how to use those functions in Port32.dll . And the usage of it.
plase help me

thank you for attention at my topic
 

port32

hi..

i am not sure for which purpose u r using port32.dll.... i guess it is to access paralle port... i have one Port.dll written and compiled by me.. it has only two functions .. to write a byte to parallel port ( outp() in C) and read a byte(inp() in c)....

i have also included an example code on how to use it..
hope this helps you....
 

inpout16.dll

Can this be done in VB6 not using C language?
 

newport.frm

the example is in VB6 only.. not in C.... check the zip file.. u can find how to use it in VB6....
 

use of log files for vb6.0

Is it possible or how or not or should it be avoided to implement IRQ or interrupts?
 

vbasm

this shoud help you understand the working principle, it is an extract from the book parallel port complete.

if u need any moe information contact me

cheers
 

inpoutv4.bas

thank ultrabrains so much ! But I used inpout32.dll , there is only two function in it ! And I don't know it can be work in ECP or EPP mode of LPT gate or not !
In this mode I can inport and Export 8 bit data parallel into pin2 ->pin9 ( d0-d7 of LPT) , To use this mode I set bit Dir(fifth bit of control register) in control register , I can Use 8 bit data (pin2->pin9) to import my paralell 8 bit data!
ex : outport32 (890,32) ' set bit dir in control register =1
A= Inport32(888) ' use 8bit paralell data to in put data into my PC through LPT port
thank so much
 

portsel.frm

Here are more examples of how it can be used

it can do all.
 

inpout16.dll download

Parallel Port Complete
by Jan Axelson

published by
Lakeview Research
2209 Winnebago St.
Madison, WI 53704
Phone: 608-241-5824
Fax: 608-241-5848
Email: jaxelson@lvr.com
WWW: **broken link removed**

This file describes the contents of the program disk that accompanies the book Parallel Port Complete. There are two versions of this file: readme.rtf is in Rich Text format, and readme.txt is plain ASCII text. They contain identical information.

About the Disk

The disk has four main directories:
\DLL contains DLLs for adding add Inp and Out routines for direct port access in Visual Basic.
\VB3 contains Visual Basic 3 (VB3) versions of the projects described in the book.
\VB4 contains Visual Basic 4 (VB4) versions of the projects described in the book. These projects will load and run under 16-bit and 32-bit Visual Basic 4.
\Basic52 contains program code for the peripheral circuits in Chapters 13 through 15.
The sections that follow describe the contents of each directory and how to use them.

Rules for Use

All of the files on this disk are provided for your use. You may use any or all portions of the files in your programs and distribute such programs without payment of royalties, if you agree to the following disclaimer:
The information, computer programs, documentation, and other material on this disk are provided "as is," without warranty of any kind, expressed or implied, including without limitation any warranty concerning the accuracy, adequacy, or completeness of the material or the results obtained from using the material. Neither the publisher nor the author shall be responsible for any claims attributable to errors, omissions, or other inaccuracies in the material on this disk. In no event shall the publisher or author be liable for direct, indirect, special, incidental, or consequential damages in connection with, or arising out of, the construction, performance, or other use of the materials contained herein.

Questions Problems, or Suggestions

If you have any questions, problems, or suggestions relating to the files on this disk or the material in the book, the best way to reach me is by email at jaxelson@lvr.com.

Copying the Files

For faster and more convenient access, you may copy the files on the floppy to a hard disk. The simplest way to do this is to copy the entire disk, including the subdirectories, to any subdirectory (folder) on your hard disk.

Windows 3.1 example

To copy the contents of the disk from drive A to directory \ppc on drive C:
1. In the File Manager, double click to open both Hard Drive C and Floppy Drive A.
2. To create the directory \ppc on Drive C, select the c:\ window, then in the File menu select Create Directory, and type ppc.
3. In the Drive A window, select a:\ and use the mouse to drag the contents of Drive A to the \ppc directory on Drive C.

Windows 95 example

To copy the contents of the disk from drive A to directory \ppc on drive C:
1. Click on My Computer and click to open Hard Drive C and Floppy Drive A.
2. To create the directory \ppc on Drive C, click on File, New, Folder and type ppc.
3. On Drive A, click on Edit, Select All, and use the mouse to drag the contents of Drive A to the \ppc folder on Drive C.

About the DLLs

The \DLL directory has three subdirectories. Each contains a DLL that adds the ability to do port I/O in Visual Basic programs. Which to use depends on your program's abilities and requirements.

For VB3 and 16-bit VB4 programs:

\inpout16 contains files related to inpout16.dll, which contains Inp and Out for port access in VB3 programs and 16-bit VB4 programs.
inpout16.dll is the DLL.
inpoutv3.bas has declarations for Inp and Out.
inpout16.txt explains how to use the DLL.
inpout16.bas is the source code for the DLL, which was created with PowerBasic's DLL compiler.

For 32-bit VB4 programs:

\inpout32 contains files related to inpout32.dll, which contains Inp and Out for port access in 32-bit VB4 programs.
inpout32.dll is the DLL.
inpout32.bas has declarations for Inp and Out.
inpoutv4.bas has declarations for Inp and Out in both inpout16 and inpout32. Use this when you want to use one file for 32-bit and 16-bit VB4 programs.
inpout32.txt explains how to use the DLL.
inpout32.bas is the source code for the DLL, which was created with Borland's Delphi 2.0 object Pascal compiler.

Another option for VB3 and 16-bit VB4 programs:

\vbasm contains files related to vbasm.dll, which includes routines for port I/O (VbInp, VbOut) as well as software interrupts (Call VbInterrupt), and direct memory access (VbPoke, VbPeek). Vbasm is for use only with 16-bit programs. Because of the differences between Windows 3.1 and Win 32, there is no equivalent for 32-bit programs.
vbasm.dll is the DLL.
vbasm.txt is declarations for the routines in vbasm.dll.
vbasm.wri explains how to use the DLL.

About the Projects

Each subdirectory in \VB3 and \VB4 contains a project that you may load into Visual Basic's programming environment. From there, you may run the programs, modify them, create .exe files, or use the code in any way you wish.
Each project was originally created in VB3. The VB4 projects are identical, except for these differences:
They use inpoutv4.bas in place of inpoutv3.bas.
The API declarations in lpttempl.bas use conditional compiling to allow 16-bit or 32-bit API calls.
The project files are .vbp format rather than .mak format.
Other file changes are made automatically when a VB3 project is saved in VB4.

The Project Files

Each project's .mak (VB3) or .vbp (VB4) file lists the files used by the project. The project's subdirectory contains the project's startup form and any other files unique to that project. Each project also uses five files in the \lpttempl subdirectory.
For example, these are the files listed in the outexpnd project's .mak file:
OUTEXPND.FRM
..\LPTTEMPL\LPTUTIL.BAS
..\LPTTEMPL\INPOUTV3.BAS
..\LPTTEMPL\LPTTEMPL.BAS
..\LPTTEMPL\NEWPORT.FRM
..\LPTTEMPL\PORTSEL.FRM
This file specification:
..\LPTTEMPL\LPTUTIL.BAS
means that the .mak or .vbp file expects to find the \lpttempl subdirectory at the same level in the directory tree as the project's subdirectory.
If you load the projects from the floppy, or if you copy the floppy to hard disk as described above, all project files will be in the expected locations. If a file is in a different location from that specified in the .mak or .vbp file, you may use Add File to load the file. Use Save Project to save any new file locations in the .mak or .vbp file. Another option is to use a text editor to change the file locations in the .mak or .vbp file.

Using the inpout DLLs

In each project, Declare statements in inpoutv3.bas or inpoutv4.bas name one or more DLLs that contain routines called by the program.
The VB3 projects use inpoutv3.bas, which declares Inp and Out in inpout16.dll (in the \DLL\inpout16 subdirectory). The VB4 projects use inpoutv4.bas, which includes declarations for Inp and Out in both inpout16.dll and inpout32.dll (in the \DLL\inpout32 subdirectory).
To use inpout16.dll and inpout32.dll, copy them to one of these locations:
The Windows directory (usually \Windows)
The Windows system directory (usually \Windows\system)
The application's working directory. (In Visual Basic's programming environment, this is the Visual Basic directory.)
Or, if you want to store the DLL in a different directory, add the path to the filename in each declaration.
Each DLL's .txt file has further instructions for using the DLL.

The Project Directories

Each project corresponds to an application described in the book. Each project has its own subdirectory in \VB3 and \VB4.

VB3

All VB3 projects also use the following files in \VB3\lpttempl\:
inpoutv3.bas, declarations for Inp and Out.
lpttempl.bas, general-purpose routines used by all startup forms.
lptutil.bas, general-purpose parallel-port routines.
newport.frm, add a new port.
portsel.frm, select and test ports.

VB4

All VB4 projects also use the following files in \VB4\lpttempl\:
inpoutv4.bas, declarations for Inp and Out.
lpttempl.bas, general-purpose routines used by all startup forms.
lptutil.bas, general-purpose parallel-port routines.
newport.frm, add a new port.
portsel.frm, select and test ports.

Project Directories Arranged Alphabetically

\Adc0809, read an analog-to-digital converter, Chapter 8
\cnbnegot, compatibility, nibble, and byte-mode transfer, with negotiating, Chapter 13
\compbyte, compatibility and byte-mode transfer, Chapter 13
\compnibb, compatibility and nibble-mode transfer, Chapter 13
\Ds1620, link to a DS1620 temperature chip (synchronous serial interface), Chapter 9
\ecp, ECP-mode transfer, Chapter 15
\epp, EPP-mode transfer, Chapter 14
\inpexpnd, input expansion, Chapter 8
\latch8s, 8 latched inputs, using the Status bits, Chapter 8
\latch8sc, 8 latched inputs, using Status and Control bits, Chapter 8
\lpttempl, general-purpose template for parallel-port programs, Chapter 4
\lpttest, toggle and view parallel-port bits, Chapter 5
\outexpnd, output expansion, Chapter 7
\pcpcnibb, PC-to-PC nibble-mode transfer, Chapter 16
\polff, polled inputs, Chapter 10
\timeoday, trigger events on time of day, Chapter 10
\timrctrl, trigger periodic events, Chapter 10
\xpoint, control a crosspoint switch, Chapter 7

Project Directories Arranged by Chapter Number

\lpttempl, general-purpose template for parallel-port programs, Chapter 4
\lpttest, toggle and view parallel-port bits, Chapter 5
\outexpnd, output expansion, Chapter 7
\xpoint, control a crosspoint switch, Chapter 7
\Adc0809, read an analog-to-digital converter, Chapter 8
\inpexpnd, input expansion, Chapter 8
\latch8s, 8 latched inputs, using the Status bits, Chapter 8
\latch8sc, 8 latched inputs, using Status and Control bits, Chapter 8
\Ds1620, link to a DS1620 temperature chip (synchronous serial interface), Chapter 9
\polff, polled inputs, Chapter 10
\timeoday, trigger events on time of day, Chapter 10
\timrctrl, trigger periodic events, Chapter 10
\cnbnegot, compatibility, nibble, and byte-mode transfer, with negotiating, Chapter 13
\compbyte, compatibility and byte-mode transfer, Chapter 13
\compnibb, compatibility and nibble-mode transfer, Chapter 13
\epp, EPP-mode transfer, Chapter 14
\ecp, ECP-mode transfer, Chapter 15
\pcpcnibb, PC-to-PC nibble-mode transfer, Chapter 16

About the Basic-52 programs

The \Basic52 directory contains program code for the peripheral circuits in the projects in Chapters 13 through 15. These programs are written for the 8052-Basic microcontroller's Basic-52 interpreter, using the circuit shown in Appendix B in the book.
The programs are intended as a very basic demonstration of PC-to-peripheral transfers using the different modes. Peripheral devices are unique, and most will not use an 8052-Basic microcontroller. However, you may use the concepts in these programs as the basis for other peripheral circuits.
The syntax of the Basic-52 language is similar in many ways to other Basics. One nonstandard keyword used in the programs is XBY, used for reading and writing to external memory.
This statement writes the byte AAh (&hAA in Visual Basic) to FC00h in external memory:
XBY(0FC00H)=0AAH
This statement stores the byte at FC02h in external memory in variable A:
A=XBY(0FC02H)

Basic-52 Programs

These are the files in the \Basic52 directory:
B52cbyt.bas, compatibility and byte-mode transfer, Chapter 13
B52cnbn.bas, compatibility, nibble, and byte-mode transfer with negotiating, Chapter 13
B52cnib.bas, compatibility and nibble-mode transfer, Chapter 13
B52ecp.bas, ECP-mode transfer, Chapter 15
B52epp.bas, EPP-mode transfer, Chapter 14
 

how to use dll in vb6.0

Simply Import It And Use PortAccess Method
 

port.dll +vb6

please help me!!!
Which the differences between ECP and EPP mode
and how can I set these modes! How can I use!
I have read Parallel Port complette ! But I don't know how we can detected the mode of LPT which our PC supported! and the register address of the ECP mode ! And how can I input data into my PC in this mode ECP
 

b52cbyt.bas

a saple program of how to detect which port you have is included in th inpout32 sip folder i earlier posted.

it is pricisely contained in the lptest folder, just run it in vb4.0 or later editions, and it will automatically detect whether it is ecp/epp/spp.

if you need any help, let me know.

and if this heleped let me equally know.

cheers
 

vb source for port32

thank ultrabrains (*_*)
I have read a part of Parallel Port complette( from chapter 1 to 8 ) But I don't understand thoroughly ! Now I do need full of this book in order to know more about parallel port! If you don't mind please send to me that book or chapter9 to 16 of this book
thank you very much
hbaocr@yahoo.com

Added after 18 minutes:

according to many direction, to use ECP mode I should set bit5 of control register high !
I try doing following to that direction many times but I'm not successfull to set I/O data as bidirectional data! Please tell me more about it
 

how to use a delphi dll with vb6.0

Hello !!!
Please help me solve my problem :
In ECP mode of LPT1, ECP's Ecr is "base address + 402H" ! tel me why : when I write one value = 34H
into ECR by this function : Out Ecr_add ,&H35
and when I receive it from FIFO by function Inp Ecr_add the value of that function is received &35H! Why do we have that result. (one sub on one Example on chapter4 page 72 parallel port parallel complette book names testPortECP)
+ Do bit0 and bit1 automaticly update upon FIFO empty,full, or having data on FIFO ! it don't depend on data which we put into that register

Added after 5 hours 49 minutes:

here are that code
Function TestForEcp%(TestAddress%)
'Test for the presence of an ECP.
'If the ECP is idle and the FIFO empty,
'in the ECP's Ecr (at Base Address+402h),
'bit 1(Fifo full)=0, and bit 0(Fifo empty)=1.
'The first test is to see if these bits differ from the
'corresponding bits in the control port (at Base Address+2).

'If so, a further test is to write 34h to the Ecr,
'then read it back. Bit 1 is read/write, and bit 0 is read-only.
'If the value read is 35h, the port is an ECP.

I don't understand at this point above ! Why do we have that result! When write to ECR 34H but when we read it the value is 35H "
Please explain it to me
here is the code in "parallel port complette" at chapter4 page 72
Dim EcrBit0%
Dim EcrBit1%
Dim ControlBit0%
Dim ControlBit1%
Dim ControlPortData%
Dim TestEcrAddress%
Dim OriginalEcrData%
TestForEcp = False
EcrAddress = TestAddress + &H402

'Read ECR bits 0 & 1 and Control Port bit 1.
EcrData = Inp(EcrAddress)
EcrBit0 = BitRead(EcrData, 0)
EcrBit1 = BitRead(EcrData, 1)
ControlPortData = ControlPortRead(TestAddress)
ControlBit1 = BitRead(ControlPortData, 1)
If EcrBit0 = 1 And EcrBit1 = 0 Then
'Compare control bit 1 to ECR bit 1.
'Toggle the control bit if necessary,
'to be sure the two registers are different.
If ControlBit1 = 0 Then
ControlPortWrite TestAddress, &HF
ControlPortData = ControlPortRead(TestAddress)
ControlBit1 = BitRead(ControlPortData, 1)
End If
If EcrBit1 <> ControlBit1 Then
OriginalEcrData = EcrData
Out EcrAddress, &H34
EcrData = Inp(EcrAddress)
If EcrData = &H35 Then
TestForEcp = True
End If
'Restore the ECR to its original value.
Out EcrAddress, OriginalEcrData
End If
End If
End Function
[/b]
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top