Zigbee re-coding Device name

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Zigbee re-coding Device name

Postby Ondra » Fri Mar 02, 2012 12:05 pm

Good day all.
On the Zigbee properties page you have the option to include a "device name".
I am using serial a numbering method where the serial number is stored in the eeprom
when the device is programmed.
When the device runs. I would like to take this value and use it for the device name.
I can read the number into a variable. How do I pass this name to the zigbee code that
will initialize the Xbee device so that when the code runs the device is initialized with
the Serial number as the device name.

Ondra

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

Re: Zigbee re-coding Device name

Postby Benj » Fri Mar 02, 2012 3:19 pm

Hello Ondra,

If you customise the Zigbee component code and edit the Init_Network function then you will find this line which is responsible for setting up the Zigbee network node name.

Code: Select all

Send_AT_Command(%a_MX_ZIG_DEVICENAME, %a_MX_ZIG_NLEN);   //Set Device Name


If you create a sting in Flowcode and populate it with your node name and the EEPROM data before you call the init network function then you can change the function to look like this. Where FCV_STRING is the C variant of the name of your Flowcode string named string.

Code: Select all

Send_AT_Command(FCV_STRING, FCSZ_STRING);   //Set Device Name from Flowcode string variable


You will not be able to use 0 as an ID value as this would incorrectly terminate the string.

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: Zigbee re-coding Device name

Postby Ondra » Fri Mar 02, 2012 3:41 pm

The string is made up of numbers and letter. If there is a 0 in the string will this cause a problem?

Ondra

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: Zigbee re-coding Device name

Postby Ondra » Fri Mar 02, 2012 5:09 pm

Hi Ben when I change the code I can see the values are being written. What I don't see is an Ok Response from the module.
Ondra