View Full Version : Xbee API Mode

06-02-2010, 03:43 PM
I am attempting to use the API mode so I can transmit data to particular XBEES (a total of six on the network). The object I think makes you build a packet before you send it (hard to tell just by looking at the code). I for now just want to transmit and receive single bytes. In the future I will want packets of multiple bytes. Can you post examples of how to properly send API data and retrieve it at the other end? I set the 16 bit source addresses from 1 to 6, 0 is the transmitter unit. I tried this code, but I think you have to build a packet, as the object probably does not do this automatically:


XB.API_Tx(1,5) 'Transmit 5 to XBEE address 1.


outa[8..15] := XB.API_Rx 'Set LEDs to received data.



06-03-2010, 08:47 AM
I haven't really used API mode because I've had so much luck with transparent. there should be commands in that mode to specify at recipient address, but you do have a delay with the attention signal.

Another strategy is to transmit to every unit and include a unique identifier code in your transmitted data that indicates the intended recipient. This strategy was useful for me using SX chips amd XBee and allowed me to avoid API mode and having to build out whole packets (which might be your problem).

Tom Talbot
New Market, MD, USA