Wireless Sensor Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Nodes sample synchronisation

Hi Zach,

 

I don't know if you have some 3226 at your office, but as I said before, the 3226 don't send data by radio message.

Here the default firmware,

I also add under it the radio message VI with all the components shown.

 

 

It's been three days that I try to solve this, the only thing I change is that the project runs on a different gateway. I was only double checking that everything was ok before installing it on a bridge. The installation is next week, over an highway, it will be very difficult to postpone it...

 

Thank you for your help

 

Matt

0 Kudos
Message 11 of 18
(3,084 Views)

Ok, I think we are talking about the same thing. Radio messages are used in 2010, and these are replaced by UDVs in 2011.

 

Looking back at your original code, the While loop in your sample case may be causing a problem. The Sample case will be called according to the Sample Interval you define in the Config Node. This means you should have code that runs once in the Sample case, and you shouldn't need any Wait functions or loops there.

 

The entire case structure of the WSN Target (Firmware) VI can be thought of as being in a loops. The cases will continue to run and change between themselves without user-created loops.

 

 

Zach P.

Staff Software Engineer | LabVIEW R&D | National Instruments
0 Kudos
Message 12 of 18
(3,066 Views)

Thank you Zach,

 

I removed the while loops and it works, but the while loop was there to synchronize all the nodes. It was working well to synchronize them, as I saw by just checking the relay turning on and off. Now I realized that since I found this method for syncing the nodes, I just assumed that the rest will work as before. I will have to find another way to sync the nodes. So if someone have an idea it would be great !

 

Thank you

 

Matt

0 Kudos
Message 13 of 18
(3,061 Views)

Hi Matt,

 

I've been able to sync two nodes by having a "master" node that always runs at a constant rate and then manually adjusting a "slave" node's sample time until their sampling times lined up and then set the slave's sample time to the desired sample rate. So lets say originally slave node samples 10 seconds after the master. Then I would reduce the sampling time of the slave by 10 seconds so the next time it samples it would sample at the same time as the master. After confirming they lined up I would reset the slave's sample rate to the desired interval. 

 

I was only doing it for two nodes so I did not automate it but it shouldn't be too hard to create a vi that checks the timestamps and syncs them up. The way I changed the sample rate was with user messages. I would read in the user message on the node and change the sample rate with a config node to whatever number was in the user message. 

 

Cheers,

Brian A

R & D Product Support Engineer | WSN/Network DAQ/Academic

National Instruments  

0 Kudos
Message 14 of 18
(3,058 Views)

Thank you Brian,

 

For the moment the nodes that I need to be synchronized are externally powered. So, when I set the switch ON, they all start at the same time so they are synchronized. I will be ok for this time. But your method seem good but not very helpful for my purpose. My job is to instrument bridge. WSN system are useful because points of measure are far away of one another. So it will be difficult to adjust them manually.

 

Thank you, have a nice day

 

Matt

0 Kudos
Message 15 of 18
(3,054 Views)

Hi Matt,

 

I probably could have worded my post better. When I say manually I do not mean physically being next to the device and powering it on/off. I meant that I checked the timestamp of the two nodes and did that calculation of time difference by hand and entered in that number to a user message to the node. I could have done that all automatically in a VI but like I said it was only 2 nodes so it did not seem advantagous to automate the process. If I were working on more nodes I would have automated it. I'll try to put together an example in the next day or two to show what I am talking about. 

 

Cheers,

Brian A

R & D Product Support Engineer | WSN/Network DAQ/Academic

National Instruments 

0 Kudos
Message 16 of 18
(3,049 Views)

Hi Brian,

 

You made me thought of something. I will try it when I'll have time. Do you think it would work to set the sample rate to something like 5 seconds or less. This way all the nodes would be at worst 5 seconds appart. Then after 1 minute or so, you send a user message to all the nodes with the desired sample rate, for example 5 minutes. I think that if all the nodes accept the message at the same time thay would be synchonized by more or less 5 seconds.

 

What do you think ?

 

Have a nice day

 

Matt

 

 

0 Kudos
Message 17 of 18
(3,041 Views)

Hi Matt,

 

I think your idea matches up with what Brian said. That should give you a rough synchronization and should be repeatable without physically powering on each of the modules.

Zach P.

Staff Software Engineer | LabVIEW R&D | National Instruments
0 Kudos
Message 18 of 18
(3,035 Views)