LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino + Labview with Weather Shield

Hello,

I've used Labview for some time but am new to Arduino. My objective is pretty straightforward: I have an Arduino Uno and a Weather Shield for it. I have successfully connected the weather shied to the arduino using these instructions: (https://learn.sparkfun.com/tutorials/weather-shield-hookup-guide/weather-shield-overview), I have uploaded the provided firmware sketch and I can read data in the Arduino IDE serial monitor as shown in the directions.

What I'm not sure how to do is get this data into Labview so that I can work with it in my VIs. I'm only trying to get temperature, humidity and pressure, at least at first. I've seen some examples of reading temperature and other data into Labview from Arduinos that includes using serial communications, but since I've uploaded the firmware to the Arduino I was hoping (perhaps unreasonably) that I could just call the myHumidity.readHumidity() function and get humidity data back, for example. Is there a way to do that with the Labview Interface for Arduino or do I need to go in a different direction?

I thought it was worthwhile to ask before I forged ahead. Any guidance is helpful. Thanks!

0 Kudos
Message 1 of 7
(6,388 Views)

Are you using the example Weather Shield sketch available at Sparkfun.  If so it needs to be modified for use with Labview.  Labview doesn't work very well with streaming data. The sketch needs to be modified so that it returns the requested data each time Labview sends a request for reading  a specific sensor. 

If the Arduino Sketch is in command - response format it will be fairly easy to get the Weather Shield to work with Labview.  Getting the Weather Shield to work with LIFA would add considerable more work.

hrh1818

0 Kudos
Message 2 of 7
(3,872 Views)

Thanks for responding!

So if I modified the sketch into a command-response format (which I think I can figure out how to do), how would I send the commands and receive the data in Labview? I'm not really clear on what functions I should use for the communications with the Arduino that doesn't involve the LIFA, so any guidance is appreciated. Thanks!

0 Kudos
Message 3 of 7
(3,872 Views)

Labview comes witha  Basic Serial Write and Read.VI. 

Suggested operating procedure for this VI is:

Set the COM Port and Baud rate to match your Arduino installation.

Set the Write switch to OFF.

Enter the string you want to send to Arduino in the String to Write textbox.

Run the VI.

Wait 2 seconds.  You need to wait for Arduino to reset.

Switch the Write switch to ON.

Wait for Ardjuino to respond.

The results will be in the Read String box. 

This example only runs once.  But it should give you some insight on how to send commands to Arduino from Labview and reading the response. To run continually the Write and Read need to be inside a While Loop.

The above example demonstrates manual operation.  This example needs to be modified automatic operation.

hrh1818

Message 4 of 7
(3,872 Views)

Thanks for the tip! I was able to use the sketch that was already running on the Arduino (I modified the time interval and data being reported, etc. based on my needs) and then I can just use a simple serial configure -> serial read structure to get the data from the sensors. So that ended up being easier than I thought it would and didn't require the LIFA at all.

I'll play around with it some more to see if I can get it to read data based on a set time-interval determined in Labview (the send command -> read response path you suggested), but I think I'm headed in the right direction. Thanks again!

0 Kudos
Message 5 of 7
(3,872 Views)

Hello,

I am trying to get information from a weather shield in labview. Have you finally figured out how to do it? If so, could you please share your sketch or the vi that you created? Thank you.

0 Kudos
Message 6 of 7
(3,872 Views)

master master help me How to make web server labview control arduino dfrobot gsm or same Internet of things ??? help me master thanks.

0 Kudos
Message 7 of 7
(3,872 Views)