Hp34970a read vi doesnot wait for scan to finish

hi all.... i am facing problem ..im tryin to read DC current values from two channels.. i modified the advanced scan vi example..
the read
vi is not waiting for the scan to finish.... i used trigger vi outside
a for loop and i want the readings to be taken for a number of times
which is equal to the trigger count.... i even placed a time delay
between the standard event vi and the read vi....the standard event
register vi has been set for operation complete bit. Yet the read vi is
not waiting.
so can anyone let me knw if the delay helps in waiting the read vi to finish the scan??
will the read vi give out the readings for each scan or will it just display random values??
im
posting the vi here... i kept the scan count to be 15 and scan-scan
interval as 1sec. ( so it implies that im using a timer source for
triggering) I used a time delay of 0.9secs in between standard event
register vi and the read vi. 
i used a for loop insted of
a while loop coz i need the number of readings = scan count. i placed
the trigger vi outside the for loop.
can anyone have a look over this vi and help me out?
Attachments:
final2.vi ‏59 KB

Now I placed a while loop around the standard event register vi and i am running it till i get a true in the bits set output. this time i checked the parameter'operation complete bit' instead of setting it. Only then i can see true value on the bit set output or else false.
The bit 1 is true after some time (after scanning is done), but the instrument is showing -410 error. This error actually says ' a command was received which sends data to the output buffer, but the ouput buffer contained data from previous command(previous data is not overwritten).The output buffer is cleared when power has been off or after a bus Device Clear.'
What should i do? Can you tell whether what i did is right? I atached the vi which has while loop around the standard event register vi.
Attachments:
final3.vi ‏49 KB

