LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Synchronization LIFA

shogunato3 wrote:

Any idea on what I should modify? Or what I should do?

But it is possible to have multiple arduino "Xbee network" but not using LIFA?

I have no idea what to modify.  I thought hrh1818 might have an idea but it doesn't seem so.  It's possible to do it without LIFA because the option wouldn't exist otherwise.  You can google for some website/webpages that talk about doing the Xbee network thing.  I know that I did once find a Java API to do it but I don't know anything about it.

0 Kudos
Message 21 of 44
(1,219 Views)

You are on the right track when you say "but not using LIFA?".  I will add further justification much latter today.

hrh1818

0 Kudos
Message 22 of 44
(1,219 Views)

LIFA and Xbee Command Mode

XBee has a command mode for setting a coordinator's end point destination address property and for setting many other XBee properties.  The procedure is:

1.  To access the command mode send the following message to a coordinator.

One or more seconds of silence,  followed by +++ and then at least one second of silence.

  Do not terminate the sequence with a carriage return, or the enter character.

2.  Then after XBee responds with OK send the following command.

ATDLxxx

Where xxx is the destination address.

This command specifies the destination address the coordinator will send data to.

3.  Return to transparent mode.

LIFA requires the transparent mode to send data to a XBee end point. 

To add command mode capability to LIFA requires the Send Receive LIFA sub VI be modified to enable sending a LIFA packet or the above AT command sequence to the COM port. 

Non LIFA Option

An alternate approach is don't use LIFA.  The salient features of a non LIFA approach are.

Give each end point Arduino the capability to read a MAX31855 temperature signal.  See:

<https://github.com/adafruit/Adafruit-MAX31855-library>

Let the coordinator broadcast messages to all end points.

Instead of using XBees addressing capability, provide each end point Arduino with the capability to decide if it should act on or ignore a message

A simple message like "Nod1" will be all that is required to get a temperature reading from end point number 1.

Temperature data sent by an end point could include  end point identification.

hrh1818

0 Kudos
Message 23 of 44
(1,219 Views)

Wow, 2+ seconds when switching devices . . . that's really slow.  For his application, that would be 6+ seconds per loop execution . . . probably not an issue if he only wants to acquire data ever 7 or so seconds.  This would mean the data would be syncronized to about ±3 seconds at best.

Do you have a source reference, hrh1818?  I was looking for it but was having trouble finding a good resource (I don't usually work with or look for Xbee stuff).

After you send "ATDLxxx" command, does it automatically switch back to transparent mode?

0 Kudos
Message 24 of 44
(1,219 Views)

Book resources are:

Wireless Sensor Networks by Robert Faludi.  The emphasis in this book is XBee series 2 hardware and Mesh Networking.

The Hands on XBee Lab Manual by Jon Titus.  The emphasis in this book is XBee series 1 hardware, point to point communication and the I/O capability built into the XBee Hardware.

A couple of on-line resources are:

<https://www.sparkfun.com/pages/xbee_guide>     A buying guide.

<https://learn.sparkfun.com/tutorials/xbee-shield-hookup-guide>  A shield hook up guide.

<https://learn.sparkfun.com/tutorials/exploring-xbees-and-xctu>  A XBee Explorer tutorial.

There are many other on-line resources.  But none that were outstanding and worth mentioning here.

After 10 or more seconds of silence XBee will automatically return to the transparent mode. If you send a new command within 10 seconds a XBee will stay in the command mode. Beginners have problems with a premature exit from the command mode.

hrh1818

0 Kudos
Message 25 of 44
(1,219 Views)

Maybe ill program synchronization in labview. From what I can see. Getting temperature and displaying values would be Much appropriate for in LabVIEW.

Ill try to research more about this and modifying send and receive.

But let me get this straight. All nodes will send data, but they send it one by one. Like. Node 1 first, after sending it will silence or something. Then this will continue to nodes 2 and 3 ? Did I get it correctly? Sorry im kinda slow on this.

0 Kudos
Message 26 of 44
(1,219 Views)

You will have to treat all of your Arduinos serially.

  • Set the explorer to Arduino1
  • Send command to Arduino
  • Receive return value from Arduino
  • Set the explorer to Arduino2
  • Send command to Arduino
  • Receive return value from Arduino
  • Set the explorer to Arduino3
  • Send command to Arduino
  • Receive return value from Arduino
  • repeat.
0 Kudos
Message 27 of 44
(1,219 Views)

In the non LIFA approach the method I suggested for reading temperatures worked as follows

Broadcast a request for thermocouple reading at node 1.

The Arduino at node 1 reads the thermocouple temperature and sends the data to Labview.

Broadcast a request for thermocouple reading at node 2.

The Arduino at node 2 reads the thermocouple temperature and sends the data to Labview.

Broadcast a request for thermocouple reading at node 3.

The Arduino at node 3 reads the thermocouple temperature and sends the data to Labview.

Continuously repeat the above sequence once every nn seconds.  You will specify the value nn.

Or if you require all  3 temperature measurements be taken simultaneously you could:

Use a broadcast to trigger all nodes into reading their thermocouple's temperature and to save the reading in a variable.

Then after a short wait.

Broadcast a request for data from Node 1.

The Arduino at node 1 returns the data

Broadcast a request for data from Node 2.

The Arduino at node 2 returns the data

Broadcast a request for data from Node 3.

The Arduino at node 3 returns the data

Continuously repeat the above sequence once every nn seconds.  You would specify the value nn.

The above are 2 suggestions.  Suggestion 2 requires different Labview and Arduino programs than those used by Suggestion 1. Or if you prefer a different sequence just program Labview and the Arduinos with your preferred sequence.

herh1818

0 Kudos
Message 28 of 44
(1,219 Views)

Thank you Nathan. That is a long process though.

Hrh1818,

I got your suggestion. Suggestion 2 would probably be the most appropriate for my system. I have to program all arduino to get data after receiving the broadcast message or something. To do this, I would have to use the VISA I suppose  or if you have resources for this that I can use. I cant seem to find multiple arduino on the net.

0 Kudos
Message 29 of 44
(1,219 Views)

What do yuou mean by "I cant seem to find multiple arduino on the net."?

What version of Labview do you have? 

hrh1818

0 Kudos
Message 30 of 44
(1,219 Views)