BBC BASIC for windows. Parallel port output

discuss PC<>Acorn file transfer issues & the use of FDC, XFER, Omniflop/disk etc.
peepshow
Posts: 4
Joined: Thu Aug 25, 2016 6:58 am
Location: UK Midlands
Contact:

BBC BASIC for windows. Parallel port output

Postby peepshow » Sat Aug 27, 2016 8:34 am

I have purchased, BBC BASIC for windows, which I am very pleased with.
But I wish to output from the printer port.
I have followed all the instructions in the help section......

Entered this into the program as instructed and put 'inpout32.dll' into the BBC BASIC for windows library all as
instructed.........

SYS "LoadLibrary", @lib$+"inpout32.dll" TO inpout32%
IF inpout32% = 0 ERROR 100, "Cannot load inpout32.dll"
SYS "GetProcAddress", inpout32%, "Inp32" TO `Inp32`
SYS "GetProcAddress", inpout32%, "Out32" TO `Out32`

But I am not sure how to use this line to output to the printer port or anything else I should do......
SYS `Out32`, portaddress%, portdata%

I am running XP on an old Dell D610 laptop

Can anyone help me please?
Many thanks.
Albert
"You are what was in your mother's genes
and what was in your father's jeans"

User avatar
richardtoohey
Posts: 3354
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand

Re: BBC BASIC for windows. Parallel port output

Postby richardtoohey » Sat Aug 27, 2016 10:42 pm

Google for people using it from VB6.

e.g.

https://bytes.com/topic/visual-basic/an ... 32-dll-vb6

'Send the integer to the parallel port using inpout.dll (The "&H378" tells it that it is a data port and the integer tell it wich pins to turn on)
Out Val("&H378"), Val(D)


So you would need something like:

SYS `Out32`, &h378, <the data you want to send>

It will depend on what you are connecting to the printer port as to what you'd want to send.

This article explains a lot more about the parallel port:

https://theredblacktree.wordpress.com/2 ... ng-vb-net/

User avatar
jgharston
Posts: 2658
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: BBC BASIC for windows. Parallel port output

Postby jgharston » Sat Aug 27, 2016 11:47 pm

You should be able to do out%=OPENUP("LPT1:") just as on RISC OS you can do out%=OPENOUT("Printer:").

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

peepshow
Posts: 4
Joined: Thu Aug 25, 2016 6:58 am
Location: UK Midlands
Contact:

Re: BBC BASIC for windows. Parallel port output

Postby peepshow » Sun Aug 28, 2016 6:16 am

Thanks very much for quick replies.
I've never used SYS before so your replies are helpful.

I am trying to input 8 bity data from an external ADC
from a photo cell.
Regards.
Albert
"You are what was in your mother's genes
and what was in your father's jeans"

User avatar
richardtoohey
Posts: 3354
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand

Re: BBC BASIC for windows. Parallel port output

Postby richardtoohey » Sun Aug 28, 2016 7:15 am

For input, it looks like you'd use the Inp32 function:

http://forums.codeguru.com/showthread.p ... pout32-dll

So I'd guess something like

Code: Select all

SYS `Inp32`, &h378 TO your_data_variable%

I've not programmed Windows for a couple of decades nor used SYS ... &h378 needs to be replaced by your printer port address. Use at your own risk, YMMV, etc.

Might be easier exploring the LPT1 approach Jonathan suggested.

peepshow
Posts: 4
Joined: Thu Aug 25, 2016 6:58 am
Location: UK Midlands
Contact:

Re: BBC BASIC for windows. Parallel port output

Postby peepshow » Mon Aug 29, 2016 5:39 am

richardtoohey wrote:For input, it looks like you'd use the Inp32 function:

http://forums.codeguru.com/showthread.p ... pout32-dll

So I'd guess something like

Code: Select all

SYS `Inp32`, &h378 TO your_data_variable%

I've not programmed Windows for a couple of decades nor used SYS ... &h378 needs to be replaced by your printer port address. Use at your own risk, YMMV, etc.

Might be easier exploring the LPT1 approach Jonathan suggested.


Thanks.
That "SYS `Inp32`, &h378 TO your_data_variable%" works OK now.
Being just an old fashioned BBC BASIC man, the 'TO' threw me, trying to puzzle out
where the NEXT was!! :)
"You are what was in your mother's genes
and what was in your father's jeans"


Return to “software & utilities for the pc, mac or unix”

Who is online

Users browsing this forum: No registered users and 1 guest