Writing the file of the measurement loop, multiple-second 'sleep '.

Hello

I do app in LabView 2011 (v11).

His reading of FP-RTD-122, attached to the FP-1001 via RS - 485.

Attached app good enough job, but (never enough for me... :-)) when the time between slaughter is long)

(I don't want to log every 100ms, rather every 30 minutes (1800 seconds, 1800000ms) - and it could become also abuse of the resource to use COM every 100ms).

App does not multitasking and waiting for sleep to the end, so he could listen to action again.

For example,.

I have 30 years 'sleep' and after 5 seconds, I interrupt app (I stop with button loop), but I need to wait for the rest of 25 seconds.

How I would make this app multitasking ("Multithreaded"), so I thread of GUI (GUI) in frontground and logging in the background,

and even if it began again sleep cycle, I would be able to stop him without waiting?

I attach .vi.

Thank you for further assistance.

(PS: strictly windows application is creating the folder C:\LOG and use of Notepad.exe.) I appologise if I forgot to translate anything.)

A loop, not two.  You are famiiliariser of trapping in the inside while loop until the time.  Using the output of the time elapsed in a structure when triggered.  Do the things you want to do periodically in the real case of the structure of the case.

Wire your waiting time in the target time, not the set start time.

Tags: NI Software

Similar Questions

  • URGENT::opening multiple files - i have 3 files in my directory... When I run the code I can open a file and read it... but the while loop get blocked after the first iteration... can someone me help or give some indications

    bbmChatDB of public database;

    public static FileConnection fconnRead = null;
    public static String fileReadData = "";
    public static InputStream is = null;
    data Byte [] = null;
    DataInputStream is = null;

    Here is my code...

    I have 3 files in my directory... When I run the code I can open a file and read it... but the while loop get blocked after the first iteration... can someone me help or give some indications

    try {}

    FileConnection fc = Connector.open("file:///store/home/user/documents/BSM/") (FileConnection); "

    If (fc.exists ()) {}

    Enumeration e = fc.list ();

    While (e.hasMoreElements ()) {}

    System.out.println ("files are:" + (String) e.nextElement ());

    play this file
    StringBuffer stringBuff = new StringBuffer();
    try {}
    System.out.println ("opening file")-;
    System.out.println ("file name is:" + (String) e.nextElement ());
    fconnRead = Connector.open("file:///store/home/user/documents/BSM/(String)e.nextElement(),Connector.READ_WRITE) (FileConnection);
    System.out.println ("data length")-;
    If (fconnRead.exists ()) {}
    is = fconnRead.openDataInputStream ();
    data = IOUtilities.streamToBytes (is);
    Ddd = new String string (data);
    fileReadData = ddd.toString ();
    System.out.println ("length of data:" + fileReadData.length ());
    System.out.println ("read data :" + fileReadData);

    }

    } catch (IOException ee) {}
    ee.printStackTrace ();
    System.out.println ("Exception in the read data :")
    + ee.getMessage ());
    }

    }
    }

    } catch (IOException e) {}

    e.printStackTrace ();
    }

    {Finally

    try {}
    If (is! = null) {}
    is. Close();
    }
    System.out.println ("is closed...");
    } catch (IOException e1) {}

    E1. PrintStackTrace();
    }

    If (fconnRead! = null) {}
    try {}
    fconnRead.close ();
    } catch (Exception e) {}
    System.out.println (try ());
    }

    }

    }

    You can recode this treatment so that it uses only:

    e.nextElement ())

    Once a loop iteration.

    Directly at the start saying something like:

    String fileName = e.nextElement ());

    and use fileName everywhere in your loop.

    Also be aware that printStackTrace() will do nothing in your situation, it only works if you catch Throwable.  So make sure you something output all your catches exception and also have a catch (Throwable t) to catch the things you miss, as follows:

    {} catch (Throwable t)

    t.printStackTrace ();

    System.out.println ("Eception exception:" + t.toString ());

    }

    I think your code is thrown an exception and you don't see it.

  • write the measurement file

    Hi all

    In fact, I'm writing a file of measures. I'll have a waveform from the oscilloscope and I want to record it after every 15 seconds.

    In the attached VI, I simulated signals (the driver that I use for data acquisition also got the while loop) and performed an analysis on it. As shown in the attached screenshot, I use the write action 1 file to connect the data as soon as starts the acquisition and then I use writing as filemarked 2 to get the data after every 15 seconds.

    I thought that this arrangement should work, but it does not work

    Could you please guide me in this regard? I want to write data to a file of measure for every 15 seconds.

    Looking forward to your response.

    Best regards

    Hernu

    The use of the timed loop is unjustified at all, IMHO. Simply place a time elapsed in the main loop function and it wire to an instruction box with the writing inside function. Or use an architecture of consumers/producers (file > open...).

    The way you wrote that the displayed example shows that you don't understand really LabVIEW and data flow. Always take the tutorials. ?

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

    Hello

    I'm trying to control a power supply with labview and adjust the tension. I currently work reading in a file and measures affecting the value in the file. I now have the question I want to update this value when the file is modified, as read in the file again when it is updated and set the voltage again. I've tried several things, but if I put the file in the while loop, then it plays once and then returns 0 after the first loop. Outside the while loop it reads only the initial value.

    I'm quite new to labview so any help would be appreciated.

    Thank you

    E

    You can use the File Info VI for the time that the file was modified.  If the time has changed, read the new values.

  • How to measure the speed of the funnel without the closed loop of the report?

    We seem to be in trouble, we want to move to 10 Eloqua and/or get the closed loop, tool of reporting, but we have to wait. However, we still really need to be able to measure our funnel and speed into the funnel. So did he do this without the help of eloqua fancy reporting tools?

    To calculate the speed you need two things:

    (1) steps defined

    (2) a date stamp for each step, you're trying to follow a long time.

    I've seen customers calculate the funnel using their CRM speed by writing a date to a field on the contact record and then report on these dates.  For global directional numbers I've seen customer on created lead report / month, then had a date on the contact record to identify SAL in a period of time, following by pointing out the standard option.  This is not one to one, but can provide valuable guidance.  To be precise and complete the picture, you would need MQL dates and SAL on the contact record, and your opportunity process will need to have associated contacts.

    On the product side, income Suite is available on E9.  No need to wait.

  • Import data from the .tdms file and comparing with the measured .tdms file

    Greetings,
    I want to make an application that writes the values measured in a .tdms file.
    But I want to do a separate database in a .tdms file that contains the theoretical values.
    After the measurement, the application must compare the measured values with the theoretical.
    If the application needs to read that a cell of the .tdms file.
    Is this possible?

    Thank you

    Here are some materials:

    http://www.NI.com/white-paper/3727/en

    http://www.NI.com/white-paper/5696/en

    I also recommend that you can start with examples of PDM in LV to get acquainted.

  • Write the measurement data in text file every 10 seconds for a duration of 2 seconds, creating a new file every time.

    Greetings,

    I'm working on an application for the acquisition of data that runs constantly and need to record data at intervals of 10 seconds for a duration of 2 seconds.

    On each interval recording, I have to create a new file that contains a number of journal in the name of the file (Test_1.txt, Test_2.txt,...);

    and add to the current time and date on the header of the file.

    My question is how can I do this with what I have so far?

    The attached vi is a notion of what I am trying to accomplish. The application also has the DAQmx read functions in the vicinity while loop.

    and a few manipulations of data. Apart from the main loop, I create and launch tasks DAQmx.

    Thank you for your help.

    Best regards

    Matej

    Hello

    Thought this one myself.

    Here is the solution, if anyone needs something similar.

    Best regards

    Matej

  • What happens when you specify multiple iterations of the parallel loop that you have processors?

    I have an app that does the same things together up to 10 times for different material resources. For example, I have a list of 10 COM ports I want to send orders series. I want that they be executed as close to synchronous as possible, but up to 200 ms sync would be acceptable. Currently, I use a loop set up to 10 parallel iterations and assume that LabVIEW will juggle processors according to the needs, the iterations run it as simultaneously as possible. Experimentally, LabVIEW indeed seems to create 10 parallel loops, even when running on a computer with only 4 logical processors, otherwise you go 10-element inside the loop would only be not able to complete, right?

    My question is, I'm doing something verboten with my number of iterations of the loop? According to the help of LabVIEW for loop iteration parallelism dialog box: "If you plan to distribute the VI on multiple computers, set number of instances of parallel loop generated equal to the maximum number of logical processors, you wait for one of these computers contain never.» Clearly I'm violating this opinion and yet it seems to work. My performance will essentially be the same as if I had 10 blocks of code in parallel on the block diagram?

    "Reading'how many Threads don't LabVIEW allocates?" links to this page, it seems that, at worst, LabVIEW is hungry for thread and switching of threads between iterations, but my short demand slowing down enough to accommodate this suboptimal situation. At best, LabVIEW has allocated 4 threads per the enforcement system, so as long as I have at least 3 processors, there are at least more son than the parallelized loop iterations. It's all a bit confusing.

    RnDMonkey wrote:

    I have an app that does the same things together up to 10 times for different material resources. For example, I have a list of 10 COM ports I want to send orders series. I want that they be executed as close to synchronous as possible, but up to 200 ms sync would be acceptable. Currently, I use a loop set up to 10 parallel iterations and assume that LabVIEW will juggle processors according to the needs, the iterations run it as simultaneously as possible. Experimentally, LabVIEW indeed seems to create 10 parallel loops, even when running on a computer with only 4 logical processors, otherwise you go 10-element inside the loop would only be not able to complete, right?

    My question is, I'm doing something verboten with my number of iterations of the loop? According to the help of LabVIEW for loop iteration parallelism dialog box: "If you plan to distribute the VI on multiple computers, set number of instances of parallel loop generated equal to the maximum number of logical processors, you wait for one of these computers contain never.» Clearly I'm violating this opinion and yet it seems to work. My performance will essentially be the same as if I had 10 blocks of code in parallel on the block diagram?

    "Reading'how many Threads don't LabVIEW allocates?" links to this page, it seems that, at worst, LabVIEW is hungry for thread and switching of threads between iterations, but my short demand slowing down enough to accommodate this suboptimal situation. At best, LabVIEW has allocated 4 threads per the enforcement system, so as long as I have at least 3 processors, there are at least more son than the parallelized loop iterations. It's all a bit confusing.

    In this case (where you're interacting with the external hardware and have an appointment) there will be a delay of inheirant at each iteration.  THUS, "Oversubscibing" or by allowing the parallel proceedings as logical processors, actually improves performance by running another period of waiting during the iteration.  In fact, you're not "Violate the advice" of oversubscibing.  You use this technique correctly! Just may not have read about this.  See Esp PP 4

  • Name of the file and the measure in the same table?

    Hello

    I wrote the following VI which opens each image file in a folder and measure a certain size on the image. He then puts the result in a table.

    The table has a column and N lines since I N images in my folder. How can I change this VI so that it puts the name of the file in the same table as well as the measurement?

    I want the table to look like:

    File1 measurement1

    File2 GCA2

    ...

    and so on.

    Currently, it just shows

    measurement1

    GCA2

    ....

    and so on.

    The VI are:

    You cannot use the Table Express. Like the properties page says: this is for digital data. You will need to use a bit of real LabVIEW to create the table. A table is simply a string 2D array. Convert the digital chain, build an array of 1 d of the filename and numberic strings and use a shift register to build a 2D array. Something like the code below.

  • How to upgrade the file name in a loop

    Hello

    I try to use the value input (voltage, current) as file name in a while loop. the voltage and current are increment in the while loop.

    I want to save a file in each iteration and the name of the file is C:\voltage_current.csv.

    Someone at - it how to update the name of the file in a loop?

    Thank you

    Tian

    The easiest way I can think of that would add to what follows in the loop: number in fractional string to convert these values into strings and String Concatenation to create the correct file name.  Also concatenate file name with the path of your backup location.  Finally convert the string path.

    Unfortunately my current computer is not installed LabVIEW, so I can't create a nice demo.  But you should be able to wire just those together without too much confusion.  It will look as follows:

    ["C:/path/goes/here/"] -----------------------> [                      ]

    [voltage]--> [fractional number string]--> []---> [string path]-->

    ["_"]    -------------------------------------> [       String         ]

    [current]--> [fractional number string]--> [concatenation]

    [".csv"] -------------------------------------> [                      ]

    The only question I could foresee is if you come across the same voltage/current.

    For example:

    -Voltages and currents

    1                    2

    2                    2

    3                    2

    4                    2

    1                    2

    You may obtain the names of files as follows:

    1_2.csv

    2_2.csv

    3_2.csv

    4_2.csv

    1_2.csv * error.  Depending on your settings, this results in the file overwritten, raise an error or be added.

    Take this into account if you have not only different combinations for each file.

  • I can't export the registry, I get an error writing the file., it is said, "there may be a disk error or system files" what can I do?

    I kept getting an error of my Norton internet security. When I call there suport tech, they made me do somethings, but nohong has worked. Then they wanted me to try to export the registry. When I wnt in regedit to export it.  He said that there was an error writing the file, there may be a disk or FFL system error.

    Assuming that there really may be a disk or file system error, try to perform a 'chkdsk' on your hard drive.  Use the /R if running chkdsk or check both options if you use the GUI version.

    "How to perform disk error in Windows XP check"
      <>5 http://support.Microsoft.com/kb/31526>

    Be forewarned that control the boot volume occurs at the next reboot after you set up, it runs before Windows starts perfectly, cannot be interrupted and can take more than a few hours to run according to the size of the disk and the amount of corruption, as appropriate.  Run it when you won't need your machine for awhile.

    HTH,
    JW

  • usefulness of reading the measurement file express vi

    Hello

    I found reading file express vi measure in LV7.1 does not read from the beginning of the file when you run it the second time. Instead, it resume from where it left off last time. Usually, the user would read the entire file measure each time. So when you try to read the second time, it will show an error window saying that it has reached the end of the file (because he was reading the entire file first).

    I wonder how useful to resume from the last stopping point is? Is there a way to start over each time that the VI excute it?

    I'm sure that's how reading file measure works 90%. Whenever she is called in a single run of the application, it will start off the coast where it was stopped. You will need to work with the low level screw to get what you want to do.

    This Express VI works in a similar way the screws and the following functions:
    Open/create/replace file
    Read text file
    Read binary file
    Read the spreadsheet file
    File dialog box
    Scan to file

    And, you can always use the node to set the file Position to set the position at the beginning of the file.

  • An order has been cancelled or stopped during the processing of multiple files

    I use Photoshop elements 13. I'll save the files from my camera on my desk. Upload photos, edit them, and then while trying to save the changes, I get an error message: "an order has been cancelled or stopped during the processing of multiple files. Continue with the next file or stop? "How I lost my job. a large part

    I was not able to find much about this error online then consulted for relief in this case.

    Thank you in advance!

    Partial solution.

    The problem occurs when the application is in the State 'restore down' (the middle between ____ and the X button). If I have the maximized application files do not delete.

    Just an info.

  • global variable functional to read and write data from and to the parallel loops

    Hello!

    Here is the following situation: I have 3 parallel while loops. I have the fire at the same time. The first loop reads the data from GPIB instruments. Second readers PID powered analog output card (software waveform static timed, cc. Update 3 seconds interval) with DAQmx features. The third argument stores the data in the case of certain conditions to the PDM file.

    I create a functional global variable (FGV) with write and read options containing the measured data (30 double CC in cluster). So when I get a new reading of the GPIB loop, I put the new values in the FGV.

    In parallel loops, I read the FGV when necessary. I know that, I just create a race condition, because when one of the loops reads or writes data in the FGV, no other loops can access, while they hold their race until the loop of winner completed his reading or writing on it.

    In my case, it is not a problem of losing data measured, and also a few short drapes in some loops are okey. (data measured, including the temperature values, used in the loop of PID and the loop to save file, the system also has constants for a significant period, is not a problem if the PID loop reads sometimes on values previous to the FGV in case if he won the race)

    What is a "barbarian way" to make such a code? (later, I want to give a good GUI to my code, so probably I would have to use some sort of event management,...)

    If you recommend something more elegant, please give me some links where I can learn more.

    I started to read and learn to try to expand my little knowledge in LabView, but to me, it seems I can find examples really pro and documents (http://expressionflow.com/2007/10/01/labview-queued-state-machine-architecture/ , http://forums.ni.com/t5/LabVIEW/Community-Nugget-2009-03-13-An-Event-based-messageing-framework/m-p/... ) and really simple, but not in the "middle range". This forum and other sources of NEITHER are really good, but I want to swim in a huge "info-ocean", without guidance...

    I'm after course 1 Core and Core 2, do you know that some free educational material that is based on these? (to say something 'intermediary'...)

    Thank you very much!

    I would use queues instead of a FGV in this particular case.

    A driving force that would provide a signal saying that the data is ready, you can change your FGV readme...  And maybe have an array of clusters to hold values more waiting to be read, etc...  Things get complicated...

    A queue however will do nicely.  You may have an understanding of producer/consumer.  You will need to do maybe not this 3rd loop.  If install you a state machine, which has (among other States): wait for the data (that is where the queue is read), writing to a file, disk PID.

    Your state of inactivity would be the "waiting for data".

    The PID is dependent on the data?  Otherwise it must operate its own, and Yes, you may have a loop for it.  Should run at a different rate from the loop reading data, you may have a different queue or other means for transmitting data to this loop.

    Another tip would be to define the State of PID as the default state and check for new data at regular intervals, thus reducing to 2 loops (producer / consumer).  The new data would be shared on the wires using a shift register.

    There are many tricks.  However, I would not recommend using a basic FGV as your solution.  An Action Engine, would be okay if it includes a mechanism to flag what data has been read (ie index, etc) or once the data has been read, it is deleted from the AE. 

    There are many ways to implement a solution, you just have to pick the right one that will avoid loosing data.

  • Sequence structure flat inside the timed loop and execution order

    I have some problems trying to implement a flat sequence structure when you use a loop timed on a target of cRio VI

    I tried with or without the while loop around the structure of sequence flat, and I also tried to replace the 'Non-deterministic loop' with a timed loop

    The problem is that the program seems to run only once, then get stuck somewhere

    I am writing a program that performs the following operations as soon as possible:
    1. read the Pos_MC of entry on the FPGA
    2 send the value of Pos_MC to the VI target (on cRio CPU)
    3. calculate a value of output based on Pos_MC with a PID block ("exit PID')
    4. send 'PID output' to the FPGA
    5 write "PID output" analog output "MOOG".

    In addition, I want the program to return the measured value "Pos_MC" to a host VI for the recording of data

    So that the output of PID is calculated and sent to the FPGA as quickly as possible, I placed a flat sequence structure to ensure that it happens before you send the output to the nondeterministic loop for recording data

    Also, I want the digital input 'Stop' to be able to stop the loop deterministic (the timed loop)

    I read much more entries than that and the help of several PID and exit, but I rewrote the code for a single entry and exit to make it easier to illustrate

    Screenshot of the code is shown in 'target code.png' and 'fpga code.png.

    The VI themselves are attached in the next post (cannot attach files of more than 3)

    Question 1:
    Any advice on how to get this race? Thank you!

    Question 2:
    Is also my correct understanding in that, using this structure, each 0.9ms (fpga loop time) comes the following:
    1. the input ("Pos_MOOG") is read on the fpga
    2. the production of PID is calculated on the cRio with some delay to computation (for example 0.1ms)
    3. the output of PID is then written for analog output "MOOG" in all about 0, 1 - 0.2ms
    4. the FPGA program then waits until 0.9ms spent and repeat the process

    As opposed to the next pass whenever performing a loop is started on the FPGA:

    1. the FPGA reads the input and written on the output (the output of the execution of the previous loop PID)

    2. then the entry is sent the cRio, PID output is calculated and sent to the FPGA

    3. the new release of PID is maintained until the next time through the loop

    Thank you!

    PHG wrote:

    Thanks for the input guys, any advice as to how I could get the feature in scenario 1?

    I still say that the best route is just putting all the logic of the control in the FPGA.

    Other alternatives include 1) the use of DMA FIFO sedn data back or 2) use interruptions so that the FPGA code can not read the output level until the RT.

    DMA FIFOs are usually very limited, and I would not use them in this situation since I belive said it this code to do for the many outputs.

Maybe you are looking for