How to access serial port using servlet

I want to communicate with a microcontroller connected to the serial port of my computer.
*I am using the following:
Windows 98 operating system
Tomcat web server 4.1
*The directory structure is as given:
Tomcat 4.1/webapps/myjsp/web-inf/classes/remoteservlets.
I have placed my jsp files in my jsp folder and classfiles in remote servlets folder.
**my java program has compiled correctly.**
** my simple java application which accesses the serial port works fine.***
*when I start tomcat I am able to access the sevlet as the servlet responds with the button name i have pressed.
**** I have also tried the following
Copied file comm.jar in <JAVA_HOME>\jre\lib\ext
Copied file javax.comm.properties in <JAVA_HOME>\jre\lib
Copied file win32com.dll in <JAVA_HOME>\lib and also in c:\windows\system32 and c:\windows\system
***************which helped me do away with errors.
still I don't get any output. I dont get any errors either.
PLEASE HELP. URGENT. i am at my wits end.
Thank you.

Servlet is the one which runs in the server side...if u want to comunicate with the serial port of the server in which ur servlet is running can be done but making use of Communication api available....
U can download the Api from http://java.sun.com/products/javacomm/index.jsp
There are three levels of classes in the Java communications API:
High-level classes like CommPortIdentifier and CommPort manage access and ownership of communication ports.
Low-level classes like SerialPort and ParallelPort provide an interface to physical communications ports. The current release of the Java communications API enables access to serial (RS-232) and parallel (IEEE 1284) ports.
Driver-level classes provide an interface between the low-level classes and the underlying operating system. Driver-level classes are part of the implementation but not the Java communications API. They should not be used by application programmers.
regards
shanu

