Inpout32 Dll Serial Port Example
Posted on by admin
- Visual Studio Serial Port Example
- Inpout32 Dll Serial Port Example Download
- Python Serial Port Example
Simple parallel/serial port programming (Visual Basic 6.0) The goal of the project is to read a voltage change on pin 13 of the parallel port. Pin 13 was chosen because it is a status line (status=read only). Now I'm using Inpout32.dll to access the parallel port through VB (XP/9x compatible), and another program called VBPortTest.exe. Windows 2000/Xp add improved drivers for accessing parallel-port devices with support for SPP, PS/2 (Byte), EPP, and ECP modes and daisy-chaining. Parclass is a system class driver for parallel-port devices, and Parport is a system function driver for the parallel port. The Windows DDK has details.
Hi Phil,First of all THANK YOU for this incredibly useful update to InpOut32. I am attempting to use QB64 (v 1.00) on a Window 7 machine with an on-board COM port (i.e. hardware port, not a USB adapter) to talk to a voltmeter via serial port. I am having trouble opening the port.
I have installed the 32 bit inpout32.dll from the 1501.zip package using InstallDriver.exe. I have confirmed that c:windowssystem32driversinpoutx64.sys was installed. I am using the code described on the QB64 wiki here: qb64 dot net /wiki/index.php/Port_Access_Libraries to open the COM port by sending bit-level commands to the UART ports as shown in the code immediataly under 'COM Ports' halfway down the page.
And, everything works, BUT ONLY after I have loaded the free serial port test program here: microridge dot com /comtestserial.htm With that test program I can send characters to the COM port and change it's state manually. If I run my QB64 program concurrently, I can do the same. As soon as I shut down the test program, I can no longer do anything with the COM port from Basic.
I also wrote the code attached below to continuously query the UART registers of COM1. It seems to work fine, returning the values of the bytes associated with the COM port, but again, only when the serial test port program is running. Once I stop that test program, the values returned by my QB64 program are all 255, i.e. it doesn't seem to be able to read the port.
SO, do you have any suggestions as to what is going on and how to fix it? I would prefer not to have to run external programs to enable by QB64 code to run.
Thanks for your help and advice.
Dan
----------------------------------------------------------------------------------------------------------
REM COMRegisterScan.bas: Scan registers associated with open COM
REM port continously, to spot changes.
DECLARE DYNAMIC LIBRARY 'inpout32'
FUNCTION Inp32% (BYVAL PortAddress AS INTEGER)
Visual Studio Serial Port Example
SUB Out32 (BYVAL PortAddress AS INTEGER, BYVAL Value AS INTEGER)
END DECLARE
Baseadd% = &H3F8 'any valid COM port address (see the Windows Component Settings)
REM Possible port addresses are &H3F8(1016) = COM1, &H2F8(760) = COM2, &H3E8(1000) = COM3 and &H2E8(744) = COM 4.
CLS
Print 'Scanning comp port registers. ESC to quit.'
print 'reading from base address: ';Baseadd%
DO
x$ = INKEY$
for i = 0 to 7
locate 10+i, 10
print 'Base address + ';i; ': ';Inp32(Baseadd% + i); ' '
Inpout32 Dll Serial Port Example Download
next iIF x$ = CHR$(27) THEN EXIT DO 'Escape key quits