Reading from serial devices

Reading from serial devices

Post by Robert All » Mon, 31 Aug 1992 19:27:50



Apologies if this is a really stupid problem, but I'm no wizzard and its
got me stumped.

I have recently had to modify some code for reading two devices connected to
the serial ports on a PS/2 running AIX.  The code uses the low level open,
and read commands to set up and read from the ports (well setup with IOCTL).
One device (a grain analyser) is connected at 1200 baud, the other (a weigh-
bridge) ate 4800 baud.  The code is linked to a database which is running as
two processes, one reading each device.  Data from the 1200 baud device is
being lost as it appears not to be buffered.  I tried changing to use higher
level fget and fopen which I thought were buffered but still no luck.  They
even fail when used in two small programs running in the background, do to
much and the 1200 device drops characters.  Getty's are disabled in
/etc/inittab fro the two ports for what its worth.

Any ideas on where I'm going wrong?  This is bugging the hell out of me, as
it's obviously a pretty simple stuff up on my part, oh yeah catting from the
devices never seems to drop characters no matter how much processing is
going on and how lower priority I run the cat at.

Many Thanks,

Rob.

--
----------------------------------------------------------------------------
Robert Alley            | See the stars come falling down from the sky
GIS Honours Student     | Gently passing, they kiss your tears as you cry
Curtin Uni. Bentley WA  | See the wind come softly blow your hair from
Australia               |   your face

                        | Still I'm sad, Still I'm sad
                        | (Samwell-Smith/McCarthy)
----------------------------------------------------------------------------

 
 
 

Reading from serial devices

Post by Andrew Flemi » Wed, 09 Sep 1992 06:22:02


: Apologies if this is a really stupid problem, but I'm no wizzard and its
: got me stumped.
:
: I have recently had to modify some code for reading two devices connected to
: the serial ports on a PS/2 running AIX.  The code uses the low level open,
: and read commands to set up and read from the ports (well setup with IOCTL).
: One device (a grain analyser) is connected at 1200 baud, the other (a weigh-
: bridge) ate 4800 baud.  The code is linked to a database which is running as
: two processes, one reading each device.  Data from the 1200 baud device is
: being lost as it appears not to be buffered.  I tried changing to use higher
: level fget and fopen which I thought were buffered but still no luck.  They
: even fail when used in two small programs running in the background, do to
: much and the 1200 device drops characters.  Getty's are disabled in
: /etc/inittab fro the two ports for what its worth.
:
: Any ideas on where I'm going wrong?  This is bugging the hell out of me, as
: it's obviously a pretty simple stuff up on my part, oh yeah catting from the
: devices never seems to drop characters no matter how much processing is
: going on and how lower priority I run the cat at.
:
: Many Thanks,
:
: Rob.
:
: --
: ----------------------------------------------------------------------------
: Robert Alley          | See the stars come falling down from the sky
: GIS Honours Student     | Gently passing, they kiss your tears as you cry
: Curtin Uni. Bentley WA  | See the wind come softly blow your hair from
: Australia             |   your face

:                       | Still I'm sad, Still I'm sad
:                       | (Samwell-Smith/McCarthy)
: ----------------------------------------------------------------------------
Hello Robert,
            Sounds like flow control is not being  used ???

--

/*             Am Unisys Park 1  W-6231 Sulzbach Ts.                       */

Any opinions expressed here, are my own and NOT those of my employer.

 
 
 

1. Read specific serial device how? Urgent!

Hi all,

first I want to say that I read the bigger part of the manuals
(but didn't get anything out of it but confusion) as well as
the current postings here (I'm not subscribed usually), but
nothing seems to fit exactly. I've also posted this request
to comp.unix.shell some days ago but wasn't anwered yet.

this is my problem:

We have a telefone system that can do something like
"statistic output", which comes over a serial line in
one-line-packages. This data is currently sent to a
PC which is running some tricky program to evaluate it.
All fine so far.

Now, I have to get the data on a HP 9000 machine (additionally
or "parallel to the PC). I think it should be done by connecting
all via the xyplex terminal server.

But I don't know exactly how to access a specified port in
HP-UX; I've an idea how to do it with sockets etc., but I'm
sure there must be a simpler way to do it. So, what I need
is a suggestion on how to read directly from a port and
write the input somewhere, and I want the easiest reliable
way.

Please send me any idea you have; this is a task for the
creative!

TIA,

Daniel

P.S.: PLEASE, please send answers by mail; I'll post a summary
when the problem is solved.

----------------------------------------------

.. no more senseless signatures ...

2. Help:ethernet address

3. Read serial device - how?

4. Help me REINSTALL Debian

5. timing out when reading from a serial device

6. DEC 3000 model 3000, ESA0 versus EWA0/ MOP versus BOOTP

7. How to set/read serial device pins directly

8. - FTP logins

9. How to determine if tty device is a serial device

10. Serial mouse only works during installation in graphics mode, problem with 'serial device driver'

11. connect SW to s pseudo UART device instead of real serial device

12. 2 standard serial cards != 4 working serial-devices