|
Post by monini64 on Sept 18, 2018 16:54:02 GMT -5
i need use paralel port but i need know how i can wryte and read it, i doing this program, but same thinks is wrong or i have misisng somethinks
port=HEXDEC("3bf")
byte=255
OUT port, byte
returnedByte = INP(port)
|
|
|
Post by Rod on Sept 19, 2018 1:56:12 GMT -5
John still has some code showing how to do this at www.diga.me.uk/oldRM/LB/indexlb.htmlScroll down to his parallel port project. Having said that this program was designed to work with a built in parallel port interface which had fixed addresses for their input and output ports. If you are using a virtual parallel port, one which connects to your computer via USB then I don’t know whether it will work. But there may be documentation with the virtual device that might point the way. I have to say that you would be far better of changing to a new digital input output device that connects via the serial port. It might still be USB based but it is far easier to use in Liberty. There are many variants on the market, choose one and check with us before purchase. Parallel has been dead for near twenty years or so. What is your project about, you might get better advice if we understood the.interface required.
|
|
|
Post by monini64 on Sept 25, 2018 17:36:24 GMT -5
i solved write and read lpt port rem 888 is the lpt1 adress dataport = 888 rem 255 all bits port lpt on byte = 255 call WriteLPT dataport, byte call InputLPT dataport end sub InputLPT port open "inpout32.dll" for dll as #h calldll #h, "Inp32", _ port as short, _ value as short rem the value return de port data close #h end sub sub WriteLPT port, value open "inpout32.dll" for dll as #h calldll #h, "Out32", _ port as short, _ value as short, _ result as void close #h end sub i download info of this link www.highrez.co.uk/Downloads/InpOut32/default.htm
|
|
|
Post by monini64 on Sept 26, 2018 0:45:04 GMT -5
this code use InputLPT like a function
rem 888 is the lpt1 adress dataport = 888 rem 255 all bits port lpt on byte = 70 call WriteLPT dataport, byte a=InputLPT(dataport) end
Function InputLPT(port) open "inpout32.dll" for dll as #h calldll #h, "Inp32", _ port as short, _ value as short print value rem the value variable have de port data InputLPT=value close #h End Function
sub WriteLPT port, value open "inpout32.dll" for dll as #h calldll #h, "Out32", _ port as short, _ value as short, _ result as void close #h end sub
|
|
|
Post by Rod on Sept 26, 2018 1:24:18 GMT -5
Good, well done. Our own version of inp and out has not worked for some time, so long that I had forgotten about it. But, Carl has fixed it recently. It would be great to know if you can get the native inp output working with your device. It’s in the help file.
|
|
|
Post by monini64 on Sept 29, 2018 15:54:52 GMT -5
i use liberty basic 4.5.1, and out not work, i no not try put on same pin of lpt in "1" and and read with inp, i use w7, i will try again mixing callings with native instruccion
|
|
Sver
Full Member
Posts: 145
|
Post by Sver on Nov 10, 2018 2:52:12 GMT -5
OUT 888, 255 set all pins high
'ínfo 'pin function ' 2 D0 ' 3 D1 ' 4 D2 ' 5 D3 ' 6 D4 ' 7 D5 ' 8 D6 ' 9 D7
'Pins 18,19,20,21,22,23,24 and 25 are all ground pins.
'Pin 2 3 4 5 6 7 8 9 'Bit D0 D1 D2 D3 D4 D5 D6 D7 'Value 1 2 4 8 16 32 64 128
'For example if you want to set pins 2 and 3 to logic 1 (led on) then you have to output value 1+2=3. 'If you want to set on pins 3,5 and 6 then you need to output value 2+8+16=26. ' In this way you can calculate the value for any bit combination you want to output.
|
|
Sver
Full Member
Posts: 145
|
Post by Sver on Nov 10, 2018 2:58:55 GMT -5
Blinking led. (set output) [begin] timer 500, [verder] wait [verder] OUT 888, 2 timer 500, [om] wait [om] out 888, 0 goto [begin]
'---------------------------------------------------------
Reading input:
Port 10,11, 12 , 13 and 15
PRINT INP(889)
|
|
Sver
Full Member
Posts: 145
|
Post by Sver on Nov 11, 2018 2:35:47 GMT -5
May be interesting when using Liberty basic, Windows,....USB
There are easy examples for it.
|
|
|
Post by tenochtitlanuk on Nov 11, 2018 3:54:06 GMT -5
I've found the UBW a great resource in the past. Also recommend the Eibotboard from Schmalz ( sold by EvilMadScientists) which has stepper motor drivers built in and interfaces via Inkscape, the vector-drawing package ( available for Windows, and Linux, which I use.... See the following on my LB site... eggbotairwriterbitwhacker
|
|