Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to get data through serial port

938 views
Skip to first unread message

vxworks_quary

unread,
Mar 27, 2006, 10:25:58 PM3/27/06
to
I'm beginner of Vxworks.I want to know how to access the data through
serial port.i am using VxWorks 5.5.
good day.

Michael R. Kesti

unread,
Mar 29, 2006, 12:36:23 AM3/29/06
to
vxworks_quary wrote:

1) open the port by calling open()
2) configure the port by calling ioctl() zero or more times
3) read data from the port by calling read()

This seemingly easy sequence is, the first time through, a somewhat
large can of worms. Finding the name of the device to be opened,
determining which of the many ioctl options one needs to use, and
setting up a task from which read() can do its job without consuming
100% of the CPU will probably keep you busy for some time! The
answers to the many questions you will encounter along the way are
in the user documentation, but the trick is in becoming familiar
enough with that documentation to find the answers. If you are an OS
beginner as well as a VxWorks beginner, you will need to muster all
of the patience you can!

--
========================================================================
Michael Kesti | "And like, one and one don't make
| two, one and one make one."
mrkesti at comcast dot net | - The Who, Bargain

LarryC

unread,
Mar 30, 2006, 5:47:36 PM3/30/06
to
Sri:

use "devs" in the shell to see what devices you have. The /tyCo/o
devices are the generic serial devices that the shell runs on, etc.
Skip the ioctl's to control the baud rate at first. All the normal
read, write functions should work fine if you select the correct device
in the open.

Larry

george...@gmail.com

unread,
Mar 31, 2006, 8:33:12 AM3/31/06
to
Here are some quick and dirty tests for serial ports

>From shell do this:
<first type stuff into serial port to be read>
<NOTE: /tyCo/1 is serial port 2 >
fd = 0 // create handle to dev
fd = open( "/tyCo/1", 0,0) // open dev
B = malloc( 0x100 ) // create buffer to hold data
read( fd, &B, 10) // read data to buffer from dev
d &B // display buffer
<do this step separate>
write( fd, "hello", 5 ) // send message to serial port
<verify the output on the serial port>

Kai

unread,
Apr 2, 2006, 6:28:52 AM4/2/06
to
hi,

the preceding posts all gave u important information.

But I want to emphasize that u should connect the 2 serial ports in a
correct way.IE, u should use null modem cable (
http://www.nullmodem.com/NullModem.htm )to connect the 2 serial
ports, or simply make sure that
the 3 vital pins Tx,Rx,Gnd are connected as follows

PortA PortB
TX ------ RX
RX ------ TX
GND ---- GND

you can make use of the 2 serial ports in your device. If u have only
one serial port, u have to make use of one more serial port in another
PC, and u can have some com debug software install on the host.

Good luck.

_________________
If you ask for help to your problem and someone answers, return the
favor by telling if the suggested fix works!

jayar...@gmail.com

unread,
Jan 7, 2019, 11:17:35 AM1/7/19
to
Do we have any idea on how to get notified when a USB device is connected(plugged in) or disconnected(plugged out) for serial communication (Serial to USB based)?
0 new messages