HPBasic code for RS-232 on a 9826 with a 98626A card?
|
08-29-2024, 06:46 AM
Post: #1
|
|||
|
|||
HPBasic code for RS-232 on a 9826 with a 98626A card?
Hey folks, I just installed a card called the IEM RI-8632 into my 9826. It's basically three 98626A's in one, each with its own DB9 (DE9) connector, and actually shows up like that at boot time. Best part is it's only $12 shipped to the lower 48 on eBay, and there are more available.
I have been able to write messages from my 9826 and have them manifest on my laptop using PuTTY and a serial-to-USB converter. It seems like the default settings are 9600/8/N/1 and then the top 5 DIP switches set the device ID. Say I have devices 9, 10, and 11 as my three RS-232s. I can write Code: CONTROL 9,12;176 to disable all three types of flow control on device 9 through register 12 by writing 128 + 32 + 16. Then by also disabling flow control in PuTTY, it's an easy way to get the outbound communication working. Then, I can write something along the lines of Code: OUTPUT 9;"Help, I've been trapped in this box since 1982" And then it'll write that cheeky little message in my PuTTY window. Now the problem comes when I'm trying to read data from the serial port into the 9826. I can use the ENTER command to do this (yes, highly search engine optimized keyword ?), but it requires a variable instantiated to hold its output. Fine, I can write this: Code: 10 LET E = 5 But then when I run this, the 9826 gives me a cursor after which I enter something, it hangs until I reset BASIC. The PuTTY window doesn't let me type anything, and then no communication works in either direction until I restart PuTTY and reset Register 12 as above. Any advice on where I'm going wrong with the ENTER command? Or is it messing up because of flow control? Or do I somehow need a different device ID for input? Or do I need to let E$ be a string so it's the same on lines 10 & 20? It'd be really slick to get two-way communication going! |
|||
08-29-2024, 07:10 AM
(This post was last modified: 08-29-2024 07:10 AM by J-F Garnier.)
Post: #2
|
|||
|
|||
RE: HPBasic code for RS-232 on a 9826 with a 98626A card?
(08-29-2024 06:46 AM)mrcity Wrote: Better to ask such specialized questions on the Vintage HP Computer group. But, some indications: - The 9000 BASIC provides living keyboard, so you can type a command during program execution. However, the processing of this command has to wait for the end of the current program line, which in this case is stuck in the ENTER statement. So the computer may look as hung. - The HP ENTER statement, by default, usually waits for a CR/LF (or just LF) terminator. Try to type LF (ctrl-J) on your terminal. J-F |
|||
08-30-2024, 12:15 AM
(This post was last modified: 08-30-2024 12:15 AM by mrcity.)
Post: #3
|
|||
|
|||
RE: HPBasic code for RS-232 on a 9826 with a 98626A card?
(08-29-2024 07:10 AM)J-F Garnier Wrote: Try to type LF (ctrl-J) on your terminal. That helped! In addition:
This way, it initializes a string variable, and now I can send messages from the GRiD to the 9826. I'll have to learn more about strings to see if I can capture more than 16 characters at a time. However, I still can't transmit from my laptop using the USB serial adapter. But now I know there is some kind of hardware misconfiguration. Thanks for your help! |
|||
08-30-2024, 02:11 PM
Post: #4
|
|||
|
|||
RE: HPBasic code for RS-232 on a 9826 with a 98626A card?
You probably have to configure it to ignore the modem control signals or jumper them so the laptop thinks it is ok to transmit. You might also need to disable flow control in the program you are using to access the serial port.
For example if using Kermit: set flow-control none set carrier-watch off |
|||
08-30-2024, 04:47 PM
(This post was last modified: 08-30-2024 04:47 PM by Martin Hepperle.)
Post: #5
|
|||
|
|||
RE: HPBasic code for RS-232 on a 9826 with a 98626A card?
You should not have to preset the variable E$.
Just use it and it should be dimensioned to the correct length by the ENTER command. As already mentioned above, ENTER reads up to the defined end of line character (see registers of the I/O card). Instead of a string you can also use a numeric variable, e.g. for reading voltage from a DMM (It's all described in the BASIC and card manuals, the IEM card behaved like a HP RS232C card only with 3 select codes). Martin |
|||
08-30-2024, 08:34 PM
Post: #6
|
|||
|
|||
RE: HPBasic code for RS-232 on a 9826 with a 98626A card?
(08-30-2024 04:47 PM)Martin Hepperle Wrote: You should not have to preset the variable E$. Unless explicitly declared, string variables have a maximum length of 18 characters. Larger string variables must be declared (dimensioned) with the DIM statement e.g. DIM E$[80] , up to 32767 characters. J-F |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)