Similar Messages

  • 10g: Cube  build performance:Waiting for tasks to finish

    I had a question related to cube build performance. We see the following in the OLAPSYS.XML_LOAD_LOG prior to completion of parallel processing. So basically the loading of records etc. happens in 2-3 mins but then the part for "running jobs and started 6 finished 5 out of 6 tasks takes almost 30-40 minutes to complete". At this point in background it invokes the xmlloader and xml_parallel_loader. Any insights as to what specifically this steps do (solving of measures etc.) ? Also what we need to modify in terms of xml tag or anything else to improve these timings?
    14:10:56 Started 6 Finished 5 out of 6 Tasks.
    14:10:56 Running Jobs: AWXML$_4361_77872. Waiting for Tasks to Finish...
    14:01:04 Started Auto Solve for Measures: TOT_AMT from Cube CR_BASE_OSUC.CUBE. 2008 Partition.
    14:01:04 Finished Load of Measures: TOT_AMT from Cube CR_BASE_OSUC.CUBE. 2008 Partition. Processed 189616 Records. Rejected 0 Records.
    Thanks,
    Sudip

    When we checked the scheduler jobs we saw xmlparallel_loader. in terms of v$session_wait we saw a db file sequential read. Following is a snapshot from the stage of finished updating partitions to starting of parallel load. Please advise.
    XML_MESSAGE
    14:49:12 Completed Build(Refresh) of AWM_CR2.CRICUBE Analytic Workspace.
    14:49:12 Finished Parallel Processing.
    14:49:10 Finished Auto Solve for Measures: TOT_AMT from Cube CR_BASE_OSUC.CUBE. 2008 Partition.
    14:40:59 Started 6 Finished 5 out of 6 Tasks.
    14:40:59 Running Jobs: AWXML$_4361_77872. Waiting for Tasks to Finish...
    14:30:58 Started 6 Finished 5 out of 6 Tasks.
    14:30:58 Running Jobs: AWXML$_4361_77872. Waiting for Tasks to Finish...
    14:20:57 Running Jobs: AWXML$_4361_77872. Waiting for Tasks to Finish...
    14:20:57 Started 6 Finished 5 out of 6 Tasks.
    14:10:56 Running Jobs: AWXML$_4361_77872. Waiting for Tasks to Finish...
    14:10:56 Started 6 Finished 5 out of 6 Tasks.
    14:01:04 Started Auto Solve for Measures: TOT_AMT from Cube CR_BASE_OSUC.CUBE. 2008 Partition.
    14:01:04 Finished Load of Measures: TOT_AMT from Cube CR_BASE_OSUC.CUBE. 2008 Partition. Processed 189616 Records. Rejected 0 Records.
    14:01:02 Finished Auto Solve for Measures: TOT_AMT from Cube CR_BASE_FIN.CUBE. 2008 Partition.
    14:01:00 Finished Load of Measures: TOT_AMT from Cube CR_BASE_FIN.CUBE. 2008 Partition. Processed 1494 Records. Rejected 0 Records.
    14:01:00 Finished Auto Solve for Measures: TOT_AMT from Cube CR_CURR1_OSUC.CUBE. 200901 Partition.
    14:01:00 Started Auto Solve for Measures: TOT_AMT from Cube CR_BASE_FIN.CUBE. 2008 Partition.
    14:01:00 Finished Auto Solve for Measures: TOT_AMT from Cube CR_CURR1_ENR.CUBE. 200901 Partition.
    14:01:00 Finished Auto Solve for Measures: TOT_AMT from Cube CR_CURR1_FIN.CUBE. 200901 Partition.
    14:01:00 Finished Auto Solve for Measures: TOT_AMT from Cube CR_BASE_ENR.CUBE. 2008 Partition.
    14:00:58 Finished Load of Measures: TOT_AMT from Cube CR_CURR1_FIN.CUBE. 200901 Partition. Processed 1494 Records. Rejected 0 Records.
    14:00:58 Started Auto Solve for Measures: TOT_AMT from Cube CR_CURR1_FIN.CUBE. 200901 Partition.
    14:00:58 Finished Load of Measures: TOT_AMT from Cube CR_BASE_ENR.CUBE. 2008 Partition. Processed 1577 Records. Rejected 0 Records.
    14:00:58 Started Load of Measures: TOT_AMT from Cube CR_CURR1_OSUC.CUBE. 200901 Partition.
    14:00:58 Finished Load of Measures: TOT_AMT from Cube CR_CURR1_OSUC.CUBE. 200901 Partition. Processed 4521 Records. Rejected 0 Records.
    14:00:58 Started Auto Solve for Measures: TOT_AMT from Cube CR_CURR1_OSUC.CUBE. 200901 Partition.
    14:00:58 Started Load of Measures: TOT_AMT from Cube CR_CURR1_FIN.CUBE. 200901 Partition.
    14:00:58 Started Load of Measures: TOT_AMT from Cube CR_BASE_ENR.CUBE. 2008 Partition.
    14:00:58 Started Auto Solve for Measures: TOT_AMT from Cube CR_CURR1_ENR.CUBE. 200901 Partition.
    14:00:58 Finished Load of Measures: TOT_AMT from Cube CR_CURR1_ENR.CUBE. 200901 Partition. Processed 1577 Records. Rejected 0 Records.
    14:00:58 Started Load of Measures: TOT_AMT from Cube CR_CURR1_ENR.CUBE. 200901 Partition.
    14:00:58 Started Auto Solve for Measures: TOT_AMT from Cube CR_BASE_ENR.CUBE. 2008 Partition.
    14:00:58 Started Load of Measures: TOT_AMT from Cube CR_BASE_FIN.CUBE. 2008 Partition.
    14:00:58 Started Load of Measures: TOT_AMT from Cube CR_BASE_OSUC.CUBE. 2008 Partition.
    14:00:57 Attached AW AWM_CR2.CRICUBE in MULTI Mode.
    14:00:57 Attached AW AWM_CR2.CRICUBE in MULTI Mode.
    14:00:57 Attached AW AWM_CR2.CRICUBE in MULTI Mode.
    14:00:57 Attached AW AWM_CR2.CRICUBE in MULTI Mode.
    14:00:57 Attached AW AWM_CR2.CRICUBE in MULTI Mode.
    14:00:57 Attached AW AWM_CR2.CRICUBE in MULTI Mode.
    14:00:55 Running Jobs: AWXML$_4361_77870, AWXML$_4361_77871, AWXML$_4361_77872, AWXML$_4361_77873.
    14:00:55 Started 4 Finished 0 out of 6 Tasks.
    14:00:55 Running Jobs: AWXML$_4361_77870, AWXML$_4361_77871, AWXML$_4361_77872, AWXML$_4361_77873, AWXML$_4361_77874.
    14:00:55 Started 6 Finished 0 out of 6 Tasks.
    14:00:55 Running Jobs: AWXML$_4361_77870, AWXML$_4361_77871, AWXML$_4361_77872, AWXML$_4361_77873, AWXML$_4361_77874, AWXML$_4361_77875.
    14:00:55 Started 6 Finished 0 out of 6 Tasks.
    14:00:55 Running Jobs: AWXML$_4361_77870, AWXML$_4361_77871, AWXML$_4361_77872, AWXML$_4361_77873, AWXML$_4361_77874, AWXML$_4361_77875. Waiting for Tasks to Finish...
    14:00:55 Running Jobs: AWXML$_4361_77870, AWXML$_4361_77871, AWXML$_4361_77872.
    14:00:55 Started 3 Finished 0 out of 6 Tasks.
    14:00:55 Running Jobs: AWXML$_4361_77870, AWXML$_4361_77871.
    14:00:55 Started 2 Finished 0 out of 6 Tasks.
    14:00:55 Running Jobs: AWXML$_4361_77870.
    14:00:55 Started 1 Finished 0 out of 6 Tasks.
    14:00:55 Starting Parallel Processing.
    14:00:55 Detached AW AWM_CR2.CRICUBE.
    14:00:55 Started 5 Finished 0 out of 6 Tasks.
    14:00:22 Finished Updating Partitions.

  • NI Scope Wait for Acquisition to Finish Obselete in 2014

    Quick Question,
    In LabVIEW 2014, the NI scope Wait for Acquisition to Finish subVI is no longer used and is obsolete apparently, can some one tell me why this is and what I can use instead with the new 2014 NI scope blocks? 
    Thanks for your help!

    Query Acquisition Status until Status is "Complete"  To avoid infiate loops (missing trigger event) you should set a Timeout for the loop
    Alternately use hardwae and rout the End of Acquisition event to something
    Jeff

  • Update of jlabel does not happen when i wait for thread to finish (join())

    gurus please help.
    I have a main application which in actionevent calls a thread, that thread calls parent method to update ths status in jlabel, but when i use thread.join() to wait for process to complete, the jlabel does not get updated, please tell me how can i update the jlabel, i have to wait for thread to finish and during run i need to update the jlabel.
    thanks

    hi camickr and gurus:
    here is the code:
    notice after pressing the Process button, the label is being updated but its not working. I called the processnow() method directly and also by thread, but in thread I have to wait until it finishes using join() but still does not work, please help. Thanks
    package label;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.text.*;
    import javax.swing.border.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    public class thePanel extends JDialog {
      private DefaultTableModel tableModel = null;
      private JTable theTable = new JTable();
      private JScrollPane scrollPane = new JScrollPane();
    JPanel tPanel = new JPanel();
      private Border mainBorder;
      private BorderLayout borderLayout1 = new BorderLayout();
      private BorderLayout borderLayout2 = new BorderLayout();
      private BorderLayout borderLayout3 = new BorderLayout();
      private BorderLayout borderLayout4 = new BorderLayout();
      private JPanel statusPanel = new JPanel();
      private JPanel buttonPanel = new JPanel();
      private JPanel lowerPanel = new JPanel();
      private JLabel statusBar = new JLabel();
      private JButton processButton = new JButton("Process");
      public JButton closeButton = new JButton("Close");
      boolean image = true;
      theProcess processThread;
      Vector tableData = new Vector();
      ImageIcon Image = new ImageIcon("image.gif");
      ImageIcon oImage= new ImageIcon("oimage.gif");
      boolean errorOcurred=false;
      String statusMessage;
      public thePanel() {
        try {
         jbInit();
        } catch(Exception e) {
          e.printStackTrace();
      private void jbInit() throws Exception {
        tPanel.setPreferredSize(new Dimension(800,424));
        mainBorder = new TitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED)," ");
        statusPanel.setBorder(BorderFactory.createEtchedBorder());
        tPanel.setBorder(mainBorder);
        tPanel.setLayout(borderLayout1);
        scrollPane.getViewport().add(theTable, null);
        tPanel.add(scrollPane,  BorderLayout.CENTER);
        // status
        statusPanel.setLayout(borderLayout2);
        statusPanel.setBorder(BorderFactory.createEmptyBorder());
        statusBar.setAlignmentX((float) 0.5);
        statusBar.setBorder(BorderFactory.createLoweredBevelBorder());
        statusBar.setMaximumSize(new Dimension(600, 21));
        statusBar.setMinimumSize(new Dimension(600, 21));
        statusBar.setPreferredSize(new Dimension(600, 21));
        statusPanel.add(statusBar, BorderLayout.SOUTH);
        // buttons
        processButton.setPreferredSize(new Dimension(70,25));
        processButton.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            process_actionPerformed(e);
        closeButton.setPreferredSize(new Dimension(70,25));
        buttonPanel.setLayout(borderLayout3);
        buttonPanel.setBorder(BorderFactory.createRaisedBevelBorder());
        buttonPanel.add(processButton,BorderLayout.WEST);
        buttonPanel.add(new JPanel());
        buttonPanel.add(closeButton,BorderLayout.EAST);
        // lower panel
        lowerPanel.setLayout(borderLayout4);
        lowerPanel.setBorder(BorderFactory.createEmptyBorder());
        lowerPanel.add(statusPanel, BorderLayout.WEST);
        lowerPanel.add(buttonPanel, BorderLayout.EAST);
        tPanel.add(lowerPanel, BorderLayout.SOUTH);
        theTable.setAutoCreateColumnsFromModel(true);
        theTable.setColumnSelectionAllowed(false);
        theTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        theTable.getTableHeader().setReorderingAllowed(false);
    getContentPane().add(tPanel);pack();
        getinfo();
    show();
      private void prepairTable(){
        tableModel = new DefaultTableModel(){
                          public boolean isCellEditable(int row, int col)
                            { return false; }};
        tableModel.addColumn("text 1");
        tableModel.addColumn("text 2");
        tableModel.addColumn("text 3");
        tableModel.addColumn("text 4");
        tableModel.addColumn("text 5");
        theTable.setModel(tableModel);
      } // end method (prepairTable)
      public void refreshTable() {
        prepairTable();
      public void getinfo() {
        try {
            refreshTable();
            tableModel.addRow(new Object[]{"3465465555","0123456789",new Date(1135022905196L),"0100000","errror message","sssssss"});
            tableModel.addRow(new Object[]{"8949344562","0324354549",new Date(1134511763683L),"0166600","errror mes666e","ddddddd"});
    setStatusMessage("ready to process, select record and click Process button to process record");
          errorOcurred = false;
        } catch (Exception ex) {
          errorOcurred = true;
          ex.printStackTrace();
        } // End try
      private void process_actionPerformed(ActionEvent e) {
        try {
          if(theTable.getSelectedRows().length > 0) {
    //        processThread = null;
    //        processThread = new theProcess(this);
    //        processThread.start();
    processnow();
            System.out.println("........finished now.........");
          } else {
        } catch (Exception ex) {
          ex.printStackTrace();
      public void processnow() {
        try {
          int[] selectedRows = null;
          int totalSelected = 0;
          setStatusMessage("processing " + totalSelected + " selected records...");Thread.sleep(1500);
          selectedRows = theTable.getSelectedRows();
          totalSelected = selectedRows.length;
          for(int i = 0; i < totalSelected ; i++){
            setStatusMessage("processing " + (i+1) + " of " + totalSelected + " selected records...");
            System.out.println(".......................row: "+selectedRows);
    Thread.sleep(2500);
    System.out.println("........fins...........");
    errorOcurred = false;
    } catch (Exception ex) {
    errorOcurred = true;
    ex.printStackTrace();
    } // End try
    public void setStatusMessage(String message) {
    statusMessage=message;
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    if(image)
    statusBar.setIcon(Image);
    else
    statusBar.setIcon(oImage);
    statusBar.setText(statusMessage);
    statusBar.update(statusBar.getGraphics());
    public static void main(String[] args){
    new thePanel();
    } // class
    package label;
    import java.lang.Runnable;
    public class theProcess implements Runnable {
    private thePanel parent;
    public theProcess(thePanel xparent){
    parent = xparent;
    } // end constructor
    public void start() {
    try {
    Thread thisThread = new Thread(this);
    thisThread.start();
    thisThread.join();
    } catch(Exception ex) {
    ex.printStackTrace();
    } // end method (start)
    public void run(){
    try {
    parent.processnow();
    } catch (Exception ex){
    ex.printStackTrace();
    } // end try
    } // end method (run)
    } // end class

  • Second tween does not wait for first to finish

    Having a little problem here and as far as I can tell it is
    just that the second tween starts before waiting for the first to
    finish. Basically on a click event it should slide out a scroll
    pane to the bottom of the screen, change the contentpath of the
    scroll pane, then slide it back up.
    with the code below it just slides up the new movie clip but
    does not slide out the old one, if i remove the code for the new
    clip to slide up the old one does do the slide out how I want it to
    look.
    how can I make a pause in between the two to wait.
    on (press) {
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    _root.mask._x = 54;
    _root.mask._y = 109.3;
    _root.scroll_pane.setMask(_root.mask);
    switch (_root.loaded_clip)
    case 2: var Slide_out:Tween = new Tween(_root.scroll_pane,
    "_y", Bounce.easeOut, _root.scroll_pane._y, 900, 3, true); break;
    _root.scroll_pane.contentPath = "Search_mc";
    var Slide_up:Tween = new Tween(_root.scroll_pane, "_y",
    Bounce.easeOut, 900, 109, 3, true);
    _root.loaded_clip = 1;
    }

    Its still not working with that code but I think I can muck
    around with it and figure it out, the slide out works on the old
    clip now but then the new one never shows up.
    The onMotionFinished was basically what I was looking for,
    think I can eventually figure it out from here, thanks for the
    info.

  • Automator doesn't wait for app to finish launching.

    During "watch me do" actions that lauch an app Automator does not wait for the app to launch. This seems like a bug since Automator does infact know it is launching an app, this shouldn't be something that should require a sleep every time.

    Did you try one these actions?

  • Make jFrame wait for jDialog to finish

    I am making a project in Netbeans i have a main Frame and some Dialog windows that open up if you press some buttons.
    when one window opens i want the main Frame script to pause and wait for it to complete.
    i have tried 3 different ways:
    questionDialog.setVisible(true);
    while (questionDialog.isVisible()) {
        try {
            Thread.sleep(200);
        } catch (Exception e) {
    } but that shows the frame of the dialog box but never loads the inside and the whole application freezes.
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            questionDialog.setVisible(true);
    while (questionDialog.isVisible()) {
        try {
            Thread.sleep(200);
        } catch (Exception e) {
    }that loaded my Dialog box but the script never waits for it to close i assume it is because it waits until "later" to show the dialog box and in that time it skips the while loop.
    Thread t = new Thread(new Runnable() {
        public void run() {
            questionDialog.setVisible(true);
            while (questionDialog.isVisible()) {
                try {
                    Thread.sleep(200);
                } catch (Exception e) {
    t.start();
    System.out.println("Dialog started");
    System.out.println(questionDialog.isVisible());
    try {
        t.join();
    } catch (Exception e) {
    }but that had the same result as the first code it waited but never showed the dialog.
    where am i going wrong how should i go about this?
    Scott.
    EDIT:
    by finish i mean become not Visible. so isVisible() will return false
    Edited by: ratcateme on Nov 20, 2008 3:02 PM

    You don't have to do anything to do that
    questionDialog.setVisible(true), this method will block the thread, it would't keep going until the questionDialog is unvisible, this is the mistake of the way 1 and way 3.
    and the way 2: the while block will be execute before the questionDialog.setVisible(true) is execute, so questionDialog.isVisible() will return false
    my en is very poor, good luck!

  • Quiz slide waits for Audio to finish before proceeding to next question

    Hi guys, hope you can help. I have 5 questions with audio inside narrating the question and the answer in selection. Once you you have chosend your answer then click submit button..it waits until the audio finishes then proceeds to the next question.
    hope you can help
    Thank you

    Having this action on Slide Exit of the Quiz Results slide may not work if the user clicks a button there to Review Quiz because that will mean that the last frame of the Quiz Results slide doesn't get played.
    There is an internal Captivate system variable that gets set on each question slide when it's in Review Mode, but I don't think you can read this variable via Advanced Actions.  If you could read it, you could check it and then trigger the mute action on Slide Enter of each question slide.
    UPDATE: Just thought of another possible workaround.  There's a system variable called cpInfoPrevSlide that records the last slide you visited before the current one.  You could use this in a conditional action to trigger cpCmndMute.  When the user clicks Review Quiz on the Quiz Results slide it will take them back to the first scoring object in the Quiz Scope. OnSlideEnter of this slide you need to check whether or not cpInfoPrevSlide is the Quiz Results slide, and if it is, set cpCmndMute to 1.  That should turn off the audio on the slides from then on.
    For instruction audio on the Quiz Results slide I prefer to have the audio attached to a rollover caption.  That way, the user only gets the audio if they explicitly roll over the HELP button (or whatever you call it).

  • HT1212 My iPad was locked & disabled & tried every possible way to restore but nothing is working - After select Restore, & waited for updates to finish, gets iPad Cannot be resotred at this time because server could not be contacted - Pls help

    Friends,
    My iPad2 was locked and disabled because my kids entered several times the passcode and now it is locked. I tried every possible ways and read all related items and followed precisely articel http://support.apple.com/kb/HT1212 but after i restored and update teh iPad, itunes keeps giveing me the same message:
    The iPad "iPad" cannot be restored at this time because the iPad software update server could not becontacted or is temporarily unavailable.
    I tired at different time of teh day and noght and different days yet kept getting the same message.
    Pls assist me as now the iPad is useless
    Regards,
    Joe

    If reset doesn't work, try and force the iPad into Recovery Mode.
    Recovery Mode
    1. Disconnect the USB cable from the device, but leave the other end of the cable connected to your computer's USB port.
    2. Turn off the device: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for the device to turn off.
    3.While pressing and holding the Home button, reconnect the USB cable to the device. The device should turn on.
    4. Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears, release the Home button. iTunes should alert you that it has detected a device in recovery mode. Click OK, and then click Restore to restore the device.
    Note: Data will be lost. You may have to repeat the above many times.

  • Wait for commit to finish

    Hello,
    I am calling a standard function that update some tables and at the end execute a commit work without the wait clause, but right after the execution of the standard function I need to perform some operations that needs all the tables to be updated, so unfortunatelly I needed commit work and wait inside the standard function.
    As I cannot change the standard function I tried to use table VBHDR to check when the update process finish but I noticed in my system this table is not trustfull as there are lots of garbage there with field VBRC = 1.
    So my question is how can I wait for the commit work to finish in this situation?
    Regards,
    Mauricio

    well this a random approach but u can try this.
    use WAIT UP TO n seconds give the vales as some 120 or 180 seconds.
    but u cant be sure if its stable all the time.
    Or u can try and call the function with the addition IN UPDATE TASK
    кu03B1ятu03B9к
    Edited by: kartik tarla on Jan 5, 2009 6:41 PM

  • Wait for progressbar to finish then continue code?

    How would you create a program where you have to type a number in numericupdown which will change the progressbar's value number and
    then click button1. When click button1 you will be navigated to google.com and then progressbar will start. when progressbar is finished navigate to bing.com. Does anyone know how to do this?
    Thanks in Advance!

    I haved moved question to C# which can be found here: New
    Forum Question
    Hello,
    I have helped you move this thread to winform forum before you post the reply above.
    In addition, I found that you have got this issue resolved in that thread.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Waiting for Thread to finish execution

    I have a program which uses a thread to copy files. While they are copying, a ProgressMonitor comes up displaying the current file being copied. After this has completed, my main program needs to be notified and go on with it's own code. Either I get the 'I'm done waiting!' message instantly, or not at all, instead of getting it after the thread completes. How do I do this?
    This is what I currently have
    // CLASS 1 //
    //...other code is here
    myMethod()
    ProgressMonitorDemo pmd = new ProgressMonitorDemo();
    while (!pmd.isDone())
    { wait(); }
    System.out.println( "I'm done waiting!" );
    }//Class 2 //
    import java.awt.*;
    import java.awt.event.*;
    import java.io.File;
    import javax.swing.*;
    public class ProgressMonitorDemo extends JPanel
      public final static int ONE_SECOND = 1000;
      private ProgressMonitor progressMonitor;
      private Timer timer;
      private LongTask task;
      public ProgressMonitorDemo()
        task = new LongTask();
        timer = new Timer( ONE_SECOND, new TimerListener() );
        progressMonitor = new ProgressMonitor( this, "Running a Long Task", "", 0, task.getLengthOfTask() );
        progressMonitor.setProgress( 0 );
        progressMonitor.setMillisToDecideToPopup( 2 * ONE_SECOND );
        task.go( );
        timer.start();
      public boolean isDone()
        return task.isDone();
       * The actionPerformed method in this class
       * is called each time the Timer "goes off".
      class TimerListener implements ActionListener
        public void actionPerformed( ActionEvent evt )
          progressMonitor.setProgress( task.getCurrent() );
          String s = task.getMessage();
          if( s != null )
            progressMonitor.setNote( s );
          if( progressMonitor.isCanceled() || task.isDone() )
            progressMonitor.close();
            task.stop();
            Toolkit.getDefaultToolkit().beep();
            timer.stop();
    }// CLASS 3 //
    import javax.swing.*;
    import java.io.*;
    import java.awt.dnd.DnDConstants;
    public class LongTask
      private int lengthOfTask;
      private int current = 0;
      private boolean done = false;
      private boolean canceled = false;
      private String statMessage;
      public LongTask()
        //Compute length of task...
        //In a real program, this would figure out
        //the number of bytes to read or whatever.
        lengthOfTask = 400;
       * Called from ProgressBarDemo to start the task.
      public void go( )
        final SwingWorker worker = new SwingWorker()
          public Object construct()
            current = 0;
            done = false;
            canceled = false;
            statMessage = null;
            return new CopyMove();
        worker.start();
       * Called from ProgressBarDemo to find out how much work needs
       * to be done.
      public int getLengthOfTask()
        return lengthOfTask;
       * Called from ProgressBarDemo to find out how much has been done.
      public int getCurrent()
        return current;
      public void stop()
        canceled = true;
        statMessage = null;
       * Called from ProgressBarDemo to find out if the task has completed.
      public boolean isDone()
        return done;
       * Returns the most recent status message, or null
       * if there is no current status message.
      public String getMessage()
        return statMessage;
       * The actual long running task.  This runs in a SwingWorker thread.
      class CopyMove
        private String currOldLoc, currNewLoc, type;
        CopyMove()
          while( current < lengthOfTask )
            try
              Thread.sleep( 1000 );
              current += Math.random() * 100; //make some progress
              if( current > lengthOfTask )
                current = lengthOfTask;
              statMessage = "Completed " + current + " out of " + lengthOfTask + ".";
            catch( Exception e )
              System.out.println( "<ERROR>: Long Task " + e.toString() );
    }

    I tried this but it froze...
    public void myMethod()
    ProgressMonitorDemo pmd = new ProgressMonitorDemo( );
    synchronized( pmd )
       try
         pmd.wait();  
       catch(Exception e){}
    System.out.println( "I'm done waiting!" );
    }Class 2
    class CopyMove
      private String currOldLoc, currNewLoc, type;
      CopyMove()
        while( current < lengthOfTask )
          try
            Thread.sleep( 1000 );
            current += Math.random() * 100; //make some progress
            if( current > lengthOfTask )
              current = lengthOfTask;
            statMessage = "Completed " + current + " out of " + lengthOfTask + ".";
          catch( Exception e )
            System.out.println( "<ERROR>: Long Task " + e.toString() );
        synchronized(this)
          notifyAll();

  • Wait for song to finish applescript

    I would like to have an applescript that will use the if statment to test if the selected song it finished and to pause the script until it does

    Well, without seeing more code, it is hard to tell for sure. What you may want to do, is to wrap your refresh in a synchronized block and wait, and then have your Form, a separate Thread I presume, notify when it is finished.
    public void add() {
      new TeamAdd(this); // pass this so you can notify later
      synchronized (this) {
        this.wait(); // wait until notified
        refresh();
    } Of course, you will have to put the corresponding notify() on the passed Object when you are through with it in TeamAdd, otherwise your main thread will hang forever.
    Hope this helps

  • VI waiting for another VI finishing before completing

    Howdy
    i have a goniometer.vi which should move the detectorarm 1°, then starts a spectrometer.vi and measures the spectrum. after completing measurements the goniospectrometer.vi should move another 1° and again...
    i have made the spectrometer.vi a sub.vi and wanted to include it into goniometer.vi, but i have no idea how to tell the goniometer.vi that spectrometer.vi is ready for moving on.
    thanks
    Robert

    Use a while loop. Make sure that both subvi's (goniometer and spectrometer) have error in and error out. Call the goniometer vi first and spectrometer second, wire error out from the first to error in of the second. Put some kind of exit condition to stop the loop. The first vi will execute, then when it is done the second will execute. The process will repeat until the stop condition is met.
    - tbob
    Inventor of the WORM Global

  • Wait for iTunes to finish

    Is there a way to have an applescript wait until iTunes is no longer busy?
    By "busy" I mean importing a CD, syncing an iPhone, or checking the volume of tracks that have been just added to the library.
    I am asking because I would like to adda few audio files from my applescript to one of iTunes' playlists. But I am afraid that this might fail if iTunes is busy with something else.
    Any insights or hints will be highly appreciated.
    Best regards,
    Gabriel.

    This kind of task typically involves polling the application to see what it's doing, looping until it's in an idle state. Luckily iTunes provides a 'player state' property which will tell you what it's doing. It only covers playback, though, so I don't know off-hand what it would say/do if it were importing -- one way to find out…
    tell application "iTunes"
      repeat until player state = stopped
        delay 5 -- wait a bit before checking again
      end repeat
      -- by the time we get here we know iTunes isn't playing anything, so do your stuff
    end tell

Maybe you are looking for

  • Error Publishing from iweb 09 - Server or iweb problems??

    I upgraded from iweb 08 (I had no issues) to iweb 09, and I have publishing errors more than half the time. Are the mobileme servers having problems, or is there a hack in the iweb software? This is a big problem because I have 20 Gb of pages with vi

  • IPod shuffle driver and new iPod

    2 questions. Question 1-I have a software update that keeps "unexpectedly quitting" when I try to download it. The iPod driver is version 3.1. I use iTunes 6.0.5.and cannot update it any more, as I am on Mac OS 10.2.8. Any suggestions? Question 2- My

  • Long text in coois

    Hi I would like to have long text displayed in coois transaction code Please let me know on this SAP version used in ECC 5.0 Thanks

  • Modeling a Many to Many relationship

    How can I modeling a Many to Many relationship between a fact table and a dimensión in Essbase? For example I have a economic zone dimension and a record in the fact is just related to one country... but a country is related to many economic zone...

  • How to block an email adress

    How can i block a spam mail?