Using FB via FBIDE-64 bit machine-Windows 7(am signed on as administrator)
Printer connected to parallel port does not respond to a sequence such as:
open lpt "LPT1:EMU=TTY" for output as #2
print #2,"SAM"
nor to explicit outputs to the port such as
out &h378,i where has been declared to be a byte and various
values of i are used.
inp(&h378) does return a value(-8) [ 248 if i is declared as ubyte]
using shell "print todo.dat" DOES work
LPT usage
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: LPT usage
For port inp/outp commands you need inpoutx64.dll here are a stzep by step http://www.logix4u.net/parallel-port/26 ... -xp-64-bit
Joshy
Joshy
Re: LPT usage
Thank you for your help to date.
Don't understand how to "link" to inpoutx64.lib
(the driver file has been placed in System32\drivers and inpoutx64.dll has been put in freebasic\lib\win32)
Have tried multiple placements of the ....lib file, inclib's, libpath's, name changes, etc.
By the way, how does one officially thank you.
Don't understand how to "link" to inpoutx64.lib
(the driver file has been placed in System32\drivers and inpoutx64.dll has been put in freebasic\lib\win32)
Have tried multiple placements of the ....lib file, inclib's, libpath's, name changes, etc.
By the way, how does one officially thank you.
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: LPT usage
Delete the import lib file: inpoutx64.lib from FreeBasic folder (it's for VisualStudio C/C++)
Here are the FreeBASIC include file you need for win32 and win64.
Joshy
file: inpout.bitest01.bas
Here are the FreeBASIC include file you need for win32 and win64.
Joshy
file: inpout.bi
Code: Select all
#ifndef __INPOUT_BI__
#define __INPOUT_BI__
#ifdef __FB_WIN32__
#ifdef __FB_64BIT__
extern "Windows-MS" lib "inpoutx64"
#else
extern "Windows-MS" lib "inpout32"
#endif
declare sub Out32(byval PortAddress as short, byval data as short)
declare function Inp32(byval PortAddress as short) as short
end extern
#else
#error Sorry OS must be Windows X86 or x86_64 !
#endif
#endif
Code: Select all
#include "inpout32.bi"
print Inp32(&H278)
sleep
Re: LPT usage
Have put inpoutx64.dll into freebasic\lib
Is this correct? Or should it go into windows\sys32?
Is the "WINDOWS MS" before lib an indication that it should go into some Windows folder.
Keep getting error message that the format of the file is incorrect.
Is this correct? Or should it go into windows\sys32?
Is the "WINDOWS MS" before lib an indication that it should go into some Windows folder.
Keep getting error message that the format of the file is incorrect.
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: LPT usage
No put it in the same folder where your *.exe are build and inpoutx64.sys also.squibit wrote:Have put inpoutx64.dll into freebasic\lib Is this correct ?
I wrote it before search and delete the file inpoutx64.lib it's for VisualStudio C/C++ not for FreeBASIC.squibit wrote:Keep getting error message that the format of the file is incorrect.
Be sure you use a 64-bit FreeBASIC compiler.
If you use a 32-bit FreeBASIC compiler on your 64-bit windows you have to use instead inpout32.dll inpout32.sys.
Joshy
Re: LPT usage
Joshy,
Thanks for all you help.
Did what you said; program compiled but did not print.
On the website with this link
https://groups.google.com/forum/#!topic ... bIO2wHK1KU
found an extra step was required, involving Installing the driver.
Program now prints--only trouble, which I can live with-is that printing occurs after one closes the
execution of the program.
Bernie
Thanks for all you help.
Did what you said; program compiled but did not print.
On the website with this link
https://groups.google.com/forum/#!topic ... bIO2wHK1KU
found an extra step was required, involving Installing the driver.
Program now prints--only trouble, which I can live with-is that printing occurs after one closes the
execution of the program.
Bernie