LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming NI-8451USB- I2C interface

Hello,
 
I have just installed the software for thew NI-8451 and am able to see it in MAX.  When I attempt to use Labview 7.1.1 to program it the VISA reference is blank, nor reference is available with the following error message:
Error -301706 occurred at NI-845x I2C Write Read.vi
Possible reason(s):
NI-845x:  The device reference is invalid. Verify that the supplied device reference contains a valid device name.
 
Is something else I need to do?
 
Thanx,
Karl
0 Kudos
Message 1 of 9
(6,969 Views)

The

NI-8451 driver does not support automatic detaction within the VISA Control.

Open the MAX (Measurement and Automation Explorer) and navigate to the USB devices

Click on the device and change the alias name to something easy (for example I2C), Save the changes !!

Then write this alias to the VISA control manually.

Now it should work.

 

DirkW

Message 2 of 9
(6,948 Views)

I get no data from my usb-8451.

And i don´t  know what to do with the EEPROM start adress in the example-program.

What can i do with this error-message:

NI-845x: The slave did not acknowledge an address+direction byte transmitted by the I2C master. Reasons include the incorrect address set in the I2C configuration or the incorrect use of the 7-bit address. When entering an address to access a 7-bit device, do not include the direction bit. The NI-845x Basic I2C API internally sets the direction bit to the correct value, depending on the function (write or read). If your datasheet specfies the 7-bit device address as a byte, discard the direction bit (bit 0) and right-shift the byte value by one to create the 7-bit address.

The example programm doesn´t allow to change the device adress, which is 0x50.

What should i do?

 

thanks for your help!!!!

0 Kudos
Message 3 of 9
(6,917 Views)

Hi shifti

The error message you got tells us that the First Byte sent to your I2C Bus, which is usually the Address Byte, got no Acknowledge by your Slave device. This can be related to the address you have specified or to an electrical problem with your connections.

To the address: The 24LC512, which is the device we are using in the example uses 7-bit addressing and the addressing scheme is 1010nnn, where nnn is the configuration of address lines A0, A1, and A2. This example assumed that these lines are connected to ground, so the default address is 0x50. Depending on how the A pins are connected(refer to the spec for your Slave) there is a addres range from 50 to 57 for EEPROMSs.

To the electrical: The example assumes that the Microchip 24LC512 EEPROM is connected as follows:

     NI 8451           Microchip 24LC512
-----------------     -------------------
Pin 31 (+5V)              Pin 8 (VCC)
Pin 32 (GND)              Pin 7 (WP)
Pin 30 (SCL)               Pin 6 (SCL)
Pin 29 (SDA)              Pin 5 (SDA)
Pin 32 (GND)              Pin 4 (VSS)
Pin 32 (GND)              Pin 3 (A2)
Pin 32 (GND)              Pin 2 (A1)
Pin 32 (GND)              Pin 1 (A0)

In addition, since the I2C SDA and SCL lines are open-drain, they must be externally pulled up to +5 V by connecting a 2.2k or 4.7k resistor between SCL and +5V (pins 30/31) and SDA and +5V (pins 29/31).

hope that helps

DirkW

0 Kudos
Message 4 of 9
(6,886 Views)

Hello,

   Thanks for the info about how to use the alias name in Max to get the device reference for the NI-8451. How can I "hard-code" the alias name into the drop down box so that I do not have to manually enter it every time I start the program?

 

Regards,

 

Kaspar

 

Regards,


Kaspar
0 Kudos
Message 5 of 9
(6,288 Views)

Hello,

   I did what you said about using MAX to create a entry and manualy enter the alias name into a drop down box, it works! How can I hardcode this value into the drop down box so that when I create a executable file for users that thye do not always have to enter in the same value in order to get the program to work?

 

Regards,

 

Kaspar

 

Regards,


Kaspar
0 Kudos
Message 6 of 9
(6,269 Views)
Hello,
 
   A co-worder told me how to set the default value of the pull down box. Just go to the block diagram, right set on t it, and select set as default value. It works for me.
 
Regards,
 
Kaspar
Regards,


Kaspar
0 Kudos
Message 7 of 9
(6,259 Views)

Hello,

        I am trying to use USB-8451 I2C functions via MAX (Measurement & Automation Explorer) VISA Test Panel. Does anyone of you have such experience ? Please share with me. How can I access USB-8451 I2C functions via MAX (Measurement & Automation Explorer) VISA Test Panel ? Your help is highly apprecaited.

        By the way, I also tried to use compiled function (*.dll) to control USB-8451. I followed the examples to execute I2Cwrite function and I got correct return value (0). Why can't I see any signals coming out from SDA or SCL port using a oscilloscope ? Is there anything wrong ? How to access the USB-8451 I2C functions correctly ? Thank you very much.

0 Kudos
Message 8 of 9
(5,836 Views)
0 Kudos
Message 9 of 9
(5,831 Views)