execution timing

Hello

I'm going to build a real-time application and I want to work for a few minutes, an automatically. Anyone have any idea how to do?

Thank you

Concerning

Hi Gharbi,

You can add some logic so that the elapsed time VI is reset during the first iteration of the inner loop. If you're not keen on the first time VI to keep account while running the inner loop then you may need to add a similar logic.

Because looks like you're new to LabVIEW, I recommend going through LabVIEW training course. They range from self free to the pace of training instructor.

Tags: NI Hardware

Similar Questions

  • Hardware timed CI/CO, operation of PCI, I / AO with specific execution order

    Hi all

    I work with a USB-6361 NI data acquisition hardware and I'm writing a LabView 2011 program which sends a signal to my output device and reads several values of various measuring devices. I have a ramp voltage signal (in a table format) and I need to sequentially send the elements of this array on my AO device with very precise timing (ideally timed material). As soon as the value is written to the device of the AO, I need my tasks HERE and CI to record all available data and my task to send a single impulse before the next array element is sent to the device AO. All this needs very precisely timed such that if I perform a measurement on 1000 points in my table of ramp with a timing of 1000 Hz, the program will have exactly 1 sec. to run (less overloading caused in initialization and closing tasks) and produce a table of data consisting of 1000 steps of AI and CI. I had initially tried to achieve this by using a structure of sequence within a timed loop software, but because I won't get into multiple channels of Amnesty International and CI and tables of data, this has proved to be excessively slow. The other danger that I fear I could run is the case in which the LabView program runs more slowly than the process of acquisition data itself, thus causing data to write to the buffer and the measures being lost.

    I didn't spend a lot of time working with the procedures, timing and synchronization, so I apologize if this is a rather naïve question - I'm having trouble reconciling restrict them inherent software and order of execution with the hardware timing. What is the best way to solve this problem? I can only think of two reasonable approaches to the problem:

    (1) should I try to trigger my CI tasks and HAVE run on the completion of the task of the AO (and if so, how)?

    (2) I have the CI and tasks run on a separate clock with a start delay initial light as to compensate for these tasks if they occur reliable after that each value AO is sent to my device?

    Finally, I build an identical for a real-time embedded controller program of SMU-8100. The approach will be different in this case?

    Thanks in advance for your answer.

    I can give you an overview of the steps you'll need, but be ready to spend experiment a little time and some of these individual pieces of troubleshooting before you put them all together.

    First of all, a X-series 63xx allows all you need to accomplish a very precise synchronization in hardware.  When you then switch to a real-time controller, you must include an X-series device in the chassis to maintain this capacity of equipment.

    Second, 1 kHz is not yet a challenge to LabVIEW to catch up with your hardware, even with powered lower RT controller.  You just need to program the DAQmx tasks to let the hardware & driver do most of the work.

    1. I would dedicate a counter of the 6361 to generate the clock shared for other DAQmx tasks.  I tend to create a clock and operating cycle of 90-95% for this type of application of stimulus / response to the response time & maximum stabilization.  Generate the stimulus at the cutting edge of the clock and gain response data on the edge of leak - before the next sample of stimulus.  Call it the task of the clock.

    2 set up a buffered AO task that uses the output of clock as the sample clock. Configure the polarity to be sensitive to the cutting edge (usually, this will be a rising edge).   Start the task AO * before * starting the task of the clock.

    3 configure tasks HERE and CI to use the output of clock as their clocks in the sample.  Configure the polarity to be sensitive at the trailing edge.  Start tasks I and CI * before * starting the task of the clock.

    4. the output pulse should be a task of meter output, configured to generate a single pulse redeclenchables.  Configure it to use the leading edge of the clock as the trigger signal output.  Set the time of 'low' and the 'initial period' to equal precision<1 msec="" delay="" you="" want="" to="" make="" sure="" that="" you="" get="" the="" same="" timing="" on="" every="" trigger.=""  be="" sure="" the="" high="" time="" allows="" the="" full="" pulse="" to="" fit="" within your="" clock="">

    5 examine the "producer-consumer" model so that you can separate your data from your CQI data processing.  You should stream to file continuous rather than it accumulates in large networks.  Write speed of file can be unpredictable, this is why access to the file must be in a separate loop that acts as a data consumer that the loop of CQI data produced.  When you spend real time, assign a lower priority in the process of writing file.

    -Kevin P

  • Execution time of the timed loop

    When I run a timed loop, even a dummy, I have 100% CPU usage with "RT get CPU loads. The Profiler 'Performance and memory' and "execution trace toolkit" also indicate a maximum time of VI. Is this normal?

    What target RT do you use? If it's a FP, you will always have 100% of the CPU load due to the optimizatio performance.

    Best regards

    Fabio

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

  • Task execution time interval Timed try again

    Hello



    Is there a way to find out what tasks (process tasks) in an OIM10g env use the Option to try again?
    What should be the Timed Task Scheduler retry interval?


    TIA...

    Yes, you are right. Scheduled task Timed retry task creates a task to retry for rejected tasks that retry the elapsed time. So if you have a period to try again in 5 minutes time to retry task scheduled as a half hour, it means that elapsed time to try again and if it is rejected after half an hour the scheduled task will retry this particular task.

  • About theoretical Timing

    Hi all!

    I have a question about the calendar with the DAQmxbase functions. I have the task to save data with a sampling frequency static (it will be greater than 100 000 points per second in theory) and I need to display a writing data to the file in real time. So my idea was to put the sample clock to whatever the desired sampling frequency (lets say 100 000 at the moment) and I would have a loop of standard state machine (just a while loop with shift registers and a case statement inside) to collect data and write to the file then to decimate the data to display to the user. Each of these iterations, the amount of data read would be one-tenth of the sampling rate so I thought I could count just iterations until I arrived at the sampling frequency * 10, which would be the total number of hours. Unfortunately, after the execution of this program for a desired 20 minutes to 50,000 points per second, I noticed that the iterations had invariably longer over time, but it was so small that I didn't notice when I tried for 3 to 5 minutes. Is that what this has to do with the decimation of data slow down the program because we need to reallocate the array every time or it has to do with my way of thinking wrong in the way of our recordings of tension time?

    Information

    -LabVIEW 2014

    DAQmxbase - package used

    -System MAC OS X

    - NI USB-6211

    Needs

    -L' sample rate > 100 000 points per second

    -record for a specific amount of seconds by the user

    -written in the file and displays the user data

    Problems

    -While the iterations of the loop are run 0.1 of a second making the program more continue to record the tension longer than expected

    Please, if you do not understand or I forget important information please let me know!

    1 State Machine is NOT good architecture here.  You must keep this look DAQ run fast enough to track data in data acquisition.  Use rather a producer/consumer.  The idea here is that you have parallel loops that make the data recording and processing of data and let the DAQ loop to just read the data that it is.

    2. in windows calendar is not reliable.  Do not trust it.

    3 use the configure DAQmx Timing (assuming that there is no in the DAQmx Base) do DAQmx data stream into your PDM file.  It's one thing less worries and it is much more effective would you be able to do.

    4. If you follow my advice in (1), then you should read a certain number of points for each iteration of the loop.  Let's say 10kS.  Therefore, each iteration of the loop will be 100ms.  But for your decimation, you take all 10 samples.  There is a simple decimate 1 D table that you can use to make it easier on yourself.

  • Not end timed loop

    In the attached VI, I put the loop timed to end once the delay 1 reaches zero. However the timed loop continues to run and stop only if I have OR both 1 and 2 delay delay. (Tried with different schedules for late 2 which are less lag 1, equal to 1 delay and more delay 1 - no chance unless it is also linked to stop)

    What is the reason for this? (The VI is in LV2012)

    And it is protected by word that prevents us from looking into it.

    Is this your VI or did you also?

    Subvi properties seem to show that it is not reentrant.  Otherwise it can only run one instance at a time.  And if happens to store data to leave once it is called to another in the uninitialized shift, running an instance registers is probably interfering with the execution of the other instance.

  • Why my program runs fine in execution of climax, but not normally?

    Hey everybody,

    So I created a program that works very well (to produce a graph of intensity) when I select run, but then when I run the program without execution of climax, the output intensity graph does not appear. I enclose a copy of my program for reference. Thanks in advance for the help!

    What kind of error do you see? What does not work?

    I have all the subVIs that make up your VI you have posted and it would be difficult to say what is happening, but I suspect that you run in some sort of timing issue. When you run with execution highlighting turned on you slowly run downhill. During normal execution things can run before the system is ready. Maybe your initialization of the camera takes time to complete (on the hardware itself) and when you run in normal mode you are trying to access it until it's ready.

  • Loop timed in LabVIEW DLL does not close

    Hello!  I have what I think, it is a simple loop timed in LabVIEW that stops after 100 iterations by throwing an error and letting the loop 'stop on error.  It works fine when it is executed in the ordinary LabVIEW environment, however, when compiled as a Dynamic Linked Library (DLL) and called from LabWindows it requires me to put an end to execution, rather than going out nicely.  As well, it seems to leave the real appeal of virtual Instrument very well and go to the next line of code, but when my function main() in LabWindows is completed it must always be something not cleaned which is the cause not come out well.  Any ideas?   I tried to add only a call to QuitLabVIEW and that doesn't seem to do it.

    Thanks in advance - hoping you will notice an error really easy. )

    A photo of the timed loop is attached.

    An excerpt from the code of LabWindows:

    int main)
    {
    CallMyLabVIEWDLL();  This line launches successfully and closed the window for my virtual instrument LabVIEW
    MessagePopup ("' My Title:", "That occurs after the call to your LabVIEW DLL" ");    This popup appears - indicating the call to the DLL has finished

    But after the code has completed LabWindows always shows "running", rather than close.

    return 0;
    }

    Why do you use a loop timed in the windows environment?  They are best used for real-time environments (not windows) and tend to have more support than the time.

    Is there a particular reason, a while loop will not work?

  • (How) Can I change the priority for execution vi when running

    Hi all

    I use the demons (free running VI) and I communicate them through queues.

    They are part of my architecture of device driver and use a producer (of the Acquisition) architecture or Architecture consumer (for control)

    I have a single VI demon I deploy an 'object of device' using a class polymorphic implimentation.

    This implimentation has a deficit of subtle,

    I'm not able to change the priority for execution to the launch

    There is a property node taunts that it is possible, but the assistance (and run the error message) says not available during execution.

    Anyone know of another method?

    Here's what I thought about so far:

    1. do you have 5 different demons with different priorities [Distasteful for the maintenance of the Code]

    2. make low priority and ensure that at least 1 VI in the driver has a highest priority [do not know if it works, mask implimentation]

    Kind regards

    Tim L.

    You might think about putting a timed loop or timed sequence in your daemon and then passing a value of digital priority to your demon. This is the best solution I can think.

  • USB-6009 software simultaneous timed output analog

    Ladies and gentlemen,

    I worked on a LabVIEW interface to a potentiostat I designed and built. I'm not very experienced with LabVIEW, but do they have experience with a variety of other languages (I had originally intend to use an FPGA for this, but he has been asked to write a LabVIEW VI first) programming.

    The goal:

    I want to output a voltage (initially consisting of ramps) signal and measure the voltage with an operational amplifier configured as an ammeter of feedback (using resistance feedback and voltage value to calculate current) connected to an electrochemical cell. The resistance of feedback is selected by using an automatic selection function (although I wrote a version prior to manual control) as TTL values using the DAQ Assistant to select relevant MUX channel outputs. I then try to save the data in a spreadsheet.

    The problem:

    I use an acquisition of data USB-6009, and I know that there is a hardware clock. Read all about him seemed obvious, the best way to the waveform of the output voltage used DAQmx package to define a function of writing in a loop that is clocked by the software. The problem I have is that I can't synchronize the output to the input with reliability and I have also some errors related to resources DAQ being reserved (error 50103). I think the way to solve this would be to convert every equivalent DAQmx DAQ Assistant and try to group their execution - this is where I fall. I tried to write a simple VI who shared a loop clocked by the software to read and write but had problems related to the value of min HAVE (error 200077).

    General issues:

    How I begin the process of read/write (with a Boolean switch) is very weak and doesn't feel not robust. Ideally, I would like to some form of indicator to warn the user when the read/write process is running and when it ended.

    My error handling is terrible, but I find no big thing to read about the basics.

    I use only a sequence of no and I think I should have more.

    Once I hit the beginning, VI requires the file name for the worksheet - at first, I was afraid that data would be entered correctly, but I think it's okay because the file is generated and then changed. It would be better if the user asked for the name of the file once completed the data collection.

    Any suggestion or help would be greatly appreciated. Thank you in advance.

    Sincere greetings,

    Julius

    The hardware supports timed 6009 entry analog. Even with the 1Samp mode, your code could be simplified with a single task and several channels (dev1\ai0:1). Then use Nchan 1Samp.

  • Why the STOP button stops not timed loop.

    Hello world

    I had a rather complicated code launched against me. I had to change program action unique (and many other things) when ACQUIRING a button has been clicked making timed measurements. I was able to add the time... but I want the loop to stop once you click on the STOP button.

    I have attached a very simplified version of my code.

    So if you start and press the ACQUIRE the program generates random numbers (to simulate the measure) and records them with a device ID. The program stops once the total is for instance in the default settings after 20 sec.

    But it does not stop when you press the STOP button. MY QUESTION: why not?

    FOR INFO:

    In my actual code, there are 10 events instead of only 1.

    It doesn't have to stop immediately, inbetween iterations (because I already tried to include the timed stop Structure VI and it did not work either).

    I also used the execution to highlight, but it did not help me.

    Thank you for any help or suggestion!

    Lisa

    Lisa,

    First of all, thank you for explaining clearly what your problem and to present a simplified program.

    The problem with your program is very simple. The loop inside the structure of the event begins when the acquisition: Mouse Down event occurs, which seems to be what you wanted. The default condition for the case of the event is "front Lock (defer the treatment of the actions of the user) until the end of the occurrence of the event." This is controlled by a checkbox at the bottom of the evetn installation dialog box. What this means is that the stop button is not recognized until AFTER the event is complete.  BUT the case of the event cannot complete until the while loop stops.

    The Solution: Move the loop outside the case of the event.  Generally speaking, event must not contain any code that could take more than a few milliseconds to run and certainly should not depend on the user's other actions to complete.

    Look at the design of producer/consumer models (events) for advice.  Also learn how to use queues to pass data between loops rather than local variables.

    Lynn

  • Abandonment of a loop timed - what happens?

    LV2013, LVRT 2013

    I'm not clear on what happens when you STOP a timed loop, STOP TIMED STRUCTURE vi.

    The help says:

    "If you try to interrupt a timed running the timed immediately loop loop runs the current iteration and returns ABORTED in the output of the REASON for the data node left."

    Given the following loop:

    I can abandon this loop, by name, by the way.

    This cancellation occurs at any time, regardless of this loop is where its cycle.

    This loop runs at 10 Hz and takes 1 to 2 mSec per iteration.

    1... what happens if the cancellation occurs during the delay?  I guess that he wakes up with the reason set to ABORTED.  It executes the code inside, or not?

    2... Suppose that the loop has already run the vi of the SAMPLE, but not the vi STORE, when comes the demolition.  It don't...

    (  ) 2A... An abortion without running the STORE?

    (  ) 2B... Run the STORE, browse again with REASON = INTERRUPTED, and then runs the SAMPLE and STORE again?

    (  ) 2C... Run the STORE, browse again with REASON = INTERRUPTED, then popping out without running again?

    3... assume that the loop is located in the middle of the vi of the SAMPLE.  What is this VI partially abandoned through?

    What throws me is help text: "immediately runs the current iteration and returns ABORTED."

    If she abandoned after he woke up normally, then the REASON is already set, so he can't tell me that it's been abandoned.  But if she should set the REASON, then it must finish executing the code, browse AGAIN, and then run the code AGAIN, isn't?

    Anyone know the rules for this?

    I have not tested, I guess based on a combination of documentation and experience in similar situations. It should still run once with the reason set to ABORTED to give the code inside a chance to do a cleaning. If you are in the middle of an iteration, it will end this iteration, then run again immediately. If cancellation is received during the wait, the loop is executed immediately once (stops pending). The last execution will always be reason set to ABORTED, and you never have a situation where the code is suddenly stopped in the middle of execution.

  • sampling time changed the buckle timed

    Hello world

    I use the timed loop to control the DC motor with the vi of PID. in the loop and the sampling time are defined as 0.01 s. However, after I added a few other screws in the loop, for example, writing of measure file.vi, to collect the errors between the angle and the practical perspective of the engine for the time histroty the movement of the motor, we find that the sampling time changed, not always 0.01 s before the vi has been added, but 0.01 or 0.02 s. the entire program desinged to be fininshed with 7 s, now's done it at 9.4 s, that is, execution of the loop time is extended.

    Another thing is, if the sampling time is defined as s 0.05, the sampling time is always 0.05 s and the execution time of the loop is always 7 s as predined, regardless of writing custom file.vi is added in the loop or not.

    As a result, I think that if the complexity of the loop is incresead and time of sampling sets is small, then the actual sampling time will be modified due to the design of things load in the timed loop. What is the reason? If so, are there methods to solve?

    It is important: the collection of the angular error of the engine in the time histrory is very important, which will be used to show the correctness of the settings KP, KI and KD.

    A friend suggested using the queue vi, but I don't really know how to use them. Can someone give some instructions?

    Thanks a lot!

    See you soon

    Cram features in a timed loop is like stuffing 5 books you know that in a book bag 3. The timed loop is only really practical on a rt system, but even in this case, if the code inside requires more time than the period of the loop, there is no magic that the loop can do to increase the execution time. Just point out you that the loop is late. The solution is to remove features from the inside of the loop. Writing to a file of measure is one of the worst if you write to a text file. Look at the producer/consumer model of design that you have examples of. There, you will have a normal loop that you will write to a queue, and a second loop will process data in the queue. Use file > open...

  • How to force a new period of a timed loop?

    Hello.

    Here my question:

    I need to modify programmatically the period of a timed loop. This isn't a problem but:

    I have to wait until the next loop to present new period value. For example if my previous period was 20 minutes, now I have to wait 20 minutes in order to submit a new period.

    This beacause the code to change the period should be inside the timed loop itself. You can see what I mean in the picture as an attachment.

    The Subvi Gets the new period of a console operator. It will run until the end of the period previously configured.

    My question is: is it possible to force the timed loop to get the new value without waiting for the execution of the previous period?

    Thank you

    FPIA

    Hi fpia.

    Sometimes, it would be more useful to 1200 seconds instead of 20 minutes

    It was suggested many times before: rather than wait for a long time with just a single call to a wait function you should divide this amount of time into smaller pieces!

    -Why do not use you a period of time for example 5 and only count the iterations to know when 20 minutes are more?

    -Why don't you use the function "Time" to know when to exceed the 20 minutes?

Maybe you are looking for

  • Completely shattered after that 10.11.3 updated Safari

    #1 I've just updated to OS X 10.11.3 software updates, and my Safari is almost completely broken. When I create a new tab it does not appear. When I enter something on the URL bar, there is no AutoComplete and the URL is also well centered and aligne

  • How to export units catalog

    Hi all. How export/import a catalog unit based on the quantities? It is simply based in the desktop.ddd? Thanx.

  • Time loop writing file of Rio - please help

    Hello world I'm writing the data collected on the 32 channels of a module 9205 to memory on board a Rio-9074.  This isn't the final requirement of the application, but this is the first simple step.  Both the FPGA Vi and Vi of the host are attached t

  • Free games on Windows 7

    I had to reinstall Windows 7, but now that the operation, the games disappeared.  How can I reinstall the games on Windows 7?

  • Blue Screen - IRQL not less or equal

    Hello! I'm new to this, so bear with me. I get a blue error screen, and I have very limited knowledge on how to know what is the cause. I have other questions trying to see if there is a single cause, but I've not seen a. I'll get to the point: I jus