Shop OBEX P1 Docs P2 Docs Learn Events
Display UDP Message from a PINK — Parallax Forums

Display UDP Message from a PINK

DosEdgeDosEdge Posts: 33
edited 2006-12-04 15:45 in BASIC Stamp
I am communicating with two PINKs with UDP messaging. I am trying to figure out the BS2 command or code to display the message sent to a PINK. If anyone have any advisement; it would be greatly appreciated for the help?


Thank you,

Dosedge

Comments

  • Roger PiersonRoger Pierson Posts: 62
    edited 2006-12-03 22:28
    You have to read the UDP message content variable from the pink via SERIN. I don't recall the variable name off the top of my head, but if nobody supplies it tonight I'll post it tomorrow when I get into work and take a peak at my PINK code.

    Just remember, if it is a string you are sending via UDP, you have to read it into a byte array, so keep your messages small.

    Also, if you use the factory web page to browse the recieving PINK modules web server, you can view the contents of ALL variables, including the UDP message from your browser.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Roger Pierson
    Senior Electronics Technicain
    DTI Assoicates
  • Roger PiersonRoger Pierson Posts: 62
    edited 2006-12-04 15:45
    Here is a subset of the code I use to test my PINK modules.

    ' PINK_Test2.bs2
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    Pink_IN         PIN         14                         ' Pink RS232 Rcv
    Pink_Out        PIN         15                         ' Pink RS232 Xmit
    
    NBUDP2          VAR(8)      Byte
    
    
    SEROUT Pink_Out,396,[noparse][[/noparse]"!NB0RBM"]
    SERIN  Pink_IN,396,[noparse][[/noparse]STR NBUDP2\7\CLS]
    
    



    This will read the contents of the UDP message buffer.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Roger Pierson
    Senior Electronics Technicain
    DTI Assoicates
Sign In or Register to comment.