Can't close CVI panels in DLL-Detach when called from Teststand

Hello,
i've got a problem with Teststand calling a DLL produced with CVI.
1. I use to DLL Attach and Detach calls to load or discard the panels. The attach part works fine, but when the TS sequence ends and i try to unload the module, the "DiscardPanel" function returns a error -129 "operation can only be performed in the thread it was created".
If i call the same dll from a CVI executable, this doesn't happen.
2. Additionally, the first time i run the sequence file the panel doesn't correctly quit and return to Teststand, so the whole thing hangs.
Does anybody have an idea, what is going wrong?
See attached files:
ErrorOnDllDetach.seq --> Call DLL from TS
\bin\usePanelsDll_dbg.exe --> Call DLL
from CVI
Attachments:
NoUnloadOfDll.zip ‏326 KB

Maik -
After some more investigation, because of limitations in Microsoft's operating system, developers and CVI are limited in what they can do in DLLMain. Basically load and unload CVI panels in DLLMain just does not work well if the DLL is loaded and unloaded arbitrarily like it is in TestStand.
One option is to never unload the panels and let CVI and the OS clean up the panels when the process terminates. You can do this by adding an extra reference to your DLL using LoadModule. You would basically prevent TestStand from unloading the DLL, so any dialog would stay around for as long as you like.
The best way to have the dialog go away when TestStand is no longer using it is to associate your dial
og lifetime with the execution that is displaying it. You load the panel either when the first call is made into the DLL or by an explicit call to a "Display" function exported from the DLL. Then have the dialog monitor for when the execution is terminated or stopped. This works because TestStand does not attempt to unload the DLL until the execution that is using it completes.
I have attached an example DLL and sequence that does just this. It uses a default pool thread to display a panel and that thread waits for either an explicit call to a "Discard" function exported from the DLL or or if the execution stops.
Hope this helps...
Scott Richardson (NI)
Scott Richardson
National Instruments
Attachments:
DLLProject.zip ‏344 KB

