Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Accessing the printer port

Posted on 2000-05-11
9
Medium Priority
?
218 Views
Last Modified: 2010-04-01
I have a relay controller hanging of my printer port.  How can I control it in Java.  I can control it in c++ and basic by writing to the adresses.
0
Comment
Question by:cmg05
[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
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 16

Expert Comment

by:heyhey_
ID: 2803761
FileOutputStream fos = new FileOutputStream("PRN");
0
 

Author Comment

by:cmg05
ID: 2803944
But how do I relate that back to the individual adresses acessed in the C++ code for operationg the different relays
0
 
LVL 19

Expert Comment

by:Jim Cakalic
ID: 2805216
Have you looked at the Java Communications API? It contains support for low-level control of parallel ports.
    http://java.sun.com/products/javacomm/index.html

Best regards,
Jim Cakalic
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 16

Expert Comment

by:heyhey_
ID: 2805308
I've used JavaComm for accessing COM ports, but what about LPT ?

>> ... my printer port ...
0
 
LVL 19

Expert Comment

by:Jim Cakalic
ID: 2805336
According to the overview at the referenced page from my previous post, the "Java Communications API contains support for RS232 serial ports and IEEE 1284 parallel ports." Like you, I have used this for serial communications but have not had a need for the parallel port access. But I tend to trust the guys at Sun when they make these kinds of claims.

Jim
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 2805375
ok :)
0
 
LVL 19

Accepted Solution

by:
Jim Cakalic earned 300 total points
ID: 2805405
Actually, I don't know that this really will be the "answer" to the problem as it (the Java Communications package) may still be at too high a level of abstraction. If this is the case, I would think perhaps the direction might be native code wrapped by JNI -- particularly if there is already a C++ implementation and there is not a requirement for portability.
0
 
LVL 7

Expert Comment

by:Ravindra76
ID: 2805523
Yaa. I agree with JIM.

By losing portability only, this problem can be solved.
0
 

Author Comment

by:cmg05
ID: 2808905
not quite what I'd hoped but it sounds like Java does have its limitations.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

604 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