Here's a little pseudo code for you

OldValue var byte

repeat
if oldvalue <> PortB then
oldvalue = PortB
SendInteger PortB
endif
forever

Sendinteger is a function to send the numeric value of PortB as a string.

With the above code, you will send only when there is a change from the previous value.

Good Luck