Zigbee Device access from delphi

My application (Master) communicates with 2 separate devices (slave) using zigbee technologie. I need to change the destination attribute of the Master in Realtime from my delphi program to communicate with the appropriate device.  How can i do that! how can i access  the Zigbee Module ZigBee┬« PRO XBee like in XCTU tool and make some change in the configuration directly from my application. What do i need? is there any example-Code
NelzoomAsked:
Who is Participating?
 
NelzoomConnect With a Mentor Author Commented:

The API FRAME Number should be set to 0.
0
 
DragonSlayerCommented:
I would reckon the devices come with an SDK?

If your devices are currently set to AT mode, basically you just send text commands to it via a serial connection, e.g. ATDT 1F<CR> where <CR> is a carriage return.

Remember to set the correct baud rate (default 9600)
0
 
DragonSlayerCommented:
On the other hand, if you're in API mode, you will basically send binary data over... with each packet starting with $7E and ending with a checksum of the packet.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
NelzoomAuthor Commented:
Hi DragonSlayer,

thank you for your comment.

i just want to add more information about this post.

Actually, i'm using  AT Mode and i communicate with remote slave device (node) by sending some Commands via zigbee module (Coordinater) connected to usb port and recognized as comport. it a just serial communication. with  the request <MyComPort.putChar($9)>  i get Value X as answer from device 1 for example.  other commands are defined to request more informations from the device.

The problem is how to send this command alternatively to an other device in realtime by chaging the destination address in the Coordinator zigbee module. the frequence is 10request/s to each device.

Is there any possibility to do that? how? i'm a new to zigbee and need some help.

thank's





0
 
DragonSlayerCommented:
Hi Nelzoom,

Check the section titled API Frames in your guide, under Explicit Addressing ZigBee Command Frame. Bytes 6-13 allows you to set the address of the destination device, or 0xFFFF for a broadcast
0
 
NelzoomAuthor Commented:
Hi DragonSlayer,

Thank you for you comment.

I will read all those staf and give you a feed back.

if i understand, i can send alternatively commands to each device by only specifying it address in the packet to send!?

Changing the  address will not affect the speed of my realtime application? where can i find some code witch may help me.

thanks.
0
 
DragonSlayerCommented:
Hi Nelzoom,

1. At a default rate of 9600 bps, if your average command packet is at, say, 30 bytes, that allows you to send up to 320 commands per second, bandwidth-wise.

2. Not sure of sample code for Delphi, there are some available frameworks for these devices for both .NET and Java
0
 
NelzoomAuthor Commented:
Hello,

I spent a lot of time in reading DIGI documentation and  things are a bit clear.

Now,  from my small delphi test program (the Master with API=1)  i can  address a small packet with 'hello' message to the slave (XCTU with API:= 0)

...

ComPort2.output:= char($7E) +  char($00) +  char($0A) + Char($01) + Char($01) + char($50) +  char($01) + char($00) + char($48) + char($65) + char($6C) +char($6C)+ Char($6F) + char($B8);
   {
// 7E 00 0A 01 01 50 01 00 48 65 6C 6C 6F B8

    - 7E
 Start delimiter

  - 00 0A
 Length bytes

  - 01
 API identifier

  - 01
 API frame ID

  - 50 01
 Destination address low

  - 00
 Option byte

  - 48 65 6C 6C 6F
 Data packet

  - B8
 Checksum
}

The message is displayed correctly in the XCTU tool. but a get an answer back from the Slave RF Module. i think it an ACK . now i dont need to receave this confirmation from the slave, so i change the 8th from 00 to 01 as in the documentation. when testing XCTU does not display the hello messahe any more.

this step is important because in my main project all slaves must answer immediately by sending some data acuired from the PIC, in response to the sent command from the master.

Any idea!
 
0
 
NelzoomAuthor Commented:
Hi Every One , I resolve it thank you for all
0
All Courses

From novice to tech pro — start learning today.