How to read two files (one is updating every second, the other is constant) simoltaneously

Dear All,
I will appreciate if somebody help me.
I want to read two files, one is temperature wich is updating every second, and the other is hysteresis energy which has specific rows and is constant.
I got a program in discussion forum which read a file as it is updating. I checked this program in my case and it works.
Then I added reading hysteresis energy file to the existing file. But while i am running the program, the hysteresis energy file is read with all rows.
But the aim is that everytime which temperature updates, I need to read just one row of the hysteresis energy file.
so, in this way in every second i have a new temperature data and one row of the other file.
I tried to used "for loop" inside the program, but it did not work, becuase reading temperature will be stopped untill for loop ends.
I attached the program.
Could somebody help me how to read just one row of hysteresis energy file everytime temperature updates?
Solved!
Go to Solution.
Attachments:
Readfiles.vi ‏23 KB

I do not understand relationship between your two files.
You have another VI or app that is writing data to both files and when new temperature data added you wish just to read the new data and then read one new line of the hysteresis file?????
But is one is constant, why do you need to keep reading it?
Anyway…
The “Read From Spreadsheet File.vi” preformed an Open and a Close for each time it is called (if you will open the VI up and drill down and you will see). So that resets the file pointer back to the beginning and there for will read in the whole file from the first to the last each time if you do not set the start of read offset or number of rows.
Now the Read from Binary File does not reset the file pointer and leaves the file pointer just past the last byte read so it will start with any new bytes automaicly only giving you the new data.
I do not think you need to do the math with the Previous EOF=0 and the File size to get what I think you are trying to do.
Plus use shift reg for the Data string instead of local var
Set the mechinacl action of the stop botton to Latched
So you do not need to init the two controls
Also, I do not get the End of file encountered error (4) from the Read from Binary file if I attempt to read past. It just returns and empty string.
Omar
Attachments:
Readfiles.vi ‏22 KB

