hi everyone,
i have 1 question
how to open cash drawer with java?
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
hi everyone,
i have 1 question
how to open cash drawer with java?
Hello lephoe,
Welcome to the forums.
Can you please give us some more information?
I need to know what type of cash drawer this is.. How its connected to the PC etc etc. Please give as much information as possible.
Please use [highlight=Java] code [/highlight] tags when posting your code.
Forum Tip: Add to peoples reputation by clicking the button on their useful posts.
I use a usb printer to open a Cash Drawer. connected to the pc via usb
how to open a Cash Drawer at the time of printing?
Who is the cash drawer made by? Do you have the manual?
Please give me a model number if possible. Also, who is the USB printer made by?
This info will help me find out what information needs to be sent to open the cash drawer. All models are different.
Please use [highlight=Java] code [/highlight] tags when posting your code.
Forum Tip: Add to peoples reputation by clicking the button on their useful posts.
I have been able to open Cash Drawer
My problem now is how do I open ports COM3
please help friends
Last edited by lephoe; April 20th, 2010 at 12:54 AM.
it is the source code
package testConn; import javax.comm.*; import java.util.*; /** Check each port to see if it is open. **/ public class openPort { public static void main (String [] args) { Enumeration port_list = CommPortIdentifier.getPortIdentifiers (); while (port_list.hasMoreElements ()) { >>> [B]this process in the past, why did not you?[/B] // Get the list of ports CommPortIdentifier port_id = (CommPortIdentifier) port_list.nextElement (); // Find each ports type and name if (port_id.getPortType () == CommPortIdentifier.PORT_SERIAL) { System.out.println ("Serial port: " + port_id.getName ()); } else if (port_id.getPortType () == CommPortIdentifier.PORT_PARALLEL) { System.out.println ("Parallel port: " + port_id.getName ()); } else System.out.println ("Other port: " + port_id.getName ()); // Attempt to open it try { CommPort port = port_id.open ("PortListOpen",20); System.out.println (" Opened successfully"); port.close (); } catch (PortInUseException pe) { System.out.println (" Open failed"); String owner_name = port_id.getCurrentOwner (); if (owner_name == null) System.out.println (" Port Owned by unidentified app"); else // The owner name not returned correctly unless it is // a Java program. System.out.println (" " + owner_name); } } } //main } // PortListOpen
So that code opens the cash drawer?
What do you need to do with COM3? Whats the issue?
Please use [highlight=Java] code [/highlight] tags when posting your code.
Forum Tip: Add to peoples reputation by clicking the button on their useful posts.
I was able to open a Cash Drawer. code was to display the text into line displays
and I have just completed.
thanks
Have you solved this issue?
Please use [highlight=Java] code [/highlight] tags when posting your code.
Forum Tip: Add to peoples reputation by clicking the button on their useful posts.
yes, i have.
I use the cmd command, because the API javax.comm command I did not understand
This command to the API javax.comm :
package testConn;
import javax.comm.*;
import java.util.*;
/** Check each port to see if it is open. **/
public class openPort {
public static void main (String [] args) {
Enumeration port_list = CommPortIdentifier.getPortIdentifiers ();
while (port_list.hasMoreElements ()) { //This part in the diving, why not you?
// Get the list of ports
CommPortIdentifier port_id =
(CommPortIdentifier) port_list.nextElement ();
// Find each ports type and name
if (port_id.getPortType () == CommPortIdentifier.PORT_SERIAL)
{
System.out.println ("Serial port: " + port_id.getName ());
}
else if (port_id.getPortType () == CommPortIdentifier.PORT_PARALLEL)
{
System.out.println ("Parallel port: " + port_id.getName ());
} else
System.out.println ("Other port: " + port_id.getName ());
// Attempt to open it
try {
CommPort port = port_id.open ("PortListOpen",20);
System.out.println (" Opened successfully");
port.close ();
}
catch (PortInUseException pe)
{
System.out.println (" Open failed");
String owner_name = port_id.getCurrentOwner ();
if (owner_name == null)
System.out.println (" Port Owned by unidentified app");
else
// The owner name not returned correctly unless it is
// a Java program.
System.out.println (" " + owner_name);
}
}
} //main
} // PortListOpen