What commands (if any) are used to access the parallel port (both to output and to read)? Similar to the "out" command in some Basics?
Compatibility:VB3
VB4
VB5
You have a choice. You can use the MS-Comm ocx, which is available by clicking Project->Components->Microsoft Comm Control XX.0.
The best way is to use our DLL, CVBIO. You can get it at our download site.
It's free of charge. However, the following text:
"Portions copyright 1997, Cool VB. http://www.beadsandbaubles.com/coolvb/"
must be put in one or more of the following: the credits, the manual, or the about box.
Here are the declarations:
Private Declare Function cvbInp Lib "cvbio.dll" (ByVal Port As Integer) As Byte
Private Declare Function cvbInpw Lib "cvbio.dll" (ByVal Port As Integer) As Integer
Private Declare Function cvbInpd Lib "cvbio.dll" (ByVal Port As Integer) As Long
Private Declare Function cvbOut Lib "cvbio.dll" (ByVal Port As Integer, ByVal Value As Byte) As Boolean
Private Declare Function cvbOutw Lib "cvbio.dlll" (ByVal Port As Integer, ByVal Value As Integer) As Boolean
Private Declare Function cvbOutd Lib "cvbio.dlll" (ByVal Port As Integer, ByVal Value As Long) As Boolean
The other option is to access the port directly, like this:
'Input
dim s as string
open "LPT1" for input as #1
s = input(numberofbytestoread, 1)
close #1
'Output
open "LPT1" for output as #1
print #1, "thestufftosend"
close #1
Copyright 2000, David J Berube<Form1@aol.com>. All Rights Reserved.