First post, by nicola
- Rank
- Newbie
Hi,
I must make a program (Siemens STEP5) work with dosbox, but I need the serial port to work on linux. I saw the support only for win32 and os/2. 🙁
Could you suggest something ?
Thanks, Nicola.
Hi,
I must make a program (Siemens STEP5) work with dosbox, but I need the serial port to work on linux. I saw the support only for win32 and os/2. 🙁
Could you suggest something ?
Thanks, Nicola.
http://sourceforge.net/tracker/index.php?func … 551&atid=467234
You need cvs sources for this patch, if it doesn't apply to the current
cvs sources try to checkout those with timestamp a few weeks ago.
Thanks.
I tried the patch and I put
serial1=directserial realport:0
in my confing file.
Unlucky, I get this error:
Invalid type for COM1.
🙁
Nicola.
Maybe the problem is in configure.in?
Looks like it sets C_DIRECTSERIAL only for compiler types cygwin and mingw32, but I have no idea what to change there...
1+1=10
Yes, 😀
you're right, I changed C_DIRECTSERIAL.
I tried step5 to connect with another pc (minicom) because I have'nt a PLC now.
So step5 freeze when I try to connect but I see some chars on minicom terminal.
Tomorrow I want to connect step5 to a real PLC.
Thanks, Nicola.
Freeze? Apply this patch too.
download.php?id=3199
1+1=10
which thread "hosts" this attachment ?
Water flows down the stream
How to ask questions the smart way!
The "Directserial port working" in Patches section.
Edit: Page 7
This not change the result.
I tried a connection with a real plc but whitthe same result.
I compiled dosbox with --enable-debug=heavy option and when step5 freeze I have:
45874779: DOSMISC:DOS:Multiplex Unhandled call B700
46090868: PIC:0 mask E8
46091213: PIC:0 mask ED
81734391: PIC:0 mask E8
Nicola.
Does it work on a Windows computer? I have Step5 V3.0 which works with a PLC (Windows).
1+1=10
wrote:Does it work on a Windows computer? I have Step5 V3.0 which works with a PLC (Windows).
Yes, with windows and the same usb2serial adapter step5 work.
With linux, dosbox report:
Serial port at 3f8: Opening "/dev/ttyUSB0"
(I'm change from ttyS to ttyUSB)
but when I try to get step5 online it freeze.
Thanks, Nicola.
wrote:Does it work on a Windows computer? I have Step5 V3.0 which works with a PLC (Windows).
Uhmm, my version is 6.6
Nicola.
There is something important missing in the posix patch.
Add the ByteTransmitted in CDirectSerial::transmitByte:
void CDirectSerial::transmitByte(Bit8u val) {
int bytes = write (fileId, &val, 1);
if (bytes == -1) {
LOG_MSG ("UART 0x%x: NO BYTE WRITTEN!", base);
// error!
}
ByteTransmitted();
}
Ok, now step5 not freeze, but I can't connect with PLC. 😀
I'm get timeout by step5. 🙁
My config file for serial port is:
serial1=directserial realport:0 startbps:9600 parity:E stopbits:1 bytesize:8
I think this is corret.
Thanks, Nicola.
The startbps parity ... should not be neccessary.
Did you try to repower the PLC? It might be insulted now because of the previous incomplete communication attempts. Also replug the USB-serial they are not perfect.
1+1=10
wrote:The startbps parity ... should not be neccessary.
serial1=directserial realport:0 stopbits:1 bytesize:8
I tried with windows and it works without reboot PLC. 😠
Thanks, Nicola.
There is another one in CDirectSerial::CDirectSerial:
InstallationSuccessful = false;
InstallTimerHandler(th);
lastChance = 0;
Don't know if it has an effect though.
wrote:There is another one in CDirectSerial::CDirectSerial: […]
There is another one in CDirectSerial::CDirectSerial:
InstallationSuccessful = false;
InstallTimerHandler(th);
lastChance = 0;
There are InstallationSuccessful and InstallTimerHandler(th), but there isn't
lastChance (I put it)
Tomorrow I will try another time.
Thanks, Nicola.
I'm still not able to make step5 online. In debug mode there aren't significant
messages. Now I'm testing S5 V3.2 but I have some problem with my keyboard. 😠
Nicola.
Another thing... add the VMIN and VTIME lines in CDirectSerial::CDirectSerial
termInfo.c_cflag |= CSTOPB;
}
termInfo.c_cc[VMIN] = 0;
termInfo.c_cc[VTIME] = 0;
termInfo.c_iflag = IGNPAR;
If it still doesn't work you'll have to investigate on your own from there, I don't have Linux. I.E. put some logging messages in the send/receive functions or watch the error return values.[/code]