How can i send "ok"to my hyperterminal?

This is a discussion on How can i send "ok"to my hyperterminal? within the C Programming forums, part of the General Programming Boards category; .....hello there..currently i am doing the serial communication between my Vb at comm 1 with my PICDEM 2 PLUS BOARD..so ...

  1. #1
    CSooi
    Join Date
    Oct 2004
    Posts
    5

    Lightbulb How can i send "ok"to my hyperterminal?

    .....hello there..currently i am doing the serial communication between my Vb at comm 1 with my PICDEM 2 PLUS BOARD..so i manage to send my data to the board to light up the LED but the data i send back by the board to VB that is "ok" to acknowledge that the data is recieved got error..when is send using this code
    putrsUSART((rom char*)"ok"); or, for a return, putrsUSART((rom char *)"ok\r");

    this code enable me to send the "ok" back but then it will send back the character i type too for example:

    ie. Send T
    Recieve ok[T].

    But the problems is that i need to send just "ok" and not "ok"[00]..to my Vb,so can someone guide me on this?thanks..

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    Without seeing how putrsUSART() is written, it's hard to say
    Perhaps you need to use a different USART function, one which doesn't send a \0 at the end of a string.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,659
    Calling Google("putrsUSART") returned this (PDF) document.
    According to it, putrsUSART() will send the null terminator of a C-string. If you don't want that, you will have to send each character yourself using putcUSART().

    You'll have better luck with your PIC specific questions here: http://forum.microchip.com/

    Use these forums (Cprogramming.com) if you need authoritative answers for any of your C or C++ questions

    gg

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    LOL - a simple RTFM problem
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. tuncated uint8_t
    By Coens in forum C Programming
    Replies: 14
    Last Post: 11-24-2008, 06:57 AM
  2. sending n no of char data uning send() function,
    By thebrighter in forum Windows Programming
    Replies: 1
    Last Post: 08-22-2007, 12:26 PM
  3. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 08:32 AM
  4. How can i send "ok"to my Vb at comm 1?
    By ooicheesan in forum C++ Programming
    Replies: 1
    Last Post: 10-13-2004, 07:45 PM
  5. LISP (DrScheme) any one?
    By Jeremy G in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 03-31-2004, 11:52 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21