NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
aRCo
Posts: 121
0 Kudos
Accepted Solution

LabVIEW and Arduino

Hi all!

I own an Arduino Uno. Reading posts in the forum seems that i can use LabVIEW only with Arduino Duemilanove. Is this true?

Thanks.

Member
Jazlan
Posts: 14
0 Kudos

How to read Serial Data from Arduino using labview VISA?

Hi =). Im a beginner working reading serial data from an arduino but im facing... Lets do this step by step

 

I constructed a voltage divider circuit that gives an output ranging from 0 to 5V. The output of this circuit is sent to an analog input pin 0 of an Arduino Duemilanove board.

 

1) Firstly I plugged in the cable connecting my laptop USB to the arduino board.

 

2) I went to start->control panel->system->hardware->device manager. Check out Ports(COM & LPT). In my laptop I can see USB Serial Port (COM4). Now I know in Labview I have to read serial data from COM 4.

 

3) For the arduino side, here is the code to read voltage variations inputted to analog pin 0. The last line 'delay' determines the sampling rate of how we want to sample the voltage divider output:

 

int potPin = 0;    // select the input pin for the voltage divider output
int val = 0;       // variable to store the value coming from the sensor

void setup()
{
  Serial.begin(9600);    // opens serial port, sets data rate to 9600 bps
}

void loop() {
  val = analogRead(potPin); // read the value from the voltage divider
  Serial.println(val);
  delay(10);
}

 

I have slightly modified the basic serial read write VI.. I have attached the block diagram used with comments. Basically I tried to read serial data, divide by 1023 and multiply by 5 in order to graph voltage variations from the voltage divider circuit.  However Im not getting the correct voltage output values . The voltage value just keeps going to 0 and coming again as shown in the pic.

 

Could you guys please guide me on what went wrong?

 

Thanks!

 

 

 

 

 

 

Knight of NI
RavensFan
Posts: 16,017
0 Kudos

Re: How to read Serial Data from Arduino using labview VISA?

Jazlan,

 

Start your own message thread.  Don't hijack someone else's message.

Member
Jazlan
Posts: 14
0 Kudos

Arduino Uno

[ Edited ]

Sorry for the interruption.. Im new to this forum and I thought my question may be helpful under this topic.

 

Regarding in whether arduino Uno can be used with labview, The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it features the Atmega8U2 programmed as a USB-to-serial converter.

 

I came across this link, http://code.google.com/p/labviewduino/

 

The.author did mention that we do not need to install an FTDI driver to our PC if we are using an Uno. The other steps the author has mentioned to in order to communicate between labview and arduino are similar to Dueminalove and other boards.

 

 

Member
aRCo
Posts: 121
0 Kudos

Re: Arduino Uno

Thanks for your considerations Jazlan, but these don't satisfy my question.

 

I simply need to know if someone succeeded in using Arduino Uno with LabVIEW. Being the owner of an Arduino Uno, i need to know this in order to understand if i have to replace it with an Arduino Duemilanove.

 

:smileyhappy:

Active Participant
ABCPrograms
Posts: 352
0 Kudos

Re: Arduino Uno

if the equipment support Serial (VISA) communication, then I see no point in why it should not work.

 

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's :smileywink:
LabVIEW 5.1 - LabVIEW 2012
Member
Tanya_V
Posts: 194
0 Kudos

Re: Arduino Uno

Yes, I've used an UNO with LabVIEW, and it works just fine. Identically to the previous versions.
I hope this helps,
Tanya V
National Instruments
LabVIEW Platform Product Support Engineer
Member
aRCo
Posts: 121
0 Kudos

Re: Arduino Uno

Clear like water. Thanks Tanya!

Active Participant
Atom.
Posts: 497
0 Kudos

Re: Arduino Uno

hello such, any consultation with arduino is better than consult in the next group, also find, documentation, examples

 

https://decibel.ni.com/content/groups/labview-interface-for-arduino

Active Participant
Atom.
Posts: 497
0 Kudos

Re: Arduino Uno