Student Projects

Showing results for 
Search instead for 
Did you mean: 

Analog Discovery Toolkit for LabVIEW by Digilent not support I2C & SPI protocol


I doing with AD2 on LabVIEW 2015, I'm using Analog Discovery Toolkit for LabVIEW by Digilent. But I can not find any API for I2C, SPI protocol. Could you please help me find this API or support me build this API for LabVIEW ?



NI Employee (retired)

Hi Duong,


Unfortunately the AD2 API does not have pre-built VIs for SPI or I2C. You can test it out and see if a home-made protocol would be feasible. The one warning that I have is the API would use a series of DIO calls to the AD2. These calls will have to be strictly timed to meet the timing requirements of the protocol. However, the AD2 is not an embedded target so the timing will not be deterministic and will be susceptible to other bus traffic or other Windows operations causing the timing to be inconsistent. 


If you would like additional advice on how you might go about creating these VIs in LabVIEW I recommend posting to our Discussion Forums where we have engineers and a wide community of LabVIEW experts monitoring posts and ready to post helpful information (as long as you provide enough information!). 


My recommendation: the AD2 is best suited for interrogating digital lines rather than sending out protocol commands like you would normally see in an embedded target. The myRIO is probably your best bet for consistent, reliable I2C or SPI communication. If you want, the latest version of Waveforms does include an application for protocol analysis using the AD2.

Brian H. -- Electronics & Measurements Product Marketing Manager

Hey guys,


Sorry to revive this old thread, but it seems to be the only one available on the topic of implementing SPI or I2C protocol on AD2.

So, I had the same task - make AD2 work as an I2C master from LabVIEW.

There's no API from Digilent (Why - beats me...)

After some poking around, I found that the protocols ARE implemented in their WF SW, so it's doable.

Then I found declarations and an example in py. This should be enough for you to implement dll calls in LV as well.

For whatever reason, I cannot attach these examples to my reply, so I attached them to original post.


If I ever get to implementing it myself, I will post API.

You can do greater things with LabVIEW!