PDA

View Full Version : Display UDP Message from a PINK



DosEdge
12-04-2006, 12:36 AM
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

Roger Pierson
12-04-2006, 06:28 AM
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 Pierson
12-04-2006, 11:45 PM
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,["!NB0RBM"]
SERIN Pink_IN,396,[STR NBUDP2\7\CLS]




This will read the contents of the UDP message buffer.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Roger Pierson
Senior Electronics Technicain
DTI Assoicates