Parallel events occuring at different intervals ...

Greatings all,
I would require some help with respect to an application I am writing.
I am trying to have a VI that would perform simultaniously two tasks in parallel (control/adjust current and perform/process readings) on two different intervals.
The control/adjust current process would adjust a specific parameter (in this case current) on a specific interval. If the algorythm does not allow convergence of the current after a certain delay, both process need to stop.
The perform/process readings process would sample, perform calculations and display data from a test equipment on a user programmable interval. This process also has to keep track of the actual total time spent doing this process.The structure would have to consider a series of exit condition such as a quit command from the user, a user programmable timeout and data convergence based on calculations made on sampled data.
A pause request could also be dictated by the user. In such a case, the control/adjust current process would have to pause and place relevent equipment into a specific mode, the perform/process readings process would have to pause (stop sampling, processing data and calculating the elapse time performing this task) until the user decides to continue.
I have tried a few things. The most promissing thing (at the time) was to use tree while loops whithin a fourth one: one for the control/adjust current process with its own wait function, one for the perform/process readings with it's own wait function, one for the pause and one to contain the other tree.
That seemed to work, but I was not able to get instantanious action on pause or quit request. It is as if the program was only taking the two first while loop into consideration. Furthermore, the sampling rate can vary from a short (1 minute) to a long period of time (120 min) and the timout could be as long as a full week. After reading that those time function were not too precise, I got a bit worried since a need a good time precision... After a full week, a few miliseconds error add up.
Do you have any ingenious and elegant ways of performing those tasks.
Thanks for your support.
Kind regards,
Roger

Hi Roger!
As far as the precision of the Wait.vi function, you're right, the timing will become off over an extended period of time. An improvement on this is the Wait Until Next Ms Multiple.vi function. What this does is make sure the amount of time between the start of each iteration is a specific amount apart (as opposed to just having a delay after the iteration of the loop). However, due to the non-deterministic nature of Windows, even this will deviate from the true timing after an extended amount of time.
So, if you're trying to execute an iteration once every 10 or 15 minutes or so, I would recommend polling the Get Date/Time String.vi function for the current time. This is not a wait function, however you could program your while loop to continuously poll the function and only execute a portion of the code every X minutes. See the attached VI below for an example of what I am talking about (written in LV 7.0). Keep in mind that this is just an example and can be programmed much differently to be customized for your application.
Also, I'm not sure I completely understand what you mean by "It is as if the program was only taking the two first while loop into consideration." This sounds like just a debugging situation. I would look over your code to determine if there are any dependencies between the loops or if one loop is hogging the processor (by having no wait).
I hope these suggestions help!
Travis H.
National Instruments
Travis H.
LabVIEW R&D
National Instruments
Attachments:
Wait10minutes_70.vi ‏33 KB

