10-25-2007 06:36 PM
10-28-2007 05:12 PM
Hi Vivek!
Thank you for contacting National Instruments. From the information you have provided here, along with the attached VIs, I would agree that it is the simulation loop that is causing the problems when stopping the VI. It looks like you are using the LabVIEW Simulation Module.
When using these loops there are two primary ways of stopping their execution. The total simulation time can be controlled from the input node, the box at the upper left of the loop, or the Halt Simulation VI can be used from within the Utilities palette. I would suggest taking a look at the detailed help for the simulation loop in order to better understand the methods of stopping this execution. As you mentioned it is always good programming practice to avoid using the abort button because this can result in open references being left without any programmatic resolution.
I hope this helps! Let me know if there is anything else I can help with or clarify. Have a great day!
Jason W.
10-28-2007 05:18 PM
10-30-2007 02:38 AM
Hi Vivek,
Are you using a VC++ program to invoke a dll created in LabVIEW. If so, you should probably be using the LoadLibrary method (http://msdn2.microsoft.com/en-us/library/ms684175.aspx) to call your dll. It seems to me that you might be using the CreateProcess method (http://msdn2.microsoft.com/en-us/library/ms682425.aspx) as this typically uses the command line to launch executables.
If you use the LoadLibrary method, then you donot have to deal with the command line as you can directly get a handle to the apporpriate function in your dll. If you are using the CreateProcess method then there are a couple of ways in which you can deal with the command line.
1. Specify CREATE_NO_WINDOW as one of the dwCreationFlags in the in the CreateProcess function. (http://msdn2.microsoft.com/en-us/library/ms684863.aspx). If there are already other flags in that argument then you need to 'or' them together.
2. Launch the command line in the CreateProcess function by using the /C option. For eg: cmd.exe /C
3. Run the exit command in the current console after the executable.
Also, you can refer to this Knowledge Base article: http://digital.ni.com/public.nsf/allkb/0E686E97C3A65EA8862565F60052A706?OpenDocument
Let me know if this helps.
Jaidev Amrite
National Instruments
11-04-2007 06:18 PM
11-07-2007 09:52 AM
Hi Vivek,
It looks like you are calling the DLL right. You should debug your program to see if there is a loop that doesnt stop executing after doing its job. This might be a loop in the DLL. So i suggest looking at the LabVIEW code as well.
Jaidev