inpout32 (Language Help)

by skidrow77, Friday, October 17, 2014, 05:31 (1952 days ago)

I am trying to use the PORTOUT command to send data to a serial port. The code is activated in the preferences and the inpout32.dll is there both in the BASI256 folder and WINDOWS folder. I can run a program that outputs characters to 0x3F8, 0x2F8, 0x3E8, and 0x2E8 (COM1 thru 4) and there are no program errors. However there is no COM output either.
What am I doing wrong??


by m.alessandrini, Monday, October 20, 2014, 09:18 (1949 days ago) @ skidrow77

Hi, I just started studying basic-256 sources and giving some contributions back.
From what I understand, inpout32.dll, and the related basic instructions, are for parallel port, not for serial. I don't know what their original use was intended for.
It would be nice in the future to have support for serial ports, cause they allow you to interface to a whole world of electronic gadgets, like robots, dev boards, etc...
Many USB devices are seen as a serial port anyway on the PC.


by skidrow77, Monday, October 20, 2014, 16:45 (1948 days ago) @ m.alessandrini

Well, that's very disappointing. Nice new programming language - stuck in the DOS days. We can only hope the developers will add some code to allow BASIC to reach outside the box for robotic or automation applications.
Thanks for the heads up.


by m.alessandrini, Monday, October 20, 2014, 17:16 (1948 days ago) @ skidrow77

This is my understanding of the serial/parallel status, the authors should confirm.
Anyway you're not fair, the program has many good features. I'm planning to contribute to it in the next future, and this could be a valid feature. I use serial port in windows and linux daily to interact with such devices, I'd like to bring my experience here. Of course using memory addresses for ports is not viable, should be like "COM1" on windows or "/dev/ttyUSB0" on linux, for example.


by Jim ⌂ @, Russell, KY, Monday, October 27, 2014, 02:35 (1942 days ago) @ skidrow77

Thanks for your input. Over the last few days I have added OPENSERIAL that will allow you to open a "com" port in Windows or a "devTTY" port in LINUX so that you can use the file IO (readbyte/writebyte) to access these ports.

I am uploading to the server right now and you should be able to download it soon.

I am also looking at USB control but that is going to be a different animal and I may need some programming help on that one.



by skidrow77, Tuesday, November 25, 2014, 01:31 (1913 days ago) @ Jim

Ok, I've got the new version - thanks so much for addressing the OPENSERIAL issue. But, I can't get a line to be accepted as error-free.
How do I refer to com1 in the statement line?
openserial 1, com1 - shows a compile error. So does COM1, com:1, com-1, or anything else I try. The documentation does not address the syntax of "port_name".
Any help is greatly appreciated.


by Jim ⌂ @, Russell, KY, Tuesday, November 25, 2014, 02:25 (1913 days ago) @ skidrow77

Put "com1" as a string in your statement


by tezza, Thursday, December 11, 2014, 15:08 (1896 days ago) @ Jim

inpout32 in basic256 is meant for parallel ports but can be used for serial ports in other lanuages. There is an easy alternative, if you need direct access to ports under windows 7, etc is to use a kernal mode driver called "userport" program driver which you can google on the internet. All you do is install the program and add the port i/o addresses and click a button or two and you have direct access to serial ports, just like the old dos years. Alternatively use an arduino board
which emulates a serial port which after installing arduino driver does not need direct access
as the driver already provides it.


by tezza, Thursday, December 18, 2014, 02:00 (1890 days ago) @ tezza

I got serial program working with my arduino clone board.
It took a little patience but it works.

mystring$ = "com3"
openserial 1, mystring$
while true
print readline(1)
pause (1)
end while

This worked in windows 8.1 64 bit and windows 7 32 bit.

Dear JIM,
could you please give me instructions how to compile new version
under Linux Mint 17.0, this would be greatly apprecciated, thank you Jim.


by Jim ⌂ @, Russell, KY, Saturday, January 17, 2015, 01:08 (1860 days ago) @ tezza

The compiling instructions are in the source trunk/COMPILING.txt . I think they are complete.


RSS Feed of thread
powered by my little forum