WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Serial
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Receiving Parity Error with pRecvFile

Keywords: 	  pRecvFile	  parity error

Question:

I am using the serial port extender to winbatch to script a download from a well known ISP. Each time the pRecvFile function is called it fails with a "Receive Parity Error". The script works fine during the login and menu drill downs. When it gets to the file receive, the problems start.

I can successfully download the same file using Hypertrm.

Settings on the port are 57600,7-E-1,RTSRTS Protocol is XMODEM

Here is the port open command...

	port=pComOpen("COM1",0,57600,"7E1","RTSRTS")
I know that 8N1 is the de facto standard but if I use this with Compuserve the text is garbled..

Answer:

I suspect the parity problem is related to a bad setting. It's also very rare to see Even parity these days, especially with binary transfers. The 8N1 is the most common setting.

Maybe CIS is changing the protocol on the fly during the xmodem? (I think xModem is an 8 bit protocol.)

There seems to be no function available to change the data on the fly. (See below. There is now) Depending on what you are up to, it may be possible to connect via 8N1 and "clean" the non-xmodem data up so it looks OK. A fast machine would be helpful here.

My first try would be use 8N1 then whenever I get a string....

	data=pGetString(port,count)
	datax=strlen(data)
	newdata=""
	for xx=1 to datax
		newdata=strsub(data,xx,1) & 127
	next
and use that code to "clean" up the strings to make them readable.

Also, you may need to change the TimeOut with pModemParams to give your modem enough time to connect. Something like:

	pModemParams(port,1,3,60000)

And finally, if you have your script set of 8N1, and in your capture log, you notice after you are logged in that the prompt you get is some gibberish, something like "Hoót Náíe:", for example, then plug "Hoót Náíe:" into the pWaitFor string (instead of the normal command prompt, in this case, "Host Name", that you expect to see).

New in Serial Extender Ver 21016

In order to solve this kind of problem, a new function was introduced in the WinBatch 2001+ compatible 21016 version of the Serial extender. This new function is pComModify.

You can use it around a transfer to temporarily change the port settings for the duration of the transfer. e.g. If the com port was originally opened with...

	port=pComOpen("COM1",0,57600,"7E1","RTSRTS")
then before a pRecvFile or a pSendFile you can modify the parity/format to 8N1 and restore it afterwards by doing
	pComModify(port,57600,"8N1","RTSRTS")
	pRevcFile(...
	pComModify(port,57600,"7E1","RTSRTS")

Article ID:   W12575
Filename:   Receiving Parity Error with pRecvFile.txt
File Created: 2001:05:10:14:51:34
Last Updated: 2001:05:10:14:51:34