LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Please explain why I loose comms to Arduino after making a change to I/O pin

Okay first off, I'm a total noob to both LabVIEW and Arduino so go easy on me please. In fact this simple vi that I got from a tutorial on YouTube is the most time I've spent on both. But we all started somewhere right?

Here goes:
I followed a video tutorial showing how to turn on/off the pin 13 LED within LabVIEW. And when I start fresh (I.E. step 1) open the Arduino application and upload the LVIFA_Base.pde file, step 2) launch LabVIEW and build the code) the vi works as it should and I get control of the led. But if I go and change the value of the Digital I/O pin on the front panel, say from 13 to 12 then back again, and run the program I loose communication with the arduino.

In fact COM4 is no longer recognized by LabVIEW or the Arduino app.
The only way to get it back is to shut down Arduino and LabVIEW all together unplug the Arduino board from the usb and plug it back in. Only then (and only sometimes... once I had to reboot the PC for COM4 to become active again), will the Arduino app see COM4 and allow me to upload the firmware file, essentially starting over from scratch.

I've changed other parameters within the vi before and borked the connection to the board as well.

My question is, why is this occurring? At this point I really just want to toy around and familiarize myself with the environment but its a drag when I have to reboot my machine just because I changed a pin on the Arduino board.

I just want a better understanding of what is causing this and its probably something very simple.

Thank you for you patience.

SCXI- 1000 Chassis w/ 1346 adapter
PCI 6281 DAQ card
SCXI- 1520 Bridge Board w/ 1314 Terminal Block (x2)
SCXI- 1180 Feedthrough Panel w/ 1302 Block
Signal Express 2014.
Win7 Enterprise
0 Kudos
Message 1 of 6
(4,151 Views)

This is a very common mistake.  You are likely using the abort button (the little red stop sign on the LabVIEW toolbar).  You should avoid using this button when stopping the VI (unless you are in some sort of infinite loop).  You should use the stop button on the front panel (which is connected to the condition of the while loop).

If you do need to abort, you can do so but then you should open Close.vi, set the appropriate settings within the Arduino resource cluster (set COM4 for VISA resource).  Then, run it.  This should release the COM port for you to either run the LIFA program again or use the Arduino IDE.

Another thing that I notice is that if you are using LVIFA_Base.pde, you have a really old version of LIFA.  If you have the most up-to-date version, it will be LIFA_Base.ino.

HOWEVER, since you are new to LIFA, I would recommend that you consider using the successor to LIFA which is called LINX.  LIFA is no longer activley supported by its author (he is actively working on LINX).

One major advantage up front is that you no longer need to use the Arduino IDE because he has implemented a built-in firmware uploader which is very convenient.

0 Kudos
Message 2 of 6
(3,305 Views)

Thanks for your advice. I now have LINX installed and will mess around with it later.

In the meanwhile, just to clarify, you mentioned that I have an older version of LIFA with the Base.pde file, however when I follow the links back to NI to download the LVIFA Toolkit it all leads to the .zip I downloaded originally... which contains the .pde file. Is there a more recent file I should be looking for?


Also, can you explain: "One major advantage up front is that you no longer need to use the Arduino IDE because he has implemented a built-in firmware uploader which is very convenient."
How does this work? In the Getting Started tutorial on the LINX site they still require you to fire up the Arduino IDE in order to deploy the FW to the UNO

Thank you for your help and sorry for all the beginner questions. I like to have a solid understanding of what I'm doing as I'm doing it and right now the learning curve is still pretty steep.

SCXI- 1000 Chassis w/ 1346 adapter
PCI 6281 DAQ card
SCXI- 1520 Bridge Board w/ 1314 Terminal Block (x2)
SCXI- 1180 Feedthrough Panel w/ 1302 Block
Signal Express 2014.
Win7 Enterprise
0 Kudos
Message 3 of 6
(3,305 Views)

Hey Okors,

As Nathan mentioned you should start using LINX rather than LIFA since LINX has replaced LIFA.  The link you provided is actually LIFA getting started instructions.  Instead use these.  Please post on the LINX fourms if you have any additional questions about LINX.

Thanks!

-Sam K

LabVIEW Hacker

Join / Follow the LabVIEW Hacker Group on google+

0 Kudos
Message 4 of 6
(3,305 Views)

I cannot use it on Arduino Mega board. I tried all possible solutions but no success. LIFA works well in my case but not the LINX.

RY

RY
0 Kudos
Message 5 of 6
(3,305 Views)

Ok, that tutorial makes much more sense...
I guess NOW I'm using LINX.

SCXI- 1000 Chassis w/ 1346 adapter
PCI 6281 DAQ card
SCXI- 1520 Bridge Board w/ 1314 Terminal Block (x2)
SCXI- 1180 Feedthrough Panel w/ 1302 Block
Signal Express 2014.
Win7 Enterprise
0 Kudos
Message 6 of 6
(3,305 Views)