All the single bytes passes work but "word" and "Dword" passes exit the DBPro .exe. Can someone make this work?
port AS BYTE
data1 AS DWORD
value AS WORD
bit AS BYTE
load dll "io.dll",1 : rem load the dll.
remstart
Function Descriptions
Please refer to the prototype for the particular language you are using.
PortOut
Outputs a byte to the specified port.
PortWordOut
Outputs a word (16-bits) to the specified port.
PortDWordOut
Outputs a double word (32-bits) to the specified port.
PortIn
Reads a byte from the specified port.
PortWordIn
Reads a word (16-bits) from the specified port.
PortDWordIn
Reads a double word (32-bits) from the specified port.
SetPortBit
Sets the bit of the specified port.
ClrPortBit
Clears the bit of the specified port.
NotPortBit
Nots (inverts) the bit of the specified port.
GetPortBit
Returns the state of the specified bit.
RightPortShift
Shifts the specified port to the right. The LSB is returned, and the value passed becomes the MSB.
LeftPortShift
Shifts the specified port to the left. The MSB is returned, and the value passed becomes the LSB.
IsDriverInstalled
Returns non-zero if io.dll is installed and functioning. The primary purpose of this function is to ensure that the kernel mode driver for NT/2000/XP has been installed and is accessible.
void WINAPI PortOut(short int Port, char Data);
void WINAPI PortWordOut(short int Port, short int Data);
void WINAPI PortDWordOut(short int Port, int Data);
char WINAPI PortIn(short int Port);
short int WINAPI PortWordIn(short int Port);
int WINAPI PortDWordIn(short int Port);
void WINAPI SetPortBit(short int Port, char Bit);
void WINAPI ClrPortBit(short int Port, char Bit);
void WINAPI NotPortBit(short int Port, char Bit);
short int WINAPI GetPortBit(short int Port, char Bit);
short int WINAPI RightPortShift(short int Port, short int Val);
short int WINAPI LeftPortShift(short int Port, short int Val);
short int WINAPI IsDriverInstalled();
remend
`LOAD DLL "io.dll",1
`CALL DLL 1,"PortOut",Port,Data
`CALL DLL 1,"PortWordOut",Port,Data
`CALL DLL 1,"PortDWordOut",Port,Data
`CALL DLL 1,"PortIn",Port
`CALL DLL 1,"PortWordIn",Port
`CALL DLL 1,"PortDWordIn",Port
`CALL DLL 1,"SetPortBit",Port,Bit
`CALL DLL 1,"ClrPortBit",Port,Bit
`CALL DLL 1,"NotPortBit",Port,Bit
`CALL DLL 1,"GetPortBit",Port,Bit
`CALL DLL 1,"RightPortShift",Port,Val
`CALL DLL 1,"LeftPortShift",Port,Val
`CALL DLL 1,"IsDriverInstalled"
gosub checkfordriver
port=1:data1=255:value=118:bit=255
gosub portout
gosub portin
gosub portwordout
do
loop
portwordout:
if dll exist(1)
if dll call exist(1,"PortWordOut")=1
portwordout=call dll (1,"PortWordOut",port,value)
error=0
else error=1
endif
endif
print str$(error)+" PortWordOut "+str$(portwordout)
return
portin:
if dll exist(1)
if dll call exist(1,"PortIn")=1
portin=call dll(1,"PortIn",port)
error=0
else error=1
endif
endif
print str$(error)+" PortIn "+str$(portin)
return
portout:
if dll exist(1)
if dll call exist(1,"PortOut")=1
portout=call dll(1,"PortOut",port,bit)
error=0
else error=1
endif
endif
print str$(error)+" PortOut "+str$(portout)
return
checkfordriver:
if dll exist(1)
if dll call exist(1,"IsDriverInstalled")=1
driver=call dll(1,"IsDriverInstalled")
error=0
else error=1
endif
endif
print str$(error)+" IsDriverInstalled "+str$(driver)
return
Thanks