Similar Messages

  • How to access parallel ports using LabVIEW?

    I want to send data to a device which is connected through LPT1.when Iam using serial port write.vi with port number 10(for LPT1) it is giving an error code 37 which means the device not found. whether those vis are only for accessing serial ports? Then how to access LPT1 using LabVIEW?

    Most likely you need to modify your labview ini file to let it know that LPT1 (or whichever) will be controled through the serial port control. See the following link for a knowledgebase answer to this question:
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/a5abd9d76665217b86256333005ac9a5?OpenDocument
    Jared

  • HOW TO ACCESS PARALLEL PORT USING JAVA

    hello guys.. Please Solve my Problem..
    I have to access motor through pc using Parallel Port. I want to know how to program in java to access Parallel Port. So How can i code to access the any Port of Parallel Port. Please Guide me in this..

    well I cannot give a more detailed answer than "use the java comm API".
    http://java.sun.com/products/javacomm/
    http://java.sun.com/developer/Books/javaprogramming/cookbook/11.pdf
    However Java wasn't built to do these kinds of operations, so it may well be that the API does not provide the functionality you need. In that case you may need a native library to do the work for you, which can make things a lot more difficult.

  • Problem in Accessing serial port using java comm Api

    I have installed java comm Api in my pc.
    i have gone through the instalation instruction which comes on this package.
    I have done the instalation like this
    Copy win32com.dll to my <JDK>\bin directory.
    Copy comm.jar to my <JDK>\lib directory.
    Copy javax.comm.properties to my <JDK>\lib directory.
    and restart the system.
    But when i run the BlackBox , it is giving me message
    "serial port not found".
    Can any one tell me , what is the exact problem ?

    I'm not sure what you mean by BlackBox, but I have used the COMM api extensively.
    The majority of problems is that the api cannot see the serial port (which is what you are describing) and this is caused by incorrect placing of the javax.comm.properties file.
    As well as <JDK>\lib, try putting it into <JRE>\lib as well. That has often solved problems on my setup.

  • "how to read serial port using labview 6.0"

    sir i am doing a project and is in a need to extract data from serial port. can anyone help me

    This link, and the links from it, are a great place to start:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/8DECBF3E0B714BF3862568F9006E7851?opendocument
    2006 Ultimate LabVIEW G-eek.

  • How to transfer file from PC to PC via serial port using labview

    I need to transfer files(.txt, .doc, .xls) from PC to PC via serial port using LabVIEW. Is it possible to transfer files, if so how to transfer?
    Solved!
    Go to Solution.

    Yes, it is possible to transfer files with the serial port using LabVIEW.  Files are just collections of bytes and the serial port is pretty good at shipping bytes from one PC to another.  You need to connect the serial ports together with a null modem cable.
    First, take a look at the example for serial communication.   In LabVIEW, go to the Help menu and select "Find Examples...".  From there you can search for "serial" or navigate to Hardware Input and Output >> Serial.  Select the "Basic Serial Write and Read.vi".  Experiment with that example to gain confidence on the serial communication methods.
    Next, it's time to learn about how to read and write files.  For that, the examples could be somewhat confusing since they all deal with files that are presumed to have data of a specific type in them.  I would recommend just getting familiar with the functions on the File I/O palette.  Specifically, get to know the following functions.
    Open/Create/Replace File - On your destination side, you'll need to create the copy of the file that you are trying to transfer
    Close File - When you are finished reading from or writing to a file, you should close it.  It cleans up the memory being used and finalizes any write operations that are still floating in the write buffer.
    Read From Binary File - The best way to read from a file when you do not really care what type of file it is.  In your case, you just want to get those bytes read and sent out so they can be written down at the destination.
    Write to Binary File - At the destination side, this is what will store those bytes to the file you created with number 1.
    Get File Size (under the Advanced File Functions sub-palette) - You need to know how big the file is so you know when you are finished.
    OK, so once you are able to create files, write bytes to them, and read bytes from existing files you can move on to transferring.
    The basic method I would suggest is to have the user specify a source file on the source PC and a destination folder on the destination PC.  Then, find out the size of the source file using number 5.  Divide that size number by the number of bytes you feel like transferring at once.  The serial buffers are usually around 32k (if I remember correctly) so do not exceed that.  Now begin sending data by reading some number of bytes and wiring that string output to the VISA Write function.  On the destination side, you'll want to be monitoring the serial port for bytes and reading them when they arrive.  Wire that string to the Write to Binary File function to add them to your destination file.
    That is the basic outline of how to do it.  You have to be careful not to overload the write and read buffers on the serial ports.  Initially you can use delays on the sending side to make sure the reading side has enough time to digest.  To get things moving faster, you can bring in some flow control.
    If all that sounds a bit intimidating, there are Alliance Member companies out there (such as PrimeTest Automation) who can write such code for you and even provide a turnkey solution for you.
    Happy wiring,
    Dan Press
    Certified LabVIEW Architect
    PrimeTest Automation

  • How do I get the Tomcat port using Servlet.

    I am running Apache + Tomcat. All request are going though Apache. How do I get the Tomcat port using Servlet.

    See:
    ServletRequest.getServerPort()This will give the port upon which the request was recieved . . .which I blelieve is what you are looking for.

  • Exception while accessing com port from servlet

    I am trying to access communication port from a Servlet using java communications api's.
    But Following exception was thrown
    Caught java.lang.NullPointerException:name can't be null while loading driver com.sun.comm.Win32Driver
    The SecurityManager do not allow that opeartion.
    java.security AccessControlException:access denied (java.io.FilePermission c:\j2sdk1.4.1\jre\lib\javax.comm.properties delete)
    at java.security.AccessControlContext.java:270) at java.security.AccessController.checkPermission(SecurityManager.java)
    at java.lang.SecurityManager.checkDelete()
    at java.comm.CommPortIdentifier.getPortIdentifiers(CommportIdentifier.java)
    Please help me.Tell me what to do.how to successfully access a communication port from a Servlet.

    Hi there. I am also facing the problem accessing com port via servlet. if u have the solution, kindly forward to me at [email protected]
    many thanks

  • Can air for html/ajax accessing serial port or usb?

    I just have made use of Adobe AIR .I want to use printer with
    air . Do air have some poperties to accessing serial port or usb?
    I look up that on the Adobe AIR documents.I only found
    'Adobe® AIR™ provides the eans to check for changes to
    the network connectivity of the computer on which an AIR
    application is installed'.
    Do you have some demo with Adobe AIR accessing serial port or
    usb ?
    Or has another poperties to do that!
    thank you!!

    There is no API for accessing the serial port. USB devices
    can only be accessed through the file system (and only if they are
    storage devices).

  • Pse help. K7T66Pro2 cannot access serial ports in DOS window

    My K7T266Pro2 won't access serial ports in a DOS window under Windows 98SE.
    Windows programs can access the ports but no DOS programs - including my modem program, banking program, Tapcis Compuserve program and MDMDR a serial port diagnostic program.
    I have tried both setting the ports in BIOS to AUTO
    and forcing the standard values for com1 and 2
    and I have verified that the serial ports are set for:
    com1 irq 4 i/o 3f8
    com2 irq 3 i/o 2f8
    I know my way around serial ports.
    Every other motherboard I have used under Windows 98SE has had no problems accessing the serial ports
    under DOS.
    I asked my dealer to try another K7T motherboard.  He loaded Windows 98SE and could not access the serial
    port in a DOS window either.
    Is this something funny about K7T boards?
    Do others have this problem?
    This is a quite urgent problem.  Please help.
    Larry Alkoff

    Larry,
    You posted in the nVidia/AMD/SiS Forum instead of the Via Forum. I have moved you to the correct forum.
    Good Luck,
    Richard

  • Problem connecting N79 to serial port using blueso...

    Greeetings to All,
    I have a big problem, when i connect my n79 using bluesoleil v3.0, i got File transfer, dialup networking and object push services only.
    If i try to start serial port service to connect my n79 to a serial port it displayes error "can not start service".
    i have tried various bluesoleil versions but the problem remains same everytime. on the other hand i can connect my sony k750i to a serial port without any problem.
    can someone tell me how to connect n79 to a serial port using bluesoleil
    OR
    Does N79 not support bluetooth serial port connectivity?
    or is there any other way to connect n79 to a serial port using blesoleil and my bluetooth dongle on a WINXP SP2 system?
    Thanks in Advance

    Yes, PCSuite supports a great deal of Bluetooth drivers. These are all built in so, give it a try.
    Windows Vista x32 en x64 editions:
    Microsoft Windows Bluetooth stack
    Toshiba Bluetooth stack, driver versie 5.10.12
    IVT BlueSoleil Bluetooth stack, driver versie 5.0.5
    Windows XP x64:
    Microsoft Windows Bluetooth stack
    Toshiba Bluetooth stack, driver versie 5.10.12
    IVT BlueSoleil Bluetooth stack, driver versie 5.0.5
    Windows XP:
    Microsoft Windows Bluetooth (enkel in Service Pack 2)
    Toshiba Bluetooth stack, driver versie 4.0, 5.0 and 5.10.12
    WIDCOMM Bluetooth stack, driver versie 1.4.2, 3.x, 4.x and 5.x
    IVT BlueSoleil Bluetooth stack, driver versie 2.x, 3.x and 5.0.5
    ‡Thank you for hitting the Blue/Green Star button‡
    N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009

  • Help - K7T266Pro2 won't access serial ports in DOS window

    My K7T266Pro2 won't access serial ports in a DOS window under Windows 98SE.
    Windows programs can access the ports but no DOS programs - including my modem program, banking program, Tapcis Compuserve program and MDMDR a serial port diagnostic program.
    I have tried both setting the ports in BIOS to AUTO
    and forcing the standard values for com1 and 2
    and I have verified that the serial ports are set for:
    com1 irq 4 i/o 3f8
    com2 irq 3 i/o 2f8
    I know my way around serial ports.
    Every other motherboard I have used under Windows 98SE has had no problems accessing the serial ports
    under DOS.
    I asked my dealer to try another K7T motherboard.  He loaded Windows 98SE and could not access the serial
    port in a DOS window either.
    Is this something funny about K7T boards?
    Do others have this problem?
    This is a quite urgent problem.  Please help.
    Larry Alkoff

    Larry,
    You posted in the nVidia/AMD/SiS Forum instead of the Via Forum. I have moved you to the correct forum.
    Good Luck,
    Richard

  • Access serial port through AIR

    isnt there any extensions or API buit for accessing serial
    port from AIR.
    i am designing a vending machile applicaton in which a coin
    drop is detected and corresponding images or message is displayed.
    MDM Zinc 3.0 allows serial port access but worths more than
    what it deserves. does AIR has some similar functionality.
    Any help.

    I'm not too hot on this subject, but would it not be possible
    to use Binary Sockets to connect to another app on the machine that
    could connect to a serial port?

  • Can not access serial port while upgrading from LabVIEW 6.1 to 7.0

    Hi,
    I built an application under LabVIEW 6.0.2. few years ago. This application uses LabVIEW serial features. When I upgraded to LabVIEW 6.1, my application was still working correctly.
    Today, I upgraded to LabVIEW 7.0, mass compile all VIs and now my application can not communicate with my peripheral !!!
    The program is sending the command to the peripheral. The peripheral answers but LabVIEW serial driver does not see any datas on buffer even if datas are available ... "Bytes At serial port.vi" always returns 0. I am sure that datas are available, using a COM port psy.
    Does anyone has an idea?
    I saw a lot of solutions in the forum, but I would like to know the best solution with minimum work, te
    st, and so on ... on my program.
    Regards,
    Pascal.

    Hi Pascal,
    Which is your version of NI-VISA?
    Please see the link bellow :
    http://digital.ni.com/manuals.nsf/websearch/E8D86CD680B0753D86256D2C005D8EA0
    The first test to be made is to test the communication with your serial port using MAX (Measurement and Automation Explorer) :
    Open MAX, Go to "Devices and Interfaces", then "Ports", select COM1 (or ASRL1::INSTR). Right clic on it and select "Open VISA Session" the go the "Basic I/O" then Write data, execute, Read data, execute.
    Be sure that the communication is OK. Be sure that you use the same Alias existing in MAX in your LabVIEW program.
    Now, if all is OK, try to use Serial communication examples existing in LabVIEW Help>>Examples Finder. These examples use NI-VISA VIs.
    If all above is OK and you
    still have the same problem, try to follow these instructions :
    "In order to use the old Serial Compatibility VIs in LabVIEW 7.x, you must copy the following files from a previous version of LabVIEW to the LabVIEW 7.x directory:
    Replace the serial.llb in LabVIEW 7.x with the serial.llb from a previous version of LabVIEW. This file is found in C:\Program Files\National Instruments\LabVIEW\vi.lib\instr.
    Replace the _sersup.llb file in LabVIEW 7.x with the _sersup.llb from a previous version of LabVIEW. In LabVIEW 6i and 6.1 this file is located in C:\Program Files\National Instruments\LabVIEW\vi.lib\platform. In LabVIEW 7.x (and 5.x) this file is found in C:\Program Files\National Instruments\LabVIEW\vi.lib\instr.
    Copy the file serpdrv to the C:\Program Files\National Instruments\LabVIEW 7.x directory. This file is not installed with LabVIEW 7.x, so it only needs to be copied from a previous version of LabVIEW, not replaced."
    I hope that my answer will help you.
    Sa
    naa T
    National Instruments

  • How to access xml file using c

    how to access xml file using c. are there any libraries regarding xml fastinfoset in c? Please let me know about any resources if u know? thanks!!!
    samitha

    There are different methods to access XML data which have pro's and cons. Let us know more about what you want to do and we can help you.

