Re-read in values in measurement file when file is updated

Hi,
I'm trying to control a power supply with labview and set the voltage. I've currently got it working reading in a measurement file and setting it to the value within the file. I'm now having the issue that I would like to update this value when the file is changed, as in read the file again when it is updated and set the new voltage. I've tried several things but if I put the file within the while loop then it reads it once and then returns 0 following the first loop. Outside the while loop it only reads the initial value.
I'm quite new to labview so any help would be much appreciated.
Thanks,
E
Solved!
Go to Solution.

You might want to explain your application a little better.  Looking for a file to change to set an instrument does not seem like a good idea.  Who is changing the file?  How often is the file changed?
A better way might be to use a queue or notifier for setting the instrument.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • Read Specific value/Search Into file

    Hi i need a java code which read specific value from a file.
    Example:
    I have a text file named data.txt
    it contain :
    Customer Name :Sarwar
    Customer Id : 001
    Product Price :2000
    now how can i take values 001 and 2000 from the file data.txt and save them in a another text file named new_data.txt ?
    Can any one help me?

    Search Google for 'java file read'. Wanna write to a file? Search for 'java file write'. Ain't Google awesome?
    If you haven't already done so, I suggest you search www.amazon.com for a beginner book on Java that has good reviews. Its much more efficient to read a book on Java than spend countless hours trying to learn it through code examples found on the internet.

  • Reading Design values from readback file

    Hi All,
    I am trying to understand the process of reading back design signal values from readback file.
    I have both the .ll file and the readback.bin file
    To get the readback file, I executed the below command:
    % readback_hw_device [current_hw_device] -readback_file <filename.rbd> -bin_file <filename.bin>
    Now, I want to know the command or process to read the design signal values from this .bin file? Is there any command provided by Xilinx or anything else that I can do to read the signal values?
    Rgds
    Sapan
     

    
    Hi Syed,
    Thanks for the reply. It was actually my own started thread. I had few questions unanswered from that post:
    Question:
    The procedure for readback that I am following here is based on the ug908-vivado programming and debugging.  
    I first uploaded the image on FPGA and then I executed the following commands in Vivado Hardware Manager
    % create_hw_bitstream -hw_device [current_hw_device] -mask fpga.msk fpga.bit
    % verify_hw_devices [current_hw_device]   #### For readback verify
    readback_hw_device [current_hw_device] -readback_file <filename.rbd> -bin_file <filename.bin> #####for readback capture
    This looks a little different from the one suggested in your document. Can you please confirm if my steps are correct?
    Using the above procedure, I did not have to explicitly send readback commands to the FPGA using JTAG as mentioned in doc:
    http://www.xilinx.com/support/documentation/sw_manuals/xilinx2015_1/ug908-vivado-programming-debugging.pdf
    However the other doc http://www.xilinx.com/support/documentation/application_notes/xapp1230-configuration-readback-capture.pdf mentions sending commands to the device in order to be able to do a readback.
    So I am a little confused which one is correct?
    Also which document will give the words per frame information for  FPGA XC7VX485TFFG1761?
    Rgds
    Sapan
     

  • Reading HashMap Values From a File

    Hi,
    I haven't done file I/O in quite a while, so I'm a little rusty.
    I have a HashMap<TreePath, Entity> that I need to store persistently. Thus far I have been creating a new HashMap every time a new session starts and populating it with Entity objects that I create from JDBC ResultSets. The TreePath is generated by adding each Entity object to its parent in the JTree. That all works well.
    Now I'm trying to write the HashMap to file using ObjectOutputStream. Basically I want to be able to load the JTree (which does not need to be persistent at this stage), and as I load it I get the TreePath of each TreeNode. If that TreePath is a key in the persistent HashMap, then I want to display the details stored in the corresponding Entity. However, when I try to read the HashMap using an ObjectInputStream, I get a NullPointer.
    I'm not sure whether the problem is in the way I'm trying to write or read the HashMap, or both. I've followed the examples in the API but they don't seem to be doing the job.
    Any suggestions?

    I have isolated the problem.
    HashMap<TreePath, Entity> map = memory.getMap();
    TreePath nodePath = new TreePath(node.getPath()); //where node is a DefaultMutableTreeNode
    System.out.println("1. Desired key is: " + nodePath);
    System.out.println("2. Map contains key: " + map.containsKey(nodePath));
    System.out.println("3. Keys in map: " + map.keySet().toString());When I use a volatile Java object to store the map, an example of the output produced by the following code is:
    1. Desired key is: [DW, Acct]
    2. Map contains key: true
    3. Keys in map: [[DW], [DW, Acct]]
    However, when I use file I/O to make the Java object permanent, an example of the output produced by the following code is:
    1. Desired key is: [DW, Acct]
    2. Map contains key: false
    3. Keys in map: [[DW], [DW, Acct]]
    As far as I can see, line 2 of the I/O output should be true, not false, since line 3 shows that the key is present in the map.
    Am I missing something here, or is the containsKey() method returning the incorrect result? It looks like it is getting its reference to map all wrong.

  • How to read and update the value of property file

    Hi,
    I am not able read the values from property file.
    Please tell me how to read and update the values from property file using Properties class
    This is my property file : - Config.properties its located in D:\newfolder
    Values
    SMTP = localhost
    Now i need to change the value of the SMTP
    New value :
    SMTP =10.60.1.9
    Pls Help me
    Thanks
    Merlin Rosina,

    Post a small (<1 page) example program that forum members can copy and run that demonstrates your problem.

  • Format when reading in values

    Hi
    I want to read in values from csv file, where values are either denoted as 200,50 or 200.50 for decimal values.
    But the datasource upload sees the values as 20050,00 What settings should be changed in datasource to make the , or . visible?
    In datasource under fields this value is specified as DEC with 2 decimal places.
    In my extraction tab the number format is 1000's as . and decimal as ,

    Hello Corne,
    I do not think it is possible to have two separate formats ie. 200,50 or 200.50 in the same file. If you have specified the thousands separator as . and decimal separator as , then the system cannot read the value 200.50 properly.
    Is is possible for you to correct the source file to have a uniform format?
    Best Regards,
    Vincent

  • Read bool value from xml

    Hi all :
    I try to read Boolean value from xml file , please see attach file , all the time this error rise
    I know that The XML tag describing the type of data does not match, how can I get Boolean value " 1" or "0 "
    Thanks
    wisam
    Attachments:
    untitled1.JPG ‏115 KB

    You are not trying to read boolean.. you are trying to read a DBL.
    To read a DBL you must first write a DBL to XML.
    To read a boolean replace the DBL with a boolean

  • Read From Measurement File... removes X Values of first column?

    During one of our tests, two instruments were switched at the terminal by accident. I need to read in the massive lvm files, remove the wrong scaling and apply the correct scaling, while switching the values in the columns and right it all to new files. Simple right?
    I wanted to use the Read from Measurement File.vi to make things easier, because the files are very large and I would like to analyze them 100 rows at a time. Some of the the files are around 1.5 Gigs in size so I need to read them in chunks.
    The read from measurement file keeps removing the first column from the data! It outputs the data as a signal (dynamic data) and I have to use the dynamic to numeric array express vi. For some reason, before I even get to that point, the first column is not in the data.
    No matter what settings I pick on the read from measurement express vi, the time column is removed from the data. I have checked/unchecked the "first row is channel names" and "first column is time channel" to no avail. The odd thing is that in the preview it shows the first column, as if it will read it properly... but it doesnt. Nothing I change in the settings can seems to make a difference in getting the first column, the x values, out of the file.
    Below you can see the first column completely removed from the data.
    This is extremely frustrating. By probing the signal out I can see the dynamic data attributes and the time column has already been removed, so I don't think that the signal to double array express vi is the problem, but I am not sure.
    I am attaching my VI and a small data file to be analyzed. You can see what I mean.
    The alternatives seem less than adequate. The read from spreadsheet file vi wants an offset of a specific number of characters not rows. The problem is that this is not constant between rows for some reason, when hidden characters are taken into account so I cant just set the number of characters in 100 rows and increment the offset in a loop... like I normally would. That means I might miss data or get a corrupted row.
    This means that I have to use the read from text file, read how ever many characters I think a row is (over estimating a bit) then search for the newline character, find out how many chars are in that set and then offset that for the next loop iteration, all while converting each string number to a double. Talk about slow.
    I have searched around and found that I am not the only one that has had this issue. This is a common thing, but no one seems to have the answer. Why can't the read from measurement file VI read all of the numbers in every row? Why cant I tell it I want a 2d array of doubles out and not a dynamic data type? It has to be something I am doing wrong.
    Attached is a zip file with my VI and two data files. The "S19_A_DSI_detensioning_c.lvm" is the one generated by my VI (_c meaning corrected). "S19_A_DSI_detensioning.lvm" is the original measurement file. I hope you will pardon my messy VI, it's a quicky.
    Any help you guys can give would be much appreciated.
    [will work for kudos]
    Attachments:
    Scaling Factor Correction.zip ‏1109 KB

    That is a great workaround. The help talked about putting a check next to "read lines" but for the life of me I couldn't find where to do that. I wonder what other VIs have mystery check options in the right mouse click menu. I mean normally options like those are inputs, I thought. I'm going to start right clicking on every VI I drop to see if there are options there I never realized.
    I would still have to use the set file position VI and specify the byte offset right? How would I know where that is? I guess each character is a byte and I would count the characters in the string retrieved and then offset by that amount on the next iteration using a shift register?
    While waiting for help, I ended up using the read from text file and using the match string to look for the new line character, and using the spreadsheet string to array vi, analyzed the files line by line. Thats just because I couldn't easily come up with a regular expression to get 100 lines. It was slow but it worked.
    However, that still really doesn't answer the question of why it is impossible to get the first column with the read from measurement file express VI. Does anyone know? Is this a known bug?
    [will work for kudos]

  • Read from measurement file (wrong values)

    I have a VI where I save data using the ''Write To Measurement File utility''. When I open the .lvm file in the note pad I can see all the data correctly, but when I use the "Read From Measurement File" tool and try tho make a graph the data shown is not correct. Attached the .lvm file and one image of the chart that labview made using the "Read From Measurement File". If you open the lvm in the notepad you can see that the time column goes up to  22 sec. In the chart the time axis goes only up to 7,5 sec. What is going wrong??? Thanks
    Ps: I changed the file .lvm to .txt to attach
    Solved!
    Go to Solution.
    Attachments:
    Chart.jpg ‏688 KB
    teste.txt ‏156 KB

    vitor22 wrote:
    I tryed.
    And how did it turn out?  Saying I tried and not saying how it didn't work doesn't help me help you.
    I was able to do it.  But the X data wasn't correct.  That is because your timestamps aren't regular spaced.  So you can't use a waveform graph.
    You need to use an XY graph.  See the attached code for how to convert the two channels of data (time, your values) into a datatype to feed to the XY graph.
    Attachments:
    Example_VI_BD.png ‏49 KB

  • How to populate column titles for y values when using Write to Measurement File Express VI with a tab delimited text-based .lvm file?

    The .lvm file generated by the Write to Measurement File Express VI includes column heading titles for the y values, but they are a default value of "untitled".  See attached example of a sample file when opened in Excel, the values in question are highlighted.  Is there a way to specify the column titles when the file is written?
    This is a similar question to this posting, which received a work around response to use the Write to Spreadsheet File.vi, rather than a solution when using this VI.
    Message Edited by Hightop Raven on 05-02-2007 03:37 PM
    Attachments:
    column_titles.gif ‏13 KB

    Sorry for the late reply.  I was out of the office Friday.
    You can do it, but the code can get rather ugly.  Under the hood, the dynamic data type (the dark blue wire) is an array of waveforms.  In your case, the scalar values you convert to a dynamic data type are being converted to an array of waveforms, each waveform having one element.  You have two options.
    Explicitly convert your scalars to one-element waveforms (t0=0, dt=1) and add the title before conversion to a dynamic data type.
    Convert your dynamic data type to an array of waveforms and loop through them to add the column labels.  The conversion blocks are in the Signal Manipulation Express palette.
    I would recommend 2, since it is the easiest to add.  It is also the easiest to run only on the first iteration.  Just put a case selector around the loop, wire the selection to the While loop iterator, and set the case containing the label code to 0.  The default case simply passes through the dynamic data.
    My apologies for not including a screen shot.  I am in the process of upgrading my machine and can't run LabVIEW.  If you need one, let me know and I can post one tomorrow.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Labview 8 crashes when using Read Labview Measurement File

    Hi All,
    I am a new user for Labview. I installed Labview 8.0 from the CD (evaluation copy). I was just testing the sample code provided by NI. I opened the "Load from File and Display" example and I was trying to open the properties for the Read Labview Measurement File component when Labview crashed. I tried it a couple of times and everytime it happens the same way (when I double click the component or right click on it).
    I am using Windows XP with all the updates done. In the Windows crash report, the application version is 8.0.0.4005.
    Other problem I encountered is a missing component on the Input Palette (no DAQ Assistant present) and the Instrument I/O Assistant raises the error "Measurement & Automation Explorer or the Instrument I/O Assistant is not installed correctly. Please install these from the Labview Driver CD". For the last problem, I will try to run the Labview Driver CD, once I get it. But I am not sure if the DAQ Assistant will show up then or not.
    Any ideas?
    Regards,
    Nick

    Hello Nick,
    While it is not my area of expertise, I would expect the DAQ Assistant would appear after installing the driver CD as you said you would be trying.
    What caught my attention was the crash.  The easiest way to resolve the crash is to delete the instance of the Read LabVIEW Measurement File on the diagram and place a new one from the Express Input palette (now called "Read From Measurement File").  In that situation, I would expect just pressing OK to accept the default configuration should work.  The crash occurs in certain circumstances when the Read / Write Measurement File Express VIs are dropped from a previous version of LabVIEW and then their config page is opened in 8.0.x.  This issue should be resolved in a future release, sorry for the inconvenience.

  • "read from measurement file" reads only first line of data

    Hello,
    I have a problem when trying to read a .lvm file through "Read from Measurements file" with the following block diagram
    Problem: it reads only the first line of data from what I can see in the probe window,.
    A part of the lvm file for reference.
    I haven't used Labview in a long long time, I'm trying to figure out what I am doing wrong.
    Thanks

    Sorry meant to attach the lvm. Here it is. (Actually I had to put it in .txt because the forum wont let me upload a lvm file)
    I unfortunately cannot share the full vi that record the data as I am not its owner/creator. I'll try to give as much info as I can with the relevant pictures attached, I hope it allows us to at least have an hint of where the problem might be.
    (this is in a while loop)
    In the stacked sequence, the other pannels are similar to the one shown here: value read fron a variable, converted to dynamic and a signal attribute is set. The "start recording" control operation is "switch when pressed".
    Here are the properties of the set signal attributes
    And here are the properties of the "write to measurement file"
    Attachments:
    NoTarget_full circle__Rx_-10-SAMPLE.txt ‏60 KB

  • Read from measurement file problem

    Hi all,
    I am using the "Read from Measurement File" VI that is built into LV8. I am reading in a .lvm file consisting of 2 columns. I cannot seem to figure out how to index each column. When tested using a a single column data file, I am able to use the index array vi to  access the data successfully. The problem occurs when I have 2 columns. To get around this problem I split my initial data file into 2 single column data file, but I would prefer not having to do this. Is there anyway to avoid this?
    When I read the 2D file into an array I can only index the data located in the 1st row 1st col and the data in the last row 2nd col.
    The array size function results in the value "2" yet each column has 201 entries.

    Attachments:
    Write to LVM.vi ‏128 KB
    To read LVM.vi ‏70 KB

  • Reading values from txt file

    Hi,
    I was hoping someone could help me. I am trying to read these values
    3.182, 0.02734, 1126.0, 4.998E-4, 0.01581, 11.0, -150.3, 10.46, 3.735, 0.8474, -0.4854, 0.7866, 1.475, 0.9439, 0.769, 0.1846, 0.07678, -0.9491, -1.236, -0.9908, 0.5265, -0.27, 0.3569, -0.09167, 0.1295, -0.04507, 0.1029, -0.03005, 0.0, 0.03752, 0.001151, 0.2935, 74.84, 19080.0, 6.086, etcfrom a txt file. I have done some coding on it but dont seem to be getting the desired results. I want to take these values and put them in a 2D array.. but its not doing it. Can you see any mistakes i have done please ?
    public double[][] readFile(){
              double[][] dArray = new double[164][37];
              int a  = 0;
            int b = 0; 
                    try
                    {  FileReader fin = new FileReader("myFile.txt");
                               BufferedReader in = new BufferedReader(fin);
                                 String line;
                                 while((line = in.readLine()) != null){
                                String[] value = line.split(", ");
                                for (int x=0; x<value.length ; x++){
                                     System.out.println("a:  "+a+" || b: "+b);
                                         if (b == 37) {
                                                a = a++; 
                                            } else
                                                dArray[a] = Double.parseDouble(value[x]);
                             System.out.println("value: "+dArray[1][1]);
                             b++;

    Yes thats because its part of larger code.. it is just a method within my code.
    but your right about the catch but so yeah sorry i missed it when i copied pasted. I ve also added you a main method.
    public double[][] readFile(){
              double[][] dArray = new double[164][37];
              int a  = 0;
            int b = 0; 
                    try
                    {  FileReader fin = new FileReader("myFile.txt");
                               BufferedReader in = new BufferedReader(fin);
                                 String line;
                                 while((line = in.readLine()) != null){
                                String[] value = line.split(", ");
                                for (int x=0; x<value.length ; x++){
                                     System.out.println("a:  "+a+" || b: "+b);
                                         if (b == 37) {
                                                a = a++; 
                                            } else
                                                dArray[a] = Double.parseDouble(value[x]);
                             System.out.println("value: "+dArray[1][1]);
                             b++;
              catch (IOException e){}
              return dArray;     
    public static void main(String[] args) {
              new Extract();
              }/code]

  • Read Measurement file does not read the first channel of my TDMS file

    When I try to read a TDMS file with the Read Measurement File express VI, the first channel of the data is not there.  When I open the file up in excel the channel exists

    Even I have the same doubt  regarding Labview plss help me reading the Excel file from 23rd row and the graph should be drawn between 1st column and 8th column ,  from 23rd row . Here is the sample data.
    Attachments:
    Book1.xlsx ‏204 KB

Maybe you are looking for

  • Iphone 5s: surprise shutdowns at lower battery %

    Iphone 5s; Version 8.1.1 As soon as my iphone was a one year old in November, 2014 I started having this issue. I have not been able to track a pattern as to when this happens. Issue: When the battery is low enough: 25-40%, and I am trying to use my

  • I can't use my iPod

    This isn't new I'm sure but has Apple made any strides to assist those who have either lost iPod or had their's stolen? I believe "Dateline NBC" ran a story on this very subject and how Apple was not willing, at the time, to get involved. Just curiou

  • Define sd organisational structure?

    define sd organisational structure?

  • Can't uninstall all anti virus files.

    I would like to uninstall old anti-virus files. Both Virusbarrier and Norton were used at one time.  Both programs have been deleted but I still get asked about Virsubarrier renewal as well as Norton safe files questions....  I've gone thru applicati

  • Idocs failing after upgrade to ecc6

    Hi Experts, we upgrade the system to ECC6, before the idoc to idoc scenario was workinf fine, but after upgrade we are getting error in we02 with Function Module Not Allowed Can any one help what was the wrong??? Kind Regards, Praveen