VOGONS


Serial port setting in dosbox.conf

Topic actions

First post, by kenhopkins37

User metadata
Rank Newbie
Rank
Newbie

😕
I am trying to us doxbox to run a dos program to program a control panel for industrial equipment. I am using com:1. I can talk to the unit but the unit is not talking back to PC. The panel and the software is made by Lauer. Any help with this would be great.

Reply 1 of 22, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

What exactly did you change in dosbox.conf?

1+1=10

Reply 2 of 22, by kenhopkins37

User metadata
Rank Newbie
Rank
Newbie

Here are the changes that I made for the serial 1

serial1=directserial realport:com1 irq:4 bytesize:8 stopbit:1 parity:E
serial2=dummy
serial3=disabled
serial4=disabled

This is the only changes that I made.

Reply 3 of 22, by captain73

User metadata
Rank Newbie
Rank
Newbie

Have there been any progress in this topic. I am asking, because I am facing the same problem.

Reply 4 of 22, by Jorpho

User metadata
Rank l33t++
Rank
l33t++
captain73 wrote:

Have there been any progress in this topic. I am asking, because I am facing the same problem.

Yes, in the last five years there have been many, many other threads posted on this subject.

If you are using a USB-to-serial adapter, you can expect to experience problems.

Reply 5 of 22, by captain73

User metadata
Rank Newbie
Rank
Newbie

Even when I use a PC with a real com port, I do not get answer from the Lauer PC. I am using DOSBox version 0.73. Would it help to use the latest version?

Reply 6 of 22, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It could help...

1+1=10

Reply 7 of 22, by Jorpho

User metadata
Rank l33t++
Rank
l33t++

Yes, using the latest version would be an excellent idea.

captain73 wrote:

Even when I use a PC with a real com port, I do not get answer from the Lauer PC.

Do you have any reason to believe the device is functioning normally? Do you have another computer that is actually running DOS that you can use for testing?

Reply 8 of 22, by captain73

User metadata
Rank Newbie
Rank
Newbie

Thank you both for your answers.
So, now I tested everything with the latest DOSBox version. Unluckily it is not working, too.
Yes, the device is working properly, because with DOS the download worked.
When I try to download the project with DOSBox, I always get overrung error at RX and TX. I already tried different cpu types, rxdelay times, and cpu cycles. Is there a chance to log the serial communication? The option dbgall is ignored.

Reply 10 of 22, by captain73

User metadata
Rank Newbie
Rank
Newbie

Hi Jorpho,
I have already tried by increasing and decreasing the speed of the program without success.
The program is setting the data/parity/stop bits internally. So they must be correct. I only can choose the com port in the program.

Maybe Portmon reveals something. I continue working on this a few days later.

Thanks for your assistance.

Reply 11 of 22, by captain73

User metadata
Rank Newbie
Rank
Newbie

So, finally I could find time to try a download to the Lauer PC via DOSBox by observing the COM port with portmon. The only thing I could see was that the Software within DOSBox is setting up the COM port and then waits for a respond of the Lauer PC. But Lauer is not responding or DOSBox is not realizing. After this Software is stopping communication and shows error message. Did somebody got this running in the past? Is there maybe an older DOSBox version more suitable?

Reply 12 of 22, by Jorpho

User metadata
Rank l33t++
Rank
l33t++
captain73 wrote:

The program is setting the data/parity/stop bits internally. So they must be correct.

Are you also specifying them in DOSBox.conf? Perhaps there is a mismatch. What do you have in the [serial] section of your DOSBox.conf, anyway?

captain73 wrote:

Is there maybe an older DOSBox version more suitable?

I think there might be some fixes in the newer SVN versions.

Reply 13 of 22, by captain73

User metadata
Rank Newbie
Rank
Newbie

In the configuration I have written serial1=directserial realport:COM1.
That's how it is described in the DOSBox wiki. Is there something more I can adjust?

Reply 14 of 22, by captain73

User metadata
Rank Newbie
Rank
Newbie

I investigated a little more by using portmon. I observed following:
When DOSBox is opening the serial port it will be adjusted to:

62 14:57:33 DOSBox.exe IOCTL_SERIAL_SET_BAUD_RATE Serial0 SUCCESS Rate: 9600
63 14:57:33 DOSBox.exe IOCTL_SERIAL_CLR_RTS Serial0 SUCCESS
64 14:57:33 DOSBox.exe IOCTL_SERIAL_CLR_DTR Serial0 SUCCESS
65 14:57:33 DOSBox.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial0 SUCCESS StopBits: 1 Parity: NONE WordLength: 8

