How can I dynamicall​y read a file and show/plot the data in the GUI?

Hi, everyone,
I hope to implement a VI with the following function:
Usually, when we "read a file" in VI and then show the data in the Waveform Chart or other display GUI, the VI will first read and record all of the data from the file and then show them simultaneously. Now, I want to implement a VI, which could read  the data from a file and display it in a time series. That is, I can define a "sampling rate" or "reading rate", like 100 data points / second,  then the data points could be correspondingly shown in Waveform Chart one by one as the time moves on. The key purpose is to simulate a real-time data collection module using an existing file.
I don't know how to implement this function. Any suggestion and solution are really appreciated.
Thanks.
Zhanpeng

Heres the same effect, just a different approach :
The code in the red box was used to create data that you would be getting from a file.
What you could do is (shown above) :
- Read all of the data
- Index only one value at a time, and set the 'sampling rate' using a wait in a while loop.
- Build an array using this value, which will simulate collecting data in real time.
- I used an array of the iterations as X-values, because they coincidentally correspond to # seconds in my example
- I then bundled the time array (xvalues) with the values from your file (yvalues)
- Send that bundle to an XY graph
That should work, though you could implement some different logic for different sampling rates.
Let me know if you need a hand with that.
Message Edited by Cory K on 02-26-2009 11:36 AM
Cory K
Attachments:
graph from file.PNG ‏10 KB

