Control Parallel Port using Python!

Hello, I've coded a new library for python which only purporse is to control the parallel port natively. It uses a C lib ported to python by me(although the C functions to handle this are really simple, all credits go to its original author Juan Gabriel del Cid Portillo) and what I like more about it in python is the interactive mode it offers! check sample code and more information at http://devpower.blogsite.org (in spanish).
By the way, this is for linux only by now, windows is supported too but I don't have a windows system to compile it, if you want to you can compile it your self since the code for the C lib is included. I hope anyone can find this useful (say goodbye to pyparallel! no more Java deps!). Direct Download Link: http://devpower.blogsite.org/data/files … arport.zip
Edgar Merino

This is a frequently asked question. I'd dare say it probably gets asked once each month. You should look at this article:
Using VISA to Access the Parallel Port in LabVIEW
In a nutshell: You have to write/read by port. You cannot read/write by bit. This means that if you want to change the value of a single line you have to read the current value of the port, mask it to get the new value that has the line you want changed, and then write out the new value of the port.
If you also do a search in this board, or on the NI site for "parallel port labview" you will find lots of hits.
Message Edited by smercurio_fc on 04-09-2007 04:18 PM

Similar Messages

  • Controlling XY stage connected to parallel port using labview

    Hi,
    I have a XY stage which I can control using mach3 software. I want to control a signal generator, VNA and the XY stage at the same time. I have programmed SG and VNA using Labview but I am having difficulties controlling XY stage using Labview. I have never controlled an instrument connected through parallel port using labview.
    Can anybody give me some ideas to start with? How do I use VISA to control the parallel port? I really appreciate your help. Thank you in advance.

    Hi srms,
    Since your question is related to using VISA, I would try posting your question on the Instrument Control Board. You're likely to have better luck there.

  • Parallel port use Lookout

    Does anybody know how to read/write through the parallel port with Lookout 5.0? Is there any example code for this?

    Hi,
    It is possible to send bytes to the parallel port using the ASCII object within Lookout. However, it is presently not possible to control the state of the individual bits on the parallel port with Lookout.
    If you need to control the individual bits on a parallel port, consider using LabVIEW. It is much more powerful when programming serial and parallel ports.
    Remzi A.
    National Instruments

  • "how to read parallel port using labview"

    "i am doing a bio medical project and need to read data from parallel port using labview. can anyone help me"

    Hi
    in most cases a simple example helps best.......see attachment. Find in addition in Word document a helpful picture of LPT - Pins.
    In case you work with WinNT, W2k, XP - you need to install accesshw.
    Regards
    Werner
    Attachments:
    printer_port_test.zip ‏41 KB
    dsub_25_parallel_port.doc ‏29 KB

  • How can I do to communicate to parallel port using labview 5.0 and NT ?

    I am trying to write and read from parallel port using Labview 5.0. It does not work with NT.
    How can I do to communicate to parallel port using labview 5.0 and NT ?
    Thank you in advance.
    Regards,

    If you are trying to use In/Out port functions that come with LabVIEW they will not work with NT. I think the AccessHW file at the following link will fix that problem:
    http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/49664743ded6f1da862564bc004e3a7f?OpenDocument
    Try also this link:
    http://zone.ni.com/devzone/conceptd.nsf/2d17d611efb58b22862567a9006ffe76/0989d3d9dafae64e8625680400679736?OpenDocument
    and do some searchs at NI.com for parallel port, you should find some more usefull info.
    Good luck
    Brian

  • I want to write data into eeprom(93LC86) in parallel port using labview?

    I want to write data into eeprom(93LC86) in parallel port using labview? Also I want to read data from EEprom.

    Hi Mr. Mz,
    after having a look to 93LC86-Datasheet I do not see a problem. The self-timing programming cycle of this Chip avoids timing problems; the rest is only logical stuff.
    If you need more general info, how to use the parallel port, I recommend: http://[email protected]/ or
    in case you need an example of SPI-Interface in LabVIEW with paraport - then write to: [email protected]
    You are welcome
    regards
    wha

  • Control parallel port (data and control lines)

    I need to control the output on the parallel port (LPT1) - Both data and control lines.  Once the data is written (Pins2-9), I then need to toggle the Sprocket signal (PIN1) - on the parallel port. The sprocket signal is also referred to as the Data Strobe Output.
    The required method is as follows:
    1. Lower the sprocket signal on PIN1
    2. Send the data (Pins2-9) and wait
    3. Raise the sprocket signal and wait.
    4. Repeat.
    I am looking for a method to control the data on LPT1 pins 2-9 and then be able to toggle PIN1 - Strobe signal - without the data falling from the other pins. What I have found is that whenever the state is changed on the strobe - the data that was written to Pin2-9 falls to zero. This will not work for my application - the strobe tells the hardware device that the data is ready. If it falls to zero when I toggle the strobe - that will not work.
    Regards,
    Guy

    Hello Adam,
    I am familiar with both references.  If you look more closely at the library reference - it allows me to communicate using VISA across the parallel port pins 2-9.  It does not permit direct communication to pin1 (the strobe signal) - property nodes don't allow the strobe to be refereced either (similar to control lines/signals for COM ports).
    Worse, I have also located examples using OUT PORT that does enable pin1 to be toggled.  The problem is, when those VIs are used, the data falls from the data pins when the strobe signal is written, even if its value is not changed.  For example, if the strobe is already high, if another high value is passed, the data falls from the data lines.  The other issue, when using VISA, as soon as the data is writen, the strobe signal automatically goes high even though I need a wait before setting the strobe high.  This is in complete contradiction to the second article you referenced which clearly discusses writing data to pins2-9 then taking the strobe high to indicate to the printer that new data is available.  It must be possible since this is the typical handshake.
    I am still looking for a more complete answer/solution.
    Regards,
    Guy

  • How can I write to the parallel port using LabVIEW 6.0.2

    I have tried updating the labview.ini file and also using the parallel.llb available on the site. When I execute the program it gives me error 37 saying,"device not found". I am running this code on windows 98. I tried to use VISA write,serial port write (using port 10) but nothing seems to work. I also tried to develop a sample code using inPort and outPort, but no success, it is not able to read the data back from the parallel port, even if it seems (????i don't know any way to cross-check it though????) to write.
    Does anybody know the problem here?
    THanks.
    Pari.

    Thanks Brian.
    Well here is the next problem. I got a VI (attatched) off ni.com and it works fine on a windows98 platform. But quits working on NT.
    I can write perfectly (which i checked by hooking an LED display unit at the other end of the parallel port cable). I observed that the LEDs respond to the toggling of individual bits (data bits). But the error occures at the "out port.vi", when I try to run it on a NT machine (where I actually wanna use it). Are you aware of any changes to be made in order to run a VI on NT that works on 98?
    Thanks again.
    Pari.
    Attachments:
    parallelPortSwitcher.vi ‏124 KB

  • HOW TO ACCESS PARALLEL PORT USING JAVA

    hello guys.. Please Solve my Problem..
    I have to access motor through pc using Parallel Port. I want to know how to program in java to access Parallel Port. So How can i code to access the any Port of Parallel Port. Please Guide me in this..

    well I cannot give a more detailed answer than "use the java comm API".
    http://java.sun.com/products/javacomm/
    http://java.sun.com/developer/Books/javaprogramming/cookbook/11.pdf
    However Java wasn't built to do these kinds of operations, so it may well be that the API does not provide the functionality you need. In that case you may need a native library to do the work for you, which can make things a lot more difficult.

  • Anybody knows how to control parallel port to generate digital line ?

    All,
         I have found at some website, there are a software can generate corresponding signal (I suppose that is digital line) to driver a relay board, the relay board is 8 channels. which out put is pin 2, pin3, pin 4, pin5, pin 6, pin7, pin8 and pin 9 of parallel port to control it . it is well control, how can it do ?  and I want to simulate it at LV with parallel port too , how can it achieve ? which command, or a simple sample which you provide will be appreciated.
    thanks in advance.

    You forget to search through NI Web site. Here are some links.
    http://zone.ni.com/devzone/conceptd.nsf/webmain/72C6FC6CE4AD4D1386256B1800794596
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B123AE0CB9CB111EE034080020E74861
    Sergey

  • How to access parallel ports using LabVIEW?

    I want to send data to a device which is connected through LPT1.when Iam using serial port write.vi with port number 10(for LPT1) it is giving an error code 37 which means the device not found. whether those vis are only for accessing serial ports? Then how to access LPT1 using LabVIEW?

    Most likely you need to modify your labview ini file to let it know that LPT1 (or whichever) will be controled through the serial port control. See the following link for a knowledgebase answer to this question:
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/a5abd9d76665217b86256333005ac9a5?OpenDocument
    Jared

  • How to use the Control lines of a parallel port as Input lines to be read using Labview ?

    The details are :
    NI Software : LabVIEW
    Version : 5.0
    OS : Windows 95
    NI Hardware : N/A
    Drivers : N/A
    CPU : Pentium
    RAM : 48
    Vendor : darcom
    Customer Information :
    SPEL TESTING
    SPEL, INDIA
    [email protected]
    Ph: (91) 4114 53818
    We do not have any DAQ cards within the PC. We have the parallel port which is EPP and ECP compatible having the address 278h on LPT2 and we are trying use this port for reading 8bit data from an external circuit. We developed a vi program in Labview 5.0 to control the parallel port.We tried with the Data lines to send signals from PC to external device through this parallel port with the addr
    ess 278h (which
    is Data lines) and it works fine. We also tried using reading 4bit data from external
    device to PC through this port with the address 279h (which is Status lines) and it
    is also working fine.
    But it was not possible for us to read through Control lines whose address is 27Ah. Whereas when line printer (dot matrix printer) was
    connected, it was possible for us to take print out. Thus printer was working. This
    informed us that the control lines are all OK!
    Can you please clarify, how to use both control lines and status lines to read 8 bit data through this parallel port using the Labview software.

    There are several Knowledge Base entries about this on the NI site, but probably the most detailed document is on the Advanced Measurements (www.advmeas.com) website. Try looking at this page, I think you will find it useful.
    http://www.advmeas.com/goodies/parallelport.html

  • Problems Reading/Writing Parallel Port Data, Status & control Registers Using In Port.vi and Out port.vi

    Hi,
    Can anyone there help me Please with the problem. I am trying to
    communicate with the parallel port using my program which i have
    attached to the message. I am running LabVIEW 7.0 Professional with
    application builder. All the program does is reads and writes to the
    three parallel port registers. It runs FINE!!! in my computer. But when
    i built an executable (see attached) and tried running on a different
    computer (with LabVIEW Runtime engine 7.0 installed) the program does
    not read/write to the registers. The target PC had the parallel port in
    SPP mode just like mine. I can't seem to understand whats going wrong?
    Can anyone please help me if you know the right answer.
    Thanks
    Attachments:
    Programs.zip ‏119 KB

    Hi Guys,
    I too have a problem using "Out Port.vi", but of a diferent kind. I use this VI to control the  Parallel Port which in  turn controls a small circuit. I use only two data pins, DP-2 and DP-4 for this purpouse. I use LV 7.1 Professional Development version in a Windows 2000 operating system. Now, my main problem is that my code runs fine (both is development and .exe forms) in my development computer, but when I try to run the .exe version in  other computers (Windows XP operating system), it asks for a "protocol file" while starting (look at the attached picture).
    Now, I really have no idea what kind of a protocol file it asks for and just click "ok" and proceed to work, the most interesting part is that the code works well as I expected. So, my only problem is that it asks for a protocl file which I want to avoid. As with the application building, I do all that is  required like including the sub VIs (self developed), creating an installer, enabling the port access, and creating a proper .ini fine. I also use the Out Port.vi from the AccessHW library.
    I have my doubts on two fronts,
    1) With the version conflict, since my development computer runs with Windows 2000 and my target computers all run with Windows XP
    2) With the Out Port.vi which further contains a small VI "Output Word to Port.vi" in it and that further contains Call Library Function Node, which might call soem external files, like what my problem is.(look at the attached picture)
    I don't have answers to these questions and may be my problem is in different place, but I would like to hear from anyone who could give me a helping hand. I am in a situation where I could not disclose my code.
    Thanks in advance,
    mohan
    Attachments:
    protocol file.zip ‏153 KB

  • Is it possible to control the parallel port with Lookout 5.0

    I want a simple demo setup on a PC, so I can control the 8 data bits of the parallel port. Example, to use START p/b that would toggle bit 0 and data returned on bit 1.

    It is possible to send bytes to the parallel port using the ASCII object within Lookout. However, it is presently not possible to control the state of the individual bits on the parallel port with Lookout.
    If you need to control the individual bits on a parallel port, consider using LabVIEW. It is much more powerful when programming serial and parallel ports.

  • Using Parallel Port with Outport.vi Problem

    Hello,
    I am trying to use my parallel port to control a relay network and have run into a problem. I am using the outport instead of visa because for some reason I get an error with visa and outport seems more simple. The problem I am having is that my program doesn't seem to be able to initially take control of the port. What I mean by this is that if I restart the computer and open/run my program, I get an incorrect output on the parallel port. However, if I run one of the example programs for controlling the paralle port using outport (attached) (I believe the one I use is called Reading and writing to parallel port using loops) I am able to control the output to the parallel port. Also, after the example has run, my program works correctly. However, if I restart my computer again and run my program first it can no longer control the port correctly. So the problem seems to be that my program isn't initializing the port correctly or assessing it right at the beginning of the program. However, looking at the example program I don't really see what they are doing that I am not. I have the correct port address. 
    My program takes values from a text file and displays them on the port and that works correctly. 
    Attachments:
    CircuitTopModule.vi ‏26 KB
    parallel port examples.llb ‏72 KB

    Hi Jag213, I'm glad you were able to resolve the issues you discussed on the other forum related to this issue.
    Now that you have it working, I would recommend a few things:
    1. Just try modifying one of the existing examples and see what you can get away with removing in order to keep it working the first time.
    2. Try modifying the timing on your example - 10 seconds is a long time to wait between each week, I wonder if you are getting a time out? Do the examples work when you insert that kind of timing delay?
    3. Add the In Port.vi into your code - this may be related to getting your Out Port.vi to work correctly.
    4. Your code controls 8-bits on the parallel port, while the examples control 32-bits. Do all 32 bits need to be initalized? Looking at the Parellel Port Read and Write Loop.vi Example, in the IO Connector Status, the 31st bit controls whether the target is initialized.
    Play with these settings and see if you can get yours to work the first. If all else fails, build your program to run off of one of the examples. For example, have the while loop run once, and then call yours as a SubVI.
    Good luck!
    Joey S.
    Software Product Manager
    National Instruments

