zigbee project problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
boldun
Posts: 3
Joined: Sat Mar 26, 2011 9:09 pm
Contact:

zigbee project problem

Post by boldun »

Hello everybody,
so I am using xbee modules and I'm making some test program with it. My problem is that while i'm connecting the two modules my output is already working, and when the modules are connected without touching anything my outputs are activated.

So can someday look at my programm and fix my problem please and tell me what I made wrong?

Regards boldun
Attachments
end.device.fcf
(7.5 KiB) Downloaded 287 times
coordiantor.fcf
(6.5 KiB) Downloaded 290 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: zigbee project problem

Post by Benj »

Hello,

My guess would be a floating input.

eg. an input pin that is pulled to GND or +V when a switch is pressed and left unconnected when a switch is not pressed.

Could this be the case?

Had a quick look and same would apply to a analogue input if disconnected and left to float.

User avatar
DavidA
Matrix Staff
Posts: 1076
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 258 times
Contact:

Re: zigbee project problem

Post by DavidA »

Hi Boldun,

If you are posting Flowcode v4 programs to ask for help, would it be possible for you to start a new topic in the Flowcode V4 forums, or if you want I can move this in there for you.

If you have not got access to the V4 forums, then this is a very simple procedure and a step by step guide is available on our FAQ site, located here:

http://www.matrixmultimedia.com/support ... f=29&t=602

When your account has been upgraded and if you would like me to move the topic, just post here or PM me. Thanks.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: zigbee project problem

Post by Benj »

Hello Again,

Ok scratch my last post.

The problem is that in the coordinator program you are testing for a value greater then 199.

The way the Receive_Char macro works is that it returns 255 if no data is available.

Therefore you will need to change the code in your if statement to:

(X > 199) && (X < 255)

boldun
Posts: 3
Joined: Sat Mar 26, 2011 9:09 pm
Contact:

Re: zigbee project problem

Post by boldun »

thank you for your messages,

thanks Benj,
so I must tell that X must be inferior of 255, but when I connect my two modules my output is activated even if my "init" macro isn't finished yet.

And what must I set two receive several bytes, can I just make a task in my end device when my analogue is like X<125 I send 2 and if X>125 I send 3 and when coordinator receives my bytes I must set if X=2..if X=3 or if X=2 && X<255 ...if X=3 && X<255.

Regards boldun.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: zigbee project problem

Post by Benj »

Hello,

If you are testing for a byte = value then you do not need to add a second check to see if the byte is less then 255.

The way I would normally do things is like this.

byte = Receive byte
if byte < 255
yes: process byte

boldun
Posts: 3
Joined: Sat Mar 26, 2011 9:09 pm
Contact:

Re: zigbee project problem

Post by boldun »

ok thanks benj it works now,

but there's still a problem now. When I want to connect the two modules I must wait 1min 15sec. Is there a way to make it faster?

regards boldun

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: zigbee project problem

Post by Benj »

Hello Boldun,

The Zigbee init routine is the main routine that takes the time during startup. You could check your component properties and switch off the verbose option if it is selected. This should considerably speed up the initialisation process. Another way is to connect to the device and then put the zigbee module to sleep. This way waking back up the module and re-connecting is much faster.

Post Reply