Solved

Accessing the printer port

Posted on 2000-05-11
9
216 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 Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 
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 100 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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…
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

724 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