Similar Messages

  • Is it possible to step into a CVI dll when called by TestStand?

    As the question says: "Is it possible to step into a CVI dll when called by TestStand?"
    I am sure Ray F. may have a few tricks up his sleeves...  Hope you see this post, Ray!
    I compiled a dll using CVI.  The dll is called as a test by TestStand.
    I do have an "exe" version of the code that I use for debug with a testbed, but the behaviour is not the same as testing the actual target while running TestStand.  My goal is to get as close as possible to the real events.
    Thanks,
    JLV

    Sorry about that,
    There are two ways as I was saying:
    1. You can configure the CVI adapter to Execute Steps in a External Instance of CVI (requires CVI 6.0 or greater).
    Only go to Configure->Adapters and select the LabWindows CVI adapter and click on configure and select the corresponding option.
    After that set a break point in the step that you want to debug.
    An external instance of CVI will be launched where you can set break points and step into the code.
    2. From CVI Specifying an external process:
    In CVI go to Run Specify External Process and enter the seqEdit.exe as the program name (you have to browse to the location <TestStand>\Bin\SeqEdit.exe).
    As the argument you enter the name of the sequence file you want to debug.
    Now just select Run->Debug SeqEdit.Exe
    The Sequence Edtior will be launched and you can set break point in your CVI code and step into it when the step is executed.
    Check the Using LabWindows/CVI with TestStand reference manual for more information.
    I hope it helps you to get started.
    Regards.

  • How can i close the preview in Adobe Viewer when the LINK ist fullscreen on my eMag? It will always go to URL and i can't open the summary.

    How can i close the preview in Adobe Viewer when the LINK ist fullscreen on my eMag? It will always go to URL and i can't open the summary.

    You have to change your page design so the link doesn't occupy the full screen of your content.
    Neil

  • You but should be when I have scurrty cood can not close the I phone should be when I need close phone I but scurty cood for can I close my phone it is biter for can't any one close phone directly  When I have program for fined my I phone when any one clo

    you but should be when I have scurrty cood can not close the I phone should be when I need close phone I but scurty cood for can I close my phone it is biter for can't any one close phone directly
    When I have program for fined my I phone when any one close phone no have internet can't find my phone agine

    It is biter for any thief take my phone can't close my phone when he close my phone can't found agine because I open 3G when thife close my phone it is finsh can't yousing program for find my I phone
    Plz back to think my point it is biter for can't lose phone
    Should be when I need close the iPhone when I have scurty cood should be when I close I but scurty cood agine
    Thank  you very mutsh

  • I have a fillable form that we send to contractors - when the form is opened on a computer the contractor can view the fields we have completed, however when viewing from a mobile device or cell phone those fields appear blank. Any suggestions? I am at a

    when the form is opened on a computer the contractor can view the fields we have completed, however when viewing from a mobile device or cell phone those fields appear blank. Any suggestions? I am at a total loss as it works when viewing from the computer. I am assuming it is a setting or maybe we need to save it a special way?

    What version of Reader are they using, exactly? And are you sure they're
    using Reader itself and not opening the file inside a browser window, for
    example?
    On Fri, Feb 6, 2015 at 5:24 PM, jessicao96457206 <[email protected]>

  • How can I keep tabs on the file size when importing from the Event Library into a Project? I want to ensure the movie will fit onto a 4.7Gb disc?

    How can I keep tabs on the file size when importing from the Event Library into a Project? I want to ensure the movie will fit onto a 4.7Gb disc?

    iDVD does not care about file sizes, as it compresses the file to the standard DVD format of mpeg2.
    It only cares about length i.e. max 2 hours including titles etc.
    iDVD encoding settings:
    http://docs.info.apple.com/article.html?path=iDVD/7.0/en/11417.html
    Short version:
    Best Performance is for videos of up to 60 minutes
    Best Quality is for videos of up to 120 minutes
    Professional Quality is also for up to 120 minutes but even higher quality (and takes much longer)
    Professional Quality: The Professional Quality option uses advanced technology to encode your video, resulting in the best quality of video possible on your burned DVD. You can select this option regardless of your project’s duration (up to 2 hours of video for a single-layer disc and 4 hours for a double-layer disc). Because Professional Quality encoding is time-consuming (requiring about twice as much time to encode a project as the High Quality option, for example) choose it only if you are not concerned abo
    In both cases the maximum length includes titles, transitions and effects etc. Allow about 15 minutes for these.
    You can use the amount of video in your project as a rough determination of which method to choose. If your project has an hour or less of video (for a single-layer disc), choose Best Performance. If it has between 1 and 2 hours of video (for a single-layer disc), choose High Quality. If you want the best possible encoding quality for projects that are up to 2 hours (for a single-layer disc), choose Professional Quality. This option takes about twice as long as the High Quality option, so select it only if time is not an issue for you.
    Use the Capacity meter in the Project Info window (choose Project > Project Info) to determine how many minutes of video your project contains.
    NOTE: With the Best Performance setting, you can turn background encoding off by choosing Advanced > “Encode in Background.” The checkmark is removed to show it’s no longer selected. Turning off background encoding can help performance if your system seems sluggish.
    And whilst checking these settings in iDVD Preferences, make sure that the settings for NTSC/PAL and DV/DV Widescreen are also what you want.
    http://support.apple.com/kb/HT1502?viewlocale=en_US

  • Am using Safari 4.1.3 with system 10.4.11 and can only come up with advances preference page when calling up security - thus cannot see cookies. I have Safari 5.0.6 on my MacBook. Will it run on my older machine? Can I transfer older bookmarks?

    Am using Safari 4.1.3 with system 10.4.11 and can only come up with advances preference page when calling up security - thus cannot see cookies. I have Safari 5.0.6 on my MacBook. Will it run on my older machine? Can I transfer older bookmarks to the new software?
    Machine Serial Number:          W8*********AR
    <Personal Information Edited by Host>

    Safari preferences has no...

  • Help, do anyone know what to do when iPad can´t close neither open. I have a message from iCloud : not enough storage, and now I can´t do anything !!!thanks for any help

    Help, do anyone know what to do when iPad can´t close neither open: have a message from icloud saying: not enough storage.. and now it´s blocked !!!! can´t do anything !!! Thank you for any help...Gyda

    Try a reset:
    Hold the Sleep and Home button down for about 10 second until you see the Apple logo.

  • How to display non modal dialog box in a Dll call from TestStand implemented in visual c

    Dear Jason F.
    Applications Engineer
    National Instruments
    Hello
    I did the same way you told me
    the non modal dialog appeared and
    system hangs and
    giving the error message
    ""SeqEdit.exe-Application Error
    The instruction at �0x047fc5b0� referenced memory at �0x047fc5b0�. The memory could not be �read� ""
    please solve my problem
    and thanks for yours early response
    you can email me at
    [email protected]

    Hi Mkehret,
    Does your dialog have ActiveX controls on it? If your DLL dialog uses ActiveX controls and is not programmed in a certain manner it can hang because of a conflict in the threading model used by the TestStand Engine that is calling into your DLL and the model that is required by the MFC ActiveX Container. If you are using ActiveX controls in your dialog, you need to make special considerations for the threading model MFC dialogs that use ActiveX controls need in order to work properly. The example under \Examples\MFCActiveXContainerDlg illustrates how to appropriately handle this situation as well as explaining why it is necessary.
    Note: The above example displays the dialog as modal, but this is irrelevant to the problem I am describing.
    Again for information on properly creating a dialog class object and displaying it as non-modal refer to the information on MSDN that I referred you to in this post:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000E98A0000&USEARCHCONTEXT_CATEGORY_0=_8_&USEARCHCONTEXT_CATEGORY_S=0&UCATEGORY_0=_8_&UCATEGORY_S=0
    If your dialog does not use ActiveX controls or after trying the programming method illustrated in the "MFCActiveXContainerDlg" example TestStand still hangs when calling your DLL, try calling your DLL from another environment just to make sure whether the DLL works at all. If the DLL works properly when called by another environment (e.g. VB, VC++, LabVIEW, or CVI), please submit a MINIMAL and REPRODUCEABLE example source project for your DLL for us to look at (please exclude all unnecessary code not required to reproduce the specific problem of displaying the dialog, and include all files necessary to build your dll with any
    specific instructions needed to do so).
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

  • Open front panel of sub vi when called - how?

    Hello,
    I have a VI with several sub VIs.
    I want some of the sub VI front panels to be opened, if they are not yet opened and if they are called but I want them to stay in the background.
    There are two SubVI Node setups: "Open Front Panel when loaded" and "show front panel when called"
    Both are not what I want. If I select "show front panel when called", then the front panels are opened but flickering because they are called often and alternately.  
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Solved!
    Go to Solution.

    johanneshoer wrote:
    No, no issue with my code :-)
    Yeah, we've heard that one before...
    @smercurio_fc: With your example I can see if a subVI is opened or not, but how can I open the subVI during run time if it is not opened
    Just call the method with it set to "write" (right-click and select "Change to Write"). I don't recall if LV 7.0 has a Front Panelpen method. Check the LabVIEW manual.

  • Can I source an environment before making a system call from the database

    I can execute system calls from the database like
    Process proc = Runtime.getRuntime().exec("env");
    but I am unable to source an environment before making the call.
    Our goal is to from within the database to execute tkprof on a
    raw trace file then load both files into clobs in a table. We can load
    the raw trace no problem, we just cannot figure out how to execute
    tkrprof on the raw trace then load its output.
    Anyone know if this is possible to hava java get a runtime and then call
    an environment file to source the environment so that path's and other environment variables are set prior to executing another system command.

    Thanks for that...but can I do multiple edits in my Stored Procedure Vaibhav and pass back something that I can then utilize in my SSIS? For example...
    One and Only one Member Span...so I'd be doing a SELECT COUNT(*) based on my match criteria or handle the count accordingly in my Stored Procedure and passing something back via the OLE DB Command and handling it appropriately in SSIS
    Are there "Diabetes" claims...again probably by analyzing a SELECT COUNT(*)
    Am I expecting too much from the SSIS...should I be doing all of this in a Stored Procedure? I was hoping to use the SSIS GUI for everything but maybe that's just not possible. Rather use the Stored Procedure to analyze my stged data, edit accordingly, do
    data stores accordingly...especially the data anomalies...and then use the SSIS to control navigation
    Your thoughts........
    Could you maybe clarify the difference between an OLE DB Command on the Data Flow and the Execute SQL Task on the Control Flow...
    You can get return values from oledb comand if you want to pipeline.
    see this link for more details
    http://josef-richberg.squarespace.com/journal/2011/6/30/ssis-oledb-command-and-procedure-output-params.html
    The procedure should have an output parameter defined for that
    I belive if you've flexibility of using stored procedure you may be better off doing this in execute sql task in control flow. Calling sp in data flow will cause it to execute sp once for each row in dataset whereas in controlflow it will go for set based
    processing
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How can i choose a lower quality print density when printing from firefox on my Mac. I cant move the slider along the scale ( I can when printing from the computer).

    I can't change the print density when printing from Firefox. It is set at standard and although there is a "slider button" to use for choosing less or more density, it can't be moved. I can tick "grayscale". I can choose the density when printing from the computer. I have a Mac

    I also have this problem where I used to be able to shrink a 2 page doc to a single page. Since upgrade to FF4 it no longer works - but you can choose say 60% and it will work. All used to work fine in FF3

  • How can I change the appearance of html report file generated from Teststand to that I change the orientation of the data in the tables?

    For instance, I'd like to have the measurement results, limits, and status all on one line in a table.
    I am running Teststand 2.0 on Windows 2000.

    Hello Joel_IEI,
    You can modify each report entry as it is being generated by doing the following steps:
    1) In the TestStand Sequence Editor's Report Options, change the Report Generator to "Sequence".
    2) In your sequence file, override the ModifyReportEntry callback. In this callback, you can modify or even replace ENTIRELY the default report information TestStand plans to append to the report. You can use Statement steps to modify the contents of Parameters.ReportEntry (the TestStand variable that you will use to do this), or replace the contents entirely!
    You can look at the code example Adding Extra Results to a Report Using the Modi
    fyReportEntry Callback Sequence for more information.
    David Mc.
    National Instruments

  • I can not see video on my apple tv when streaming from my ipad

    Curious what I can try.  I am trying to watch a vidoe off my ipad using apple tv and all I get is the audio.  I am streaming from Amazon Prime. 

    --Not sure if they still do but Amazon Prime used to block video Airplay, only transmitting audio  I thought they'd changed this but that may have been another provider.
    Is your Amazon Prime app up to date?

  • Can't find services in the Detailed Navigation when open from Overview page

    Hi,
    We have developed a custom area page for our ESS application. The area is visible in the Overview page as well as in TLN (Top leavel navigation). When we open the area from TLN the services under this area are visible in the Detailed Navigation(DN) on the left. But when we are trying to open the area from the overview page we can't be able to see the services in the DN and we have realized that the focus is on "Overview" in the TLN. In DN also only the Overview link is coming. But for other standard ESS applications the focus in the TLN is changing.
    Please help to find the solution.
    Thanks,
    Sekhar

    Hi Sekhar,
    Did you get any solution for this issue. I am facing the same situation.Please advise.
    Thanks,
    -Ashwani

