open lpt[x]
open lpt[x]
trouble with open lpt1 but not with open lpt
Have dot matrix printer attached to lpt1
The following works: open lpt....as #2 : print #2 "whatever" :close #2
But open lpt1 etc. returns a value of 2
Does this mean ( ?? no Printer at port ??)
Apparently FreeBasic will only work with spooler.
OS Windows 10
Under Printer Properties direct print to printer was chosen
Have dot matrix printer attached to lpt1
The following works: open lpt....as #2 : print #2 "whatever" :close #2
But open lpt1 etc. returns a value of 2
Does this mean ( ?? no Printer at port ??)
Apparently FreeBasic will only work with spooler.
OS Windows 10
Under Printer Properties direct print to printer was chosen
Re: open lpt[x]
You've got a working solution.squibit wrote:... works: open lpt....as #2 : print #2 "whatever" :close #2
Read the FB-Manual ... for detailed information.
Re: open lpt[x]
Have read that page perhaps 20 times over the last year-the point is to get direct printing to the device onMrSwiss wrote:You've got a working solution.squibit wrote:... works: open lpt....as #2 : print #2 "whatever" :close #2
Read the FB-Manual ... for detailed information.
lpt1 with the ultimate goal of using the port to control hardware- SO indeed there is no solution.
Re: open lpt[x]
You are "heavily switching targets" here:
from: printing (got a serial Printer) to: HW-Device Control, on Parallel-Port.
However, the opening of the port, remains the same.
Writing to the Port must be done without using "print"-statement.
See the related threads on Serial communication, for that (using put).
In this day and age: no more direct HW-Control any longer (OS handles that).
Even serial runs over OS provided Buffers (send/receive).
from: printing (got a serial Printer) to: HW-Device Control, on Parallel-Port.
However, the opening of the port, remains the same.
Writing to the Port must be done without using "print"-statement.
See the related threads on Serial communication, for that (using put).
In this day and age: no more direct HW-Control any longer (OS handles that).
Even serial runs over OS provided Buffers (send/receive).
Re: open lpt[x]
Hi All
If the LPT port is a genuine port on the hardware (as in Desktop Plugin LPt board, or on board LPT chip), then you can address it.
If the port is emulated on some obscure piece of hardware and needs a special driver to get to it, then you are out of luck.
I use a Library called WinIO, and after initialising it, just as an example.
Have used this in various Win version.
Regards
Wel that depends a bit on the hardware.In this day and age: no more direct HW-Control any longer (OS handles that).
If the LPT port is a genuine port on the hardware (as in Desktop Plugin LPt board, or on board LPT chip), then you can address it.
If the port is emulated on some obscure piece of hardware and needs a special driver to get to it, then you are out of luck.
I use a Library called WinIO, and after initialising it, just as an example.
Have used this in various Win version.
Code: Select all
InitializeWinIO
Motor.LptAddr = &H378
Motor.Fwd = 1
Az = Inp(Motor.LptAddr)
Bz = Az or Motor.Fwd
Out Motor.LptAddr, Bz
Re: open lpt[x]
"If the LPT port is a genuine port on the hardware"
Before attaching the printer I have been trying to get direct output using OUT32
Monitoring the strobe socket with an oscilloscope while in an unending loop
with( out32(&h37A,1) ........out32(&h37A,0)........) No luck.
Also tried writing 0 and 255 to &H378 with equal lack of success.
[1]Do you think WINIO will succeed where inpoutx64 failed?
[2]In case you suspect as I do, that the port is not genuine, can you name
a board that contains a genuine port.
Best regards , a Happy New Year, and if you are up to it , a Merry Christmas
Before attaching the printer I have been trying to get direct output using OUT32
Monitoring the strobe socket with an oscilloscope while in an unending loop
with( out32(&h37A,1) ........out32(&h37A,0)........) No luck.
Also tried writing 0 and 255 to &H378 with equal lack of success.
[1]Do you think WINIO will succeed where inpoutx64 failed?
[2]In case you suspect as I do, that the port is not genuine, can you name
a board that contains a genuine port.
Best regards , a Happy New Year, and if you are up to it , a Merry Christmas
Re: open lpt[x]
Hi All
squibit, you will need the WinIO library.
http://www.internals.com/utilities/utilities.htm
In this zip there are 64 bit dll and.sys, and also help .chm
I have not used the Out32 in FB only the Out instruction.
But rest assured it worked for me and and at this very moment is controlling motors
in a production environment.
Regards
Edit:
Depending on what your hardware bus is, just search for Parallel Port Adapters.(I was still using Industrial ISA bus backplanes 2 years ago)
squibit, you will need the WinIO library.
http://www.internals.com/utilities/utilities.htm
In this zip there are 64 bit dll and.sys, and also help .chm
I have not used the Out32 in FB only the Out instruction.
But rest assured it worked for me and and at this very moment is controlling motors
in a production environment.
Regards
Edit:
Depending on what your hardware bus is, just search for Parallel Port Adapters.(I was still using Industrial ISA bus backplanes 2 years ago)
Re: open lpt[x]
Code: Select all
extern "Windows-MS" lib "WinIo64"
declare function _
InstallWinIoDriver stdcall ( DriverPath as zstring ptr, _
Loaded as Boolean) as Boolean
end extern
dim fl as zstring ptr
fl=allocate(32)
'fl= "C:\FreeBASIC64\WinIo64.sys"
*fl= "C:\Windows\System32\WinIo64.sys"
'fl= "C:\ SysWOW64\WinIo64.sys"
dim as Boolean ld,dl
ld=false
dl=InstallWinIoDriver(fl, ld)
print dl,ld,*fl
sleep
Cannot get WinIo64.sys to install: have tried "C" instead of "Windows-MS" in the extern declaration
Also, have tried the three locations indicated(a copy of the driver is in each)
Am logged in in a Windows account for which I'm the administrator.
Also FBIDE is being run as administrator.
In addition the executable is being run as an administrator
The bcdedit /set TESTING ON has been run and the computer says it's running in test mode
Do you have any suggestions, including that I've made a stupid mistake
Re: open lpt[x]
Hi All
Will fire up my XP laptop and visit the old project and note the sequence of events.
Regards
Will fire up my XP laptop and visit the old project and note the sequence of events.
Regards
Re: open lpt[x]
Hi All
squibit , below what makes the system work on Windows XPe.
Files in Folders:
WinIO.dll in my applications folder
WinIO.sys " "
WinIO.vxd " "
WinIO.dll in /Windows/system32
In your Fbc compile statement: -l winio
In your declare statements:
At beginning of your code:
In your code:
At end of code:
It is very reliable and in one application I control about 240 IO bits on addresses from &h140 to &h1b0.
In another I use the LPT port to communicate with a Stepper Motor controller by giving it direction and start signals.
If you have an XP system available, try it there if you can't get the 64 bit version to work.
Good Luck.
Regards
squibit , below what makes the system work on Windows XPe.
Files in Folders:
WinIO.dll in my applications folder
WinIO.sys " "
WinIO.vxd " "
WinIO.dll in /Windows/system32
In your Fbc compile statement: -l winio
In your declare statements:
Code: Select all
'Lib WinIO
Declare Function InstallWinIoDriver Alias "InstallWinIoDriver"(Byval WinIoDriverPath As Zstring Ptr,Byval IsDemandLoaded As Integer ) As Integer
Declare Function RemoveWinIoDriver alias "RemoveWinIoDriver"() as integer
Declare Function InitializeWinIo Alias "InitializeWinIo"() As Integer
Declare Function ShutdownWinIo Alias "ShutdownWinIo"() As Integer
Code: Select all
Print InitializeWinIO
Code: Select all
Out &h378,1
Code: Select all
Print ShutDownWinIo
In another I use the LPT port to communicate with a Stepper Motor controller by giving it direction and start signals.
If you have an XP system available, try it there if you can't get the 64 bit version to work.
Good Luck.
Regards
Re: open lpt[x]
If you have an XP system available, try it there if you can't get the 64 bit version to work.
Hi Dinosaur
Took a Toshiba Protege Tablet with Windows XP in which was a card bus parallel port had been
inserted Got it to work, first in PowerBasic35( old standby) and then in FreeBASIC 0.4.6 without
winio simply using out instruction.
Will be happy to send you details on the card bus if you're interested.
A query
Only winio files I could find for 32 bit XP are winio32.dll and winio32.sys (no .vxd file)
Should these work?
Best regards and Thanks for your advice
Squibit
Hi Dinosaur
Took a Toshiba Protege Tablet with Windows XP in which was a card bus parallel port had been
inserted Got it to work, first in PowerBasic35( old standby) and then in FreeBASIC 0.4.6 without
winio simply using out instruction.
Will be happy to send you details on the card bus if you're interested.
A query
Only winio files I could find for 32 bit XP are winio32.dll and winio32.sys (no .vxd file)
Should these work?
Best regards and Thanks for your advice
Squibit