I'm really hoping someone can help me on this, I may have overlooked some info somewhere doing numerous searches in the past week, but what I'm trying to do is quite simple.
I have a handheld inventory device (circa early 90's but still in prolific use in the industry) that sends data to a PC via the serial port. I do have the manufacturer's app in DOS that facilitates this, and it works in Windows, but in Linux I need to use dosemu (dosbox won't work), and on Mac OSX you can not use dosemu at all (just dosbox). So I'm trying to write a simple program to do this in legacy basic (I know Quick Basic, also python, but not Visual Basic or C). It will be a non-gui app, just one run in the console as part of a script.
I actually figured out how to get the device to send the data, and I know all the parameters to open / close the port etc. But so far I can only do this using a terminal emulator, and not an actual program where I can read the data into arrays and save it to files.
Ok, without trying to get too wordy here, this is what I got to work:
In Windows XP, I downloaded a shareware program called Eltima's "Advanced Serial Port Terminal". I open the terminal and com1 with 19200, none, 8, 1 and no flow control, then hook up the device and put it in send mode. Then I send a hexadecimal 43 (character "C") to the port and the device spits out its first block of 133 characters, which appear on the terminal screen. All the data is in blocks of 133, even the last block. To get the next block, I send a hexadecimal 06 ("ACK"), and the next data scrolls on the screen. If at any point I send a 43 as I did to get the first block, it repeats the previous block. After the last block, when I send an 06, the machine sends an 04 (end of transmission), and then I can close the port.
I need to somehow save the data I see on the screen into an array, and write it (later) to a data file, which I can later parse and get the data I need. I just can't figure out exactly what to do, and I tried a bunch of things.
I'd like to use an older Basic, as I can get one (such as Chipmunk basic) that works on OS X as well (my final target platform), and by coming up with something that works, I finally won't need any more DOS emulators or virtual machines.
Not sure if I need to out the INP or OUT statements rather than try to INPUT from #1 (etc), or need use some sort of direct hardware address. Nor if this project can even be done in an "early" basic. I would like to keep away from learning visual basic as I need to make the source code compilable cross platform for Linux & Mac too, as mentioned.
On this particular windows box, the I/O range for com1 shows as 03F8-03FF with interrupt 4.
Any clues on where to go from here would be sincerely appreciated.
Thanks in advance.