I need to read an unsolicited serial variable string.

Hello,
I am new to LabVIEW and I am working on my first app. I have a serial device that I am trying to read from. This device periodically broadcasts a string containing 17 numeric values. Each value is delimitated and of a variable length.
I need to monitor the serial port and when the data comes in I need to parse off the different variables and make them available to the rest of the program.
Any suggestions on where to start and how I might do this would be appreciated. Thank you in advance.
Gregory Osenbach, CLA
Fluke

I recommend using VISA to control the serial port.
You can use a while loop with a timer (10 ms or so) and a Property node for the VISA session to check for any data in the Serial port buffer (And read only if there's something there). By checking the string read for a delimiter (I presume \r or \n are sent to mark the end of the string) you can tell if the end of the string has been reached or not.
Once you're certain you have the full string, you can parse using the SCAN from string function (I've left this out of my example, because I don't know what format your string has).
Hope this helps
Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Attachments:
Unsolicited_RS-232_read.vi ‏29 KB

Similar Messages

  • I have two copies of CS6 and I need to find out which serial number is installed on which computer. How do I find the serial number once it's installed on a computer?

    I have two copies of CS6 and I need to find out which serial number is installed on which computer. How do I find the serial number once it's installed on a computer?

    if they're pcs, Belarc Advisor - Free Personal PC Audit, for software, hardware and security configuration information on your computer.…

  • 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

  • Need to read Hex data format for Handheld device. (SAP AII RFID )

    Hello,
    we developed a custom screens for packing, unpacking, tag commission.. etc for handheld device for my client. the Serial number field  type is /ain/barcode. Its working fine. but for the new system need to read the Hex format. I created a new field in the screen. but the handheld device is not reading the Serial number in Hex format.
    Could anyone suggest me how to read Hex data in Handheld devices. We are using Motorola MC9090 Series.
    Regards,
    Kamal

    Hi
    Are you using the reader to read an RFID tag or for reading barcodes.
    Ideally, if you read an EPC Gen2 RFID tag, for example, the 96 bit encoded EPC is read and that can be converted to its equivalent  HEX format for posting the observation to SAP AII.
    In case of barcodes, the string is read as is printed on the barcode.

  • I need to update specific records(of variable lengths) in a file. I can get the correct record but when I update it(add info), it overwrites part of the record following it. I am using labview 6.0

    I need to update specific records(of variable lengths) in a file. I can get the correct record but when I update it(add or change info), it overwrites part of the record following it. I am using labview 6.0. I need to be able to insert information into the middle of a file without disturbing the data before and after

    It's hard to give more specifics without more detail, but in general you're going to need to read in the entire file, split it into three pieces (everything before the record of interest, the record itself, and everything after the record of interest), modify the record, reassemble the three pieces in proper order, and write the whole thing back to the file.Of course if the file is very large you might not want to actually implement it this way, but conceptually at least, this is what you are looking at.If this file some sort of proprietary format?Mike...PS: this type of issue is why I really like databases...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Reading flat files with variable names in SSIS

    I have a ssis package that reads a flat file from a network drive (using a flat file connection manager) and loads the data into sql server tables. I have this working on a fixed file name, however in reality the file name will not be the
    same from run to run.      Essentially, I need to check a folder each day and if there is a file there with a certain prefix (for example, 'datafile'), I need to process this file(s). In other words, if there is a file in the folder
    called datafilexyz, my process needs to read it in and process it.    If there are files named datafileabc, datafiledef, and testfile123, I need to read in and process the datafileabc and datafiledef flat files.    
    I'm not sure how to make this work.     I haven't had any SSIS training, just what I can find on the internet and looking at existing SSIS packages (I haven't found any that do what I'm trying to do here) so I'm kind of lost.   
    Any help is appreciated.  

    this is working well.    How can I, after loading each flat file, move the flat file to an archive folder?    I'm trying to use a file system task, but doing something wrong.    I created and reference
    an archive folder connection manager in the destination connection, and reference the original folder connection manager for the source connection, but get 'sourcepath is not valid on operation movefile'.    I think a file system task is what
    is needed (within the foreach loop after the data load for each flat file), but I'm not doing something correctly.
    Sounds fine except for one thing. Did you assign the filename variable to connection string property of the source file connection manager used by file system task?
    Also it should be existing file option you should choose for
    source connection and existing folder for destination.
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Need help finding my iphone serial number but my phone is dead

    Need help finding my iphone serial number but my phone is dead

    no one here can help you find it.

  • Reading Data from serial (Comm) Port in developer200 forms 6i

    Dears,
    I have developed an application using Dev2k forms 6i.
    I need to read data from a device (weigh bridge) that is attached to PC on comm port.
    scenario: when a vehicle comes on the Weigh bridge it calculates its weight and send it to the PC on serial port.
    on when-button-pressed event I want to get data into a text field on form.
    If any one has developed such form please help me.
    Thanks and regards

    you can:
    create java class -> wrap plsql -> invoke plsql-code from button trigger
    googling java class instead of creating =)

  • Reading and analyzing serial data

    Hello,
    My question is about interpreting periodic serial data.
    I'm trying to read a serial rs232 port, through which I'm receiving periodic data which is made up of 4 repeating messages.
    Each message consists of several parameters of various length and fomates (for example, the first parameter could be an unisgned byte while the second parameter could be a word-long float). Each message begins and terminates with known character sequences.
    I need to read this periodic data and display it to the user, so that each of the parameters (of which the messages are made) is displayed
    by a different indicator.
    Right now, I've used the basic read/write rs232 LabView tutorial but now I'm pretty much stuck...
    I've built a similar program using Visual Basic and I've started using LabView in order to build better user interfaces but so far I'm stuck...
    Any suggestions?

    First, I think you really could have come up with a better user name then falling asleep on your "N" key.
    Data that comes in through the serial port is a string.  So your problem really comes down to how to parse the string into its respective parts.  Look at the functions on the string pallete.  Functions such as Match String, Search/Split String, or Scan String for Tokens, should do what you need.  Once you have the parts broken up, the String to Number conversion functions would convert the strings into their appropriate datatypes.

  • I never used LabView but need to generate a RS-233 serial output string that contains an IRIG timestamp based on a contact closure. Is LabView an appropriate tool to do this? How much does it cost to get started with the product?

    I never used LabView but need to generate a RS-233 serial output string that contains an IRIG timestamp based on a contact closure. Is LabView an appropriate tool to do this? How much does it cost to get started with the product?

    Labview isn't cheap, but it would certainly allow you to build a program (set of vi's - virtual instruments) that would do what you describe. Where would the timecode information come from? Your vi, or program, would: Start up, initialize the serial port, loop until a trigger happened, read the timecode (from where?), output that timecode out the serial port in a loop until you pressed the stop button. There is a free evaluation of Labview software available from NI - the base product itself runs about $995.
    - Dave

  • When I log in to Adobe, it says I have no products registered, but I need to find my CF serial #.

    When I log in to Adobe, it says I have no products registered, but I need to find my CF serial # which was registered. What do I do?

    Once logged in to LWS press search button.
    EG
    HTH, Carl.

  • Reading Operationg System Environment Variables

    How can i read Operating System environment variables for examples in Windows without using java -D option
    just to simply get the value from windows enviroment variables settings... such as "MyApp"
    is there a way i can get the value using java???
    need something that is backward compatible ... like between jdk version 1.2.2 to 1.3.1???
    help...
    :~(
    Thanks in Advance,
    Cheah

    Some ugly hack like using Runtime.getRuntime().exec("echo %wasteoftime%") and examining its output might work.

  • I need to read a reference inside of a data object

    Hi Developers,
    I need to read some data that is nested deep inside a method. My situation looks like this:
    data object
         IREF_MDO_DATA       Type    Reference
              v
             OREF_MDO_HANDLER   Type    Reference
                  v
                 STR_DOF_FILTER_VALS   Type   Deep Structure(232)
                      v
                   ASSIGNMENT_TYPE
                   SALES_AREA
                   DOC_NUMBER
                   SALESORG
    My question is how do i access  OREF_MDO_HANDLER  and then access STR_DOF_FILTER_VALS  ?
    Please let me know if you need more information? I will do my best to explain better?
    Thanks,
    Patrick

    Hi Adrian,
    I forgot to mention that the second Reference Variable (OREF_MDO_HANDLER) is a TYPE REF TO. I believe this is my problem. I can not use the statement GET REFERENCE OF IREF_MDO_DATA-> OREF_MDO_HANDLER. because OREF_MDO_HANDLER is a TYPE REF TO. Is there way i can access the reference TYPE REF TO?
    Thanks,

  • Reading Hard Disk Serial No.

    How can I read hard disk serial# from oracle forms?..I need it to implement security on login system...so that system could'nt be run on any other system.

    Kashif,
    If you had searched the forum then the first searched result would have solved your worries
    i made a sample form and posted it on OTN last month
    please follow this link and download the smaple form
    Hard Disk Serial No. Retrieval Example!!
    If you have problems using the sample form then follow these steps to make your own
    follow these steps...
    Make a new form, new block, new canvas...
    go to layout editor of the canvas
    Now:
    - Create an ActiveX Control Item (OCX) on your canvas.
    - Right click it and select 'Insert Object...'.
    - A list will come
    - Press 'H' on keyboard
    - It will come to a selection "HardwareInfo Control'
    - select it and then press ok!.
    - In the main Form biulder menu 'Program', choose 'Import OLE Library Interfaces'
    - again Press 'H' on keyboard
    - and see to find out a selection in the list: "HardwareInfo.HardWareInfo.ctrl1'
    - select it and then u will see something each in Method Package(s) and the Event Package(s) lists.
    - Select both the Method Package(s) and the Event Package(s). Make sure they're highlighted.
    i.e "_dhardwareinfo and _dHardwareinfoEvents"
    - Now press OK
    - Verify the existance of 5 new programme units in your Foms Program units section in object navigator:
    i.e.
    HARDWAREINFOLib_CONSTANTS
    HARDWAREINFO_HardWareIn_EVENTS
    - Now go to layout editor again and make a new single display_item (non-db)
    - make a push button..
    copy the following code in ur wehn-buton-pres tigger, dont forget ot change the
    'your_block.your_activex_item_name' p[ortion in the following code with correct block and OCX item name
    DECLARE
    VAR oleobj;
    BEGIN
    VAR := :ITEM('your_block.your_activex_item_name').interface;
    :ur_display_item_name := HARDWAREINFO_DHardWareInfo.HardDisk1SerialNumber(VAR);
    END;
    now run the form and see what serial no it shows..
    also how maany hard disk u have on ur pc the .dll files can show upto four hard disk serial nos
    look closely this 'HardDisk1SerialNumber' of the above:
    :ur_display_item_name := HARDWAREINFO_DHardWareInfo.HardDisk1SerialNumber(VAR);
    u can see the '1' in the 'HardDisk1SerialNumber' is the no of system hard disk..u may try it by changing to HardDisk2SerialNumber, HardDisk3SerialNumber, HardDisk4SerialNumber
    regards
    Asim.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Error message says need Adobe reader 8 or 9 installed to open pdfs from web pages yet Reader 9alredy

    Error message says need Adobe reader 8 or 9 installed to open pdfs from web pages yet Reader 9 is alredy installed on computer. Is this a 64 bit ossue although I am sure I did not have this problem prior to a replacement hard drive being installed.

    What is your operating system, browser?
    What is the exact message you are getting?

Maybe you are looking for