01-06-2009 01:03 PM
01-07-2009 09:16 AM
Hello Clayton,
I would recommend using NI-VISA to communicate with the parallel port. When you install this API, be sure to select support for LabWindows/CVI in order to obtain the VISA library. You may want to check if you already have this support by determining whether the VISA library is presently available to you. Your parallel port will be mapped to a resource string that you can use with the VISA functions. This resource string can be found in Measurement & Automation Explorer.
01-07-2009 12:57 PM
I have the VISA library installed. Are you referring to the viWrite and viRead functions to accomplish communicating with individual lines on the parallel port? How would I set the parameters?
Could I use WriteToDigitalLine and ReadFromDigitalLine functions? Thanks
01-07-2009 04:39 PM
See the link below, it may help:
http://forums.ni.com/ni/board/message?board.id=180&message.id=29526#M29526
Also, the parallel port mode may be important. You can check and change it from your PC's BIOS.
Try changing it to "Output Only" or "Bi-directional" according to your application.
01-07-2009 05:25 PM
Thanks you for the reply, this may work. If I need to send a logic 1 on pin14 of the parallel port I would just use "outp (0x378, 0xD)"? Does this explicitly set all of the other channels to 0?
I also need to read pins 12 and 13 simultaneously after sending the logic 1 on pin 14. Can I do this with inp? I really appreciate the help
01-08-2009 12:38 AM
Hi Clayton,
That's NOT correct. The output pins of the parallel port are between 2(lsb) and 9(msb).
You cannot control pin 14 as ouput and I thnik you misunderstood the connection between the data (the second parameter to the outp function) you write and the pins effected.
The data byte is 8 bits and each bit correspond to a pin from 2 to 9. So writing 0x0D = "0000 1101" to the port will send a logic 1 to pins 9,7 and 6.
The attached drawing may help to clarify further.
I also recommend a little reading from the internet. You can start with: http://logix4u.net/Legacy_Ports/Parallel_Port/A_tutorial_on_Parallel_port_Interfacing.html
Hope this helps.
08-13-2010 12:12 AM
BACLI,
I am working on Porting project from Windows 95 to XP platform.
In windows 95, we had used CVI 4.0 for developing the test application, in which we used outp and inp functions to communicate with parallel port.
will same outp and inp functions can communicate with parallel port directly under XP with CVI7.0? If not, Do I need to write any low level driver application to bridge the gap between inp&outp functions to parallel port? and one more thing I haven't loaded any external low level drives in my present code but still CVILowLevelSupportDriverLoaded () function is returning "1". your help is really needed to move forward.
Regards,
Ramesh
email ID: ramesh.meka@Honeywell.com, please forward your reply to this email ID.
08-16-2010 12:43 PM
Hi Ramesh,
The CVILowLevelSupportDriverLoaded() function should return a 1 if the driver is loaded, and the driver should be loaded automatically by CVI at startup, if the driver is present on the system. Since the driver is present, you should be able to call the inp and outp functions in your code. Have you been able to test this yet?
Best Regards,
John M
08-16-2010 11:39 PM
Yeah John....It's working now....I could able to communicate with parallel port with inp and outp functions. Thank you so much for your inputs.
Regards,
Ramesh
08-17-2010 02:21 AM
Hello
i need to read and write the parallel port. In the past we use the LPT on board and so was enought read the 0x378 addres with inp.
Now we dont find anymore PC with onboard LPT and we need to add one PCI card with LPT, but the addres is not more 0x378.
How can i read the LPT status and write direct to the port ?
Thanks