Serout format


Closed Thread
Results 1 to 4 of 4

Thread: Serout format

  1. #1
    Join Date
    Apr 2007
    Posts
    26

    Question Serout format

    This is in reference to the example:
    http://www.rentron.com/four-channel-ad.htm

    In this example of Analog-Digital conversion what is the format of RESULT[X]
    that is sent to the computer serial port ? i.e. binary or ascii ?
    Code:
    SEROUT GPIO.5,N2400,[1,RESULT[0],2,RESULT[1],3,RESULT[2],4,RESULT[3]]

    Unsure of the format, if I put # like:
    Code:
    SEROUT GPIO.5,N2400,[1,#RESULT[0],2,#RESULT[1],3,#RESULT[2],4,#RESULT[3]]
    will the result to PC serial port be in ASCII format ?


    I would like to get it in ASCII format.

    Thanks

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    I believe the examples on Bruce's website are sending data through the serial port to a VB written application that does the ASCII conversion, not to hyperterminal.

    If you want to send to hyperterminal (examples)

    Code:
    X = 65
    Serout GPIO.5,N2400,[65] 'sends "A" to hyperterminal
    Serout GPIO.5,N2400,[#65] 'sends "6" and then "5" to hyperterminal
    Serout GPIO.5,N2400,[X] 'sends "A" to hyperterminal
    Serout GPIO.5,N2400,[#X] 'sends "6" and then "5" to hyperterminal
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    From the manual for more clarification..
    SEROUT supports three different data types which may be mixed and
    matched freely within a single SEROUT statement.
    1) A string constant is output as a literal string of characters.
    2) A numeric value (either a variable or a constant) will send the
    corresponding ASCII character. Most notably, 13 is carriage
    return and 10 is line feed.
    3) A numeric value preceded by a pound sign ( # ) will send the
    ASCII representation of its decimal value. For example, if W0 =
    123, then #W0 (or #123) will send “1", “2", ”3".
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Apr 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default MScommctl

    Hi,

    VB Commctl has this binary input which I have never used.
    Will do experiment and post here.

    Rentron's(Bruce) examples are great--I could not find other website with that quality of examples.

    Thanks for the info.

    Aftab.
    Last edited by aftab; - 22nd August 2007 at 07:14.

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. Serout to serial servo
    By azmax100 in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 12th August 2009, 16:46
  3. Advice-scrutiny for my serial controller
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th December 2008, 17:11
  4. Keypad unlock (as in garage door possibly)
    By Fred in forum Code Examples
    Replies: 5
    Last Post: - 2nd April 2006, 04:26
  5. Replies: 11
    Last Post: - 13th July 2005, 19:26

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts