Shop OBEX P1 Docs P2 Docs Learn Events
Extended Full Duplex Serial - RxStr Question — Parallax Forums

Extended Full Duplex Serial - RxStr Question

ryfitzger227ryfitzger227 Posts: 99
edited 2013-09-01 09:19 in Propeller 1
Hello,

I'm working on a project that interfaces a Propeller microcontroller with a vb.net application. What I'm trying to achieve is the microcontroller to "wait" until the user of the vb.net program is ready. When he is ready, he will press a button that sends a string to the Propeller of ABC. Once the Propeller gets that, it will continue. I've tried everything and I can't get it to work. What am I doing wrong? I'm using the default delimiter of a comma.

VB.NET Code
COMPort.Write("ABC,")

Propeller Code
repeat until strcomp(MyVar, string("ABC"))
    serial.RxStr(@MyVar)
'continue


What could I be doing wrong with something this simple?

Comments

  • AribaAriba Posts: 2,690
    edited 2013-08-31 23:06
    repeat until strcomp([COLOR="#FF0000"]@MyVar[/COLOR], string("ABC"))
        serial.RxStr(@MyVar)
    'continue
    

    How is MyVar defined? It should be a byte array. The name MyVar sound more like a long. A long will work here accidentally, but only as long as the received string is not more than 3 characters.

    Andy
  • ryfitzger227ryfitzger227 Posts: 99
    edited 2013-09-01 07:05
    MyVar is defined as a byte array. Making it the address of MyVar worked. Thanks!
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2013-09-01 09:19
    Parallax have an application note , AN018, that covers PC to Prop communications, it has some nice tips.

    http://www.parallaxsemiconductor.com/an018

    Jeff T.
Sign In or Register to comment.