LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino in SubVI

I'm doing the tutorial at http://cnx.org/content/m12209/latest/?collection=col10241/latest to refresh my Labview knowledge and as I dont have a DAQ I thought I'd try and use an Arduino.  The core functionality is working, but I wanted to create a connector allowing me to use the module as a SubVI in other systems.

My VI looks like this:

thermometer2d.png

The connector contains three terminals - the Stop signal, the C/F switch signal and the temperature.

If I insert it in a VI with 2 constants for the C/F switch and stop and an indicator on the temperature it doesnt run.  The execution switches to the SubVI but it seems to wait there.

I suspect this has something to do with the arduino init.  Must this be in a top level and the arduino resource passed down once?

If I take out the while loop, it the top level VI runs, but very slowly as I presume the arduino is initialised and stopped every time

Any ideas how this should be setup?  If I used the DAQ Assistant in a SubVI then I think it would have worked fine.

0 Kudos
Message 1 of 2
(5,869 Views)

I would recommend not making the entire thing into a subVI.  If you really want to put it all in one VI then you would need to not close the arduino unless the stop terminal is true and then not initialize the Arduino if it's already initialized.

0 Kudos
Message 2 of 2
(2,923 Views)