Solved

Zigbee Device access from delphi

Posted on 2010-08-26
11
1,492 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:Nelzoom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
11 Comments
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 33529899
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
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 33529928
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
 

Author Comment

by:Nelzoom
ID: 33530125
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:DragonSlayer
ID: 33533838
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
 

Author Comment

by:Nelzoom
ID: 33548578
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
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 33548622
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
 

Author Comment

by:Nelzoom
ID: 33616332
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
 

Author Comment

by:Nelzoom
ID: 33634678
Hi Every One , I resolve it thank you for all
0
 

Accepted Solution

by:
Nelzoom earned 0 total points
ID: 33634689

The API FRAME Number should be set to 0.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question