🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.lang.visualbasic.ver3
Article #49

VB4 16-bit and parallel port

#49
From: Adam Greenberg
Date: Thu, 21 Jun 2001 05:05
38 lines
3161 bytes
Ok, I wrote a program about 2 years ago that will poll the "busy" pin on 
the parallel port.  It's accepting a TTL pulse and waits for a change in 
status value before doing something.  It was compiled as 16-bit on a 
laptop running Win98.  We got a new laptop and I tried moving the 
executable over and it didn't work (after intalling all the necessary 
16-bit dlls into Win/Sys directory).  Then I tried recompiling and that 
didn't work.  So, I downgraded the new laptop to Win98 and that didn't 
work either.  I am using the interrupt function in vbasm.dll to gain 
access to the port.  It seems to be able to read from the port once and 
then (although the TTL value changes) the value read doesn't change the 
way it used to.  Anyone know why this would not work on a new laptop?  
Also, in the BIOS I noticed that there are the following options for the 
"mode" of parallel port:  output only, bi-directional, EPP, and ECP.  
Anyone know which of these is best for what I'm doing?  Unfortunately, I 
don't have access to the old laptop anymore so I can't look up the BIOS 
settings on that one, but I'm sure they were standard settings (whatever 
those are).  Here's the snippet of code that calls the busy pin:

Global Const IntNum = &H17

'power the device by turning on data lines
InRegs.AX = &H7
InRegs.DX = &H0
Call vbRealModeIntX(IntNum, InRegs, OutRegs)
'Status Request Parameters
InRegs.AX = &H2000
InRegs.DX = &H0
TriggStat = OutRegs.AX

'Read from the port
Call vbRealModeIntX(IntNum, InRegs, OutRegs)
TriggStat = OutRegs.AX
Text1.Text = TriggStat

Maybe my addresses are off for the new machine?  I never really 
understood how those worked (I lifted them from something else I saw and 
they just worked).  Thanks for any and all help.
-Adam
Technical Details
Message-ID: <agreenb-2106010005080001@dsl-64-34-93-149.telocity.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!enews.sgi.com!telocity-west!TELOCITY!newsrump.sjc.telocity.net!agreenb

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10c949,bbe90fa7170f1617,start
X-Google-Attributes: gid10c949,public
X-Google-Thread: 1023e1,bbe90fa7170f1617,start
X-Google-Attributes: gid1023e1,public
X-Google-Thread: f5f6f,bbe90fa7170f1617,start
X-Google-Attributes: gidf5f6f,public
X-Google-Thread: 10ab99,bbe90fa7170f1617,start
X-Google-Attributes: gid10ab99,public
X-Google-Thread: 108062,bbe90fa7170f1617,start
X-Google-Attributes: gid108062,public
X-Google-ArrivalTime: 2001-06-20 22:05:36 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!enews.sgi.com!telocity-west!TELOCITY!newsrump.sjc.telocity.net!agreenb
From: agreenb@uab.NOSPAM.edu (Adam Greenberg)
Newsgroups: alt.comp.lang.visualbasic.ver3,alt.lang.basic,comp.lang.basic.misc,comp.lang.basic.visual.3rdparty,cz.comp.lang.basic.visual
Subject: VB4 16-bit and parallel port
Message-ID: <agreenb-2106010005080001@dsl-64-34-93-149.telocity.com>
Organization: UAB
X-Newsreader: MT-NewsWatcher 2.4
Lines: 38
X-Trace: MzggTm9BdXRoVXNlciBURUxPQ0lUWS1SRUFERVJTIDY0LjOJLjkzLjE0OSAgV2VkLCAyMCBKdW4g!MjAwMSAyMjowNToOMyBQRFQ=
X-Abuse-Info: Please forward ALL headers when reporting abuse.
X-Complaints-To: abuse@bb.directv.com
NNTP-Posting-Date: Wed, 20 Jun 2001 22:05:33 PDT
Date: Thu, 21 Jun 2001 00:05:08 -0500