Similar Messages

  • How 2 read two files from 2 diff. directories, using single adapter

    How 2 read two files from 2 diff. directories in same system, using single file adapter.

    you can use advanced selection for source file
    see
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm

  • I have two iPhones, one is a 4s and the other is a 3g. I have not used my 3g in some time now. I recently restored it but I cannot use it without a sim card, it says i have to "activate it."

    I have two iPhones, one is a 4s and the other is a 3g. I have not used my 3g in some time now. I recently restored it but I cannot use it without a sim card, it says i have to "activate it." I cannot place my iPhone 4s sim card in it (too small), and i do not want to get a new contract or sim card for an iPhone that i do not ues very much.

    Thanks for your help, but i cannot borrow a noral sim card now, my family has all up graded to iPhone 4s's, i have done this before, but one of my family had the same type of iphone so i could use theirs. Now i am the only one who still holds on to their old phone... I am not sure about buying an adapter...

  • I have a MacBook Pro 15" and my warranty just ran out! I partitioned my harddrive into two partitions, one with Snow Leopard and the other with microsoft.This morning I turned on my Macbook Pro and it will not boot into Snow Leopard.

    Good Morning,
    I have a MacBook Pro 15" and my warranty just ran out! I partitioned my harddrive into two partitions, one with Snow Leopard and the other with microsoft.This morning I turned on my Macbook Pro and it will not boot into Snow Leopard. I shut it off took out the battery, reinstalled the battery. Then I put in the Snow Leopard CD and booted up to disk utility and The Snow Leopard partion would not show up?? I do see the microsoft partion.
    I also rebooted holding down the shift key and still no Snow Leopard
    Could you please tell me what I can do, what keys do I press on restart any advice to get Snow leopard back.
    thank you.

    Have you restarted holding down the Opt key?  That procedure should give you a gray screen with all of the partitions that exist.  Then select the SL partition for boot.  Also go to System Preferences and Startup Disk, unlock the lock and select the SL partition as the default boot partition, then relock.

  • I have two computers, one runs Windows 8.1, the other runs Windows 7.

    I have two computers, one runs Windows 8.1, the other runs Windows 7.  Can I put Premier Pro, or any of the suite, on both computers at the same time?

    Cloud License allows 2 activations http://www.adobe.com/legal/licenses-terms.html
    -Install on a 2nd computer http://forums.adobe.com/thread/1452292?tstart=0
    -Windows or Mac does not matter... 2 on the same operating system, or 1 on each

  • In regard to Time Machine. I have two accounts one is an admin account, the other is a standard user account. When I implement Time Machine when I am logged into the Admin account, is the standard user also backed up?

    in regard to Time Machine.
    I have two accounts on one Macbook Pro running OS 10.6.8. One account is an admin account, the other is a standard user account.
    When I initially implemented Time Machine I was logged into the Admin account. I allowed Time Machine to erase the drive and backup the computer. Is the standard user account contents also backed up?
    Also after I completed the Time Machine backup session, I turned off Time Machine and removed the portable hard drive. I plan to return in to Time Machine after being away from the portable hard drive for approximately a month. After a short interruption of approximately one month, when the Macbook Pro is reconnected and Time Machine is turned back on, will Time Machine create a new instance of a backup? WIll the back up contain the standard user account changes?

    Time Machine backs up by default all the user accounts.
    When you reconnect the backup drive after one month, Time Machine will do an incremental backup and it might take a while minutes to hours depending on how much has been changed. With a gap of a month, Time Machine will have to do a lengthier than normal survey of both drives to see what has changed, so it might take some time preparing for the backup. The backup will include everything that has changed since the previous one.

  • Two topics - One a general question and the other related to Mac OS/X 10.4

    I need to update my email address and I can't seem to be able to find a way to do in this forum. Can you help me with that ?
    The other issue is that since I got my MacBook Pro I am having problems with my USB Flash Drive. Either I can't read from it or write to and I constantly get the spinning beach ball and I have to shut down and restart my computer. Has anyone come across this.
    Please remember you have to respond to [email protected] not the address in my profile because I no longer have it.
    Thanks
    MacBook Pro   Mac OS X (10.4.6)   Please respond to [email protected]

    Change your email address from this page:
    https://myinfo.apple.com
    For the flash drive question, it may be best to post a topic here where other MacBook Pro owners will be able to help you:
    http://discussions.apple.com/forum.jspa?forumID=1149
    Good luck.

  • How to compare two files using MD5?

    Hi,all:
    How to compare two files to know if they're the same without any difference?I want to use MD5, but I just konw how get a message digest of a string. How to get a message digest of a file? Or there is other method to compare two files?
    Thanks advance!

    This is starting to sound rather a lot like a homework problem.
    An MD5 message digest is simply a 16 byte array. To compare two message digests...
    byte[] md5incoming = ...
    byte[] md5comparison = ...
    if( md5incoming.equals(md5comparison) ) {
       System.out.println("MD5 Checksums match");
    }To find out how to generate an MD5 checksum, please look up MessageDigest in the API documentation, and do a google search for "MD5 java"
    In a networked scenario, there are two issues - firstly the performance in sending copies of files all over the place (imagine if it's a 10Gb file to be compared over a 14.4K modem link, this would take a while). Secondly, the network link itself might insert an error in the file and you'd get a false miss.
    By only sending MD5 digests over the link, you simultaneously reduce the error (shorter files are less likely to be corrupted) and reduce the transmission time (16 bytes takes practically no time to transmit over damp string, let alone any sort of sensible device).
    D.

  • How to read .asl files?

    I'm working on an iMac, OS 10.5.8. My log folder is full of asl files. I'm not a program-savvy person and need plain language. I've gotten as far as to put the many log files into a temp folder on my desktop. Now I see instructions to "read them at my leisure" but can't find out how to read these files to determine what's causing the rapid multiplication. How do I "read" these logs to determine where the problem lies?

    -Correction, in your Log folder, under Private/var/log/asl ; asl files are not associated with photoshop, they are Apple System Logs.
    -I also have runaway (asl) files on my 10.5.8 Imac. Some are 80 gig +/-. and it fills my hard-drive. I got a program called Disk Inventory X that helped me graphically find these huge files. That way I can see them, right click on them and reveal them in a finder screen.
    -After locating the offending files, if you right click the .asl file and say open with the utility "console" you can view the logs.
    -Look for lines that repeat ludicrous times, then try to figure it out.
    -I am no expert, but apparently I just found out my problem might be apple.launchd keeps trying to contact com.rim.BBLaunchAgent. I haven't owned a Blackberry for a few years now and already uninstalled their Desktop Manager, but some program remnant seems to be haunting my computer.
    -If I determine the asl file(s) are unimportant, I delete them after entering my password. You have to then empty your trash to really free up hard-drive space.
    -Good luck with your hunt.

  • I have two excel files I cannot open or delete from my desktop.  One is titled 6ACAD200 and the other file is titled 8D73A700.  How can I get these off of my computer?

    I have two excel files I cannot open or delete from my desktop.  One is titled 6ACAD200 and the other file is titled 8D73A700.  How can I get these off of my computer?

    From the names I'd guess they are temporary files. If excel is running, quit and try again. If they still won't move or delete reboot. If they still won't move or delete...kill a chicken at midnight under an oak tree?

  • How to read XML file and update the data in MS CRM 2011?

    Hi Folks,
    Can anyone please help me finding some references to read XML files and push the data to MS CRM 2011 preferably by using a console application.
    Please let me know if any ways of handling it in simple ways.
    Thanks,
    Sri

    HI,
    How to read XML file:
    https://social.msdn.microsoft.com/Forums/en-US/5dd7261b-86c4-4ca8-ba87-95196ef3ba50/need-to-display-xml-file-in-textboxes-edit-the-data-and-save-the-new-xml-file?forum=csharpgeneral
    How to work with CRM:
    ClientCredentials credentials = new ClientCredentials();
    credentials.Windows.ClientCredential = new System.Net.NetworkCredential("USER", "Password", "Domain");
    Uri uri = new Uri("http://server/Organization/XRMServices/2011/Organization.svc");
    OrganizationServiceProxy proxy = new OrganizationServiceProxy(uri, null, credentials, null);
    proxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
    IOrganizationService service = (IOrganizationService)proxy;
    //using "service" you can create, update and retrieve entities.
    More information here about service functions:
    https://msdn.microsoft.com/en-us/library/gg328198.aspx

  • How to Read all files inside resource Folder inside Jar?

    I have a Jar file,,,, The program reads for resource files in the resource folder inside the Jar. I want my program to read all files inside this folder without knowing the names or the number of files in the folder.
    I am using this to make an Applet easy to be updated with spicific files. I just want to add a file inside the resource folder and Jar the program and automatically the program reads what ever is in there!!
    I used the File class to get all file names inside the resource folder. it works fine before Jarring the program. After I jar I recieve a URI not Herarichy Exception!!
    File fold=new java.io.File(getClass().getResource(folder).toURI());
    String[] files=fold.list();
    I hope the question is clear!!

    How to get the directory and jar file that you class resides in:
    // returns path and jarfile (ex: /home/mydir/my.jar)
    public String getJarfileName()
            // Get the location of the jar file and the jar file name
            java.net.URL outputURL = YourClass.class.getProtectionDomain().getCodeSource().getLocation();
            String outputString = outputURL.toString();
            String[] parseString;
            int index1 = outputString.indexOf(":");
            int index2 = outputString.lastIndexOf(":");
            if (index1!=index2) // Windows/DOS uses C: naming convention
               parseString = outputString.split("file:/");
            else
               parseString = outputString.split("file:");
            String jarFilename = parseString[1];
           return jarFilename;
    }If your my.jar was in /home/mydir, it will store "/home/mydir/my.jar" in jarFilename.
    note: getLocation returns "file:/C:/home/mydir/my.jar" for Windows/DOS and "file:/home/mydir/my.jar" for windows, thus why I look for the first and last index of the colon so I can correctly split the string.
    If you want to grab a file in the jar file and get an InputStream, do the following:
    import java.io.*;
    import java.util.Enumeration;
    // jar stuff
    import java.util.jar.*;
    import java.util.zip.ZipEntry;
    public class Jaris
       private JarFile jf;
       public Jaris(String jarFilename) throws Exception
           try
                           jf = new JarFile(jarFilename);
           catch (Exception e)
                jf=null;
                throw(e);
       public InputStream getInputStream(String matchString) throws Exception
           ZipEntry ze=null;
           try
              Enumeration resources = jf.entries();
              while ( resources.hasMoreElements() )
                 JarEntry je = (JarEntry) resources.nextElement();
                 // find a file that matches this string from anywhere in my jar file
                 if ( je.getName().matches(".*\\"+matchString) )
                    String filename=je.getName();
                    ze=jf.getEntry(filename);
          catch (Exception e)
             throw(e);
          InputStream is = jf.getInputStream(ze);
          return is;
       // for testing the Jaris methods
       public static void main(String[] args)
          try
               String jarFilename=getJarfileName();
               Jaris jis = new Jaris(jarFilename); // this is the string we got from the other method listed above
               InputStream is=jis.getInputStream("myfile.txt"); // can be used for xml, xsl, etc
          catch (Exception e)
             // this is just a test, so we'll ignore the exception
    }Happy coding! :)
    Doc

  • Reading/monitoring file on each update by using java code

    Hello, Thanks for help in advance..
    I want to read a log file automatically on each time when log file get update . Actually i am reading that file one time but i have to read that file when log is added to that file.
    Thanks

    File change notification is not supported on all os yet.
    So I do not think it is available in java. You may have
    to write in C/C++ code for os which supports this feature.
    Or use file monitoring tools.

  • How to read xml file as shown below.

    Hello,
    I am using flash builder 4 and currently working on implementing AIR application.
    I need to read xml file data.
    Normal xml files are easy to read and i am much more aware of it.
    But can any one have idea how to read XML file which is given below.
    <node>
    <key>ID</key>
    <integer>1</integer>
    <key>Name</key>
    <string>Dhwani</string>
    <key>Postno</key>
    <integer>20</integer>
    <key>deskname</key>
    <string>flex</string>
    <key>empid</key>
    <integer>25</integer>
    <key>projectname</key>
    <string>abc</string>
    </node>
    Here i have xml file in form of key value pair. <key> node shows name of the key and after that <integer> or <string> node are the value for that specific key.
    if i select node.key then it shows me all the keys. and from that i cant make out what is the value for key ID.
    Is there any way to take first node and then second. i mean first i ll take value of key and store it into some arraycollection. and then value will be stored.
    Any help is appreciated.. Looking for positive reply.
    Thanks
    Dhwani

    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.

  • How to read XML file and write into another XML file

    Hi all, I am new to JAVAXML.
    My problem is I have to read one XML file and take some Nodes from that and write these nodes into another XML file...
    I solved, how to read XML file
    But I don't know how to Write nodes into another XML.
    Can anyone help in this???
    Thanks in advance..

    This was answered a bit ago. There was a thread called "XML Mergine" that started on Sept 14th. It has a lot of information about what it takes to copy nodes from one XML Document object into another.
    Dave Patterson