Maybe you are looking for

  • Why can I no longer backup my Iphone to Outlook using ITunes?

    Why can I no longer backup my Iphone to Outlook using ITunes? for 6 months I never had a problem as it was indicated on Itunes but now the word OUTLOOK has disappeared from the screen!

  • Steps to retrieve attachments from a storage system linked via ArchiveLink.

    Dear experts, I want to retrieve the documents stored in a storage system linked to SAP via the archivelink and show it in a webdynpro application(Adaptive RFC).I need to know the right approach to do so.I am searching for a funtional module which ca

  • Transfer of time from CO to PS

    Hi, I have a poblem, We are using CATS timesheets to record time. The problem is that the cost rate had been wrongly maintained in KP26, the rates were changed in KP26 after 1 week. The time in CAT2 was how ever already enteres, The utilization now g

  • Runtime parameter, report not running

    hii i am using form 6i and on a button press, i am caling the following procedure that runs a report ... procdure.... begin    INCEXP_PARAMETER(M_PARAM_ID);    RUN_PRODUCT(REPORTS,M_REP_ID,SYNCHRONOUS,RUNTIME,FILESYSTEM,M_PARAM_ID,NULL); end; PROCEDU

  • I sent this question several times but have not received an email so that I can confirm.

    Here is the question: Firefox freezes or closes with any version past 3.6! Have tried various suggestions from online support. I am using Windows XP Pro with all updates, Comcast, Norton Security Suite, V5.1.0.2 updated. The only add-on that seems to