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.

Similar Messages

  • 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 .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

  • Does Aperture read and display XMP data generated by LR?

    Does anyone know if Aperture reads and displays XMP data generated by LR? I am not interested particularly in keywords.

    Thanks for the quick reply, William.
    I would suggest to David Schloss and AUPN that this would be a feature worth supporting. Although, hopefully both new software and improving skills in using them make me less concerned about preserving a static conversion or interpretation of an image, I think that whatever software we use to read/exchange keywords and other IPTC data is a constant.

  • What is the best way to read high rate serial data?

    My goal is to read 14 bytes of binary data from an instrument over RS232 serial (baud 460800) at 2000 Hz. I have not gotten a high speed serial card yet so I am currently using the standard serial port (115200 baud) and reading at 400 Hz. I configure the serial port, flush the buffer then enter a while loop to read the incoming data. I have a visa read 14 bytes per interation every 0.0025 seconds (400 Hz). However it seems the sensor is spitting out data faster than labview can read it because bytes are accumilating at the port. After a while the buffer fills up and the program fails.
    Is there a better way to do this?
    Would it be better to read larger amounts of data less often, e.g. like 1400 bytes every 0.25 seconds?
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    serial_read.jpg ‏161 KB
    serial_read.vi ‏19 KB
    bytes read.png ‏20 KB

    Here is a producer consumer approach.... not tested
    The unwrapping of the string could be done in a better way (didn't spend much time on it, not tested!! Just a quick mod from another post)
    Can't remember what is faster scan from string or match pattern or regular expression .....
    Avoid any frontpanel objects in the serial read loop to keep that thread independent from the GUI thread. Blocksize (128) should be optimized...
    EDIT: The scan loop will not work   
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'
    Attachments:
    ProducerConsumerData 2.vi ‏29 KB

  • How to Read and write array data into notepad or lvm?

    Hello,
    I am new to Labview and i wanted to use it in my project where i get accelerometer values X,Y and Z serially into a notepad and then displaying those values in Labview as a 3D plot or graph.The problem i am facing is the use of Cover to dynamic data express VI and how to save the array in a notepad or a lvm file.i was testing a basic block of building x and y values separately.was successful in plotting it to  graph but dont know how to save those values in a file.Can some1 please help me out in his ??
    Solved!
    Go to Solution.
    Attachments:
    Capture.PNG ‏22 KB

    Thank you for looking into this. Since I was converting into dynamic data before writing it I thought you have to convert it after reading but then I got stuck as to whether build the array again so as to display it in the graph. Dennis I did what you said and the graph on reading is a bit funny just started today and I am kinda skipping the long tutorial due to shortage of time. sorry
    Attachments:
    Capture.PNG ‏32 KB
    Capture2.PNG ‏59 KB

  • What is the best way to read and manipulate large data in excel files and show them in Sharepoint

    Hi ,
    I have a large excel file that has 700,000 records in it. The excel file has a few columns that change every day.
    What is the best way to read the data form the excel file in fastest and most efficient way.
    2 nd Problem,
    I have one excel file that has many rows each row contain some data that has certain keywords.
    What I want is  to segregate the data of rows into respective sheets(tabs ) in the workbook.
    for example in rows have following data 
    1. Alfa
    2beta
    3 gama
    4beta
    5gama
    6gama
    7alfa
    in excel
    I want there to be 3 tabs now with each of the key words alfa beta and gamma.

    Hi,
    I don't really see any better options for SharePoint. SharePoint use other production called 'Office Web App' to allow users to view/edit Microsoft Office documents (word, excel etc.). But the web version of excel doesn't support that much records as well
    as there's size limitations (probably the default max size is 10MB).
    Regarding second problem, I think you need some custom solutions (like a SharePoint timer job/webpart ) to read and present data.
    However, if you can reduce the excel file records to something near 16k (which is supported rows in web version of excel) then you can use SharePoint Excel service to refresh data automatically in the excel file in SharePoint from some external sources.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Memory leak in Real-Time caused by VISA Read and Timed Loop data nodes? Doesn't make sense.

    Working with LV 8.2.1 real-time to develop a host of applications that monitor or emulate computers on RS-422 busses.   The following screen shots were taken from an application that monitors a 200Hz transmission.  After a few hours, the PXI station would crash with an awesome array of angry messages...most implying something about a loss of memory.  After much hair pulling and passing of the buck, my associate was able to discover while watching the available memory on the controller that memory loss was occurring with every loop containing a VISA read and error propogation using the data nodes (see Memory Leak.jpg).  He found that if he switched the error propogation to regular old-fashioned shift registers, then the available memory was rock-solid.  (a la No Memory Leak.jpg)
    Any ideas what could be causing this?  Do you see any problems with the way we code these sorts of loops?  We are always attempting to optimize the way we use memory on our time-critical applications and VISA reads and DAQmx Reads give us the most heartache as we are never able to preallocate memory for these VIs.  Any tips?
    Dan Marlow
    GDLS
    Solved!
    Go to Solution.
    Attachments:
    Memory Leak.JPG ‏136 KB
    No Memory Leak.JPG ‏137 KB

    Hi thisisnotadream,
    This problem has been reported, and you seem to be exactly reproducing the conditions required to see this problem. This was reported to R&D (# 134314) for further investigation. There are multiple possible workarounds, one of which is the one that you have already found of wiring the error directly into the loop. Other situations that result in no memory leak are:
    1.  If the bytes at port property node is not there and a read just happens in every iteration and resulting timeouts are ignored.
    2.  If the case structure is gone and just blindly check the bytes at port and read every iteration.
    3.  If the Timed Loop is turned into a While loop.
    Thanks for the feedback!
    Regards,Stephen S.
    National Instruments
    Applications Engineering

  • Read and store XML data

    I have created a connection to a sample XML file and was wondering how you would go about reading from that data source and storing the data using JavaScript so that different data can be displayed based on user choices (e.g. dropdown list)? Can this data also be stored so that an end-user can open the PDF without needing to have a local copy of the XML file on their machine?

    I have created a connection to a sample XML file and was wondering how you would go about reading from that data source and storing the data using JavaScript so that different data can be displayed based on user choices (e.g. dropdown list)? Can this data also be stored so that an end-user can open the PDF without needing to have a local copy of the XML file on their machine?

  • Read and Modify NTUser.DAT file

    Hello All,
    I've to perform the uninstall operations of activesetup in a console application based in C#.
    The tasks is to mount the NTUser.Dat file of all the users of system and search the HKLM and HKCU hives of each user and remove corresponding registry entries related to activesetup.
    I've found the RegLoadKey method but couldn't found the read and modify methods to treat NTUser.dat for my requirement.
    I've found one link:-
    https://www.daniweb.com/software-development/vbnet/threads/108278/load-registry-hive
    But even this doesn't perform the required operations.
    Please share some suggestions or Code examples to perform this operation?
    Thanks in Advance.
    TECHIT_ASHISH

    Hi
    TechIT_Ashish,
    The Ntuser.dat file is a registry file. Each user's Ntuser.dat file contains the registry settings for their individual account. The Windows registry, as described by Microsoft, is a "central hierarchical database" that contains information about
    the software, hardware and user profiles contained on a computer.
    So about read that file, the.NET Framework supports a lot and in C# the RegistryKey class.
    You can use the
    RegLoadKey P/Invoke.
    [DllImport("advapi32.dll", CharSet=CharSet.Auto, SetLastError=true)]
    public static extern int RegLoadKey(uint hKey,string lpSubKey, string lpFile);
    //API'used
    // Loading a Hive "C:\NTUSER.DAT"
    RegLoadKey(HKEY_USERS,"NTUSER.DAT",@"C:\NTUSER.DAT");)
    You can get some hints from Load registry hive from C# fails 
    Modify NTUser.DAT file, I am afraid there is no some build-in method in .Net Framework, after some research, I've found use Script to modify ntuser.dat.
    http://www.experts-exchange.com/Networking/Windows_Networking/Q_21220278.html
    http://blogs.technet.com/b/deploymentguys/archive/2008/06/06/useful-script-number-5-adjusting-the-default-user-registry-hive.aspx
    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience
    to you. 
    Microsoft does not control these sites and has not tested any software or information found on these sites;Therefore, Microsoft
    cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you
    completely understand the risk before retrieving any software from the Internet.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Is there a way to use the FF vi's to read and write complex data types; specifically, clusters?

    I'm trying to interface with a Fieldbus device through LabVIEW.  I need to be able to read and write a variable that consists of a cluster of two unsigned int 32's.  The FF vi's provided with FF Communications Manager 3.2 do not support clusters.  I have tried to use a code interface node to write my own, but the CIN's I was using before to do this function do not give me a device list anymore (they were originally written on Communications Manager 2.3.5).  I have recompiled the .lsb, as well as trying to use the older versions of the header and library files.  Is there another workaround I can use?

    Hello Bryan,
    The BrowseDeviceList VI was released within NI-FBUS 3.2. For NI-FBUS Configurator 3.1, please unzip the attached file and copy the "addon" and "Ff" folders into "\vi.lib" directory. LabVIEW 7.1 or above version is required for using these addons.
    And for your information, there is a free upgrade (version 3.1.1) for NI-FBUS Configurator 3.1 users. Here is the link to the upgrade kit.
    http://digital.ni.com/softlib.nsf/websearch/00A1614EC291219586256F390020671B?opendocument&node=132070_US
    Hope it helps!
    Regards,
    --Josiane
    Attachments:
    locate_fflv_in_labview82.jpg ‏214 KB
    vi.lib.zip ‏391 KB
    locate_fflv_in_labview71.jpg ‏193 KB

  • Some questions on efficient serial read and speeding up data processing

    I have this flow meter that spits out two strings when queried with command "x" : Date:time, and then Meter #1 xxxx.xxxx SCFM . All that the x does is query the meter to display its status. The serial readout from the meter is intended to only duplicate the value present on the little lcd that the meter has. It's not meant for controlling and my discussion with the company was that while not ideal, parsing the string is the only way to get useable info from it. I only need the flow value and there is no way that it will just output that string. So I have it set up to search for the meter name, and if this has a value find the number. Before I did not have the true false case but it meant that the flow would state zero every time that it received the date:time string. My questions are:
    Is this the only way to do this? both in terms of finding the number I need and making sure that it is always updated properly.
    Right now I have a delay in the while loop because if I sample too fast, I oversample the buffer and get no useable string data (get one letter or no value at a time). Is there any way to remove this and have continous sampling?  I thought about reducing the wait time to 25ms, searching for a series of characters like #, 1, and parsing the string character by character, but the vi moves too fast to capture all of the data. If I put in a buffer delay I am right back where I started with the longer delay.
    Is there anything else I can do to make this code more efficient and better sample the flow meters output?
    Attachments:
    Serial Test.vi ‏15 KB

    Does the device send back a termination character such as a line feed or carriage return?  If so, you should be using that to terminate your read after reading a large number of bytes.
    Right now, your Write/Read sequence is in an odd order.  First you check number of bytes, then you write the X, then you read that original number of bytes immediately after sending the x.  Since it was probably 0 at the port when the loop started, you initially read 0 bytes.  Then the next iteration, (assuming your loop rate was slow enough, you'll get bytes as the port based on the X written in the previous iteration.
    You need to write the X, delay a period of time, then do bytes at port (assuming you can't use the termination character, and you have a different number of bytes every iteration that you can't rely on), then read that number of bytes.

  • Read and write compressed data from blob in ADF

    Hi All,
    I have a requirement where i need to compress/zip the file, if the file is greater than 2MB and store in database.
    And i need to extract it from database in download dialog as zip file.
    Please suggest me, i m using JDev 10.1.3.5 and using inputFile component or please redirect me to any examples or demos.
    Regards,
    R N V Prasad

    Hi
    I am first uploading file and if the file is more than 2MB, i am compressing it. i used the below method for compressing.
    public void zipFile(String inputFilePath,String outputFilePath,String outFileName){
    long fileSize;
    long twoMBFileSize=2097152;
    String outFileLocation;
    try
    byte[] data = new byte[1000];
    File file=new File(inputFilePath);
    FileInputStream fis=new FileInputStream(file);
    BufferedInputStream in = new BufferedInputStream(fis);
    fileSize = file.length();
    System.out.println("File size.."+fileSize);
    int count;
    outFileLocation=outputFilePath+outFileName;
    System.out.println("outFileLocation..."+outFileLocation);
    ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(outFileLocation)));
    out.putNextEntry(new ZipEntry(outFileName));
    while((count = in.read(data,0,1000)) != -1)
    out.write(data, 0, count);
    in.close();
    out.flush();
    out.close();
    catch(Exception e)
    e.printStackTrace();
    And i will read the compressed file and posting to DB.
    Here i am facing the problem while downloading the compressed files.
    Naga

  • How to read and write the data like this(is JSON?)?

    i have some data like below(is json?),how to write them into
    the database?
    i user coldfusion 7.
    {"title":"ColdFusion?","url":"
    http://www.adobe.com/cfusion/"},
    {"title":"flex blogs","url":"
    http://www.flexblogs.com/"},
    {"title":"studio","url":"
    http://www.sans.com.com/"}
    Thank you very much!

    You need to parse it and then insert the records into your
    database.
    Take a look at
    CFJSON it is a JSON
    serialiser and de-serialiser.
    Once you have converted it to native CF datatypes you can
    loop through it and insert it into your database.

  • How to read and display table data entries from ERP in CRM

    Hello experts,
    I am new to CRM. I need to read data base entries from ERP in CRM system. What would be the best way to do . The table is a standard SAP table with a custom include (several customer fields). Calling a web service would be the best way..? or is there any other way that I can do it too.
    Also, to display these entries what would be the best tool? Should I built my own transaction/report to do it?
    Any advise or guidance would be a great kick start to learn the CRM development environment.
    Regards,
    jaffery

    Hi,
    Check the below wiki link if it helps.
    http://wiki.sdn.sap.com/wiki/display/CRM/Howtodisplayaz-tableinanassignmentblock
    Also, you can try an option of transaction launcher.
    Hope this helps.
    Regards,
    Chandrakant

Maybe you are looking for