ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C 8451 Write Read Issue

Hey everybody,

 

I'm having some issues getting the USB 8451 to work properly.  I currently have connected a MEMS accelerometer using I2C and I'm trying to simply read the WHO_AM_I register to make certain everything is working properly.

 

The address for this device is 19 (hex) while letting the software take care of the final bit for write/read.

The clock rate is set to 100 kHz.

 

The WHO_AM_I register is 0F, but the generic I2C Read.vi won't allow that value.  When I run the VI, I don't receive any errors.  I have had errors before that were quite clear (lack of bus seizure, improper address, etc.).  Can anyone help explain why I can't modify this file at all or point me towards a more in depth and robust Read/Write VI?  Thanks for your time.

 

=Chris

 

Accelerometer Datasheet 

http://www.st.com/stonline/products/literature/ds/15094.htm 

0 Kudos
Message 1 of 4
(3,040 Views)

When I open up the Write Read.vi that is part of the larger sample VI, I notice the number of bytes to read is set to 0.  When I change it to anything other than 0 and run, I receive the error code -301742 in the error out window.  I have no idea how to diagnose this because no text accompanies the error message.

 

=Chris 

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

Klepackage,

 

Write Read.VI where did you get this?  As far as the error this forum as some good information that I think may apply.  Does this application work other than trying to read this register?

Sincerely,
Jason Daming
Applications Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 3 of 4
(3,004 Views)

Jason,

 

I was tinkering around with the General I2C Read.vi.  When you double click on the icon that says 845x I2C (has glasses and a pencil), it opens up a clone of NI-845x I2C Write Read.vi.  That is what I was referring to.

 

=Chris 

0 Kudos
Message 4 of 4
(2,983 Views)