LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use 2 digital pins ...

hello,

           i need to make blink two leds connect in arduino digital pins 11 and 12 , i did by using two Arduino Digital Pin icon but it not work,

can anyone guide IS THERE IS POSSIBLE TO USE MORE THAN ONE DIGITAL PINS IN ARDUINO INTERFACED WITH LABVIEW

;BYE

0 Kudos
Message 1 of 12
(11,039 Views)

Yes it is possible, either two digital write pin vis or a single digital wire port vi is the way to do this.  Did you configure the pins as outputs using the set pin mode vi?

Please include as much information as possible about what exactly is not working, what you've tried, what errors you see, etc.  Its really hard to debug with so little information.  Post code if possible.

Thanks,

-Sam K

LIFA Developer

0 Kudos
Message 2 of 12
(7,240 Views)

Hello Sammy_K

                    sir i describe my question with more details here by attach the BLOCK DIAGRAM AND FRONT PANEL to get two digital ouput from arduino through labview block diagram

i get error while connect wire in CLOSE icon, so can u plz explain hw to get more than one input /output through block diagram , and plz suggest me some example circuits

THANK YOU

BLOCK DIAGRAM:

BLOCK DIAGRAM.JPG

FRONT PANEL:

FRONT PANEL.JPG

0 Kudos
Message 3 of 12
(7,240 Views)

santhosh40,

If you click the run arrow it will give you an explination of why your VI is broken and will even take you to the offending code.

In this case you are trying to connect two arduino reference wires back together.  This does not work in LabVIEW, you can split a wire to go from one source to two sinks, but you cannot merge wires back together by simply connecting them (this violates data flow).

Think about what would if you did this with two numeric wires (such as doubles) rather than arduino references.  If one wire contains the value 8.0 and the other 10.0 what would / should happen when you connect them? You can use things like the select primitive to select between two wires based on another value, or use case structures for more than two values.

At the end of the day your code should look like this:

pic.PNG

-Sam K

LIFA Developer

Message 4 of 12
(7,240 Views)

Also you may want to check out

http://www.ni.com/academic/students/learn/

for some introductory LabVIEW training.

-Sam K

LIFA Developer

Message 5 of 12
(7,240 Views)

Thanks Sammy_K,

                    Now i get the good solution of my problem and i clear about what the mistake i've done, i'm new 2 labview and LIFA so i need to practice more to get familiar with labview

Once again thank you 4 ur valuable guidence

0 Kudos
Message 6 of 12
(7,240 Views)

No problem.  Everyone is new at one point.  Feel free to post LIFA quetsions here as you come accross them and also check out NI's LabVIEW forums here.

Thanks,

-Sam K

LIFA Developer

0 Kudos
Message 7 of 12
(7,240 Views)

hello,

     as i m new to LIFA ther4 i hv a bit f a situation here. i want to give same voltage at two different pins of arduino and then using a relay want to output the voltage from those two pins. So, for that, after initializing i used two Set Digital Pin Mode vi followed by two Digital Write vis......now the problm is that when i open these vis to set there digital I/O pin.... the pin number which i set in first Set Digital Pin Mode vi gets automatically set on the other Set Digital Pin Mode vi. so if that happens then how can i select two different pins of arduino for output

PS: sorry as m not able to upload my VI to u... hope u could hlp somhow without it....

0 Kudos
Message 8 of 12
(7,240 Views)

We can't really help you with your code without your code to look at.  Also, you should not be using LIFA but instead using LINX.  See LIFA Replacement - LINX Officially Released.

0 Kudos
Message 9 of 12
(7,240 Views)

thnku, i'll try to post my code to u but in the mean time can i know why i should not be using LIFA here?

0 Kudos
Message 10 of 12
(7,240 Views)