MultiThrea​ding: To stop the program

Hello,
I have a dll which has following functions: "MainFunction" ,"Cancel" etc,. When the function "MainFunction" is executed it get's stuck and doesn't come out. In this case the documentation of dll says to run the "Cancel" function in separate thread to cancel the operation. I tried running two while loops in parallel but this didn't work. Would any one help how to do this and are there any examples to describing the multi-threading.

By default, dlls called with the "call lirbary function node" run in the UI thread, meaning they both will run in the same thread. Make sure that your CLFN setup specifies to "run in any thread" (the node will change color from orange to tan).
Just a guess...
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • How do I input data to a table on the front panel and stop the program immediatel​y as button is pressed?

    What should I do if I want to display on the front panel in real time the values from Polarizer #, P1, P2 and the last calculated value (P2/P1 * 100) called T% in a table or some graphical representation like that?  What would I have to do?  It could just be Polarizer # and T% if that would be simpler.  I just want to let the user know the values in a list, spreadsheet or table as they go.  One last thing is that I would like to be able to stop the program at any point in time as soon as the stop button is pressed.  As of now, when the button is pressed it goes through the iteration currently in progress and then one afterwards.  I want the program to end as soon as the stop button is pressed no matter what sequence it is.  What can I do to achieve this?  Could you give me an example or modify my program to show me this.
    Thanks,
    Steve
    Stephen Coward
    Northrop Grumman
    [email protected]
    Attachments:
    EPM2000 almost done.vi ‏50 KB

    Put a single frame sequence structure around your stop button and then wire from the error cluster going into the error handler to the edge of the sequence structure. Now your code will stop at the end of the current iteration. To see why this works, watch you code execute with execution highlighting turned on and review the section of the manual talking about "Dataflow".
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to stop the program flow

    Hi all,
    i need to stop the program flow control without entering into the start-of-selection.
    i am using some manual conditions for validating some parameter fields...
    i used Leave list-processing--->but it dosint works
    call selection-screen 1000--->it works but when i click the back button the control goes inside the start-of-selection can any one help me with this....

    If you want to stop the program flow in case one condition is satisfied, you can use STOP or EXIT command. Else, if you want to stop the program and debug it just but BREAK command where ever you want to stop the program. Also, if you want to validate the program selection at the time of entering the selection before the start of selection, you need to add AT SELECTION-SCREEN event block before the start of selection.

  • How to stop the program for a while?

    Hi,
    I've created a small prog that the only thing it does is to ask for a given password before granting access to certain data. It works fine on the WTK emulator (from Sun of course), but it crashes on a Nokia 6600 due to a bug in the Nokia's MIDP2.0 implementation. Now I need to trace/find the exact point of the program where it crashes (in the mobile phone - where the app gets closed). MY PROBLEM is that I need to insert into the program some kinda code that stops for a while the program saying "I am at the Nth step and running fine", but I can't stop the program from executing, because I can't find out how, I've tried the
    display.setCurrent( someAlert );but it doesn't seem to stop the program like it would in an HTML JavaScript page. And:
    Thread.currentThread().sleep( 2000 );doesn't stop for some reason the program either..
    Can anyone give me a tip or a workaround of how I can temporarily stop the prog? Please help

    Try putting the current thread to sleep right after setting the alert:
    yourAlert.setTimeout(3000);
    display.setCurrent(yourAlert);
    try {
       Thread.sleep(3000);
    catch(...)

  • Every time i try to start itunes it trys to backup my ipad and says an error stopped the program working and closes down??

    Every time i try to start itunes it trys to backup my ipad and says an error stopped the program working and closes down??

    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!

  • PSE remains active in background after exit. How can I stop the program completely?

    PSE remains active in background after exit. How can I stop the program completely?
    Is there any command line option to force PSE to stop completely after exiting the GUI?
    Opening the Windows Task Manager and killing the PSE process is not a solution!
    (Context: I want to start PhotoshopElementsEditor.exe from another program with an image filename as command line argument. This other program waits in background until PhotoshopElementsEditor.exe has finished and pops up again after that. Since PhotoshopElementsEditor.exe continues to run silently in background, the other program will never come back.)

    Hi - having the same problem with PSE process not ending on exit. Have you had any luck in resolving the issue?
    Any advice would be appreciated. TIA

  • How can I stop the program from going through all of the text previously put in.  It is making the process very slow.

    How can I stop the program from going through all of the text previously put in.  It is making the process very slow. 

    while True:
    and just indent everything else under it
    Ends when you press ^C.
    if you wish to have a way to break out of the loop, say, when you press enter at the VPC number without entering anything, add the following after your vpc input:
    if not vpc:
    break
    which will break out of the while loop and end your program.
    Last edited by buttons (2007-12-14 22:03:06)

  • How to make a pop up that pause the program (during pop up) and click button to continue OR stop the program

    Hi people,
    I am using LabVIEW to create a testing program to test a power system. The testing lasts for a loop of 90 minutes. 
    I would like to make a pop up when the testing is completed. When the pop up message appear, the whole program should be paused (NOT STOP) and when the two buttons (continue, stop) are pressed, the program should continue to run OR stop. [To start another loop of testing in order to make sure data collected is accurate and consistent.]
    How do I make this kind of pop up window? I have totally no idea how to work on this. I will be very appreciated if someone could give me some suggestions/help regarding this.
    Thank you.
    Regards,
    Vanessa

    VanessaWen wrote:
    Hi Blokk,
    In my actual program I have 3 while loops. In while loop A, it is used as counter, to transfer rows of data from an array (row by row) to loop B. For loop B, device drivers are used so that my program can be used to control the devices (it is for automated instrument testing). Loop C is then used for DAQ, data at different test points will be recorded at every second.
    I would prefer something simple in controlling all the while loops as my program is quite complex.
    Thank you so much.
    Vanessa
    I do not see why you need these 3 while loops. This task could be done with a single while loop, or max 2. Why you need loop A? You could generate data from this array inside loop B. You must use the DAQ and device control part in separate while loops? Maybe you could simplify you code to have one single while loop: at every iteration you could send a new control command to your device(s), and after this do a DAQ measurement.

  • Stop the program

    hello
    i have a labview programworking as follows
    the labview program will be waiting until certain threshold is detected like if the voltage is greater that 5 volts
    then it will send the an sms message using a gsm modem through VISA
    the threshold voltage may last for hours and i want only one message to be sent while the program is always looking for that thresold
    i need the prgram to be running continously as i need to monitor the home via labview
    so what programming i can do
    i think its simple but i cant reach it 
    looking for ur help
    Solved!
    Go to Solution.

    To detect the transistion you want to look for the situation where the current value of the comparison to the threshold is in one state and the previous comparison is in the other state.
    You should have a Wait function in the False case (or just one outside the case structure with values inside each case). Without it the loop will run as fast as possible consuming all available CPU resources at least in one core.
    Is there a reason you have three Writes rather than concatenating all the strings and just doing one write?  Normally opening and closing the serial port inside a loop is not a good idea.  You indicated that the system may be idle for hours between messages so it may be OK here.  What if the serial port configuration fails because some other program is using it or the GSM device fails to respond?  You are not doing any error handling.  A remote system which runs for long times should have robust error handling.
    Lynn

  • Teaching Myself Python. How Can I Stop The Program From Closing :)

    I wrote a program today that will log into a router here at work and check if the line protocols are up and if i can see thir mac address.  If i run it from the IDLE program it works fine.  When i run it as just crosnet.py it runs fine but closes before i can see the output.  I imagine there is some simple line that will have run and just sit?  Or even better, loop back to the beginning and wait for me to give it a new number to then telnet with.
    #import getpass
    import sys
    import telnetlib
    HOST = "111.111.111.111"
    password = "password"
    vpc = raw_input("Enter The VPC Number: ")
    #password = getpass.getpass()
    tn = telnetlib.Telnet(HOST)
    #tn.read_until("login: ")
    #tn.write(user + "\n")
    #if password:
    tn.read_until("Password: ")
    tn.write(password + "\n")
    #tn.write("sh int atm6/0.vpc\n")
    tn.write("sh int atm6/0." + str(vpc) + "\n")
    tn.write("sh arp | in " + str(vpc) + "\n")
    #tn.write("exit\n")
    print tn.read_all()
    Sorry the code is bad, dont know python and i was shown a outline of how to telnet and adjusted it to my needs.

    while True:
    and just indent everything else under it
    Ends when you press ^C.
    if you wish to have a way to break out of the loop, say, when you press enter at the VPC number without entering anything, add the following after your vpc input:
    if not vpc:
    break
    which will break out of the while loop and end your program.
    Last edited by buttons (2007-12-14 22:03:06)

  • Enable null values assignments in javascript..without stopping the program flow. Same code is ok in IE8

    I have the following code which is falling over in Firefox, while in other browsers like IE, Chrome and Opera is passing through even though the value in the array at that point of time is null.
    var vitemp = document.getElementById('F06_'+ij).value;
    In firefox, i get the error below.
    [18:59:35.747] TypeError: document.getElementById(...) is null @ http://
    How can i change the firefox parameters so as to be less strict for null value assignments ?

    Use code like this to test if that id exists.
    <pre><nowiki>var vi_id = document.getElementById('F06_'+ij);
    var vitemp = vi_id?vi_id.value:null;</nowiki></pre>

  • How to stop the "Elapsed Time" counting without stop the program running?

    我使用Labview 8.2,配合USB DAQ來做測試治具。目的:
    當檢測到某個電壓(Analog Input)到達某個電壓值(5V)之後,開始啟動計時。若是在15秒之內,另一個電壓值降為0之後為正常​,此時停止計時(但是數值不能歸零);若是超過15秒還沒有降到0伏,則表示錯誤,此時亮起紅色 indicator警示,但是時間仍然繼續計時,直到電壓降到0為止才停(但是數值不能歸零)。
    我使用 Elapsed Time 模組來使用,可是問題是如何讓該模組停止計時同時不能將時間歸零?因為此模組只有 "Reset" 控制功能,一但將條件結果輸入到 Reset input 之後,電壓達到零之後就會將此 Elapsed Time 歸零了。有沒有解決辦法?

    Elapsed Time 確實會將時間reset,如果你想要保留時間的話其實有很多做法
    例如使用 tick count,他會顯示出相對時間數值,先放一個tick count在迴圈開始前
    記得用sequence以確保他會在回區尚未開始運作前先記錄時間
    然後再放一個tick count在迴圈內,再用case或select讓電壓等於零時記錄下tick count的值
    再將兩者相減即可
    Chris

  • How can I stop the execution on a JSP page and start it again

    Hi
    I am making a program that simulates how to manage transactions when accessing a database by using locks. I have run into a problem and I hope someone has the time to help me.
    When a user does an update the transaction commits and releases its locks when the program executes
    <%stmt.executeUpdate("commit!"); %>
    I need to put a break in to stop the program executing this statement, to illustrate the lock is set correctly.
    I have tried to put in an alert box but this does not prevent the rest of the java code being executed.
    I have tried to use prompt boxes, JavaScript functions, but these functions cannot have any java code in them.
    I have tried using the java.swing JOptionPane boxes but this didn?t work either
    I have tried to get input from the user but I don?t know how to retrieve this data on the same page. (As far as I know you have to use submit and even refresh the page or retrieve it on the next page).
    Does anyone know how I can stop the execution on a JSP page and start it again (on same page)
    Mette

    I already have another client (Tomcat jsp application) running and it throws a SQLException correctly when I don�t put in a commit=true statement and don't close the database connection.
    But the problem is how to get the code above to stop to illustrate I have set this lock.
    I have tried to use the JOptionPane but because my program is running in a web browser I cannot use the JOptionPane dialog box.
    I have tired using an alert box but it executes the commit statement before the alert box is dispayed. So this does not work
    While (i < 2)
    if( i==1)
    %>alert(�The transactions commits when you press Ok�); <% //what it to stop execution here
    else
    stmt.executeUpdate(�commit�);
    I am not using threads so I cannot use the sleep function.
    I am using mysql and have already configured it to detect deadlocks and how long to wait for locks.
    Thanks for your help
    Mette

  • How can I stop a program until a button will be clicked

    I have a class that create a JTable and in this class I have two columns, the first culumns has the name of the variables an the second column has a checkbox to select the correponding variable.this JTable is created from a vector originating in other class. I need obtain a vector of integers with the number of the variable selected after the JButton will be clicked. For this i create a method called EspererSeleccion. This is the class
    import javax.swing.table.AbstractTableModel;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.table.TableColumn;
    import javax.swing.border.Border;
    import java.util.*;
    import javax.swing.*;
    import java.lang.Integer;
    public class MiTabla extends JFrame implements ActionListener
    //Variables de Instancia
    private boolean DEBUG = true;
    public boolean TERMINA=false;
    public Vector Valores=new Vector(1,1);
    //Constructor de objetos de la clase MiTabla
    public MiTabla()
    super("Variables");
    Border empty;
    MiModelodeTabla myModel = new MiModelodeTabla();
    JTable table = new JTable(myModel);
    table.setPreferredScrollableViewportSize(new Dimension(300, 200));
    TableColumn column=null;
    column = table.getColumnModel().getColumn(0);
    column.setPreferredWidth(220);
    column = table.getColumnModel().getColumn(1);
    column.setPreferredWidth(80);
    //Crea el scroll pane y agrega la tabla en el.
    JScrollPane scrollPane = new JScrollPane(table);
    empty= BorderFactory.createEmptyBorder();
    JButton boton=new JButton("Aceptar Seleccion");
    boton.setBorder(empty);
    boton.addActionListener(this);
    getContentPane().setLayout(new BorderLayout(100,0));
    getContentPane().add(scrollPane, BorderLayout.CENTER);
    getContentPane().add(boton, BorderLayout.SOUTH);
    addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent e)
    setDefaultCloseOperation(HIDE_ON_CLOSE);
    dispose();
    //System.exit(0);
    //clase MiModelodetabla
    class MiModelodeTabla extends AbstractTableModel
    MiVector v=llamaVector();
    int numElementos=v.size();
    private int i,j;
    public final Object[][] data=new Object[numElementos][2];
    final String[] columnNames = {"Variable",
    "Seleccion"};
    public MiModelodeTabla()
    CreaListas();
    public void CreaListas()
    for (i=0; i<numElementos; i++)
    data[0]=v.elementAt(i);
    for (j=0; j<numElementos; j++)
    data[j][1]=new Boolean(false);
    public MiVector llamaVector()
    MiVector V1=new MiVector();
    v=V1.addElementos();
    return(v);
    public int getColumnCount()
    return columnNames.length;
    public int getRowCount()
    return data.length;
    public String getColumnName(int col)
    return columnNames[col];
    public Object getValueAt(int row, int col)
    return data[row][col];
    public Class getColumnClass(int c)
    return getValueAt(0, c).getClass();
    public boolean isCellEditable(int row, int col)
    if (col < 1)
    return false;
    else
    return true;
    public void setValueAt(Object value, int row, int col)
    data[row][col] = value;
    fireTableCellUpdated(row, col);
    if (DEBUG)
    String s=new String("true");
    Integer I=new Integer(row);
    String S=value.toString();
    if(s.equals(S))
    Valores.addElement(I);
    else
    Valores.remove(I);
    value=(Object)value;
    public void EsperarSeleccion()
    while (TERMINA==false)
    int i=0;
    TERMINA=false;
    public void actionPerformed(ActionEvent e)
    TERMINA=true;
    dispose();
    and this is the method that create the JTable but when i call the method EsperarSeleccion the program fail and the JTable is not visible only the frame that contains It.
    How can I do to stop the program or the actions until the JButton will be clicked using and other method diferent from the EsperarSelection method
    Vector leeVariablesRelevantes ()
    System.out.println ("Variables relevantes");
    MiTabla frame = new MiTabla();
    frame.pack();
    frame.setVisible(true);System.out.println("El vector tiene "+frame.Valores.size()+" elementos");
    int i;
    for (i=0; i<frame.Valores.size(); i++)
    System.out.println("El elemento "+i+" de el Vector es: "+frame.Valores.elementAt(i));
    System.out.println();
    return frame.Valores;

    Say,Class A contains JTable and in Class B you wish to acess the vector which contains the things required by you.
    First you have to get the reference of Class B in Class A.
    It can be done in the following way.
    In Class B ,you create a static method like this.
    public static ClassB getObject()
      return this;
    }Now you can get the Class B's object easily via this method.
    Again in Class B , you write a method which will handle your requirment.(Let this method name be doThings( Vector vector))
    Now in Class A's actionPerformed() ,when the buton is pressed ,just call doThings() and pass the vector.

  • Acrobat sdk, not able to run samples, getting a message, unable to start the program

    Hi,
    I have downloaded Acrobat sdk XI and tried to run plugin samples  in visual studio 2010, It is build successfully but when I try to run the program am getting an error message saying " Unable to start  Program 'C:\Users\downloads\sdk110_VI_win\Adobe\acrobatXISdk\Version1\Plugin Support\samples\BasicPlugin\Win32\Debug\BasicPlugin.api'."
    Can anybody help me finding out why am getting this message.
    Thanks.

    How do you run the program?
    I need to copy the compiled BasicPlugin.api under Acrobat\plug_ins folder. I can create a subfolder of plug_ins and copy the .api file there. Just one level deep: if I create a subfolder under a subfolder of plug_ins, the .api file will not be found by Acrobat.
    Then I need to restart Acrobat and I find the plugin running. In particular, BasicPlugin add a new Acrobat SDK menu and a menu item under it.
    If I close Acrobat and go back to Visual Studio, I can push the Debug button which will open Acrobat for me and stop the program execution at any breakpoints I have set in the code.

Maybe you are looking for

  • Print Message Report from Mobile

    Hello... We need modify standard mobile infrastructure java code... We need print some report from Mobile Front-end. Is possible to print all MESSAGE data that we can see from front-end of mobile infrastructure 2.5 ??? thank you very much Stefano

  • How can I get a complete update without anny douwnload error.

    Ich habe mehrmals versucht das neue Update zu installieren, bekam aber jedes mal die Mitteilung, dass es fehlerhaft ist und ich soll es später noch einmal versuchen.

  • No Apple TV icon but for only one movie

    I can play my music or any other of my previously purchased movies thorugh my apple tv but a movie I purchased last night has no apple tv icon. Double checked, played some music from purchased and also imported works ok check previously purchased mov

  • Documentation frustration

    Dear Apple: FWIW, I started with computers when main frames had 48K of memory, the terminals said "TeleType" on them, and the modem ran at 58 baud. So on this subject I know where of I speak. I'm new to the Mac world. Getting started on them has been

  • Mike Hub

    I just purchased product and  having problems with converting PDF to word. The complete text in the PDF is not being converted in the word format. Also, I'm not allowed to adjust the format in the word document. What should I do?