Answered using API communications in C#

  • Donnerstag, 2. Februar 2012 03:57
     
     

    Hi,

    Does anyone know how to program XBee in API communications?

    • Verschoben Leo Liu - MSFT Freitag, 3. Februar 2012 06:14 Moved for better support. (From:Visual C# Language)
    •  

Alle Antworten

  • Freitag, 3. Februar 2012 07:54
    Besitzer
     
     

    I'm not sure that this is a Robotics question. XBee can be used for Robotics, but there RDS does not include a service for it so you would have to write your own. I think that the XBee controller on the PC end looks like a virtual serial port, so the Serial Port service might work.

    Trevor

     

  • Freitag, 3. Februar 2012 08:21
     
     

    Hi, This is what i receive from serial port (7E 00 12 92 0013 A2 00 40 6B 68 BB 4F 01 01 00 02 00 00 00 4F). How do I program it whenever it receive "7E" so that it will trigger the stopwatch?

    Thank you.

  • Sonntag, 5. Februar 2012 03:07
    Besitzer
     
     

    I'm confused. This is still not a question about RDS. If you are already receiving the data, what is the difficulty in executing some code whenever you see a 7E in the data stream?

    Trevor

     


  • Sonntag, 5. Februar 2012 04:26
     
     
    I need some starting guide codes to program whenever it receive "7E" to trigger the stopwatch.
  • Montag, 6. Februar 2012 20:56
    Moderator
     
     Beantwortet Enthält Code
    List<byte> streamBuffer = new List<byte>()
    {
        0x7E, 0x00, 0x12, 0x92, 0x00, 
        0x13, 0xA2, 0x00, 0x40, 0x6B, 
        0x68, 0xBB, 0x4F, 0x01, 0x01,
        0x00, 0x02, 0x00, 0x00, 0x00, 
        0x4F 
    };
     
    foreach (byte value in streamBuffer)
    { 
        if(value == 0x7E)
        {
            // Start StopWatch
     
     
            // If done with processing current streamBuffer break out of the foreach loop
            break;
        }
        else
        {
            continue;
        }
    }