Interface Arduino With Labview

Introduction: Interface Arduino With Labview

In this we will see how we connect arduino with labview with serial communication and controlling led.Labview is software that work as grapical representation code so anybody can use and make cool stuffs.

Step 1:

Open labview.

Create a new VI in File > New VI.

In block diagram

  • right click->Instrument I/0->Serial->Visa configure serial port

  • right click->Instrument I/0->Serial->Visa write

  • right click->Instrument I/0->Serial->Visa close

Step 2:

For toggle of led we use switch for that go to Front panel>right click->Boolean-> Vertical switch. you can use any switch you want.

Come back to block digram.Now Switch we used is boolean so we any conversion to string.For that will convert the boolean to (0,1) and then to string.

  • right click->search-> boolean to (0,1)
  • right click->search ->format to string.

Step 3:

for Continuously running use while loop from structures menu.

That's it labview now come to arduino.

open arduino & write following code also availabel inbuild in arduino.

int data;
void setup()

{

Serial.begin(9600);

pinMode(13,OUTPUT);

}

void loop()

{

if(Serial.available()>0)

{

data=Serial.read();

if(data=='1')

{

digitalWrite(13,1);

}

else if(data=='0')

{

digitalWrite(13,0);

}

}

}

Step 4:

Upload the code and run the labview vi.

Be the First to Share

    Recommendations

    • Mason Jar Speed Challenge

      Mason Jar Speed Challenge
    • Bikes Challenge

      Bikes Challenge
    • Remix Contest

      Remix Contest

    Discussions

    0
    java243
    java243

    Question 2 years ago on Introduction

    Hi guy, I find that your post is very helpfull for my project. I have tried
    your steps and got great results.

    However, I still need your help to tackle the issue as following:

    - I need to put more Boolean in VI to control more leds, but it doest work.

    - I add a boolean to VI block and edit arduino code as shown in attached
    images

    (addition: I made value of boolean 1 as (0,1) and boolean 2 (0,2)