Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

I/O through the LPT port.

Posted on 1998-02-21
3
Medium Priority
?
314 Views
Last Modified: 2012-06-27
I've bought a K8000 Kit from Velleman. That's an interface specific for domotica. That interface is connected to my computer through my LPT1 port. Is there somenone who knows how to handle parallel communication in Jave ?
0
Comment
Question by:ndb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 200 total points
ID: 1233178
Only through a native interface to the host operating system.  Java provides no built-in capabilities to access hardware directly.
0
 
LVL 2

Expert Comment

by:shogi
ID: 1233179
You can always do a open file on the LPTx you need, if it's for simple use. Otherwise you need to write C/C++ DLL to the host operating system, and access it with the JNI (java native interface).

Here an example for LPT1 :

public void printLTP1(String OutPrint)
{
  if (OutPrint != "")
  {
     PrintWriter out = null;
     try
     {
        out = new PrintWriter(new BufferedWriter(new FileWriter("lpt1")));
     }
     catch ( IOException e)
     {}
     out.print(OutPrint);
     out.flush();
     out.close();
}

0
 
LVL 2

Expert Comment

by:shogi
ID: 1233180
forgot one
}  // end of the method PrintLPT1


0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question