Solved

Accessing the printer port

Posted on 2000-05-11
9
212 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
  • 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
github account with ecipse 1 47
difference of if loops 23 49
mysql jsp example issue 32 35
Is Applet the way to go for my drag and drop system? 8 14
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…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

772 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