Maybe you are looking for

  • How to load a Properties file : Very URGENT

    I have properties file ie., SQLProperties.properties SQLProperties.properties logdetails = SELECT USERNAME AND PASSWORD FROM USER_TBL I want to load this file . I used like this public static Properties prop = null; strKey ="logdetails"; FileInputStr

  • Delete photos from photo stream but keep in iphoto?

    I want to delete the pictures in my photostream on my phone, but I know once I do this they will be deleted from all other devices. How can I save all my photostream pictures that are already in iphoto and then remove them from my phone without them

  • Configuring the appbuilder chart using SQL Statements

    Hi all! I am able to create a chart using .mameta My Chart is able to read in data and display on a chart successfully. What i could not achieve was that the chart doesn't read and display the numbers correctly as shown below. It read by ID instead o

  • Adobe and IT7 Does not work at the same time

    When editing a video with Adobe Premier, I opened IT7 to have some background music. Except that whenever I move my mouse of hit any keys, the song fasts forward, or slows down. Also, only when I have Adobe open, does the sound come out staticy. Play

  • ISight camera image is grayed out

    As of a couple weeks ago, the image from my MacBook Pro built-in iSight camera has been grayed out. The image can be seen, but barely - it's in monochrome with minimal contrast. It happens in multiple applications - have tested with Skype and Photo B