Reading RS232 String


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2005
    Posts
    67

    Question Reading RS232 String

    Hi,

    I am trying to read a RS232 string and act upon it.
    IE. RS232 in is "ABC1" @ 9600 baud, place in variable R
    Can I then simply do If R = ABC1 Then excute the command?
    Peter
    Pete

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    No or, not directly. You'll need to compare an String Array to another one.

    If you have only 1 string to act with you can also use the WAIT modifier.

    In my case, when i need to jump to several Subroutine with PCTask, i use a simple Byte and Branch(or more than often BRANCHL)

    something like

    Code:
    SubRoutineToBeExecute var byte
    
    Main:
        HSERIN[SubRoutineToBeExecute]
        branch SubRoutineToBeExecute,[Sub1,Sub2,Sub3,Sub4]
        goto Main
    
    Sub1:
        ' stuff here
        goto Main
    
    Sub2:
        ' stuff here
        goto Main
    
    Sub3:
        ' stuff here
        goto Main
    
    Sub4:
        ' stuff here
        goto Main
    easier than use this precious Code space to store String stuff IMHO.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Feb 2005
    Posts
    67


    Did you find this post helpful? Yes | No

    Red face

    Steve,

    Shouldn't I be using SerIn on a PIC12F675?
    (Sorry I negeleted to mention it before)

    Peter
    Pete

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    sure you can use SERIN, SERIN2, DEBUG...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. How about String Variables?
    By mytekcontrols in forum PBP Wish List
    Replies: 40
    Last Post: - 20th January 2015, 12:53
  2. Reading large data via RS232
    By Robson in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 28th August 2007, 19:37
  3. Visual Basic 6 & Access 2000
    By Demon in forum Off Topic
    Replies: 33
    Last Post: - 7th September 2006, 04:39
  4. Message String Table using Readcode
    By mytekcontrols in forum Code Examples
    Replies: 2
    Last Post: - 10th July 2005, 23:17
  5. reading 2c strings
    By beto in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 22nd December 2004, 15: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