LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 8451 for I2C

Solved!
Go to solution

Hello,

 

I am looking for a starting point.

 

My problem is I need to communicate with the PCA9555 (http://focus.ti.com/lit/ds/symlink/pca9555.pdf). I have searched the NI website and have come across a USB-8451 that seems to be the answer to my problem.  However, I need to also measure current and this device seems to lack that ability.

 

First off, would this be the device I would want to use to communicate via I2C? The only reason I question this is because I cannot access the examples that would give me a good sense that I found what I was looking for.

 

Secondly, is there a device like this offered by NI that would be able to communicate via I2C and be able to measure current? Or do I have to purchase 2 separate devices?

 

Thirdly, is there anybody out there who has encountered the same problem (possibly with the same PCA9555)? 

Thank you,

 

Gerardo Hernandez 

0 Kudos
Message 1 of 17
(7,867 Views)

The 8451 is just a communication device. It will be able to control that chip, but it cannot measure current. I am assuming you want to measure the current of each output? To do this you will need to use some sort of DAQ device. NI offers many. If you're having trouble picking one then just contact your local NI sales rep.

 

Note: I do not know what your programming experience level is. If you're fairly adept, then an alternative to the 8451 is something like the Diolan U2C-12. It is much less expensive than the 8451, but it uses a DLL, which means you would need to write wrapper VIs to control it. We have several of these in our lab, and I have written the driver VIs, but unfortunately I cannot distribute them due to company proprietary issues. 

0 Kudos
Message 2 of 17
(7,857 Views)

Thank you for your quick response. I could not find any examples for using the 8451.  Do you know if the examples are shipped with the device or can I find some online? I went through labview>hellp>example finder>hardware but found nothing

 

Thank you in advance

 

Gerardo Hernandez 

0 Kudos
Message 3 of 17
(7,845 Views)

The drivers are available here. I believe the examples are installed with that, but I can't be sure since I don't have one of those devices.

 

One additional note: Since you need to do some current measuring, and will thus need to get a DAQ card, an alternate solution is to get a DAQ card with some digital I/O and implement the I2C interface using the old-fashioned bit-banging method. In fact, I2C/SPI interfaces such as the one from Cal-Bay, which use the parallel port, do exactly that. 

0 Kudos
Message 4 of 17
(7,833 Views)

Hello,

 

I have a USB-8451 on my desk in use, and for ease of use in LabVIEW, you cannot beat it; some example code from one of my apps:

 

i2cInitCode.PNG

 

Here I am just transmitting an constant sequence (an initialisation sequence for my hardware) to a Slave with address 112 (actually an I2C bus all-call address for my devices).

 

If you want to keep things easy, I would suggest 2 seperate devices, one being a USB-8451. You can bit-bang I2C, etc at the cost of complexity and dev time.

 

 

 

0 Kudos
Message 5 of 17
(7,828 Views)

macaba wrote:
 

I have a USB-8451 on my desk in use, and for ease of use in LabVIEW, you cannot beat it;


Well, that's debatable. But, you are from NI, so I can understand the slightly bias. Smiley Wink Don't worry, I'm just needling you. 

0 Kudos
Message 6 of 17
(7,825 Views)

Smercurio_fc,

 

I have done some more searching and came across another device that converts from I2C to either RS-232 or USB.  I have attached a PDF of this device below.  It comes up as a comport in hareware manager. I think this device is sufficient for my communication and am planning on purchasing the usb-6008 for my data acquisition.

 

Does LabVIEW have an API to support this device or any device of this nature? I would think so because it shows up as a comport.

 

Macaba,

 

The code that you posted is what I am looking for in terms of getting started.  Would you be so kind as to elaborate on the function of the numeric array as well as how to pull up those icons?

 

Thank you,

 

Gerard

0 Kudos
Message 7 of 17
(7,809 Views)

I forgot to attach the PDF. Here it is

0 Kudos
Message 8 of 17
(7,807 Views)
That device isn't actually converting serial to I2C. It simply has a serial interface so you can send commands to tell it what to send/receive over I2C bus. I'd guess it has a small microcontroller or perhaps an FPGA inside. It will probably work for you, and the price is quite reasonable. If you want to use the serial interface then on the LabVIEW side you would use VISA to send commands to it and read what it has acquired over the I2C bus. Several examples ship with LabVIEW on how to do serial communication using VISA. The USB interface will likely be a DLL, like the Diolan that I had mentioned earlier.
0 Kudos
Message 9 of 17
(7,804 Views)

I am now using the I2C 2 PC device mentioned above but I sometimes get a "Error -1073807253 occurred at VISA Read Possible reason(s):

VISA:  (Hex 0xBFFF006B) A framing error occurred during transfer."

 

What is this attributed to? the port settings are as follows

 

9600 baud rate

8 data bits

no parity

1 stop bit

no flow control

0 Kudos
Message 10 of 17
(7,787 Views)