How to read and write from the serial port using java

can anyone tel me how to capture data from a serial port and display on the screen and also store it in a database.

Java Comm API, JDBC

Similar Messages

  • How to read and then extract HTMl source code using java program?

    Hi,
    Could someone tell me how to read and then extract the content of certain tag from html source code. For example, given url http://.... , I would like to know what the <Title> content <Title> in that page is.
    Any help is greatly appreciate.

    Use a URLConnection to make the connection to the page at the needed URL. From the URLConnection, you can get an InputStream that is the stream of data from that page. Just search through the stream and find the <title> tags (don't forget to check for case sensitivity).

  • How do I read and write at the same time using the NI-CAN channel API?

    Here's the situation.  I have one CAN bus, and I need to read and write channel data (using the channel API) at the same time both at an interval of 20 ms.  It's easy to do one or the other using the channel API, but you can't setup a channel task to do both.  It's either input or output, not both.  Is this even possible?

    Hi,
    yes , this is possible. But you have to create two tasks, one for input and one for output. see the attached example for LabVIEW.
    If you download and install NI-CAN 2.4 you will get this example and one for C and VB as well.
    DirkW
    Attachments:
    Single Sample Input Output same Port.vi ‏79 KB

  • How to get a signal from the serial port to start a labview program?

    I need to synchronize the data obtained from a program (which is not in Labview)with the data collected with Labview on a different computer. I can send some data strings to the serial port of the computer running the Labview program when the other program starts. However, I need to be able to read the trigger in my Labview program. Do you know what I should do? Thanks.

    If you don't have any other programs listening on the COM port, you need to let a LV program run BEFORE the signal comes, otherwise you won't be able to read it. You can have the program wait in a slow timed loop so that it doesn't use up too much CPU time, and when the required "trigger" comes, to move into the main part of the program.
    You basically need a while loop waiting for a certain string in the serial buffer. Once the string is found the while loop is exited, and the data acqquisition or whatever else you require from the progam can be performed.
    In the example attached the program wait for ANY text to be sent to the COM port. Please note that you need to configure the VISA resource before using it. Once there is something at the COM port, the loop will exit and the rest of the program will be executed.
    Hope this helps
    Shane
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
    Attachments:
    Wait for serisl message.vi ‏17 KB

  • How to read and write from XL file

    HI ,
    I wanted to read a data from XL file and write a data in XL file by generating a report .Can any body help me out.Many examples are available on discussion forums but when I try to save and run those Vi .I am not able to run Showing error .Please tell what is going wrong as I m having latest labview 8.6 .
    Regards
    Sharmila.karale

    Hi Adnan,
    Here are the examples of Vi which I have downloaded from the forum for my reference
    Regards
    Sharmila.Krale
    Attachments:
    SAVE TO EXCEL.llb ‏128 KB
    excel.llb ‏1618 KB

  • How to read and write to the same external HDD using Mac and PC

    Hello,
    I am using a mid 2014 MacBook Pro.
    I read somewhere that to write to an external HDD from a Mac, you need to format it in a particular way.
    But this would stop it from being used on my PC. Is there any way I can write to the same HDD from both OSes ?
    Thanks !

    Yes.  Format the HDD to FAT or ExFAT.  It seems best to do that on a PC.
    Ciao.

  • Hello!!!I need to read some data from the serial port and processing these, at the same time I want to see the process that I am doing.

    I read the data without problems, and I see them using Waveform graph, the problem is that I want to see the real time stamps, but in the graph appears 2:00:00,000 and 01/01/04, so the date and the time is wrong !!
    Can I change this?
    I am thinking that the problem is that I have to adquire the data and the time stamps ( using Get date/time) and after, I have to represent both!!!
    Thanks!!!

    Hello,
    As you probably know a waveform is made of a beginning time (t0), a time difference between each value (dt) and an array of values (Y). Your problem is probably that you don't initialize t0. Use the Vi 'Waveform->Build a waveform' to initialize the time of the waveform.
    Hope this helps !
    Julien

  • How to read some lines from a text file using java.

    hi,
    i m new to java and i want to read some lines from a text file based on some string occurrence in the file. This file to be read in steps.
    we only want to read the file upto the first Occurrence of "TEXT" string.
    How to do it ,,,
    Kinldy give the code
    Regards,
    Sagar
    this is the text file
    dfgjdjj
    sfjhjkd
    ghjkdg
    hjkdgh TEXT
    ikeyt
    ujt
    jk
    tyk TEXT
    rukl
    r

    Hendawy wrote:
    Since the word "TEXT" is formed of 4 letters, you would read the text file 4 bytes by four bytes. Wrong on two counts. First, the file may not be encoded 1 byte per character. It could be utf-16 in which case it would be two byte per character. Second, even if it were 1 byte per character, the string "Text" may not start on a 4 byte boundary.
    Consider a FileInputStream object "fis" that points to your text file. use fis.read(byte[] array, int offset, int len) to read every four bytes. Convert the "TEXT" String into a byte array "TEXT".getBytes(), and yous the Arrays class to compare the equality of the read bytes with your "TEXT".getBytes()Wrong since it relies on my second point and will fail when fis.read(byte[] array, int offset, int len) does not read 4 bytes (as is no guaranteed to). Check the Javadoc. Also, the file may not be encoded with the default character encoding.
    The problem is easily solved by reading a line at a time using a BufferedReader wrapping an InputStreamReader wrapping a FileInputStream and specifying the correct character encoding.
    Edited by: sabre150 on Apr 29, 2009 2:13 PM

  • How to read and write a data from extrenal file

    Hi..
    How to read and write a data from extrenal file using Pl/sql?
    Is it possible from Dyanamic Sql or any other way?
    Reagards
    Raju

    utl_file
    Re: How to Create text(dat) file.
    Message was edited by:
    jeneesh

  • How to read and write a string into a txt.file

    Hi, I am now using BEA Workshop for Weblogic Platform version10. I am using J2EE is my programming language. The problem I encounter is as the above title; how to read and write a string into a txt.file with a specific root directory? Do you have any sample codes to reference?
    I hope someone can answer my question as soon as possible
    Thank you very much.

    Accessing the file system directly from a web app is a bad idea for several reasons. See http://weblogs.java.net/blog/simongbrown/archive/2003/10/file_access_in.html for a great discussion of the topic.
    On Weblogic there seems to be two ways to access files. First, use a File T3 connector from the console. Second, use java.net.URL with the file: protocol. The T3File object has been deprecated and suggests:
    Deprecated in WebLogic Server 6.1. Use java.net.URL.openConnection() instead.
    Edited by: m0smith on Mar 12, 2008 5:18 PM

  • How to read and write on ntfs partitions??

    Hello everyone, thanks for viewing my post.  I want to know how to read and write on ntfs partitions under sata hd on my arch64 system.  I'm using kde as my de and dolphin does sees it but can't access it anyway.  I didn't had problem so far on mounting usb drives it just automounts maybe because it is a fat partition not a ntfs?  Please I need your help...Thanks in advance:)

    You will most likely need to rework your fstab.  The one from my desktop is shown below. If you want regular users to be able to access the partition, then you will need to change the gid option as I have done. Although you could create a group just for people you want to have access.
    You will need to know the device that your windows partition is held on of course. In my case it is my first hard disk, first partition, hence /dev/sda1.
    # /etc/fstab: static file system information
    # <file system> <dir> <type> <options> <dump> <pass>
    none /dev/pts devpts defaults 0 0
    none /dev/shm tmpfs defaults 0 0
    /dev/cdrom /media/cdrom auto ro,user,noauto,unhide 0 0
    /dev/dvd /media/dvd auto ro,user,noauto,unhide 0 0
    /dev/mapper/nvidia_fbgfhehd1 /boot ext2 defaults 0 1
    /dev/mapper/nvidia_fbgfhehd2 / reiserfs defaults 0 1
    /dev/mapper/nvidia_fbgfhehd3 /var reiserfs defaults 0 1
    /dev/mapper/nvidia_fbgfhehd5 /opt reiserfs defaults 0 1
    /dev/mapper/nvidia_fbgfhehd6 swap swap defaults 0 0
    /dev/mapper/nvidia_fbgfhehd7 /home reiserfs defaults 0 1
    /dev/sdd1 /mnt/andromeda vfat defaults 0 0
    /dev/sda1 /mnt/windows ntfs-3g defaults,user,gid=users 0 0
    My XP partition is set to mount automatically, as I regularly interchange documents between the OS's.
    Hope that helps.

  • How to read and write data in to a specified range of cells(it include multiple row & columns) in excel

    How to read and write data in to a specified range of cells(it include multiple row & columns) in excel

    CVI Comes with a sample project that explains how to read/write to a Excel file: choose "Explore examples..." in CVI welcome page and navigate to <cviSampleDir>\activex\excel folder where you can load excel2000dem.prj.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • I have the latest Mac Air 13" and I have a Seagate 500MB external hard disk I cant copy or Cut any files on the hard disk and I cant even delete any files. I have the settings as Read and Write in the get info tab. Please help

    I have the latest Mac Air 13" and I have a Seagate 500MB external hard disk I cant copy or Cut any files on the hard disk and I cant even delete any files. I have the settings as Read and Write in the get info tab. Please helpand also note that my hard drive was formatted on a Windows 7 Laptop.

    thats the problem, its in MSDos (Fat) or NTFS for Windows.
    Options.....
    1. offload all that data on the HD onto your PC, THEN format the HD in EXFAT for use on BOTH PC and Mac for read/write.....then reload all (or as you need) that data back onto the HD
    2. get another HD, and format it for Mac OSX extended journaled.
    FAT32 (File Allocation Table)
    Read/Write FAT32 from both native Windows and native Mac OS X.
    Maximum file size: 4GB.
    Maximum volume size: 2TB
    You can use this format if you share the drive between Mac OS X and Windows computers and have no files larger than 4GB.
    NTFS (Windows NT File System)
    Read/Write NTFS from native Windows.
    Read only NTFS from native Mac OS X
    To Read/Write/Format NTFS from Mac OS X, here are some alternatives:
    For Mac OS X 10.4 or later (32 or 64-bit), install Paragon (approx $20) (Best Choice for Lion)
    Native NTFS support can be enabled in Snow Leopard and Lion, but is not advisable, due to instability.
    AirPort Extreme (802.11n) and Time Capsule do not support NTFS
    Maximum file size: 16 TB
    Maximum volume size: 256TB
    You can use this format if you routinely share a drive with multiple Windows systems.
    HFS+     ((((MAC FORMAT)))  (Hierarchical File System, a.k.a. Mac OS Extended (Journaled) Don't use case-sensitive)
    Read/Write HFS+ from native Mac OS X
    Required for Time Machine or Carbon Copy Cloner or SuperDuper! backups of Mac internal hard drive.
    To Read HFS+ (but not Write) from Windows, Install HFSExplorer
    Maximum file size: 8EiB
    Maximum volume size: 8EiB
    You can use this format if you only use the drive with Mac OS X, or use it for backups of your Mac OS X internal drive, or if you only share it with one Windows PC (with MacDrive installed on the PC)
    EXFAT (FAT64)    ------Can read/write from both PC and Mac
    Supported in Mac OS X only in 10.6.5 or later.
    Not all Windows versions support exFAT. 
    exFAT (Extended File Allocation Table)
    AirPort Extreme (802.11n) and Time Capsule do not support exFAT
    Maximum file size: 16 EiB
    Maximum volume size: 64 ZiB
    You can use this format if it is supported by all computers with which you intend to share the drive.  See "disadvantages" for details.

  • How to Read and Write .XML datas   (HELP Plz...)

    hai everybody
    how to read and write xml datas... plz give clean and simple example..
    bcoz me want to produce such type of module...
    if any one help me .. thats the only way me laid in software ladder
    plz....
    thank u in advance

    thank u for giving idiot..
    but before posting i search in google also..
    but i cant get what me expect..
    thus i posted...
    then who is ................?
    sorry javacoder01
    // plz help me
    Message was edited by:
    drvijayy2k2

  • Reading a whole frame from the serial port

    I have posted before about my attempts to use the serial port (http://forums.ni.com/ni/board/message?board.id=170&thread.id=387410).
    Anyway, I want to connect an external device through using VISA. It uses a protocol that exchanges frames. My main program is a series of while loops going through the different echanges, it sends one frame, waits for the proper response, sends the frame again etc.
    My problem lies in reading the frames. I'd like to read from the serial port until I get an EOF character, then parse the frame, etc. for every cycle of send/check. This doesn't work. I've managed to get one character from the port, thereby confirming that my reading function does actually read. Then I tried to put it into a loop which resulted in it not returning any characters at all.
    Attachments:
    AssReq.GIF ‏5 KB
    GetFrame.vi ‏14 KB
    readVISA.vi ‏13 KB

    Attachments:
    SerialPortControl_2.vi ‏24 KB

Maybe you are looking for

  • I cant edit my photo on facebook

    hello when i try to edit my profile photo on facebook when i try to upload my new photo firefox locks up and then shuts down

  • Problem with handoff in iWork

    Hi to everyone! I´ve installed iOS 8 on my iPhone 5s, iPad Air and iPod Touch, I try to test handoff features and works fine  with the most of apps (safari, notes , calendar...) except iWork apps... when I open a document with pages I can´t continue

  • Dictionary won't work

    Whenever i try to open Dictionary, a question mark appears over the icon in the dock, and nothing happens. I had to delete my preferences, would that have made it not work? I think i may have accidentally deleted the application. Can someone tell me

  • Not able to connect ot iTunes Store

    Hello all, I'm getting the following error message when trying to login to the iTunes Store from my MacBook. "iTunes could not connect to the iTunes Store. An unknown error has occurred (-9807)." Any Help? regards, Joe Velez

  • Significance of renumbering in task lists  in spro

    Significance of renumbering in default values in defining default values for task list data and profile assignments. Edited by: Pallavi Kakoti on Jun 27, 2011 2:40 PM