Parallel port(help)

Hi,
I wanna try to do a project.its about parallel port and show the numbers on the display.The user will enter a number between 0-255.For example: user entered 36 . So the code will send the 6 number.the low label(level) bits will be sent.And we ll see the number on the display with 7 leds.I need help and maybe can give codes for me ..Thansk for all..
Message was edited by:
yetcom

anyone can not ????:(((

Similar Messages

  • Parallel Port Help. Please

    Dear friends,
    Am developing an application that is to use the javax.comm package under a Linux (Fedora Core 5) system. However am quite stuck when it comes to sending a signal to a specific 'wire' off the parallel port.
    I have read about the configuration of the parport that is in such a way:
    1      Not normally used
    2-17      Data ports
    17-25     Ground
    so that if I want to send a signal to port 2 and ground I will open the port and transmit the signal 0100000000000000000000000 correspoding to the various port wires. This is, however, not working since the ports are giving me a HIGH signal through the entire time even when no signal is being trandmitted. How can I work around this or is there an easier or better way to go round this?
    This is the class I use to open/close the ports
    package controllers;
    import javax.comm.*;
    import java.io.IOException;
    import java.util.*;
    import java.io.OutputStream;
    import java.io.InputStream;
    * This class forms the base of all communication port events
    * It opens and closes ports and sends packets of data through the
    * serial and parallel ports
    public class RS232BaseClass
        private SerialPort portName;
        private ParallelPort parPort;
        private CommPortIdentifier portID;
        private OutputStream portOut = null;
        private InputStream portIn = null;
        private boolean isParallelPortOpen = false;
         * The class constructor
        public RS232BaseClass()
            portName = null;
            parPort = null;
            portID = null;
            portIn = null;
            portOut = null;
         * Method to re-init everything
        public void reInit()
            this.portName = null;
            this.parPort = null;
            this.portID = null;
            this.portIn = null;
            this.portOut = null;
         * Method to retrieve list of ports in OS
        public void getListofPorts()
            System.out.println(
                    "Getting the List of Ports configured in this server");
            Enumeration pList = CommPortIdentifier.getPortIdentifiers();
            while (pList.hasMoreElements())
                portID = (CommPortIdentifier) pList.nextElement();
                System.out.println("Port :[" + portID.getName() + "]");
         * Method to open specific port required
        public void openPorts(String toOpenPort)
            System.out.println("Process is opening port: [" + toOpenPort + "]");
            // Retrieve the port
            try
                portID = CommPortIdentifier.getPortIdentifier(toOpenPort);
            catch (NoSuchPortException e)
                System.out.println(
                        "No such port available to retrieve - Program will Exit!");
                e.printStackTrace();
                System.exit(1);
            // Open the port
            if(toOpenPort.startsWith("LP") || toOpenPort.startsWith("/dev/parport"))
                try
                    parPort = (javax.comm.ParallelPort) portID.open(toOpenPort, 30000);
                    System.out.println("Port opened successfully!");
                    this.isParallelPortOpen = true;
                    // Get Output Stream
                    portOut = parPort.getOutputStream();
                    // We do not get InputStream since Parallel port does not support input
                catch (PortInUseException e)
                    System.out.println("Port is in use - Program will Exit!");
                    System.out.println("Owner is [" + e.currentOwner + "]");
                    e.printStackTrace();
                    System.exit(1);
                catch (IOException ioe)
                    System.out.println(
                            "IO Exception during stream IO - Program will Exit!");
                    ioe.printStackTrace();
                    System.exit(1);
            else
                try
                    portName = (javax.comm.SerialPort) portID.open(toOpenPort, 30000);
                    System.out.println("Port opened successfully!");
                    // Get Input Stream
                    portIn = portName.getInputStream();
                    // Get Output Stream
                    portOut = portName.getOutputStream();
                catch (PortInUseException e)
                    System.out.println("Port is in use - Program will Exit!");
                    System.out.println("Owner is [" + e.currentOwner + "]");
                    e.printStackTrace();
                    System.exit(1);
                catch (IOException ioe)
                    System.out.println(
                            "IO Exception during stream IO - Program will Exit!");
                    ioe.printStackTrace();
                    System.exit(1);
         * Method to set the port parameters
         * @param baudrate the baud rate of communication
         * @param dataBits the data bits of communication
         * @param stopBits the data bits to signify end of message
         * @param parity the parity rate of communication
        public void setPortParameters(
                int baudrate,
                int dataBits,
                int stopBits,
                int parity)
            try
                portName.setSerialPortParams(baudrate, dataBits, stopBits, parity);
            catch (UnsupportedCommOperationException ucce)
                System.out.println(
                        "Unsupported Comms Operation - Program will Exit!");
                ucce.printStackTrace();
                System.exit(1);
         * Method to set Port Wait timing - Different for different devices
        public void setPortReceiveTimeout(int timeOut)
            try
                this.portName.enableReceiveTimeout(timeOut);
            catch (UnsupportedCommOperationException ucce)
                System.out.println(
                        "Unsupported Comms Operation - Program will Exit!");
                ucce.printStackTrace();
         * Method to Read contents from the port
        public String readPort()
            System.out.println("Reading From port...");
            StringBuffer buffer = new StringBuffer();
            int ch = 0;
            try
                while ((ch = portIn.read()) != -1)
                    buffer.append((char) ch);
                portIn.close();
            catch (IOException e)
                e.printStackTrace();
            System.out.println(
                    "String read is ["
                    + buffer.toString()
                    + "] Length is "
                    + buffer.toString().length());
            return buffer.toString();
         * Method to write contents to the port
        public void writePort(String outToPort)
            try
                portOut.write(outToPort.getBytes());
                System.out.println("Writing out [" + outToPort + "]");
    //            System.out.println("Data written out successsfully!");
            catch (IOException e)
                System.out.println("IO Exception during Writing to port");
                e.printStackTrace();
         * Method to close the port
        public void closePort()
            System.out.println("Closing Port");
            if(isParallelPortOpen)
                this.parPort.close();
            else
                this.portName.close();
            System.out.println("Port closed successfully!");
    }Thanks.

    After much googling and searching all over the web, I found out that package javax.comm is just redundant and, for a lack of more appropriate word, useless. The same goes for package rxtx. However, I came across something called parport that gives excellent output in very simple ways :)

  • HP color laserjet 4600 parallel port is wierd need help to identify

    Hi I have a laserjet 4600 and it has a wierd looking parallel port and I can't seem to find out the name for it so I can buy it online. I have tried looking for it online but the only thing that comes up is the IEEE 1284 36 pin parallel port. Can anyone help me identify this port so I can connect it to my computer?
    Thanks

    dan4757 wrote:
    I am running windows 7 64 bit trying to connect to a HP color laser jet 4600. We have tried multiple times to get a Notebook to load the driver. Everything works and asks to print a test page. When you press print test page nothing happens and nothing will print. 
      This is a working printer. It is presently hooked to a network and it works from it. I am trying to make it work from my notebook. I am using a ethernet cable wired directly to the Jetdirict card. 
      Do I need to set up a network. I know the IP of the printer and can not access it from the Notebook.
    This should work for you.  I've installed several printers using a Jet Direct this way:
    Install the printer manually.  Go into Devices and Printers -> Click "Add a printer" then select "add a local printer" and select the option for "Create a new port - Standard TCP/IP Port" and click next.  Type the IP address of the printer into the Hostname/IP Address field then click "next" -  Choose Hewlett Packard Jet Direct from the Standard drop down menu then click next.  You will need to select your printer model/driver from the list and then click next.  

  • Help needed urgent please ( parallel port access in linux)

    hi all, i am trying to read and write data to /from the parallel port , i am running IBM j9 vm on linux.under /dev there are lp0..lp3 parport0..parport3, and port devices , i dont know which one to use , i have tried all , they all return with an ioexception saying "cannot find the file" except for port device which does not generate any error but it does not return what i have written on it ,
    any help would be much appreciated.
    i am using fileoutputstream and printwriter calsses .
    i dont want to use javax.comm api cause i think its incompatible with ibms visual age micro edition ( the one i am using ) so i would prefer something that works with my IDE .
    thanks
    yahya
    [email protected]

    However, there is an on-going OpenSource version called "RXTX" (http://jarvi.ezlink.com/rxtx/) that works quite well. Be sure to read all the documentation that comes with it, as you'll need to set some permissions on the ports you want to use.

  • Parallel Port Programming - Pls Help

    Sir / Madam,
    Greetings.
    We are new to writing parallel port programming. We have tried to execute a sample code.
      import parport.ParallelPort;
      class SimpleIO {
        public static void main ( String []args )
          ParallelPort lpt1 = new ParallelPort(0x378); // 0x378 is normally the base address for the LPT1 port
          int aByte;
          aByte = lpt1.read(); // read a byte from the port's STATUS pins
          System.out.println("Input from parallel port: " + aByte);
          aByte = aByte >> 2; // a simple and irrelevant operation
          lpt1.write(aByte); // write a byte to the port's DATA pins
          System.out.println("Output to port: " + aByte);
      }We get the following error:
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_PRIV_INSTRUCTION (0xc0000096) at pc=0x10001057, pid=2224, tid=2916
    # Java VM: Java HotSpot(TM) Client VM (1.5.0-b64 mixed mode, sharing)
    # Problematic frame:
    # C [parport.dll+0x1057]
    We are new to this..
    Pls help us. We have connected a parallel port device already.
    Regards
    Rampalli

    This means there is a bug in the driver you are using.
    I would check you have the latest version of Java 5 or 6 and the latest version of the driver you are using.

  • I've a parallel port problem.Can anyone help me?

    Hi everybody I've a problem about programming with parallel port.I tried to write a simple byte data likes "0x0D" through the OutputStream of parallel port "LPT1" but it didn't get out from the runtime process;I 've found that it has stuck at OutputStream.write(0x0D); when i 've debugged it. Do you guys have any clues? and How can i make it through.

    Maybe take a look at this:
    http://java.sun.com/products/javacomm/javadocs/index.html

  • Could you help me to control a DC motor with the parallel port and windows 2000?

    I have labview 5.1 and i want to control my application throught the internet

    I would recommend upgrading to LabVIEW 7.0 for a couple of reasons. First, LabVIEW 6.1 introduced remote front panels which allows you to control a VI through a web browser. Setting up remote front panels is very simple and that alone is worth the upgrade. As far a using the parallel port you can use VISA to send/receive commands via the parellel port if you are using a motor controller with a parellel interface. If you are talking about using the port on a bit level to control the motor, LabVIEW 7.0 ships which an example of how to do basic digital input output with the parallel port.
    Regards,
    JR A.
    Application Engineer
    National Instruments

  • Parallel Ports vs. Trashing Printers

    Recently bought 3 new workstations:  2 w/Windows 7 - - 1 w/Windows XP Pro... Question is:  my old HP Laserjet 2100tn will not work with these computers due to their not being a paralel port on the back of the computer.  
    Do they make converters for the cables to make them work? Or is the printer basically worthless at this point?
    This question was solved.
    View Solution.

    You can purchase and install parallel port adapter cards and the printer will work. I can't specify which cards as you haven't stated what the specs are on your workstations. There are also usb to parallel port converter cables available.
    Best regards,
    erico
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • How to Install a parallel port printer to usb port of Pavilion dv5 Notebook

    In trying to install my HP DeskJet 610C Parallel Port printer to my HP Pavilion dv5-1235dx Notebook PC with Windows Vista Home Premium 64-bit, I followed instructions given by HP Support some two years back.
    I connected up the two units through a Parallel-to-USB ports cable. The PC loaded and confirmed suitable driver. (Following advice from sites on the Internet, I have made repeated attempts to carefully install the printer, but to no avail).
    Upon my issuing the Print instruction, the printer invariably prints two copies of what appears to be 'gibberish' in two lines at the start of the sheet. Thereafter it picks up and then ejects 6-8 sheets of blank paper.
    Any help in resolving this anomalous situation will be be most welcome and much appreciated.
    I might add that the printer works normally when connected in parallel to an older, Compaq Armada 1750 Notebook (XP OS). In this instance too, the Parrallel/USB worked as in the Pavilion PC, above.  
    This question was solved.
    View Solution.

    Hi khalidem, 
    Sounds like you have a communication problem with the printer cables. Have you tried a new parallel to USB cable or adapter?
    I am an HP employee.
    Say Thanks by clicking the Kudos Star in the post that helped you.
    Please mark the post that solves your problem as "Accepted Solution"

  • Using XP software with a parallel port dongle in windows 7 professional

    Please help...  Looking to have my parallel port dongle recognized for my older version software (XP) in Windows 7 under the XP PC mode.  Help in figuring out if LPT1 is set correctly or what I am doing wrong.
    Thanks

    Hello,
    I have W7 Professional 64 bit with Windows Virtual PC/Windows XP Mode installed. I have some older programs installed in XP Mode and they are working properly.
    Unfortunately, I have one older program that I currently have working on an older XP Machine and that program requires a Sentinel dongle to be seen on the LPT1 Parallel Port. Since my W7 computer has an LPT1 Header on the mother board, I have purchased and
    installed a PCI-Express Parallel Port and I have the ribbon cable connected to the LPT1 Header.
    After I enabled the parallel port in the bios, I could see LPT1 in the W7 Device Manager and in the Windows XP Mode Device Manager. However, when I click on
    Windows Virtual PC, highlight Windows XP Mode.vmcx and click on Settings, LPT1 does not appear.
    I have installed my old program in Windows XP Mode and it starts to run but, when it gets to the point where it must see the Sentinel dongle on the LPT1, the
    program does not find the dongle.
    I also purchased a Manhattan MHUSB to DB25 Parallel Converter and plugged it in. It said that it found new hardware and installed drivers for it but that didn’t
    work either.
    I am not married to any particular solution. So, I would use a USB Adapter or LPT1 connected to the mother board but there must be some code editing or changes
    in settings to make the dongle work in XP Mode.
    Can you tell me how to get W7 Professional 64 bit with Windows Virtual PC/Windows XP Mode to find the Sentinel dongle 
    on LPT1?
    Thank you,
    Dan
    Dan

  • Sending trigger through parallel port, C++, Visual Studio 2010, Windows 7

    Hi, I have a problem that I am really stuck with, and I am novice to the task so any help would be extremely helpful.
    I an trying to write to parallel port on my PC in order to send a trigger to EEG recording machine every time the new goal appears in a Virtual Reality game that I wrote in C++ (I want to record EEG brain signals while subjects are playing the game).
    I tried to follow the instructions from here: http://msdn.microsoft.com/en-us/library/ff802693.aspx
    I wrote the following code:
    BOOL FileExists(LPCTSTR szPath)
    DWORD dwAttrib = GetFileAttributes(szPath);
    return (dwAttrib != INVALID_FILE_ATTRIBUTES && 
    !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
    BOOL WriteABuffer(char * lpBuf, DWORD dwToWrite)
    OVERLAPPED osWrite = {0};
    DWORD dwWritten;
    DWORD dwRes;
    BOOL fRes;
    // Create this write operation's OVERLAPPED structure's hEvent.
    osWrite.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
    if (osWrite.hEvent == NULL)
    // error creating overlapped event handle
    return FALSE;
    // Issue write.
    if (!WriteFile(ghComm, lpBuf, dwToWrite, &dwWritten, &osWrite)) {
    if (GetLastError() != ERROR_IO_PENDING) {
    // WriteFile failed, but isn't delayed. Report error and abort.
    fRes = FALSE;
    else
    // Write is pending.
    dwRes = WaitForSingleObject(osWrite.hEvent, INFINITE);
    switch(dwRes)
    // OVERLAPPED structure's event has been signaled.
    case WAIT_OBJECT_0:
    if (!GetOverlappedResult(ghComm, &osWrite, &dwWritten, FALSE))
    fRes = FALSE;
    else
    // Write operation completed successfully.
    fRes = TRUE;
    break;
    default:
    // An error has occurred in WaitForSingleObject.
    // This usually indicates a problem with the
    // OVERLAPPED structure's event handle.
    fRes = FALSE;
    break;
    else
    // WriteFile completed immediately.
    fRes = TRUE;
    CloseHandle(osWrite.hEvent);
    return fRes;
    I get none of the specified errors, but game fails to start and it seems nothing gets written to parallel port. Any suggestions on how to proceed from here would be more than appreciated.
    Thank you, Joanna

    Hi, I have a problem that I am really stuck with, and I am novice to the task so any help would be extremely helpful.
    I an trying to write to parallel port on my PC in order to send a trigger to EEG recording machine every time the new goal appears in a Virtual Reality game that I wrote in C++ (I want to record EEG brain signals while subjects are playing the game).
    I tried to follow the instructions from here: http://msdn.microsoft.com/en-us/library/ff802693.aspx
    I wrote the following code:
    BOOL FileExists(LPCTSTR szPath)
    DWORD dwAttrib = GetFileAttributes(szPath);
    return (dwAttrib != INVALID_FILE_ATTRIBUTES && 
    !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
    BOOL WriteABuffer(char * lpBuf, DWORD dwToWrite)
    OVERLAPPED osWrite = {0};
    DWORD dwWritten;
    DWORD dwRes;
    BOOL fRes;
    // Create this write operation's OVERLAPPED structure's hEvent.
    osWrite.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
    if (osWrite.hEvent == NULL)
    // error creating overlapped event handle
    return FALSE;
    // Issue write.
    if (!WriteFile(ghComm, lpBuf, dwToWrite, &dwWritten, &osWrite)) {
    if (GetLastError() != ERROR_IO_PENDING) {
    // WriteFile failed, but isn't delayed. Report error and abort.
    fRes = FALSE;
    else
    // Write is pending.
    dwRes = WaitForSingleObject(osWrite.hEvent, INFINITE);
    switch(dwRes)
    // OVERLAPPED structure's event has been signaled.
    case WAIT_OBJECT_0:
    if (!GetOverlappedResult(ghComm, &osWrite, &dwWritten, FALSE))
    fRes = FALSE;
    else
    // Write operation completed successfully.
    fRes = TRUE;
    break;
    default:
    // An error has occurred in WaitForSingleObject.
    // This usually indicates a problem with the
    // OVERLAPPED structure's event handle.
    fRes = FALSE;
    break;
    else
    // WriteFile completed immediately.
    fRes = TRUE;
    CloseHandle(osWrite.hEvent);
    return fRes;
    I get none of the specified errors, but game fails to start and it seems nothing gets written to parallel port. Any suggestions on how to proceed from here would be more than appreciated.
    Thank you, Joanna

  • Push button signal to parallel port to trigger a process

    I just need to connect a push button to the parallel port to set it as a trigger signal for a process.
    When push button is pressed, labview executes a process.
    Kindly help me how to do this, the wiring please
    Regards
    Grugh Mike
    Success is Everything !!
    Solved!
    Go to Solution.

    Data Lines to be used as inputsSome parallel ports can be configured to use the data lines as inputs. It depends a great deal on the way the manufacturer designed the parallel port. With some models the data lines can be read the same way we read the control lines, by driving them to high logic so they will take on the value of an external signal. However, most parallel ports require that you set the direction bit for input. This is bit 5 in the Control register (base+2). If the port is capable of it, setting the direction bit high has the effect of making the lines tri-state so it can be driven externally. Sometimes it is also necessary to toggle bit 6 high or low. However, it should be noted that some manufacturers actually lock these bits so that software cannot change them. An example is shown below in Figure 7.
    To test whether your data lines can be used for input, try the following:
    Set bit 5 of the control register high (at base address+2).
    With nothing connected to the port, write a couple of values to the data port, and read each back after you write it.
    If the reads DON'T match the writes, your port is probably bidirectional. Setting C5 disabled the data outputs and you're reading the open inputs of the data-port buffer. If the reads DO match the writes, your port isn't bidirectional. The data outputs are still enabled, you're reading back what you wrote, and you won't be able to read external signals. If it is possible to use your data lines for input, then you just need to set control register bit 5 high and read from the value of the data lines at the base address.

  • Parallel port adapter in labview

    I have usb to parallel port adapter . After plug it into my laptop some drivers installed automatically and it is detected in device manager as "parallel port printing support" under "universl serial bus controller".
    I know how to write data to serial port using visa write funtion but, i dont know how to access this adapter from labview 2010
    i am using windows 7.
    Can anyone help me in this regards.
    Thank you

    Please stick to the original post. Thanks.

  • Parallel port under linux

    could anybody help a linux-labview beginner?
    i'm trying to write to my parallel port. but labview is obviousely not set
    up for this. does anywone happen to have a vi which can do that?
    best of regards
    michael h. fischer
    ============================================
    cell: +43 664 1254415
    fax: +34 664 1265930
    icq: #61578912
    vienna university
    institute of geology
    geochronology laboratories
    althanstrasse 14 / 2a482
    a - 1090 vienna (austria)
    web: www.univie.ac.at/geologie/fischer/
    wap: www.univie.ac.at/geochron/wap/
    ============================================

    "michael h. fischer" writes:
    > maybe i didn't comunicate here.
    > i don't intend to print anything out but i want to set each pin of the port
    > hi or low. i'm trying to turn some electrical relay-switches on and off.
    >
    > thanks anyway, all these hints are useful to me
    Michael,
    So using an true ASCII printer or dircetly /dev/lpx is the easiest
    solution. Just "print" the ASCII charakter representing the bits to
    set.
    Johannes Nieß
    >
    > "Johannes Niess" wrote in message
    > news:[email protected]..
    > > "michael h. fischer" writes:
    > >
    > > > could anybody help a linux-labview beginner?
    > > > i'm trying to write to my parallel port. bu
    t labview is obviousely not
    > set
    > > > up for this. does anywone happen to have a vi which can do that?
    > >
    > > Michael,
    > >
    > > I'm not sure how you adress the parallel port.
    > >
    > > Writing directly to an I/O port is not allowed for security
    > > reasons. There are VI's to do the required system calls.
    > >
    > > You might be able to use the (old) serial VI's with a high serial port
    > > number. You can look up the port number on a LV version for Windows.
    > >
    > > I'd use a completely different strategy: VISA can address parallel
    > > ports. With Windows you just use ASRL10. You might need some tweaking
    > > of the VISA preferences files to do it.
    > >
    > > Printing data to a parallel port should be done with the tools
    > > designed for it: System Exec: lpr file.txt
    > >
    > > Does someone have a summary of the options for reading the parallel
    > > port and setting control lines via the described methods?
    > >
    > > Johannes Nieß

  • 8200 elite Parallel port not run

    Hi to all,
    On my elite8200 I can not run the LPT port on my windows7 64bit port with the address but F0E0 wrong with the management software for a CNC machine.
    In the bios (updated) I can only edit the IRQ of the serial port (it looks like prunes A) For the parallel port can only choose between Standard ECC + ESP etc..
    Does anyone know help me?
    thank you very much

    Perhaps a more complete model number would help.  In looking with that  limited model number there are several listed, even an AIO unit.  In the models such as the small form factor model, there is no parallel port ( which is normally  LPT ) shown.  What actual output port is being addressed as the LPT?
    {---------- Please click the "Thumbs Up" to say thanks for helping.
    Please click "Accept As Solution" if my help has solved your problem. ----------}
    This is a user supported forum. I am a volunteer and I do not work for HP.

Maybe you are looking for