InpOut32 is an open source windows DLL and Driver to give direct access to hardware ports (for example the parallel and serial port from user level programs..
Dear Megan, I'm working now since 1 year and a half with CVI, and have no problem with common RS232 transmissions between 2 devices (using callbacks, timeouts.). I will read the pages you sent me, just in case I missed something. As the first post, I'd like to emulate an I2C bus with the pins available on the serial port: RTS, DTR etc. The goal is to create a GUI to program small I2C memories used with some of our products. As our customers will do this operation, I can't use the free software solutions available on internet, like this one: I don't want our customers to edit the memory in hexadecimal mode.
![Inpout32 Dll Serial Port Examples Of Resignation Inpout32 Dll Serial Port Examples Of Resignation](http://members.tripod.com/~skennys_outpost/pportreader/image004.jpg)
You will see on the page above that people already emulate I2C bus on the serial port since several years, so they are able to emulate the I2C clock line (at a frequency of 100kHz). I'm just wondering why I can't, and how I will be able to do this in CVI. I found several pages and program source code about the programming of serial ports to emulate an I2C bus with Linux (but I have to use Windows platforms), or with Visual Basic and MSCOMM.OCX library. But nothing helps for CVI or Windows API. Regards, Pascal. Hi Pascal, There isn't any direct calls to make a serial port simulate I2C communication. I did notice that you said you were using a USB to Serial converter.
If you are planning on using this you might look into the. It was made for I2C/SPI communication and has a documentation and function calls to do exactly what you are wanting to do.
I thought this might be something you could look into while I am trying to find out more information about the possibilities of using Serial to communicate to an I2C device. Dear Krista, Thanks for your answer. I sure that I can build up an adaptator between the NI-USB-I2C OEM card and my product, and that it will perform as needed (we often use NI acquisitions cards here). If I try to use the serial port as some others, it's mainly a matter of price, and circuits simplicity. I've found to web pages today: The first one is a tutorial about serial ports, from Microsoft: The second one explains how to use.NET 2.0 class named 'SerialPort': In the first one, I read that usually the Windows drivers keeps the control of DTR and RTS lines, it can explains the 'delays' when I try to switch them 'by hand'. The second one is interresting, because the.NET class allows to access virtual/USB serial ports. Before to try, I have to learn a bit how to use.NET classes in CVI (I know it's possible).
But I'm not sure it will gives better results. Regards, Pascal. Hi, Finally I succesfully tested a complete CVI program to talk I2C over an RS232 port. All the program is in C/CVI (but the solution may be reprogrammed with Labview),. I2C lines are done by controlling RS232 control lines with the Windows API functions as explained before,.
It works for true RS232 port, and also for virtual COM ports (USB to RS232 adapters, like FDTI FT232R component),. I tested it on the PCF8574 component, DIP switch and LEDs (this component allows to control 8 DIO with an I2C bus).We can even use the /INT port of this componant connected to the 'RING' RS232 line as an interrupt to avoid continuous reading over the I2C bus.
I can't gives the code as is it for my job. These are the performance obtained:. RS232 hardware port: 22kHz for the SCL lineup to 2200kB/s as about 10 bits have to be transmitted for 1 byte).
![Examples Examples](http://www.nitehawk.com/w3sz/w3szProject1.jpg)
RS232 port over USB: 150Hz for the SCL line (about 8 B/s, yes, it's SLOW, but it works). If a 1ms delay is added after each SDA or SCL, the SCL frequency is about 100Hz. The SCL frequency may vary a lot with the processor and disk usage of the computer. I don't recommand a such solution if a lot of data have to be transmitted. But the RS232 to I2C circuit is cheap and perfect to command slows devices as LED, lamps, motors, or readslow variation of temperature and so on. If you want a reliable I2C bus, you should look for the FDTI FT2232 chip (USB to 2 RS232). This compagny gives free DLL for create various protocols with this chip (JTAG, SPI, I2C), and allows fast communications, as you can adjust the clock line up to several MHz.
Regards, Pascal.
Parallel Port Programming with Delphi This article demonstration how to access parallel port with delphi 6. To access parallel port for all Windows platform i use driver file inpout32.dll becuase it easily to use with delphi.You can dowload from and it included in the example which you can download at the buttom of this page. PC Parallel Port Basic As we know the standard parallel port have 3 port for controll 1. Status port 2. Control Port 3. Data Port each port have own address like this.