Parallel Port #3

Blitz3D Forums/Blitz3D Beginners Area/Parallel Port #3

I am making progress with WinIo. I did the following:
1. loaded winio.dll, .sys, and .vdx into the userlibs folder;
2. created the .decls file (with just the declarations that I think I will use) and placed it in the userlibs folder;
3. created a .bb program.

Following is the .decls file then the .bb file. The program executes, but the value shown in the output window always scans 0. It seems that I am not properly capturing the DWORD (I do not know how to express a 4-byte DWORD in the parameters -- as I said, I am a newbie!). By the way, the I/O board that I am using does work with the VB example sent with WinIo package. More basic help, please?

(Thanks soja!)

**********************************************************

DECLARATION FILE

.lib "winio.dll"


;Initializes the WinIo library. Does not have to be used with Windowe XP.
InitializeWinIo():"InitializeWinIo"

;Performs shutdown of the WinIo library. Must be called before terminiating an application or when no longer using the WinIo library.
ShutdownWinIo():"ShutdownWinIo"

;Calls the WinIo driver. Parameters: (Points to a null-terminated string to specify the winio.sys driver path, Set to false).
InstallWinIoDriver(WinIoDriverPath$,IsDemandLoaded):"InstallWinIoDriver"

;Removes the WinIo driver.
RemoveWinIoDriver():"RemoveWinIoDriver"

;Reads a 1, 2, or 4 byte value from specifies I/O port. Parameters: (Input port $379, DWORD variable, BYTE = 1).
GetPortVal(PortAddr,PortVal,Size):"GetPortVal"

;Writes a 1, 2, or 4 byte value to an I/O port. Parameters: (Output port $378, Hex value written to port, BYTE = 1).
SetPortVal(PortAddr, PortVal, Size):"GetPortVal"


THE BLITZBASIC PROGRAM

;The BlitzBASIC code for:
;Direct Port access from BlitzBASIC using WinIo.

;Set graphics mode.
Graphics 800, 600, 16, 2
SetBuffer BackBuffer()

;Initializes the WinIo library.
;InitializeWinIo()

;Call the WinIo driver
InstallWinIoDriver(".\", False)

Repeat

;Read a 1 byte value from the specified port and place in variable DWORD.
GetPortVal($379, ?????, 1)

;Print variable
Print ?????

Until KeyDown(1)

;Removes the WinIo driver.
RemoveWinIoDriver()

;Shutsdown the WinIo library.
;ShutdownWinIo()

End