07-30-2007 03:04 PM
07-30-2007
03:23 PM
- last edited on
11-19-2025
05:27 PM
by
Content Cleaner
Do you actually have an I2C interface board, or are you directly connected to the parallel port? Where did you get this GUI?
If you have an interface board you should first check with the manufacturer of the I2C interface board that you have to see if they have LabVIEW drivers or a DLL (for Windows). Chances are they will at least have a DLL as that is what the GUI is probably using.
If you're directly connected you will need to write your own code to basically do bit-banging to set the SCL and SDL lines. You need to remember that for the parallel port you have to write out an entire port's value, which is 8 bits. To do this you can use either the "In Port" and "Out Port" functions or VISA. For the "In Port" and "Out Port" there's an example that ships with LabVIEW. Open LabVIEW and go to Help->Find Examples. Switch to the "search" tab and enter "parallel" in the search box. Open the "Parallel Port Read and Write" example. For VISA take a look a this example: https://forums.ni.com/t5/Example-Code/Using-VISA-to-Access-the-Parallel-Port-in-LabVIEW/ta-p/3996020
07-31-2007 12:53 PM
Thanks sm,
Well i dont have a direct I2C interface board, its a simple PCB on which the IC is mounted. this IC uses I2C. so on the pcb there is a dongle that is connected to the parallel port of the PC. We have gui which is developed in-house which is used to prog, this part and communicate with it. I would like to know what kind of bit-banging i need to do in order to communicate with the IC, I am going through the examples that you have suggested, any lead on this one will be great and helpful.
Looking forward for help.
Thanks a bunch.
Regards
RKD
07-31-2007 04:06 PM
02-15-2011 05:02 PM
Hi there,
I am trying to use my cRIO for I2C communication.
I am following the NI document 'Implementing I2C Comunication Protocol in LabView FPGA'.
I am using two DIO lines from a 9401 card to connect with the SDA and SCL lines of the I2C bus in the device.
The first thing is: How can I configure the 'Digital Enable' function? Each DIO line has only two state: read/write (input/output). I don't know if there is a 'Digital enable' state for this card.
The second thing is: did anyone succeed by following that document for I2C communication?
Users pointed out two obvious error in the code. Other than that, is it working?
Thanks
Z
02-16-2011
05:17 PM
- last edited on
11-19-2025
05:28 PM
by
Content Cleaner
Hey zzyin,
It looks like that option is not available for the 9401. However, I simulated a 9403 and it gave me that option, below:
Digital enable allows you to write data (very slightly) faster, because you can set the output as enabled and then write data--an IO node will always make sure the output is enabled first.
I've found a few other bits of sample code which might help you:
http://zone.ni.com/devzone/cda/epd/p/id/4063
http://zone.ni.com/devzone/cda/epd/p/id/3975
This document may also help:
https://www.ni.com/en/shop/labview/understanding-the-i2c-two-wire-bus-interface-with-ni-labview.html
I hope that explains the purpose and helps you get around the digital enable items in that tutorial.
Thanks
02-16-2011 05:29 PM
Hey, looks like I was somewhat wrong. Because it is the 9401, you have to enable/disable entire nibbles, like so:
Apparently (according to the LabVIEW help), using an I/O node does not automatically enable or disable output. This method node, configured for the 9401 (pop down a property node, right click, select item>>fpga>>9401) is how you enable or disable a nibble.