Problem in sending data to parallel port

Hello,
I can open a parallel port (LPT1) using java comm api i,e javax.comm.
but problem in sending data to parallel port,
I choose the appropriate port(LPT1), it is in bi-directional mode according to BIOS configuration.
but according to the java program the mode is SSP.
when i write data to parallel port the volt-meter give a reading of high state for all data pin (pin1 to 9) i,e the parallel port doesnot change state. I am using windows XP.
What is the solution?

try it on Open Solaris 10 or Linux platform.
also just try using the new FileWriter("LPT1").write("Hello");
on windows platform
Pravin

Similar Messages

  • Problem while reading data from Serial Port

    Hi All,
    I am facing some problem while reading data from Serial Port.
    As per the requirement I am writing the data on Serial Port and waiting for response of that data.
    Notification for data availabilty is checked with method public void serialEvent(SerialPortEvent event) of javax.comm.SerialPortEventListener.
    When we are writing data on the port one thread i.e. "main" thread is generated and when data availability event occures another thread "Win32SerialPort Notification thread" is generated. This creates problem for me as we can't control thread processing.
    So can anybody pls explain me how to overcome this problem?
    Regards,
    Neha

    My Problem is:-
    I am simoultaneouly wrting data on port & reading data from port.
    First I write data on port using outputStream.write() method. Now when target side sends me response back for the request on serial port DATA_AVAILABLE of SerialPortEventListner event occured,we are reading data from serial port.Now till the time we didn't get the response from target next command can't be written on the serial port. When we are writing data on port main thread is executed.Now my problem starts when DATA_AVAILABLE event occured.At this point another thread is created.Due to this my program writes data of next command without reading response of previous command.To solve this prob. I have used wait() & notify() methods as follows.But again due to this my pc hangs after execution of 2 commands. (PC hang in while loop in a code provided below.)
    From SOPs I could figure it out that after 2 commands we are not able to write data on serial port so DATA_AVAILABLE event doesn't occure n pro. goes in wait state.
    Can anybody help me to solve this issue.
    Neha.
    Code:
    public void serialEvent(SerialPortEvent event)
              switch (event.getEventType())
                   case SerialPortEvent.BI:
                   case SerialPortEvent.OE:
                   case SerialPortEvent.FE:
                   case SerialPortEvent.PE:
                   case SerialPortEvent.CD:
                   case SerialPortEvent.CTS:
                   case SerialPortEvent.DSR:
                   case SerialPortEvent.RI:
                   case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
                                 break;
                   case SerialPortEvent.DATA_AVAILABLE:
                        try
                             dataThread = Thread.currentThread();
                             dataThread.setPriority(10);
                             dataAvailable = true;
                                                                                    byte[] tempArray=new byte[availableBytes];
                                        inputStream.read(tempArray);
                                                                       catch (IOException io)
                             SOP(io, "Error in serialEvent callback call for event DATA_AVAILABLE");
    public void  writetoPort(byte[] data) throws IOException
                             outputStream.write(data);
                              while(finalTimeOut >= actualTime)
                            if( ! dataAvailable)
                                    actualTime = System.currentTimeMillis();
                           else
              synchronized (mainThread)
                   mainThread = Thread.currentThread();
                   mainThread.wait();
    public  void sendDatatoUser(byte[] b) throws Exception, HWCCSystemFailure
              obj.returnData(b);
              synchronized(mainThread)
                   mainThread.notify();
                                                           

  • How send data to serial port from forms 6i

    How send data to serial port to activate hardware connect.
    The hardware is a drawer for cash the point of sales.

    Andres,
    I do the exact thing you are looking for,
    I spool out a text file using text_io
    the file will either contain a double ^G or an epson escape sequence, depending on the drawer type connected.
    I then copy this file to the port using a copy function id d2kwutil
    Works perfectly, but god knows how I'll do it if we want to run the point of sale over the web :)
    John

  • How to rollback a traansacation if we got any problem while sending data to

    how to rollback a traansacation if we got any problem while sending data to a webservice...

    Is it SOA or OSB? Which version you are in..

  • Sending trigger through parallel port, C++, Visual Studio 2010, Windows 7

    Hi, I have a problem that I am really stuck with, and I am novice to the task so any help would be extremely helpful.
    I an trying to write to parallel port on my PC in order to send a trigger to EEG recording machine every time the new goal appears in a Virtual Reality game that I wrote in C++ (I want to record EEG brain signals while subjects are playing the game).
    I tried to follow the instructions from here: http://msdn.microsoft.com/en-us/library/ff802693.aspx
    I wrote the following code:
    BOOL FileExists(LPCTSTR szPath)
    DWORD dwAttrib = GetFileAttributes(szPath);
    return (dwAttrib != INVALID_FILE_ATTRIBUTES && 
    !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
    BOOL WriteABuffer(char * lpBuf, DWORD dwToWrite)
    OVERLAPPED osWrite = {0};
    DWORD dwWritten;
    DWORD dwRes;
    BOOL fRes;
    // Create this write operation's OVERLAPPED structure's hEvent.
    osWrite.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
    if (osWrite.hEvent == NULL)
    // error creating overlapped event handle
    return FALSE;
    // Issue write.
    if (!WriteFile(ghComm, lpBuf, dwToWrite, &dwWritten, &osWrite)) {
    if (GetLastError() != ERROR_IO_PENDING) {
    // WriteFile failed, but isn't delayed. Report error and abort.
    fRes = FALSE;
    else
    // Write is pending.
    dwRes = WaitForSingleObject(osWrite.hEvent, INFINITE);
    switch(dwRes)
    // OVERLAPPED structure's event has been signaled.
    case WAIT_OBJECT_0:
    if (!GetOverlappedResult(ghComm, &osWrite, &dwWritten, FALSE))
    fRes = FALSE;
    else
    // Write operation completed successfully.
    fRes = TRUE;
    break;
    default:
    // An error has occurred in WaitForSingleObject.
    // This usually indicates a problem with the
    // OVERLAPPED structure's event handle.
    fRes = FALSE;
    break;
    else
    // WriteFile completed immediately.
    fRes = TRUE;
    CloseHandle(osWrite.hEvent);
    return fRes;
    I get none of the specified errors, but game fails to start and it seems nothing gets written to parallel port. Any suggestions on how to proceed from here would be more than appreciated.
    Thank you, Joanna

    Hi, I have a problem that I am really stuck with, and I am novice to the task so any help would be extremely helpful.
    I an trying to write to parallel port on my PC in order to send a trigger to EEG recording machine every time the new goal appears in a Virtual Reality game that I wrote in C++ (I want to record EEG brain signals while subjects are playing the game).
    I tried to follow the instructions from here: http://msdn.microsoft.com/en-us/library/ff802693.aspx
    I wrote the following code:
    BOOL FileExists(LPCTSTR szPath)
    DWORD dwAttrib = GetFileAttributes(szPath);
    return (dwAttrib != INVALID_FILE_ATTRIBUTES && 
    !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY));
    BOOL WriteABuffer(char * lpBuf, DWORD dwToWrite)
    OVERLAPPED osWrite = {0};
    DWORD dwWritten;
    DWORD dwRes;
    BOOL fRes;
    // Create this write operation's OVERLAPPED structure's hEvent.
    osWrite.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
    if (osWrite.hEvent == NULL)
    // error creating overlapped event handle
    return FALSE;
    // Issue write.
    if (!WriteFile(ghComm, lpBuf, dwToWrite, &dwWritten, &osWrite)) {
    if (GetLastError() != ERROR_IO_PENDING) {
    // WriteFile failed, but isn't delayed. Report error and abort.
    fRes = FALSE;
    else
    // Write is pending.
    dwRes = WaitForSingleObject(osWrite.hEvent, INFINITE);
    switch(dwRes)
    // OVERLAPPED structure's event has been signaled.
    case WAIT_OBJECT_0:
    if (!GetOverlappedResult(ghComm, &osWrite, &dwWritten, FALSE))
    fRes = FALSE;
    else
    // Write operation completed successfully.
    fRes = TRUE;
    break;
    default:
    // An error has occurred in WaitForSingleObject.
    // This usually indicates a problem with the
    // OVERLAPPED structure's event handle.
    fRes = FALSE;
    break;
    else
    // WriteFile completed immediately.
    fRes = TRUE;
    CloseHandle(osWrite.hEvent);
    return fRes;
    I get none of the specified errors, but game fails to start and it seems nothing gets written to parallel port. Any suggestions on how to proceed from here would be more than appreciated.
    Thank you, Joanna

  • Problem in sending data to BW through XI

    Hi all,
    I am using "How to..push data to BW from XI".
    There a javascript code is given for sending data to BW using XI.
    But when I use that code for sending XML file it is showing a java script error:"Automation server can't create object".
    I think it has something to do with ADODB.Stream object.
    As given in the microsoft document I have deleted the registry entry which disables ActiveX component ADODB.Stream object.
    Even then it is showing the same error.
    Can someone figure out what is the problem.
    Any help will be appreciated.
    Regards,
    Anand

    Hi Anand,
            Sure, first i tried to send hardcoded data by using a report in bw, and refering the classes from transaction sproxy.
    The code was:
    REPORT  ZZ_TEST_XI_POC.
    *& Report  ZZ_TEST_XI_POC
    *& start of code by Anirban Ghatak , 14/03/06
    *& This Report will send data to sap xi
    *& start of code by Anirban Ghatak , 14/03/06
    DATA prxy TYPE REF TO ZPUSHCO_PROXY_INTERFACE_OB.
    CREATE OBJECT prxy.
    DATA it TYPE  ZPUSHPUSH_TABLE1.
    TRY.
        it-PUSH_TABLE-EMP_NO = 'Anirban'.
        it-PUSH_TABLE-EMP_NAME = '393'.
        it-PUSH_TABLE-DEPARTMENT_NAME = 'NetWeaver'.
        CALL METHOD prxy->execute_asynchronous
          EXPORTING
            output = it.
         commit work.
      CATCH cx_ai_system_fault .
        DATA fault TYPE REF TO cx_ai_system_fault .
        CREATE OBJECT fault.
        WRITE :/ fault->errortext.
    ENDTRY.
    *& End of code by Anirban Ghatak , 14/03/06
    then execute it , this sends data to xi.
    Refer /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy
    this can send data from bw to xi.
    Try have a look and see if you can replicate, actually mine is a POC so i have a little bit of flexibility but if you are working on a live devlopement reconsider the solution.
    Anirban.

  • Send bit to parallel port

    Hello LV community,
    I am sending bits to my parallel port to communicate with my ASIC but I have an issue to enter some test modes which require to send simultanously for example 3 bits at the same time into 3 pins  to the port, I can seen from the scope that there are some delays between them (aprox.20 us).
    My question is, this delays is it due to the PC performance or the way to send them? I am using the Out Port8.via for thi purpose. Is there any solution for this issue?
    Thx

    Hi,
    I don't really know your program but maybe you a better of with a Digital I/O board to avoid these delays. Most people use these boards to control there parallel port at high speed by directly accessing the pins. Don't forget that when you are using Port In and Port Out that you are still using software calls and you are dependant on PC performance.
    Regards.
    JorisV

  • Problem in Sending data to Backend.

    Hi All,
    Thanks for all who is answering all my quations. Now i am unable to send data to backend.
    Model and Cardinalities are fine ( I am getting data from backend).
    I created new element in comp controller and method(executing model). I am calling this method in wdInit() in view.
    Do i need to write any code further to insert data into database.
    Any idea, If you have code or example. Please provide me
    Thank you
    Regards
    Ravi.Golla

    Ravi,
    *For sendind data to backend you need to create the model in your webdynpro
    application and call your own/Standard BAPI/RFC enabled function module
    to send/get data from your Back end.
    *If you already done this and getting error then please check these
    Check your Mapping and Binding
    Check your JCO connections.
    Check your code for executing your RFC module
    Check your RFC FM/BAPI in your Back end
    Regards,
    Ram.

  • Problem in reading data from serial port continuously- application hangs after sometimes

    I need to read data from two COM port and order of data appearance from COM port is not fixed. 
    I have used small timeout and reading data in while loop continously . If my application is steady for sometime it gets hangs and afterwards it doesnt receive any data again. 
    Then I need to restart my application again to make it work.
    I am attaching VI. Let me know any issue.
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet
    Attachments:
    Scanning.vi ‏39 KB

    billko wrote:
    Ranjeet_Singh wrote:
    I need to read data from two COM port and order of data appearance from COM port is not fixed. 
    I have used small timeout and reading data in while loop continously . If my application is steady for sometime it gets hangs and afterwards it doesnt receive any data again. 
    Then I need to restart my application again to make it work.
    I am attaching VI. Let me know any issue.
    What do you mean, "not fixed?"  If there is no termination character, no start/stop character(s) or even a consistent data length, then how can you really be sure when the data starts and stops?
    I probably misunderstood you though.  Assuming the last case is not ture - there is a certain length to the data - then you should use the bytes at port, like in the otherwise disastrous serial port read example.  In this case, it's NOT disastrous.  You have to make sure that you read all the data that came through.  Right now you have no idea how much data you just read.  Also, if this is streaming data, you might want to break it out into a producer/consumer design pattern.
    Not fixed means order is not fixed, data from any com port can come anytime. lenght is fixed, one com port have 14 byte and other 8 byte fixed..
    Reading data is not an issue for me as it works nice but I have a query that why my application hangs after sometime and stops reading data from COM PORT.
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet

  • Problem while Sending data concurrently using Evsnd function.

    Hi All,
    i am trying to send data from input schudule using evsnd function.
    As per a test scenerio.
    User 1: one user( cantains all bas members) , opens the input schudule  , waits for and hour  and do planning for few basmemebers and  then submit the data.
    User 2:another user ( subset of all base members) ,opens input schudule  ,do planning and submits the data.
    Now when  user 1 Sumits the data , it overwrites the value of user 2.
    is there is any way by which we can restrict user 1 of sending those value only that he/she  changed.
    Edited by: Tapeshwar Singh Bagal on Mar 11, 2009 11:02 AM

    First, I'd strongly encourage you to use EVDRE instead of EVSND, as it gives a lot better control over many aspects of the input schedule.
    As to your point, EVDRE definitely will only send back to the server the cells which have changed. It's been a few releases since I used EVSND (and its behavior may have changed some in the meantime), but if I recall correctly, it also does some of this same checking.
    Another option to consider is to make the input schedule smaller (fewer accounts or entities or products or whatever your dimensions), and split it into two pieces, one for each of the business processes that the 2 users are performing.
    If the 2 users are maintaining the same intersection of data, and performing the same business process (acting as a team, for example) then BPC has limited ability to support "checking out for edit" or locking the data for one user, in a way that prevents another user from changing it. The "park n go" feature does this in a way, but it's something that the user needs to do intentionally. That doesn't sound like your User 1 scenario of waiting for an hour before submitting -- probably when they opened it up, they thought it would only take 2 minutes, but then the phone rang, and then an email.... and then finally they finish it an hour or 8 later.

  • Problems in Sending Data through JMS Bridge - WLS 10.3 to WLS 11g

    I have a scenario where I need to send data from a queue configured on WLS 10.3 to WLS 11g. I am using OSB on WLS 10.3.
    What I have done is
    1. Created a JMS Based BS in OSB which sends data to jms://localhost:7001/ConnFactoryJNDI/QueueJNDI
    2. Created a JMS Bridge on WLS 10.3
    3. Source Destination has been configured as the one mentioned above.
    4. Target Destination has been configured to a queue on WLS 11g.
    When i execute the JMS Based BS in OSB, data is being written to the Source Queue directly. I am not sure of the JMS Bridge functionality but I assume that once data is written to the Source Destination, that data will be automatically pushed on the target destination.
    I have configured a JDBC store for the target queue but I no table is created with the data sent from the source.
    M i missing something here?

    I think this question belongs to weblogic server, but as far as I know bridge should be created always at higher version. means, you should create bridge at 11g and try to pull/drop data from 10g. To check any errors in bridge, check the server log and make sure status of bridge is "forwarding messages"
    Regards,
    Anuj

  • Problem in sending data through email in brodcasting

    HI All
    i am trying to send the data through email in the broadcasting. but as i execute the broadcasting the message comes
    "Online processing is not possible for user 1"
    further its is saying
    "You want to execute a broadcast setting online. Processing this setting requires switching to another user (for example, with the user-specific precalculation of Web templates for a user other than your user). This is only possible in background processing."
    but i dont know how to login as seperate user. as i have to send the data through my login and not someone else.
    Hope i am clear.
    Please help me on this its very urgent
    Thanks

    The solution to this problem is that:-
    1. this is not an error
    2. it gives the warning beacuse we cannot execute the broadcast setting at that moment (with different users in reciepient list) i.e. we have to schedule the broadcast settings.
    Thanks
    Prat

  • Java Server/Client Applicaton - problem with sending data back

    Hello!
    I'm trying to write a small server/client chat application in Java. It's server with availability to accept connections from many clients and it's app just for fun... However, I've come up against a huge problem: everything what clients send, arrives to server (I'm sure about that because it is displayed on the Server Application screen) and then server should send it back to all clients but it doesn't work. I have no faintest idea what causes this problem. Maybe you can help me?
    Here is my server app code:
    import java.net.*;
    import java.util.*;
    import java.io.*;
    * @author Robin
    public class Server {
        ServerSocket serw = null;
        Socket socket = null;
        String line = null;
        Vector<ClientThread> Watki = new Vector();
        ClientThread watek = null;
        public Server(int port) {
            try {
                serw = new ServerSocket(port);           
                line = "";
                while(true) {
                    System.out.println("Running. Waiting for client to connect...");
                    socket = serw.accept();
                    System.out.println("Connected with:\n" + socket.getInetAddress() + "\n");
                    watek = new ClientThread(socket);
                    Watki.addElement(watek);
                    Watki.firstElement().Send("doszlo?");
            }catch (IOException e) {
                System.out.println("BLAD: " + e);
        public void sendToAll(String s) {
            for(int i = 0; i < Watki.size(); i++) {
                Watki.elementAt(i).Send(s);
        public class ClientThread extends Thread {
            Socket socket;
            DataInputStream in = null;
            DataOutputStream out = null;
            String line = null;
            public ClientThread(Socket s) {
                try {
                    this.socket = s;
                    in = new DataInputStream(s.getInputStream());
                    out = new DataOutputStream(s.getOutputStream());
                    start();
                }catch (IOException e) {
                    System.out.println("BLAD: " + e);
            public void Send(String s) {
                try {
                    out.writeUTF(s);
                }catch (IOException e) {
                    System.out.println("BLAD: " + e);
            public void run() {
                try {
                    line = "";
                    while (true) {
                        line = in.readUTF();
                        System.out.println(line);
                        sendToAll(line);
                }catch (IOException e) {
                    System.out.println("BLAD: " + e);
        public static void main(String[] args) {
            Server serwer = new Server(5000);
    }And here is client app code:
    import java.net.*;
    import java.util.*;
    import java.io.*;
    * @author Robin
    public class Client implements Runnable {
        Socket socket = null;
        BufferedReader keyIn = new BufferedReader(new InputStreamReader(System.in));
        DataInputStream in = null;
        DataOutputStream out = null;
        String line = null;
        public Client(String host, int port) {
            try {
                System.out.println("Connecting to " + host + ":" + port);
                socket = new Socket(host, port);
                System.out.println("Connected\nTALK:");
                out = new DataOutputStream(socket.getOutputStream());
                in = new DataInputStream(socket.getInputStream());
                line = "";
                while(!line.toLowerCase().equals(".bye")) {
                    line = keyIn.readLine();
                    Send(line);
            }catch (UnknownHostException e) {
                System.out.println("BLAD: " + e);
            }catch (IOException e) {
                System.out.println("BLAD: " + e);
        public void Send(String s) {
            try {
                out.writeUTF(s);
            }catch (IOException e) {
                System.out.println("BLAD: " + e);
        public void run() {
            String loaded = "";
            try {
                while(true) {
                    loaded = in.readUTF();
                    System.out.println(loaded);
            }catch (IOException e) {
                System.out.println("BLAD: " + e);
        public static void main(String[] args) {
            Client client = new Client("localhost", 5000);
    }By the way, this app is mainly written in English language (text that appears on the screen) however in functions I used Polish language (for example: BLAD - it means ERROR in English). Sorry for that :)

    Yeap, I will change those exceptions later, thanks for advice.
    You asked what's going on with it: both applications start with no errors, but when I write something in client side it should be sent to the server and then forwarded to all connected clients but it stops somewhere. However, I added a one line to the server code
    line = in.readUTF();
    System.out.println(line);
    sendToAll(line); and after it reads message from client (no matter which one) it shows that message on the server side screen, then it should send this message to all clients but it doesn't work in this moment. What's confusing: no errors occurs, so it's rather a mistake in my code, but where?
    Edited by: Robin3D on Sep 30, 2009 9:07 AM

  • Sending data to USB port !

    Hi,
    I have a transmitter card and receiver card which fits to USB port. I need to send bulk data, may be video from one system to other, both running windows OS (98/ME or 2000).
    I went through the USB postings and saw something about TWAIN driver for USB scanner. My primary purpose is to check that I can transfer bulky data with high band-width (11mbps) through this TX/RX cards. ANy data transfer will do.
    Can anyone suggest me a good solution!!!
    My OS is windows and so I guess jUSB and JSR-80 will not work!
    please help!
    -kk

    What drivers com with yoyur TX/RX cards?
    How does windows see them?
    Do they look like extra serial ports?
    Is a C/C++ api provided?
    Can you provide a link to the manufacturers web site?
    Then we could help :)

  • Problems with sending data to serial

    Hi!
    This may be a stupid question. 
    But i try to ask it, however...
    I'm trying to communicate with a motor throu rs-232. 
    The manual says that the commands should have the following form: (an example)
     SXWT <0H><0H><0H><32H> <88H><cr>
    Where <0H><0H><0H><32H> is the data in a four byte long integer. <88H> is a checksum, that is easy to calculate.
    My problem is how do I send the hex. data in a string(combined with the ascii-string in the beginning)?

    Also have in mind how the motor want to receive the integer. Labview uses Big Endian. If the motor want the integer in Little Endian you must use byte swapping
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

Maybe you are looking for

  • How to Change default text in Multi-Selection Table Bar

    Hi, I would like to change the default text "Select Object" on the Multi-selection Table Bar. I tried adding the following in my resultsCO but I'm getting errors: tableBean.setTableSelectionText("<newText>"); Error(25,34): invalid method declaration;

  • Select file one at a time

    I just created my first automator plugin to sort and rename video files from a JVC Everio camera. Once I have the .MOD files, I am using MPEG Streamclip from www.squared5.com to convert those files into a .DV file for iDVD or iMovie. The problem is t

  • Problem  while reading XML file from Aplication server(Al11)

    Hi Experts I am facing a problem while  reading XML file from Aplication server  using open data set. OPEN DATASET v_dsn IN BINARY MODE FOR INPUT. IF sy-subrc <> 0.     EXIT.   ENDIF.   READ DATASET v_dsn INTO v_rec. WHILE sy-subrc <> 0.   ENDWHILE.

  • SAP Query Alias Table in Info-set not working

    Hi Guys, I'm having a bit of trouble with a query I'm writing in SQ01. I am trying to create a standard margin report between two different costing variants that we use. n order to do so I have had to employ the use of alias tables. I have named the

  • Iphone 5 pictures not showing in Windows Explorer

    When I plug my iPhone 5 to my company's laptop it is showing in windows explorer. I can go to the DCIM folder, but it's empty....there are plenty of pictures on it but they are not showing up....how's that? It worked out with my iPhone 4 all the time