Solved

parity error

Posted on 2000-03-06
4
337 Views
Last Modified: 2010-04-21
ON SCO UNIX
I have a hardware device that is sending a byte to the com port with a parity error.   The com port will not let this byte pass through.  I need to somehow ignore this and let the data pass through to my application.

HOW CAN I DO THIS?

Thanks
0
Comment
Question by:pentomino
  • 2
  • 2
4 Comments
 
LVL 20

Expert Comment

by:tfewster
ID: 2588266
IMO, the parity settings for the device and com port should match, or you risk
your data being garbaged. However, you can have the device issue a "stty ignpar"
command to override this.
0
 
LVL 1

Author Comment

by:pentomino
ID: 2588407
tfewster

Thanks

I tried that.. from the command mode before the application was started.  It did not help. We are also tryiing to do the same thing via code.  A line monitor
between the com port and the hardware device shows
the parity error and the byte does not get to the application.  I realize that this may cause garbage but until we get a hardware fix, we need something to
allow the data to be recieved.

Any other ideas?
0
 
LVL 20

Accepted Solution

by:
tfewster earned 100 total points
ID: 2589241
I take it by "hardware device" you mean something like a specialised computer system with a terminal emulator that can communicate via a serial port.

I found a few references on SCO's web site relating to comms. parity problems: They vary depending on the O/S version! If you haven't done so already, have a look at:
http://www.sco.com/cgi-bin/ssl_reference?107162
http://www.sco.com/cgi-bin/ssl_reference?106673
http://www.sco.com/cgi-bin/ssl_reference?107594
to see if your O/S is mentioned. Even if it isn't, they contain useful generic tips on fixing serial settings problems.

Using "stty ignpar" should stop the com port from recalculating a 7-bit bytes parity bit for verification. However, it may not be sufficient to do this once communication has started and you may need to reconfigure the port.

The alternative is that the device uses 8-bit words. If your line monitor is set up the same as the com port, it would confirm the "error" on the parity check. AFAIK the 8th bit in an 8-bit word is used for extended characters, so the problem would not show up until you tried to send one of them.

You need to double check what comms. parameters the device has set. If this is not possible, try setting the com port up for 8 bits/no parity or 7/space. To double check the com port, try connecting a dumb terminal or PC with HyperTerminal (where you CAN vary the serial port settings).

If this doesn't get you any further, can you tell us:
- The nature of the hardware device
- What comms. settings the terminal emulator has (plus other options)
- What SCO version you are running
- the output of stty -a when run from the terminal emulator

Hope this helps,
Tim

0
 
LVL 1

Author Comment

by:pentomino
ID: 2597474
Thanks

It is still failing.  The external device is a tineclock where employees swipe a card through to "punch" in and out.

We have decided to update the e-prom that has been causing the problem
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question