LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW I2C bus monitoring

Hello fellow programmers, 

 

I'm testing a device that has an i2C bus with a master and 3 slave devices.

I've been exploring all example vi's I can find for my NI-4852 USB/i2C device, but all these examples either configure my device like a master or a slave. Neither of these options are good because I need to be in "invisible" mode only monitoring ALL communications that happen on the i2C bus. Here's a simplified example of what I would want a log to look like:

1. Master writes to device 0x19 {give me register 0x25}

2. Slave 0x19 answers with the value in register 0x25, and Master Reads it. (its a 0x00)
3. Master writes to device 0x5A {give me register 0x27}
4. Slave 0x5A answers with the value in register 0x27, and Master Reads it (its a 0x0B)

As you can see, I basically need to detect ANY communication happening in the bus, so I can't be a master or a slave in a fixed device address or register, I need to act more like a "sniffer". I'm already able to do this with a 3rd party device and it looks pretty simple (I attach a picture), I just need to do it inside labview so I use all this i2c activity to pass/fail the UUT.

I would appreciate any help or pointing in the right direction. Thanks!

 

 

0 Kudos
Message 1 of 5
(3,108 Views)

I dont think the image attached on my initial post so here's what the log looks like in a Saleae Logic Analyzer

0 Kudos
Message 2 of 5
(3,103 Views)

I know you can do that with an Arduino.

 

But don't use LINX, use the native Arduino language and VISA to communicate with it just like any other device on a serial port.

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 5
(3,049 Views)

Thanks for your input,

 

Would an Arduino UNO do it? do I need additional Hardware? I've researched some Arduino i2c modules but same as the NI 4852, they don't necessarily specify if they can be used in a "passive mode", the ones I've found have actual salve addresses so I imagine it would be the same case :S Any recommendations on specific Arduino Hardware?

Thanks a lot!

0 Kudos
Message 4 of 5
(3,028 Views)

As an alternative you can use the Saleae API

for your existing hardware to get the data into LabVIEW. 

 

"Existing customers have also used the socket API with Python, Labview, C++, and other environments and programming languages" as stated on the web page. I haven't done this but it does look possible.

 

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 5 of 5
(3,009 Views)