I’ve been trying to communcate in API mode to my Xbee from a PC for a while now. My biggest problem has been the actual sending of Hex data, for some reason Visual Basic only likes to send string data. I finally got it to work and here’s what I used:
CODE:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
am trying to send data to my xbee through vb express 2008 too, well am trying to switch on and off an led from an xbee cnnected via usb cable to my pc and an idle xbee which is powered by a 3.3V battery and has only an led soldered through the pin 20 via a resistor to pin 1 of the xbee
but the codes am sending is like ;
SerialPort1.Write(ATD0=4) ’ switch on the LED
SerialPort1.Write(ATD0=5) ’ switch off the LED
the thing is that its not working at all.
am guessing that maybe both xbees have been wrongly configured in the x-ctu software.
I have written several .NET applications for XBee, including VB.NET. When sending API data using the serial port control, I usually place the bytes inside of an array and then send them out, much like HarrisnHJones.
Here’s the array I created to use the transmit request API frame (0x10) to send an ASCII “1”: