Solved

parity error

Posted on 2000-03-06
4
332 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now