The Lauer Software is adjusting the serial port like following:
13139 14:54:15 DOSBox.exe IOCTL_SERIAL_SET_BAUD_RATE Serial0 SUCCESS Rate: 38400
13140 14:54:15 DOSBox.exe IOCTL_SERIAL_CLR_RTS Serial0 SUCCESS
13141 14:54:15 DOSBox.exe IOCTL_SERIAL_CLR_DTR Serial0 SUCCESS
13142 14:54:15 DOSBox.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial0 SUCCESS StopBits: 1 Parity: EVEN WordLength: 8

After this some data are going to be exchanged:
18845 14:54:23 DOSBox.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: .
18870 14:54:23 DOSBox.exe IRP_MJ_READ Serial0 SUCCESS Length 1: .
18871 14:54:23 DOSBox.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS
18895 14:54:23 DOSBox.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: .
18904 14:54:23 DOSBox.exe IRP_MJ_READ Serial0 SUCCESS Length 1: !
18935 14:54:23 DOSBox.exe IRP_MJ_READ Serial0 SUCCESS Length 1: P
18945 14:54:23 DOSBox.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: .
18946 14:54:23 DOSBox.exe IOCTL_SERIAL_GET_MODEMSTATUS Serial0 SUCCESS
18947 14:54:23 DOSBox.exe IRP_MJ_READ Serial0 SUCCESS Length 1: G

and so on...

After a while the serial port is set back to following:
19603 14:54:23 DOSBox.exe IOCTL_SERIAL_SET_BAUD_RATE Serial0 SUCCESS Rate: 9600
19604 14:54:23 DOSBox.exe IOCTL_SERIAL_CLR_RTS Serial0 SUCCESS
19605 14:54:23 DOSBox.exe IOCTL_SERIAL_CLR_DTR Serial0 SUCCESS
19606 14:54:23 DOSBox.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial0 SUCCESS StopBits: 1 Parity: EVEN WordLength: 8

And that's it ! Software shows then communication error.

Is DOSBox re-setting the serial port after a while or certain circumstance?[

Reply 15 of 22, by Jorpho

User metadata
Rank l33t++
Rank
l33t++

It definitely appears to be both reading and writing data. How much did you slow down the program in your earlier tests? Perhaps you did not slow it down enough.

Have you tried the SVN version yet?

Reply 16 of 22, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

> Is DOSBox re-setting the serial port after a while or certain circumstance?[

No.

1+1=10

Reply 17 of 22, by captain73

User metadata
Rank Newbie
Rank
Newbie

Ok then. I am going to try with SVN r3829. Does this release include all improvements of Megabuild 6 from H-A-L 9000?
Does somebody know a similar "portmon" program for DOS ?

Reply 18 of 22, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

DOSBox has its own serial port logging which can be enabled by a compiler define and parameters in dosbox.conf.

1+1=10

Reply 19 of 22, by captain73

User metadata
Rank Newbie
Rank
Newbie

Even with the latest SVN version the communication fails. This time I used the serial log from DOSBox. Here an exerpt of the results:

Com Port is configured by Lauer program:
148271.885 [ 156957] New COM parameters: baudrate 9600, parity even, wordlen 8, stopbits 1
148271.886 [ 156957] write 0x 3 to DLL.
148271.886 [ 156957] New COM parameters: baudrate 38400, parity even, wordlen 8, stopbits 1
148271.887 [ 156957] write 0x 0 to DLM.
148271.887 [ 156957] New COM parameters: baudrate 38400, parity even, wordlen 8, stopbits 1
148271.888 [ 156957] write 0x1b to LCR.

Here data exchanges with shown errors:
151021.000 [ 159748] rx 0x47 (G)
151021.000 [ 159748] with error: framing=0,overrun=1,break=0,parity=0
151021.000 [ 159748] rx overrun (IF=1)
151021.000 [ 159748] rx 0x39 (9)
151021.000 [ 159748] with error: framing=0,overrun=1,break=0,parity=0
151021.000 [ 159748] rx overrun (IF=1)
151021.000 [ 159748] rx 0x30 (0)
151021.000 [ 159748] with error: framing=0,overrun=1,break=0,parity=0
151021.000 [ 159748] rx overrun (IF=1)
151021.000 [ 159748] rx 0x30 (0)
151021.000 [ 159748] with error: framing=0,overrun=1,break=0,parity=0
151021.000 [ 159748] rx overrun (IF=1)

This log I did with MB6 from h-a-l 9000.
I think a log with the latest SVN should be similar.

I also tried different CPU cycles, high (~10000) and low (~1000).

What else could I try?