03-20-2016 02:34 PM
Hello,
I am new to the forum, so I appologize for anything I do that may be frowned upon.
I am working on a project for school where I am trying to communicate with a ADT7470 IC through a Silicon Labs CP2112 USB to SMBus/I2C dev kit. I am fimiliar with Labview, but when it comes to things like this, I get a little lost. I was wondering if anyone here could provide some help to get me started or tell me this isnt possible. I believe that I need to use the NI VISA USB Contol In and Control Out to make this work, I Think. I appreciate all the help and Thank you.
CP2112 dev kit: http://www.silabs.com/products/interface/Pages/CP2112EK.aspx
03-21-2016 06:51 AM
I2C bus devices like the one you mention can be interfaced by a lot of standard interfaces. NI also sells an i2c interface but rather expensive.
An alternative is the https://wiki.openwrt.org/doc/howto/usb.i2c-tiny-usb
Not really the easiest page but very cheap. Maybe even to buy somewhere.
If you need more info on how to interface in LabVIEW with i2c just ask.
03-21-2016 06:11 PM
03-23-2016 09:15 AM
Hi jdl,
It looks like there is a Windows dll that comes with the CP2112 kit, or you can download it from the Silicon Labs website. After installing the software, you should be able to import the dll into LabVIEW. This article explains how to do that:
How Do I Call a Dynamic Link Library (DLL) from LabVIEW?
http://digital.ni.com/public.nsf/allkb/DCB90714981A1F148625731E00797C33
This will create VIs for the functions in the dll that you can then make calls to in LabVIEW.
J. Calvert
Applications Engineer
National Instruments
03-31-2016 08:39 AM
03-31-2016 08:40 AM - edited 03-31-2016 08:44 AM
If there is a good example to access a USB device and send it commands with custom VIs, that would be awesome. If there is something I can read and learn from I should be able to figure this out.
03-31-2016 08:41 AM - edited 03-31-2016 08:45 AM
Sorry, extra post
03-31-2016 09:58 PM
Ok so I figured out to import the DLL and make calls to them, The only issue now is doing the write and read to the CP2112 which in turn will be sent to the ADT7470. Do I need to use the VISA Open to see the device, and what do I use to write the information to it. Thank you for your help and I really appreciate it.
04-01-2016 09:33 AM
LabVIEW can make calls to the functions in the SLABHIDtoSMBus.dll API. All of the functions are outlined in a document called AN496 that is included with the library. These functions are all you should need to open a connection to the device and write to and read from it. You shouldn't need any VISA calls. Also read throug the user guide for the CP2112 to figure out which calls to make.
J. Calvert
Applications Engineer
National Instruments
04-02-2016 09:48 PM - edited 04-02-2016 09:56 PM
Ok so messing around with CP2112 program provided by Silicon Labs. I have wired the CP2112 to the ADT7470. With the Silicon Labs program, I was able to commuicate with the ADT7470 for both read and write. As I perform these operations, the program tells me what function it calls as it goes along, which is awesome. I figured I can use the same order in Labview to perform the same operation. Now, my question is what is the proper way to wire these function together. I was able to import the dll file and header file to create the VI's. How do I wire these Call Library Function Nodes together.
For example, the CP2112 program uses the HID_SMBUS_OPEN();, to connect to the device, then HID_SMBUS_READREQUEST();, to request a read to a certain slave address. Then, HIS_SMBUS_WRITERQUEST();, to write to a certain address on the slave advice, and finally the HID_SMBUS_READRESPONSE(); to read the response of that address. This worked and all I did was read the value of a register in the ADT7470. So how would I wire all these functions together in Labview to perform the same process. I'm just claifying, because I would like to make sure I'm doing this right. Thank you for all your help, I really appreicate it.