Similar Messages

  • How to handle events occuring on different items in a tree control

    I am developing a small application in which I need to display different panels when user clicks on a tree control item....how to make it display a panel inside a parent panel when a user clicks an item in a tree control....any help would be greatly appreciated. thank you
    If you are young work to Learn, not to earn.

    The tree control can handle several events that you can rely on to handle user interaction. I suggest you take a llok at treeevent.prj example that comes with CVI. In your situation, one possible event to handle is EVENT_SELECTION_CHANGE, that marks the operation the user does when clicking on a new tree item.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • For loop pause till event occurs

    I'd like to know if it's possible pausing for loop in a fixed step till en event occurs.
    I need to use for loop index to indexing some vector's data, but the steps in for loop must be exectuted only if  precise condition occurs.
    thank you very much for possible solutions
    Francesco

    Without seeing any code, it is hard to recommend what to do.
    You probably want a State Machine architecture so that you can stay in a certain state of a while loop, then move on to the next step (state) when your condition is met.
    You could also use event structures.  You could also use notifiers or occurrences to hold the execution of your loop until the notifier is written to or occurrence executed in a parallel loop of your code.

  • Simple question - How do you make an onchange event occur in a select list

    Simple question - How do you make an onchange event occur in a select list to fire a process?
    Thanks

    1) Using ApEx Selec list on Submit Item.
    You will create a PL/SQL Process after Submit. -> Conditional Type Request = Expression1. -> Expression1 is the name of your Select List. Process Source - > Procedure you like. For example depending of your select List value you will add rows in different tables.
    2) Javascript This example will change a System parameter value when changed
    <select id="P3_SUBSYSTEM" onchange="location.href='f?p=101:3:2164422329953284::NO::P3_SUBSYSTEM:'+this.options[selectedIndex].value;" size="1" name="p_t21">

  • Power Shell script to send a email with event details when an specified event occur

    I want a power shell scrip to send a email to a specific email id with the event details when an specified event triggered. The default option to trigger the email on event occur is failed.

    Why is everybody now saying "I want, I want, I want"
    Can you say what is happening?  Can you post a script with a line that is failing?  No!  All you want is a free script.
    Start by learning how to script.   Try at least to write a simple "hello World" script.  Until then you cannot post here.
    ¯\_(ツ)_/¯

  • EDN:  subscribe to the same event deployed on different domain/Servers

    We are working on use case where in we would like to publish an Event from an ADF application . We would like to subscribe to the same event deployed on different domain/Servers than the servers on which ADF Application deployed. We would like to get more information on the configuartion of Foreing JNDI for the Business events for this use case. in the documentation it was mentioned, it is possible but not much details were provided.
    So far all I have to go on is: http://download.oracle.com/docs/cd/E21764_01/integration.1111/e10224/obe_intro.htm#BABHBGAG

    We are working on use case where in we would like to publish an Event from an ADF application . We would like to subscribe to the same event deployed on different domain/Servers than the servers on which ADF Application deployed. We would like to get more information on the configuartion of Foreing JNDI for the Business events for this use case. in the documentation it was mentioned, it is possible but not much details were provided.
    So far all I have to go on is: http://download.oracle.com/docs/cd/E21764_01/integration.1111/e10224/obe_intro.htm#BABHBGAG

  • Measuring different values with different intervals

    I have a program which is measuring temperatures every second (or how often I want it to) and writes this to a file. But now I want it to open a digital line to measure the current through a resistant and if the current is higher than a certain limit, the program should open another digital line. But I don't want it to open the digital line/measure the current so often because the resistant will get hot, so I want it to measure maybe every 15 minutes. How should I make the program measure these values in different intervals?
    I am really a beginner in labVIEW, and i have no clue how to do this. If someone could give me any advice, even if it's only about where i can look to find a solution, I would be very greatful.

    On your front panel, you can have two numerics: one is the interval between temperature reads, the other is the interval between digital reads. If intervals are on the order of seconds (not milliseconds) you're probably better off checking the interval using Get Date/Time in Seconds rather than using Wait (ms). Add shift registers to your loop to save the last time read (one shift register for last temp read, another for last digital read). Each time through the loop, check if the current time (from Get Date/Time in Seconds on the Time & Dialog palette) is more than the specified interval from the last time read. If it is, take the reading and save the current time as the last time read to the shift register. Use separate case structures for the temperature
    reading and the digital reading.
    See the attached LabView 6.1 example.
    Attachments:
    ReadAtDifferentIntervals.vi ‏35 KB

  • Having iCal peep when event occurs... way too long of a process

    When i set appointments in ical with reminder, in order to get a peep when the event occurs, i need to set reminder->message->on date and then iCal sets the reminder 15 minutes before the date! I then need to fix this. This process is really annoying. How can i make iCal set off a reminder peep without going through this process. I would be happy to just get rid of the fixing the 15 minutes thing again and again.

    What is the exact CODEC in the MOV files?
    Also, Exporting to H/264 can be CODEC dependent. Which H.264 CODEC is installed and chosen?
    Good luck,
    Hunt

  • TS4204 I need to delete a calendar event that transfered to my 4S from my Droid.  Also this event occurs yearly.  When I open this event, the edit button in the upper right corner does not exist so I can't delete it.  Any suggestions to get rid of it? Sur

    I need to delete a calendar event that transfered to my 4S from my Droid phone. This event occurs yearly.  When I open this event, the edit button that normally appears in the upper right corner does not exist so I can't delete it.  Any suggestions on how to get rid of it?

    uninstalled firefox ....deleted all files still remaining under mozilla firefox directory in program files ... to avoid having to reprogram all my settings, reisntall all addons as well .. I did not remove anything from mozilla firefox that is stored in either appdata or under the windows users directory (if any)
    ... the as suggested reinstalled the latest version of the firefox browser using the link you provided in the email ..; tested and several issues still remain present and unresolved ....
    so please this is urgent or I will have to jump browsers and start using chrome .. because we work 14 hours a day 6 (sometimes 7) days a week, to get ready for the launch of our newest venture and we cannot lose that much days on browser related issues ... so please instead of putting me through week long step process .. of do this .. do that .. can you please actually look into the issue from your end .. I use firefox for so many, many years thta I deserve this kind of support .. thnx Robert

  • Different Intervals for each tab in Spry Widget TabbedPanels

    Hi,
    I have two tabs panels in my tab panels group and I would them to have different intervals between the two panels is this possible?
    Heres my code for the tab panels:
    <div id="TabbedPanels1" class="TabbedPanels">
          <ul class="TabbedPanelsTabGroup">
           <li class="TabbedPanelsTab" tabindex="0" onFocus="blur();">Tab 1</li>
           <li class="TabbedPanelsTab" tabindex="1" onFocus="blur();">Tab 2</li>
          </ul>
          <div class="TabbedPanelsContentGroup">
           <div class="TabbedPanelsContent">
                   Tab 1 Content
          </div>
          <div class="TabbedPanelsContent">
                   Tab 2 Content
         </div>
         </div>
    </div>
    and here's my code to specify the interval value at the moment:
    <script type="text/javascript">
    <!--
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1", { interval: 12000 });
    TabbedPanels1.start();
    //-->
    </script>
    Thanks

    -- When-New-Form-instance
    IF :SYSTEM.Record_Status ='query' THEN
    go_block('PLN_STOCK_TAKING_HEADER');
    execute_query;
    go_block('PLN_STOCK_TAKING_DETAIL');
    execute_query;
    go_block('PLN_STOCK_TAKING_DETAIL2');
    execute_query;
    END IF;
    same behaviour,excute on tab2 not tab1,well i think it has something to do with the relation..!
    Regards,
    Abdetu..

  • Photos in events thumbnail are different to those that show the event itself, Photos in events thumbnail are different to those that show the event itself

    When I click on an event in event view the correct photos are shown scrolling through, but when you open the event a completely different set of photos are shown that have nothing to do with the event. Help please.

    Backup your iPhoto library, depress the option and command keys, launch iPhoto and rebuild thumbnails. If this does not fix it repeat and rebuild the library
    LN

  • Dreamweaver Crashes and following events occur

    Hello
    I am using Dreamweaver CS6 but it given me error many times Dreamweaver has stopped working.These are the events occur in event viewer.Please help.same problem is in photoshop cs 6 to.there are two event mostly which occur frequently
    Event 1
    Faulting application name: Dreamweaver.exe, version: 12.0.0.5808, time stamp: 0x4f7617ae
    Faulting module name: Dreamweaver.exe, version: 12.0.0.5808, time stamp: 0x4f7617ae
    Exception code: 0xc0000005
    Fault offset: 0x00ad39e9
    Faulting process id: 0x9d8
    Faulting application start time: 0x01cf5ad426053f75
    Faulting application path: C:\Program Files (x86)\Adobe\Adobe Dreamweaver CS6\Dreamweaver.exe
    Faulting module path: C:\Program Files (x86)\Adobe\Adobe Dreamweaver CS6\Dreamweaver.exe
    Report Id: 97feda94-c6c7-11e3-be92-7845c43fa6f7
    Faulting package full name:
    Faulting package-relative application ID:
    Event 2
    Faulting application name: Dreamweaver.exe, version: 12.0.0.5808, time stamp: 0x4f7617ae
    Faulting module name: ntdll.dll, version: 6.2.9200.16578, time stamp: 0x515fac6e
    Exception code: 0xc0000374
    Fault offset: 0x000daa3c
    Faulting process id: 0xdf4
    Faulting application start time: 0x01cfa17624c76318
    Faulting application path: C:\Program Files (x86)\Adobe\Adobe Dreamweaver CS6\Dreamweaver.exe
    Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
    Report Id: fc130fc6-0d79-11e4-be97-7845c43fa6f7
    Faulting package full name:
    Faulting package-relative application ID:
    Please give me solution.Thanks

    Hi ankitj1611,
    Can you try the solutions from here Dreamweaver crashes on start up?
    Thanks,
    Preran

  • ICal has dropped a monthly event for the previous four months....... why did it disappear? and where is it?  It was the same event but a different day each month.

    iCal has dropped a monthly event for the previous four months....... why did it disappear? and where is it?  It was the same event but a different day each month.

      I installed this same digitizer in my T|X some weeks ago.  Some discussion of my experience may be found in this Usenet posting and subsequent thread.
      The stock digitizer in my T|X had always had some significant alignment issues (for which PowerDigi was able to compensate very nicely) and sensitivity which was uneven, but which usually required a heavier touch than I liked.
      Eventually, it began to develop a “dead spot” near the upper left.  My T|X was under warranty, so I probably ought to have sent it in to Palm to be repaired, but I wasn't willing to be without it for the required amount of time, and I've heard enough reports of other T|X owners getting unsatisfactory results this way.  I'd heard enough good reports about the PDAPARTS.COm digitizer, that I decided that the only acceptable way to repair my T|X would be to install one of those.
      After however many weeks it has been, I am still very pleased with the results.  It continues to work flawlessly; it is much more sensitive, so it doesn't require nearly so heavy a touch, and I very much like the hard feel that it has, compared to the spongier feel of the stock digitizer.
      My wife's T|X still has its stock digitizer, and it has so far not shown any of the same problems that mine did, or for which the T|X has become notorious, but the feel is noticeably inferior.  She's content with it the way it is, but I think that if I were to ever buy another T|X for myself, I wouldn't wait for the stock digitizer to fail.  The PDAPARTS.COM digitizer is simply superior in every imaginable way; and, in my opinion, a T|X with the PDAPARTS.COM digitizer installed is sufficiently superior to one with the stock digitizer (even if it isn't defective) to be very much worth the expense and trouble of installing it.
    Post relates to: Palm TX

  • Move an image when mouseDragged event occurs

    I have a JFrame with an image in it.Now when the user press and hold the mouse button(that is when the mouseDragged event occurs)on the image anywhere I want to make the image as movable.
    how should I do that , i am not getting any ideas.This is important , please let me know how to do that.
    Sample code will be very helpful.
    Thank you

    Are you displaying the image in Applet....
    You can use something like this...
    void panel_mouseDragged(MouseEvent e) {
    Container c = this.getParent();
    if (c instanceof JViewport) {
    JViewport jv = (JViewport) c;
    Point p = jv.getViewPosition();
    int newX = p.x - (e.getX()- m_XDifference);
    int newY = p.y - (e.getY()- m_YDifference);
    int maxX = this.getWidth() - jv.getWidth();
    int maxY = this.getHeight() - jv.getHeight();
    if (newX < 0)
    newX = 0;
    if (newX > maxX)
    newX = maxX;
    if (newY < 0)
    newY = 0;
    if (newY > maxY)
    newY = maxY;
    jv.setViewPosition(new Point(newX, newY));
    void panel_mousePressed(MouseEvent e) {
    setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    m_XDifference = e.getX();
    m_YDifference = e.getY();
    void panel_mouseReleased(MouseEvent e) {
    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    }

  • Making an event occur

    Hi,
    How can a make an event occur?. The event I have is mouse pressed. In some part of my program, I want this event to happen withoug pressing the button? Is there a way out?
    Thanks

    so, you want to trigger one of the methods defined in the interface MouseListener (i assume you have a class that implements this)
    well, what parameters does it take??
    check the API, the method signature is..
    public void mousePressed(MouseEvent e)
    so you need to generate a MouseEvent and call this method
    your class that generates the MouseEvent will need a reference to the class with the method
    you can do this in its constructor or you can set it with a setListener(MouseListener listener) method, or you could call its addMouseListener or even fooBar, it maters not a bit
    the java.awt.Component class and all its sub-classes call the relevant method addMouseListener, as thats exactly what it does, it adds one
    Component keeps a list of all its listeners and calls the relevant methods as and when it chooses (ie when you do something with the mouse buttons)
    note however that you may be thinking of mouseClicked, it only matters which method you call, the MouseEvent canreally be any MouseEvent (that is if your listening method dosent check...)

Maybe you are looking for