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.

Similar Messages

  • 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 access NTFS entries using Java

    I want to access and read the attributes of a file stored in the Master File Table of NTFS.
    How should I do it using Java. Is using native code and using JNI the only way or is there a package in Java that supports this?
    Thanks

    WebSphere Application Server has a bunch environmental variables such as log locations. These are held at the "server", "node", and "cell" level.
    To access them, you have to get the right context. Something like this, I believe...
    InitialContext initialContext = new InitialContext();
    initialContext.lookup("foo:bar/baz/blah"); //correct context hereGo to the IBM website for WAS and do a search on namespace bindings. That should give you some more information.
    Good luck.

  • How to open specific port using java program

    Hello,
    I want to open ,close port using java comm.plz help me how can i do it.is it possible
    by using java program.later i want to use that specific port to accept the server socket connection .plz
    help me.

    i try this java program.*but it get block in accept method*.tht mean i m not able to make connection with port.
    import java.sql.SQLException;
    import java.io.IOException;
    import java.net.ServerSocket;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    class MakeConn
         public final static int PORT = 7788;
    public static java.net.Socket clientSocket = null;
    public static java.io.PrintWriter pw = null; // socket output stream
    public static java.io.BufferedReader br = null;
    public static ServerSocket server_socket;
         public static void main(String[] args) throws SQLException
         try {
              server_socket = new ServerSocket(PORT);
    clientSocket = server_socket.accept();
    System.out.println("CLIENT>>>" + clientSocket);
         br = new java.io.BufferedReader(new java.io.InputStreamReader(clientSocket.getInputStream()));
    pw = new java.io.PrintWriter(clientSocket.getOutputStream(), true);
    String message = br.readLine().trim();
    System.out.println("message is"+message);
    pw.close(); // close everything
    br.close();
    clientSocket.close();
         catch (Exception ex) {
    ex.printStackTrace();
    }

  • "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 to access sharepoint logs using Java?

    Is there a way to access Sharepoint logs using Java from a remote machine? 
    Any help / pointers would be appreciated. Thanks.

    Hello,
    I am not aware about any client modal class for log but if you create your own service and host in SP server then you can call this web service in JAVA. (i am not sure whether JAVA supports .NET web service or not).
    You can refer this for web service:
    http://www.arboundy.com/2010/12/centalised-view-of-sharepoint-uls-log-files/
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to access Websphere variables using java

    Hi
    I want to access Websphere variables using java.
    Any help is appreciated!!
    Thanks
    P

    WebSphere Application Server has a bunch environmental variables such as log locations. These are held at the "server", "node", and "cell" level.
    To access them, you have to get the right context. Something like this, I believe...
    InitialContext initialContext = new InitialContext();
    initialContext.lookup("foo:bar/baz/blah"); //correct context hereGo to the IBM website for WAS and do a search on namespace bindings. That should give you some more information.
    Good luck.

  • How to access serial port using servlet

    I want to communicate with a microcontroller connected to the serial port of my computer.
    *I am using the following:
    Windows 98 operating system
    Tomcat web server 4.1
    *The directory structure is as given:
    Tomcat 4.1/webapps/myjsp/web-inf/classes/remoteservlets.
    I have placed my jsp files in my jsp folder and classfiles in remote servlets folder.
    **my java program has compiled correctly.**
    ** my simple java application which accesses the serial port works fine.***
    *when I start tomcat I am able to access the sevlet as the servlet responds with the button name i have pressed.
    **** I have also tried the following
    Copied file comm.jar in <JAVA_HOME>\jre\lib\ext
    Copied file javax.comm.properties in <JAVA_HOME>\jre\lib
    Copied file win32com.dll in <JAVA_HOME>\lib and also in c:\windows\system32 and c:\windows\system
    ***************which helped me do away with errors.
    still I don't get any output. I dont get any errors either.
    PLEASE HELP. URGENT. i am at my wits end.
    Thank you.

    Servlet is the one which runs in the server side...if u want to comunicate with the serial port of the server in which ur servlet is running can be done but making use of Communication api available....
    U can download the Api from http://java.sun.com/products/javacomm/index.jsp
    There are three levels of classes in the Java communications API:
    High-level classes like CommPortIdentifier and CommPort manage access and ownership of communication ports.
    Low-level classes like SerialPort and ParallelPort provide an interface to physical communications ports. The current release of the Java communications API enables access to serial (RS-232) and parallel (IEEE 1284) ports.
    Driver-level classes provide an interface between the low-level classes and the underlying operating system. Driver-level classes are part of the implementation but not the Java communications API. They should not be used by application programmers.
    regards
    shanu

  • Problem in Accessing serial port using java comm Api

    I have installed java comm Api in my pc.
    i have gone through the instalation instruction which comes on this package.
    I have done the instalation like this
    Copy win32com.dll to my <JDK>\bin directory.
    Copy comm.jar to my <JDK>\lib directory.
    Copy javax.comm.properties to my <JDK>\lib directory.
    and restart the system.
    But when i run the BlackBox , it is giving me message
    "serial port not found".
    Can any one tell me , what is the exact problem ?

    I'm not sure what you mean by BlackBox, but I have used the COMM api extensively.
    The majority of problems is that the api cannot see the serial port (which is what you are describing) and this is caused by incorrect placing of the javax.comm.properties file.
    As well as <JDK>\lib, try putting it into <JRE>\lib as well. That has often solved problems on my setup.

  • How to Access UNIX scripts using Java

    folks,
    Is there any way we can access UNIX scripts or CRON Jobs in java, I am planning to come up with some monitoring tool for our application and in these i need to monitor the UNIX scripts whether its running or not ,
    Let me know if any of you guys done this,
    Regards
    Mathew

    Check the java.lang.Runtime object and exec(...) methods.
    Marc

  • How to access sql server using java script

    Hi, Is it possible to connect to sql server in java script. I'm using microsoft jdbc driver for connectivity to sql server.
    Thanks

    Hi, Is it possible to connect to sql server in java
    script. I'm using microsoft jdbc driver for
    connectivity to sql server.If you want to ask about Javascript, you are in the wrong place. Go and find some JavaScript forum. Actually, you could connect to database from javascript using Ajax or the like mainly because you could have Java code behind the scenes, but then that too is not something I would want to discuss here. So, go find the correct place for the topic.

  • How to read a data from USB port using JAVA

    hi all,
    i need to know how to read a data from USB port using java. any API are available for java ?.........please give your valuable ideas !!!!!!!!!
    Advance Thanks!!

    You can do this. Please use this link
    [http://www.google.co.in/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=uHu&q=java+read+data+from+usb+port&btnG=Search&meta=&aq=f&oq=]
    What research did you do of your own? Have you done some testing application and tried yourself??

  • 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

  • How to set proxy authentication using java properties at run time

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

  • How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    Hi,
    Thanks for the suggestion. I've been playing around with some of the classes of the java.net package and java.io
    Using the URL class i can get the content of the data from a STATIC page and output that response to file so that is does not display to the client broswer.
    But this only works if the URL i give points to a static html page.
    So the problem i'm getting is if i'm righting in arguments in the URL, this means that server needs to process the arguments i give and its sends back a dynamic result. Because its dynamic the URL class can not handle this and throws me an exception everytime :(
    Have u ever tried to do some things like this?
    Rahul

Maybe you are looking for

  • Screen samples for EHS Management tool

    Hello EHS gurus: Can someone tell me where I can see some sample screens and steps in the EHS Management tool program? Regards,

  • Personal Oracle 8i Database Create Error

    I am trying to set up personal oracle on a Dell notebook with 128MB ram and windows ME. When I have installed the software it tries to create a database - this procedure crashes with a Page Fault in a Dos window and from then on the Notebook complete

  • Cannot drag MOV videos into timeline

    Hi there, So i have weird problem now with MOV files. After dragging into timeline the second one, different from the first one, I can't drag any more files. Including the first one, or other non-mov files. If I drag just the first one i can repeat i

  • Moving Moblie Me to iCloud

    I already have an iCloud account set up with my Apple ID which is my @yahoo account, NOT @me.  When I go to move my moble me account to iCloud, it is creating a new account for me, or so it seems... I don't want a new iCloud account, I just want to t

  • Creating an Error Message

    Aloha, all! Long time Flash user, first time on the forums since Adobe acquired the property. :) I know this is a weird request, considering we spend a lot of time asking how to get RID of an error message. But, I'm trying to design an application wh