LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Synchronization for multiple Arduino

I made a program wherein there are 3 nodes, each node measure temperature using thermocouple. Each node has 1 arduino and 1 Xbee. All the three will send their temperature data to the base station where Xbee exists. What I want to do is All of the data will be placed in chart, it should have time and date. As shown in my VI, and if you see something that I have used incorrectly please do say. I am new to LabVIEW.

 

How will I synchronize the data? For each and everyone have a time and date? Say, node 1,2, and 3 took a measurement at t=0. Since they all have different location, they will all have a different received time in base station? How can I make them send their data and place the appropriate time for the temperature measurement?

 

 

 

0 Kudos
Message 1 of 7
(4,560 Views)

Are the Arduinos all starting at the same time? You could look into the millis() function to count the time the Arduinos are running, report that back to LabVIEW, and then synchronize based on that and extrapolate a date/time from t0.

Brian H. -- Electronics & Measurements Product Marketing Manager
0 Kudos
Message 2 of 7
(4,510 Views)

Yes they should start at the same time. Is that applicable in LIFA?

0 Kudos
Message 3 of 7
(4,499 Views)

I believe that you can do something similar using Get Timing Data Sub-VI. Have you tried that?

Brian H. -- Electronics & Measurements Product Marketing Manager
0 Kudos
Message 4 of 7
(4,460 Views)
Well, another problem came up. LIFA can ony do one to one communication. I need multiple to one though.
0 Kudos
Message 5 of 7
(4,453 Views)

Serial communication via RS-232 is always one-to-one because there is no addressing capability. The LIFA Init VI does not have any addressing capability so it appears that none of the other communications methods allows more than one device per channel. I think you will need three separate channels (COM ports) for the three devices.

 

How precisely do you need the temperatures to be synchronized? I would expect that any system using XBEE will not be responding to rapid changes of the temperatures. Just assume that the three readings taken in the same loop are at the same time and append a timestamp or tick count in software. I do not have the Get All Data.vi so I canot tell how fast it executes. I would move the Write to File to a parallel loop and put a Wait in the read loop to set the loop time. For most temperature applications software timing is good enough.  What will you be doing with the data?

 

Lynn

0 Kudos
Message 6 of 7
(4,441 Views)

Instead of having your remote units send temperature data "whenever" have them wait un til polled by the base unit.

 

Then poll all of them in sequence each interval and use the time stamp at the start of the poll as the time for all remote units.

========================
=== Engineer Ambiguously ===
========================
Message 7 of 7
(4,437 Views)