Maybe you are looking for

  • Get all children under root

    I want to know whats the easiest way to get all children under root. Say, if the depth is 100, how can I get the all the children from depth 1 to depth 100? Does java has an API? Thanks.

  • Custom report region (Conditionaly Split over two rows)

    I have a request, to take an existing report that displays data like this: Pool Performing vs Non-Performing Current Balance Low Value High Value Value Cumulative Cumulative WA Low WA High Loss Low Loss High AA Performing $XXX,XXX,XXX $XXX,XXX,XXX $X

  • Heading for repeating frame (horizontal) to appear just once - How?

    Hi I have 3 queries that represent 3 different levels. Each level is displayed one above the other. Example Level 3: <field3 from query3> Level 2: <field2 from query2> Level 1: <field1 from query1> In the output The level labes are displayed as many

  • Handle exception?

    hello all, table structure: CREATE TABLE COR_DIVI_MST (divi_locn_code varchar2(6) not null, Divi_CODE VARCHAR2(2) NOT NULL, Divi_NAME VARCHAR2(200), CONSTRAINT CORDIVIMST_PK PRIMARY KEY(divi_locn_code,divi_code)); i have a form for enter master data.

  • Application Server - Admin Console Login Problem

    Hi, I have installed J2EE 1.4 (Sun Java Application Server Platform Edition 8) on Windows 2000. Installation was successful and the app server is getting started too. When i am going to http://localhost:4848/asadmin (Admin Console) and enter user/pas