First post, by pmorath
I have a model railway which is controlled digitally - meaning that tracks and signals are switched end-to-end according to the time-table, trains start and stop as configured, etc.
The model railway is Märklin with decoders from Trix (Selectrix). The program was developed by me in QBASIC on Windows 3.1 and refined over the years. The connection between the old PC and the model railway was a serial interface (RS232 cable). Now I want to shift from the old PC to my laptop to add some features, e.g. sound.
Attached to my Windows 11 laptop is a USB- to RS232 converter cable, installed on the computer are the DOS-BOX and QBASIC.
The QBASIC program as copied from the old PC is executable inside DOS-BOX - but unfortunately, the RS232-connection doesn't come up.
To locate the area of the issue, I've tested the connectivity between laptop and the model railway control unit with hterm (run in Win11) - in this test the control unit reacted as expected. So the laptop is ok, the USB is ok, the cable as well and also the external device.
Therefore I assume that either the DOS-BOX configuration doesn't support COM-PORT via USB (which I doubt, because many games need serial interfaces as well), or something's wrong with the QBASIC interpreter.
With my old application (ported from Win3.1), the communication at earlier days was successful with statements such as
...
OPEN "com2:9600,n,8,2,cs,ds,rs,cd" FOR RANDOM AS #2
...
PRINT #2, CHR$(128);
...
This should set Bit7 via RS232 (without CR-LF or other control characters) and in effect switch on the model railway central unit.
Does anyone have an idea, if the reason is with DOS-BOX or with QBASIC?
Do I have to change in the set-up of the DOS-BOX? If so, how?
Or am I using wrong QBASIC-commands?
I'm looking forward to your suggestions!
Peter