Similar Messages

  • How can i Track or Read "404 File Not Found" errors that appear in the firebug console?

    Currently i'm able to capture the javascript errors using window.onerror callback. But with this callback i'm unable to capture the "File Not Found" errors. Could you let me know if there are any possible ways to track this kind of errors?

    I don't know the answer to that. You will probably have better luck asking on the Firebug website:
    *Firebug documentation - http://getfirebug.com/wiki/index.php/Main_Page
    *Firebug community - http://getfirebug.com/community
    Or try asking on the Firebug IRC channel - [https://www.mibbit.com/?server=irc.mozilla.org&channel=%23firebug #firebug on irc.mozilla.org]

  • I had renamed my user login name and assumed that there will be no change in the settings and files. When I login with the new profile name everything is gone. How can I get back all my files and settings?

    I had renamed my user login name and assumed that there will be no change in the settings and files. When I login with the new profile name everything is gone. How can I get back all my files and settings? Please help. Thanks.

    You should have asked this before you tried: Changing username or short name- User Account and Short Name- OS X- How to change user account name or home directory name.

  • How can I export to a .sfw file? it does not give me the option in FILE EXPORT.

    how can I export to a .sfw file? it does not give me the option in FILE > EXPORT. I have Flash installed and everthing.

    The feature to export SWF files directly from After Effects has been removed. It never worked at all well.
    To create SWF files, use Flash Professional.
    If you want to play a movie that you've created in After Effects in a SWF container, then export your composition using Adobe Media Encoder in H.264 format and then link or embed that movie into a SWF file in Flash Professional.

  • How do you have 2 Safari windows open and show both pages simultaneously on the monitor

    How do you keep open 2 Safari windows and show both pages on monitor?

    While in Safari with your first window open go to the File menu and select New Window. That will open the second window on which you can navigate to your second web page. Resize both windows to fit on your display.

  • In C#, how can I detect an opened PDF file and save it into disk?

    he WebBrowse componente in C# opened an PDF file inside. The file came from the Internet. So, the Adobe Acrobat Reader was called and opened the file correctly. I want to save this file to disk. How can I do it?
    The WebBRowse component does not have access to the PDF content.

    PDFs are not designed to be editable. Your engineers can make comments using Adobe Reader without any extra steps provided they use the highlight and sticky note comments. If you want them to have access to the full range of comment markup you will need to use Acrobat to apply extended rights to the file.

  • How can I transfer or make readable files from one user to another on the same iMac

    I have migrated files from a windows PC to my Imac. The transferred files have been saved successfully against a new user (which I can access). How can I make those files available to the all users of my Imac?

    In FINDER, drag and drop the files into the Public Folder.  All Users can then access those files.
    Hope this helps

  • How can I get back a pages file and its backup if I did not save them to my documents?

    Hallo community!
    My mac got stock on a website because of a java update so I was forced to shut down the computer using the on-botton. Upon restarting my work on Pages I clicked on the file I was working on so as to open both the file and pages but the file wouldnt open. I checked if I had also saved the file on my documents to try to restart it from there. But this file comes originally from a USB which I dont have at this moment although I could kee on working on this file without the usb. The file is not my documents yet it shows on the last files-list of pages.
    I cant open this file anymore, maybe because I did not save it to my files. Although this is strange because I even named another file I worked on along this first document. Enfin, the first file even has a backup according to the list but the backup wont open either. I don't know how to get this file back I am in big trouble If I dont get to open it soon! I hope somebody can help me. Anyone knows a trick or something!?

    What version of Pages?
    It sounds like it may be damaged.
    You do not have to save to Documents.
    Peter

  • How to read a file (lvm) after of saving data in the same VI ..??

    hELLO
    I just want to know how it could be, i want to save and read the file in the same vi,......?

    What exactly are you having trouble with. Unless you're not telling us something, it's easy. The Write LabVIEW Measurement has an output called File Name Out and Read labVIEW Measurement has an input called File Name. Wire the output to the input.

  • How can I merge an AOL iTunes files and new(different) iTunes files?

    I used to have an AOL iTunes account. I now have an iTunes account and can no longer access these files purchased under AOL iTunes account. How can I merge these accounts or even access the files under the AOL iTunes account? In addition, I can no longer access the old AOL iTunes account name.
    When I try to play any of these files, I am asked to authorize the computer with the AOL iTunes account name and it does not accept the information.

    There is no way to link or merge Apple IDs.
    If you've forgotten the password, reset it here: https://iforgot.apple.com/cgi-bin/WebObjects/DSiForgot.woa/wa/iforgot

  • How can I extract both my mp3 file and its associated .jpg out of itunes

    Hi everybody,
    I'm a DJ and once a month, I like to share a set of mine with my friends. For each set, I also make a dedicated flyer.
    I usually put the recorded set in Itunes, then I add the flyers using the "Illustration" (I'm using a French version) tag.
    Then, I drag the new file (both the .mp3 and .jpg) on a folder on my computer and I can see the flyers and not the normal Mac icon for music file.
    I had always worked, but today I tried to do the same but it doesn't work anymore. In Itunes, my mp3 file contain the flyers, but when I drag it to another folder, the flyer is not there anymore.
    What happened???
    does anybody know a freeware to associate a mp3 with a .jpg?
    Thanks for your help,
    Have a nice day
    Jean

    Bonjour.
    I'm not firm with the french iTunes but I'm sure its similar to all other iTunes in the world, except the language of the menus.
    You can include the cover (Illustration) inside the music file. mp3, AAC or Lossless makes no difference.
    To do so go to:
    The song (or songs) by marking it (them) in the main iTunes window. Then right click mouse (or two fingers on touchpad) and choose "Information"
    In the information window go to the tab called "cover"
    Move the wanted picture via drag & drop into this window. The best format for such illustrations are 500 x 500 pixels. If yours are bigger then iTunes will resize it to fit.
    Click on save
    If you will change the cover for more than one file (song) you will be ask "you are sure to change all files"
    Simply press ok
    After that the cover will show up in iTunes and will be exported within the file if you pass the song to others..
    There is no reason to place the cover / Illustration in the Music folder cause iTunes uses for imported covers the "Album Artwork" Folder in the Library.

  • I need to refresh my windows 8.1.  How can I save my edited raw files, and preferences before losing Lightroom?

    I'm about to refresh my laptop, and is sounds like I'm going to loose all " desktop apps".  Is Lightroom included, and what do I need to do to save my work and settings?  (Am I in the right community for this question?)

    How to Migrate LR to Another Computer | The Complete Picture with Julieanne Kost | Adobe TV

  • My PC with iTunes on it got fried (lightning).  I have a 2nd PC with iTunes on it.  How can I move my devices to that iTunes (I have recovered data from the drive)

    I had a primary PC that had iTunes on it that got fried by lightning strike a few months ago.  I have several devices (1 iPod, 1 iPad, 3 iPhones) that were synched with that iTunes install.  I had a secondary PC with a separate iTunes installation on it (separate music library.)  I recovered the hard drive so I can move the music to the secondary PC, but how can I sync my devices with that 2nd installation of iTunes without losing all of the information on those devices?  (I haven't saved or synched those devices since the summer.)  Can I keep the playlists from from the first PC?
    Thanks in advance for any and all help.

    Sorted it out. If anyone has this problem i reccommend visiting http://forums.ilounge.com/ipod-classic-ipod-5g-video/237546-ipod-classic-80gb-fr eezes-itunes-need-restore-plz-help-2.html#post1403546 there's some pretty good advice on it. have to go into control panel and re-format iPod into NTFS file. good luck.

  • FileToArray or readline to read a file and show the information in a textbox

    CVI I am a beginner and have some basic questions.
    Currently I am using CVI 2009th
    I want to open a file and transform it into another format. The most important information to be displayed on the GUI.
    For text output, I use the textbox.
    With readline everything has worked, but for my data rows rather is impractical.
    That's why I tried the same with FileToArray. But the array does not display in the text box.
    I just do not know exactly how the textbox works. Does the textbox made a formfeed after a certain number of characters? Or I can write text in succession away?
     Here are a few lines from my code.
    // FileToArray  FileToArray (pathname, &fcsLine, VAL_CHAR, fcsfile_numberofelements, 1, VAL_GROUPS_TOGETHER, VAL_GROUPS_AS_ROWS, VAL_ASCII);
    // What is the right way to diplay text with filetoarray?
    SetCtrlVal (tabPanelINFO, TABINFO_FCS_VERSION, fcsLine);
    InsertTextBoxLine(tabPanelFCS, TABFCS_FCSBOX, -1, fcsLine);  // ReadLine while (ReadLine (fcsfile_open, fcsLine, fcsfile_numberofelements) >= 0)
    { InsertTextBoxLine(tabPanelFCS, TABFCS_FCSBOX, -1, fcsLine); } 
    Solved!
    Go to Solution.

    Ok, so you are dealing with bynary data to read from the file. First of all, the post you linked refers to FileToArray () function, an I/O function which opens a file, reads its content in memory and closes it. It is basically different from ReadLine or ScanFile functions: ArrayToFile is useful to read files with numeric data only, which is not your case.
    On the other hand, ReadLine actually reads file content into a string, without splitting it into data fields. On the data you have posted, ReadLine will read the entire field into a single string, since inside the data no linefeed is present. It will be up to you to extract from the string the values you need. It is possibly not the best approach...
    Another option can be to read directly from binary format into memory, defining an appropriate datatype to read in file content. I don't know FDS file format (which of them is? ) so I made a rough trial to describe the data structure: knowing the exact data format you will be able to define the appropriate structure; the result will be something like that:
    typedef struct {
       char   type[3];
       char   version[7];
       char   n1[32][8];
       char   header[95];
       char   data[291];
     }  fds_format;
    fds_format s;
    fH = fopen ("c:\\FCS file.fcs", "rb");
    fread ((char *)&s, sizeof(fds_format), 1, fH);
    fclose (fH);
    My attempt correctly scans all (hypothetic ) fields in text section, doing nothing in the binary section which is simply read int 'data' field.
    I understand that this is not so simple to understand: I will be glad to clarify your doubts if any.
    Message Edited by Roberto Bozzolo on 02-12-2010 05:31 PM
    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?

  • How can I export photos from my Iphone and show the filming time

    I tried to export my photos from my iphone, but the times of them are created time and modified time, how can they show the filming time?

    I tried to export my photos from my iphone, but the times of them are created time and modified time, how can they show the filming time?
    How are you trying to view the times of the photos? On a Mac you cannot see the capture date of a photo in the or video in the Finder.  The Finder will always show the date the file was created or modified, and not when the photo has been taken. The capture date, when the iPhone took the photo will be encoded in the EXIF tags of the file, and that is different from the file creation. Photo software will show you the EXIF, the Info panel in iPhoto, or the Info panel in Preview.

Maybe you are looking for