LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LIFA Analog Port Read to Spreadsheet File

I am new to LIFA and would like to perform a "analog port read" on all six analog inputs, graph the values and write these values to a spreadsheet file. I would like to perform this operation every second to every six minutes depending on the type of test. Does anyone know of an example that will lead me in the right direction?

Thanks,

Jim_H

0 Kudos
Message 1 of 4
(5,790 Views)

You quest sounds very simple and shouldn't be hard to do.  Once you have LIFA working with Arduino, the rest should be trivial.

Init.vi

Start Loop

Read Analog Port

Plot Data, Write to Spreadsheet

End Loop

Close.vi

If you have any issues with LIFA and Arduino, attach your VI saved for LabVIEW 2009 here.

If you have issues working with the spreadsheet stuff then you should look for examples (first check the examples that come with LabVIEW).  If you are still unable to figure out the spreadsheets then you should search the main LabVIEW forums for advice (you can simply google it and you will likely find enough infor).

0 Kudos
Message 2 of 4
(3,001 Views)

Nathan_B,

Thanks for the response.  The code is working very well.  I would like to incorporate data from an SHT15 digital temperature & humidity sensor in additiona to the six channels of analog input data.  In Arduino this is usually done by using a library of function calls for the device. 

Do you have any hints on how this might be done in the LIFA environment?

Thanks,

Jim_H

0 Kudos
Message 3 of 4
(3,001 Views)

Jim_H wrote:

I would like to incorporate data from an SHT15 digital temperature & humidity sensor in additiona to the six channels of analog input data.  In Arduino this is usually done by using a library of function calls for the device. 

Do you have any hints on how this might be done in the LIFA environment?

My advice will depend on how these devices communicate.  LIFA has both I2C and SPI capabilities.  So, your sensors use either one of these then you would not be required to modify the firmware and you would have to "recreate the library" in LabVIEW using the LIFA functions.

If they don't communicate with one of these protocols or as an alternative, you would need to add custom functions to LIFA.  In this case you would include your library in the firmware and write a custom LIFA function in the main switch() statement.  Then, you would need to create a LabVIEW function that will talk to Arduino via the LIFA protocol that then calls your new function.  For this method, I recommend duplicating a function that is similar to yours (as far as LIFA and sending back information to LabVIEW goes).  Something like "Analog Read Pin" for example.  Make sure you have it duplicated and working as expected then you can add your library functions into that new case statement.

The complexity of using either method described above can vary greatly.

EDIT:  I just glanced at the datasheet and it says that you cannot communicate with it using I2C.  So, the second option I detailed above is the one you need to use.

0 Kudos
Message 4 of 4
(3,001 Views)