07-08-2013 03:50 PM
Rewired to set to 0x1D and thgen updated the VI to post the three bit sequence. No success. I'm working with Arduino 1.0.4 and an Uno r3 with LabView 2012 and an ADXL345EB. Nothing seems out of place but I can;t get any data to transfer between the Uno and LV, when I insert probes everything comes up as zeros...
Modified VI attached
07-08-2013 05:48 PM
I'm quite sure that I figured out what is going wrong. It is actually quite trivial but LabVIEW won't let me fix it. I'll let you know when I figure it out.
07-08-2013 08:16 PM
Ok, I got it fixed. Go and download the library again (v1.1.2) from the original document.
12-04-2013 05:01 AM
Hi all! I'm reading this forum to study i2c communication. Could someone explain me why the I2c Write Express VI takes an input made by register address and data value combined in "build array" function? Thanks,
Regards.
12-04-2013 01:03 PM
Building the array in the I2C subVI is how LIFA sends the data to the Arduino. To interact with the I2C sensor, you need to specify the device address (to know which device on the bus to talk to), the piece of information that you want to access on the sensor (register address), and sometimes some sort of information to give to the sensor.
12-04-2013 01:20 PM
Thank you so much Nathan. So the input "I2C Data Bytes" is an array that I realize appending the information to register address? Can I found any documentation about the I2C Express VIs for Arduino? Thanks again.
12-04-2013 01:47 PM
Just to clarify the LabVIEW nomenclature, the VIs that you use with LIFA are not "express" VIs (Click here for a definition of an Express VI). They are simply called subVIs.
Anyways, the first place to look for information about any VI or subVI is the Context Help window. If you are unable to fully understand it from that, go to the Detailed Help page if available (afaik, the LIFA subVIs don't have a detailed help page). If you still don't understand it, the only thing that you can do is start looking at the code. However, with LIFA, you will probably also need to learn how the firmware handles the code as well in order to understand the complete functionality because the firmware is where the I2C communication is actually occuring.
So, I would describe the inputs to the I2C write subVI as follows:
where a "byte" is simply an array element.
12-05-2013 04:39 AM
Thank you Nathan for this great explanation. If I can, I have the last question: the image in the previous page represents the using of "Index array" and "Join numbers" functions. Why the first output of Index array is the second input of Join numbers (it's the same question for the second output)? Is it a left-justifying implementation?
12-05-2013 09:35 AM
If you send the least significant byte (LSB) first and the most significant byte (MSB) second, then you need to use them in the appropriate order. So, if you are writing the firmware function yourself, you can choose to send them back in any order you like and then use them accordingly in LabVIEW. Some sensors may send the LSB first and others the MSB and it is often convenient to just send them back to LabVIEW in the same order as the sensor sends them to Arduino. But, when you write your own LIFA function, you can choose to do it how ever you like.
When using I2C directly from LabVIEW, you don't really have a choice and have to accept the data in the order that the sensor returns it.
12-13-2013 02:03 PM
Well Nathan, your help was very useful. If I want to read data from LSM303 in registers that give me Low and High value (for x,y and z axes) with "I2C Read", how can I communicate to this subVI the Slave Address, the address of six registers (low and high for x, y, z) and the number of bytes to read? is there a way to create a list of register that I use as input? Thanks, best regards.