What is the best way to execute code at a specific time?

Hello,
I have a problem. I need to execute some code at a specific time: subVI A should run at e.g. 2 seconds (after start) and stop at 3.5 seconds and subVI B should execute at 3.5 seconds until 5 s. The user can choose the time points. It could also be that subVI B has to execute before subVI A or at the same time.
Time precission is not important +/- 20 ms is ok.
I have implemented it like that: In a loop (period time approx. 20ms) I query if the timeframe has come and then the subVI will be executed.
See attached picture.
I don't believe that this is an economic way. It will produce high CPU load. How can I do it better?
Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
Attachments:
Timeframe.PNG ‏9 KB

@HaD
Something like this?
Johannes
LabVIEW 7.1 (!)
Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
Attachments:
Timeframe.vi ‏33 KB

Similar Messages

  • What is the best way to start SAPGUI in a specific transaction

    Hello,
    What I'm trying to do is to run a Java program that will start SAPGUI (in windows format, not HTML) and present the user with a specific transaction with some data already inserted.
    I already managed to start the SAPGUI and I know how to fill in data using the SapJCo but my question is: what is the best way to navigate to a specific transaction? I can activate an RFC of BAPI_CALL_TRANSACTION but it seems like a big overhead. so, can any of you tell me what is the best way activate a specific transaction in SAPGUI using JCo?
    Thanks,
    Uri Lifshitz.

    Uri
      JCO are mostly used to executed a RFM on the Destination.
      I don't think we could call a Transaction using JCO.
    Thanks
    Jack
    <b>Allot points if my post helps !!!</b>

  • What is the best way to run AirPort Extreme and Airport Time Capsule together?

    I have cable DSL, and I was running an AirPort Extreme. DH was sold a time capsule, so I just daisy-chained off the airport. We had an issue with limited reach, so I tried to reconfigure. Now I have no wifi at all. Tried everything I can think of. What is the best way to handle these two products, or should one be left out? Any suggestions would be great.

    Decide which one you would like to serve as your router, and configure the other one as a bridge. If they are both the most recent models of each neither one is particularly advantageous over the other.
    Connect them to each other with an Ethernet cable if you want to create a "roaming network", or not, if you want to create a "wirelessly extended" network. A roaming network is the better of those two choices.
    "Hard reset" the one connected to the modem and use AirPort Utility to configure it. Verify everything works to your satisfaction, then "hard reset" the other and configure it.
    To "hard reset" an AirPort Base Station: make sure it's powered up, then press and hold its tiny reset button and keep it depressed for five to ten seconds, long enough for its LED to flash amber rapidly. Release the reset button. Then, the LED will glow amber steadily for about a minute. Then, it will flash amber, slowly, about once every second or two, waiting for you to configure it with AirPort Utility.

  • What is the best way to execute immediate particular sql stored in a table

    I have a string variable containing row_ids eg "12,24,35,23"
    and a table
    row_id, sql
    1 , "insert into some_table values(23,'Happy');"
    6 , "insert into some_other_table values(24,'Sad');"
    12 , "insert into some_table values(23,'Crazzzy');"
    15 , "insert into some_other_table values(23,'Old');"
    23 , "insert into another_table values(23,'Left');"
    24 , "insert into stuff_table values(23,'Gold');"
    30 , "insert into old_table values(23,'Even');"
    35 , "insert into archive_table values(23,"True");"
    And I need to write a plsql function that takes the list of row_ids as an argument and executes the sql statements stored in the table that matches.
    I am trying a combination of cursor and execute immediate statements to do it at the moment but suspect I am being very inefficient. So any suggestions or examples of similar code anyone knows about would be hugely appreciated.
    Cheers
    Reuben

    Not sure why anyone would be doing such a thing as storing their SQL in a table and wanting to dynamically execute it (generally this is bad practice), but if you must...
    SQL> select * from testdata;
        SQL_ID SQL_TEXT
             1 insert into some_table values(23,'Happy');
             6 insert into some_other_table values(24,'Sad');
            12 insert into some_table values(23,'Crazzzy');
            15 insert into some_other_table values(23,'Old');
            23 insert into another_table values(23,'Left');
            24 insert into stuff_table values(23,'Gold');
            30 insert into old_table values(23,'Even');
            35 insert into archive_table values(23,'True');
    8 rows selected.
    SQL> set serverout on
    SQL> ed
    Wrote file afiedt.buf
      1  DECLARE
      2    v_ids VARCHAR2(4000) := '12,24,35,23';
      3    CURSOR cur_fetch IS
      4      SELECT sql_text
      5      FROM   testdata
      6      WHERE  sql_id IN (SELECT TO_NUMBER(REGEXP_SUBSTR (v_ids, '[^,]+', 1, rownum))
      7                        FROM   DUAL
      8                        CONNECT BY ROWNUM <= length(regexp_replace(v_ids,'[^,]*'))+1);
      9  BEGIN
    10    FOR s IN cur_fetch
    11    LOOP
    12      DBMS_OUTPUT.PUT_LINE(s.sql_text); -- For demo purposes show the sql text
    13      -- EXECUTE IMMEDIATE s.sql_text; -- In reality, uncomment this to execute the sql text
    14    END LOOP;
    15* END;
    16  /
    insert into some_table values(23,'Crazzzy');
    insert into another_table values(23,'Left');
    insert into stuff_table values(23,'Gold');
    insert into archive_table values(23,'True');
    PL/SQL procedure successfully completed.
    SQL>

  • HT5624 hello . my question is , if i want change my security answers , what is the best way to change it , i tried many time to sent email to restert my security answers , but nothing come to my email . can please help me . thank you .

    hello . i have problem that is i forget my security answers i tried to send it to email but nothing come . how can i slove this problem . please help my thank you .

    Alternatives for Help Resetting Security Questions and Rescue Mail
         1. Apple ID- All about Apple ID security questions.
         2. Rescue email address and how to reset Apple ID security questions
         3. Apple ID- Contacting Apple for help with Apple ID account security.
         4. Fill out and submit this form. Select the topic, Account Security.
         5.  Call Apple Customer Service: Contacting Apple for support in your
              country and ask to speak to Account Security.
    How to Manage your Apple ID: Manage My Apple ID

  • Upgrading to SSD, what is the best way to clean install and transfer my files over?

    I am upgrading to an SSD and I would like to start clean by doing a fresh installation of Yosemite on the new drive. However, I still want all of my personal files from my current hard drive, like my music, music libraries, photos, and Home folder, transferred over to the new drive. What is the best way of doing this?
    I have Time Machine and a Time Capsule. Could I simply restore a Time Machine backup, or will that defeat the purpose of doing a clean install?
    Should I just back up the home folder and transfer the home folder onto an external drive, then drag the home folder to my new drive? Will that save my iTunes playlists and music?
    I don't need to transfer apps over so I'm not worried about that. Just my documents, files, pictures, music.

    How to replace or upgrade a drive in a laptop
    Step One: Repair the Hard Drive and Permissions
    Boot From An OS X Installer Disc
    1. Insert OS X Installer Disc into the optical drive.
      2. Restart the computer.
      3. Immediately after the chime press and hold down the "C" key.
      4. Release the key when the spinning gear below the dark gray Apple
          logo appears.
      5. Wait for installer to finish loading.
    Boot From a Recovery HD:
      1. Restart the computer.
      2. Immediately after the chime press and hold down the
          "COMMAND" and the "R" keys together.
      3. Release the keys when the Utilities Menu appears.
    After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger, Leopard, Snow Leopard and later.)
    For Lion or later select Disk Utility from the Utilities Main Menu.
    After Disk Utility loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the Disk Utility status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If Disk Utility reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    Step Two: Remove the old drive and install the new drive.  Place the old drive in an external USB enclosure.  You can buy one at OWC who is also a good vendor for drives.
    Step Three: Boot from the external drive.  Restart the computer and after the chime press and hold down the OPTION key until the boot manager appears.  Select the icon for the Recovery HD on the external drive, then click on the downward pointing arrow button.
    Step Four: New Hard Drive Preparation
      1. Open Disk Utility from the Utility Main Menu, then click on the Continue button.
      2. After Disk Utility loads select your new hard drive (this is the entry with the
          mfgr.'s ID and size) from the left side list. Note the SMART status of
          the drive in DU's status area.  If it does not say "Verified" then the drive
          is failing or has failed and will need replacing.  Otherwise, click on the
          Partition tab in the Disk Utility main window.
      3. Under the Volume Scheme heading set the number of partitions from
          the drop down menu to one. Set the format type to Mac OS Extended
          (Journaled.) Click on the Options button, set the partition scheme to
          GUID  then click on the OK button. Click on the Partition/Apply button and
          wait until the process has completed.
      4. Select the volume you just created (this is the sub-entry under the
          drive entry) from the left side list. Click on the Erase tab in the DU main
          window.
      5. Set the format type to Mac OS Extended (Journaled.) Click on the
          Options button, check the button for Zero Data and click on OK to
          return to the Erase window.
      6. Click on the Erase button. The format process can take up to several
          hours depending upon the drive size.
    Step Five: Clone the old drive to the new drive
      1. Select the destination volume from the left side list.
      2. Click on the Restore tab in the DU main window.
      3. Check the box labeled Erase destination.
      4. Select the destination volume from the left side list and drag it to the
          Destination entry field.
      5. Select the source volume from the left side list and drag it to the
          Source entry field.
      7. Double-check you got it right, then click on the Restore button.
    Destination means the new internal drive. Source means the old external drive.
    Step Six: Open the Startup Disk preferences and select the new internal volume.  Click on the Restart button.  You should boot from the new drive.  Eject the external drive and disconnect it from the computer.

  • What is the best way to protect my new iMac?

    Hi:
         I just ordered and customized a new iMac that I will receive in three weeks. My 2008 iMac just died. Could you please advise me as to what software program to buy, (if any), to protect me from viruses, malware, trojans,or hacking for my new computer?. I heard Mackeeper is bad. Should I even worry about this? Also what is the best way to back up my files? Time machine, Carbonite, Dropbox, or any other? Thanks.   

    In General 3rd Party AV Software is Not Required as Mac OS X tends to look after itself.
    Read Here  >  Antivirus Discussion
    To keep your Mac Happy... See Here...
    http://support.apple.com/kb/HT1147
    http://www.thexlab.com/faqs/maintainingmacosx.html
    Mac OS X: About background maintenance tasks
    With regard to Backing Up...
    Time Machine vs. Clones and Archives
    On one external Hard Drive... Time Machine for Day to Day use and on a seperate External Hard Drive create a Bootable Backup using either SuperDuper or CCC...
    SuperDuper  http://www.shirt-pocket.com/
    or CCC  http://www.bombich.com

  • What is the best way to add external C++ code to LabView 6.1?

    I have various C++ class-based DLL's written with Visual Studio 6.0 and wish
    to create instances of these C++ classes and call their methods in LabView
    6.1. What is the best way to do this?
    It seems based on the little reading I have done that there are two choices:
    1. Wrap the C++ class as a simple COM control and use LabView's COM based
    VIs to create a COM object and access the methods of various interfaces.
    2. Wrap the C++ class methods as C functions and a "constructor" and
    "destructor" C function to create and destroy an instance of the class. Then
    use LabView's DLL call support.
    Which is best? What direction is LabView going to take that better supports
    the notion of C++ class libraries?
    Thanks,
    Te
    rry

    You could also try using a CIN. This is a tool that LabVIEW provides for interfacing with external code.
    The CINTools libraries of LabVIEW allow you to embed compiled C code into a particular Virtual Instrument (VI) using a CIN.
    In order for LabVIEW to be capable of calling compiled functions of C from a running VI, the code must be loaded and unloaded into memory at the same time as the VI code itself. LabVIEW uses object code in the form of a .lsb file which is generated by the C compiler from the C source code using the ntlvsbm.mak file. This ntlvsbm.mak file is included in the CINtools directory in the LabVIEW folder. You also must create another .mak file which includes parameter definitions for the ntlvsbm.mak file and also includes a call to the LabVIEW .mak file.
    The generic documentation for CINs only explains how to use them to call C compiled code from a LabVIEW VI. It shows several development environments such as Visual C++, but in essence it only allows the user to create .lsb files out of plain C source code ( .c ) through C compilers on those environments.
    The question now is how can I create .lsb files from C++ native source code using a C++ compiler. Furthermore, how can I create a .lsb file from several C++ source code files (.cpp) and make calls to C++ functions from a VI using CINs? The following explains how to do this:
    1) Drop a Code Interface Node (from the Advanced Subpalette of the Functions Palette) into the LabVIEW VI. Make sure to wire the inputs.
    2) Right-click on the CIN and choose "Create.c File...", then in the file dialog box specify a "name.cpp" file name. (very important: use .cpp extension)
    3) Then create a name.mak makefile (text file) and add the following lines :
    name=name_of_cpp_file_without_the_extension
    type=CIN
    cinlibraries=Kernel32.lib
    CINTOOLSDIR=path_to_cintools_directory
    !include <$(CINTOOLSDIR)\ntlvsb.mak>
    4) Go into Visual C++ and File>Open and open the .mak file. You can even Add the name.cpp file to the project to make it easier to edit. Select that name.cpp or open it as a text file in NotePad or and edit the prototypes of the CIN MgErr functions as shown below, adding extern "C" at the beginning of the line. extern "C" CIN MgErr CINRun(float64 *INPUT);3) Select Build.exe to create the "name.lsb" file. To import the .lsb into LabVIEW, right-click on the CIN and choose "Load Code Resource...". Then, choose the name.lsb file and it is ready to run!
    If you want to use several C++ source code files with .cpp extensions, then compile them in Visual C++ and link them to name.cpp and create a .lsb by modifying the name.mak as follows:
    name=name_of_cpp_file_without_the_extension
    otherobj=other_cpp_files_BUT_USING_.obj_extension
    type=CIN
    cinlibraries=Kernel32.lib
    CINTOOLSDIR=path_to_cintools_directory
    !include <$(CINTOOLSDIR)\ntlvsbm.mak>
    It's worth a try? I have also heard of using clusters to represent classes, so you could check that out.
    J.R. Allen

  • What's the best way to protect my code?

    What's the best way to protect my code from people reading it? Do obfuscators work well? If so, which one is really good?

    Obfuscation helps but is not a complete solution.
    Here is an idea to consider. Take the binaries(*.class) of the files you wish to protect and encrypt them. This would require you to write a small utility...not too hard. When you want to use these classes you decrypt them and dynamically load them. You could make a custom classloader to handle the details if you want to get fancy. The security of your classes would rest on the quality of the encryption you choose. A scheme such as this would be tough to reverse engineer using available tools.

  • Everytime i try to open creative cloud installer i get a error code 22 i have tried turning off my firewall and no success. what is the best way forward?

    everytime i try to open creative cloud installer i get a error code 22 i have tried turning off my firewall and no success. what is the best way forward?

    is that the case-sensitive drive error?  Error "Case-sensitive drives not supported" or similar install error | Mac OS

  • (New to C# here) What is the best way to return false in a function if it cannot be executed successfully?

    In Javascript or PHP you can have a function that could return, for example, a string in case of success and false in case of failure.
    I've noticed (in the few days I've been learning C#) that you need to define a type of value that the function will return, so you need to return that type of value but in case of failure you can't return false.
    What is the best way to achieve this behavior and is there an example I can see?
    Thank you in advance,
    Juan

    Juan, be aware that returning null won't work with value types, such as an int, which can't be null. You'd have to use a nullable value type. A nullable int would be declared with a "?", such as:
    int? someOtherFunction(int param)
    if(something goes great)
    return param * 42;
    return null;
    And you have to use it like this:
    int? result = someOtherFunction(666);
    if (result != null) // you can also use result.HasValue
    // it worked, do something with the result
    // if you're doing math with the result, no problem
    int x = result * 2;
    // but if you're assigning it to another an int, you need to use this syntax
    int y = result.Value;
    Before nullable value types came along, for a method that returned an int, I'd use a value of something that wouldn't normally be returned by that method to indicate failure, such as a -1.
    ~~Bonnie DeWitt [C# MVP]
    That's something very very important to keep in mind. Can save you from a lot of headaches!
    So if you have an int function and it might return NULL, if you are doing Math with the return value you can use it directly, but if you're assigning it to another variable you have to use .Value?
    Thanks

  • What is the best practice to migrate code from dev  to prod

    I have few questions related OWB version control/migration.
    1. What is the best way to Version the design repository
    We want to keep a separate copy of production and test version all the time.
    Do we have to create design repository in each environment ?
    2. Is it possible to have multiple copies of the same mapping ? If yes how this is done in OWB
    3. How to migrate the code to different environments
    2.1 Is there a way to provide DBA with script for deploying PL/SQL mapping without using OWB ?
    2.2 How important is the setting before actual code in the XML file is required to execute the mapping.
    2.3 We are planning to create tables , materialized view etc., outside OWB will this cause any problems ?
    Note : Our DBA prepare compiling the code through SQLPLUS
    3. Which user ( target owner or runtime access ) should be used to execute the mapping through sqlplus.
    We are looking for a solution were we do not have to use OWB tools for version control , migration and deployment. Currently we are using PVCS for version control and migration.
    we are using OWB 9.2 , Oracle 9.2.
    Any suggestion/ comments are appreciated.
    Thanks,
    Sekar,K

    Some answers below:
    1. Yes, you should use snapshots (right click on t he object and select create snapshot or on the project menu, select Change Manager for a centralized snapshot management).
    2. See above.
    3. Usually you will export the (test/development) design repository to an mdl file, and import it into the other (production) design directory. Then you will deploy the code from the other design directory into the production target (runtime).
    2.1 From 9.2 on, you will have to deploy to file and then use OWB scripting (OMBPlus) to deploy the generated file outside of the deployment manager.
    2.2 Not sure what is asked in this question - can you rephrase?
    2.3 No, but the creation and use of thes will not be managed and audited by OWB (Runtime Audit Browser)
    3.(bis) The target owner.
    Regards:
    Igor

  • What is the best way to implement a scheduled task?

    Dear kind sirs...
    let us say I have a JSF application, and it is working perfectly fine...
    I need the method like
    void DoProcessing()
    *// processing code here*
    to execute everyday at 7AM...
    so what is the best way to do it? I need this to be part of the JSF application... not in a different process... and I want the method to execute at that exact time every day.
    and what are the main steps to do that?
    best regards

    Dear Mr. Chris...
    the reason I am asking about this is because we are required to provide reports for a number of customers by email every day... each report requires retrieving values from a DB.
    I made a test few hours ago about making a thread sleeps and check the time when it wakes up, it works, no problem about that...
    I placed a thread in the servlet context and started it... and it kept working for about an hour writing in the log every 5 seconds... so I guess the idea works...
    but do you think that this way of implementing the scheduler is ok? for I have not done it before and I don't know the cons of such a method.
    thanks for any advice or comment.
    best regards

  • What is the best way of Exception Handling

    There are many ways to handle the exceptions of a program.
    1: You could put every exception handler in the most upper abstract classes.
    2: You could write a generic exception that handles a lot of things.
    3: You could write exceptions handling for every class.
    4: you could group the exception handling.
    many, many more ways.
    Question:
    What is the best way to do this?

    There are many ways to handle the exceptions of a program.
    1: You could put every exception handler in the most upper abstract classes.I woldn't do that always, a class may throw an exception if it's not able to handle it prperly, but it may, so it'll catch it. Throw Exception in abract supper clases only when you are sure the children must always throw the exception, not processing it.
    2: You could write a generic exception that handles a lot of things.Bad idea, if you always throw an Exception no informtaion is provaided about whta happened, if you throw a NullPointerException and a NumberFormatException in one of your method I (for example) colud handle properly both problems, one likely to be a programming erros, so check my cod eagain, and the other like to be an user error in introduciong some data, so I wold ask him for the data again.
    3: You could write exceptions handling for every class.Write exceptions handling for every class that needs it, throwing the exception if at that moment you don't know what to do with it and catching it if yes. Do not employ too many exception handling: execution of try catch blcks is slower than usuall code.
    4: you could group the exception handling.I don't undestand this. What do youmean?
    Question:
    What is the best way to do this? In general thrwo an exception if the class dosen't know what to do with it, the class which uses yours will handle it. If your class can process the Exception, don't be too lazy and process it.
    Employ exceptions always you need them but do not abuse; thay made the code execute slower because the VM machine must check if the exceotions occur.
    abraham.

  • What's the Best Way to Clear a DataGrid?

    What's the best way to clear out a datagrid and where should
    I put it in the code? The problem I am having is with data that is
    populated in the grid. When I leave the screen and come back to it
    (using the Accordion component), the data is still populated in the
    datagrid and I would like to have a clear screen when going back to
    it.
    So what I am looking for is the code to clear it (or
    removeAll()) and where would be the best place to execute it within
    the Accordion style setup.
    Thanks.
    Dave

    Use a collection for the dataProvider, and call removeAll();
    Call it on the hide, show or change events.
    Avoid raw Array an XMLList as dataProviders.
    Tracy

Maybe you are looking for