how to get data through serial port - VxWorks

This is a discussion on how to get data through serial port - VxWorks ; 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....

+ Reply to Thread
Results 1 to 5 of 5

Thread: how to get data through serial port

  1. how to get data through serial port

    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.


  2. Re: how to get data through serial port

    vxworks_quary wrote:

    >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.


    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

  3. Re: how to get data through serial port

    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


  4. Re: how to get data through serial port

    Here are some quick and dirty tests for serial ports

    >From shell do this:



    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

    write( fd, "hello", 5 ) // send message to serial port



  5. Re: how to get data through serial port

    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!


    vxworks_quary wrote:
    > 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.



+ Reply to Thread