Maybe you are looking for

  • Will a Saittek Eclipse usb keyboard work with an Intel Mac Mini?

    The Saittek Eclipse is my favorite keyboard. Anybody know if it will work with an Intel Mac Mini. Box only says Windows, but I'm just wondering if everything except volume controls will work fine? (it is also illuminated, with a light level control,

  • How do i open a VERY big file?

    I hope someone can help. I did some testing using a LeCroy LT342 in segment mode. Using the Labview driver i downloaded the data over GPIB and saved it to a spreadsheet file. Unfortunately it created very big files (ranging from 200MB to 600MB). I no

  • WPC - Anonymous User Error

    Hello,   I have some problems with displaying the site content for the anonymous user.   First, I specify that I've done all the steps provided as a solution in this thread: [Web page composer and end user;   Some of the containers from a web page ar

  • Deleted All My Songs And I Want New Ones On But It Wont Update

    Ok Well, i Deleted all my songs on porpose and Then i Put New Songs Into Music On Itunes And Then I Pluged My Ipod In and i went to music on my ipod and all my old songs are still there then i pluged it in again and then it comes up with ''DO NOT DIS

  • NUMA support on LDOM?

    Hi, I would like to know whether Oracle VM Server for SPARC version 2.0 support NUMA or not? We're having some problem with JAVA garbage collection (+XX:UseNUMA is enabled) on LDOM running on Sparc T3. Restarting the LDOM can help resolve the problem