TestStand API terminate all notification

I've developed a LabWindows based user interface using the TestStand UI controls and the TestStand API. I have a sequence file that has several cleanup steps, some of which take a while to finish. One function of the user interface is an Emergency Stop button. When this is pressed, an Engine.TerminateAll is issued via the API. The test fixture has 8 sockets which are using the Batch Model TestUUts entry point. Is there any easy way via callback or other means of knowing when all the terminations have completed. I would like to display a popup telling the operator to wait while the cleanup steps are being carried out. I also want to disable the START button and reenable it when the terminations are complete.
I am launching the execution with TS_EngineNewExecution and I can get the id. I tried to wait until I saw this execution end with the ApplicationMgr  EndExecution event or the Execution VIew Manager EndExecution event but I saw a bunch of exection id's except the one that I was looking for. It may be my fault but I wanted to ask and see what is the best approach for what I am trying to accomplish.
John

Hey John,
Your method will work, and your assumptions are partially
correct.  If you look in the Batch Process Model, inside of the
Cleanup Step Group of Test UUTs there are steps that tell all
TestSocket executions to stop.  There is also a wait step that
forces the Process Model execution to wait until all of the TestSocket
executions have terminated. There are going to be multiple EndExecution
events because it is going to occur for each execution that finishes
whether it is the Process Model execution or one of the TestSocket
executions. However, the Process Model will always be after all of the
TestSocket executions have completed. 
Another thing to keep in mind is that this is only happening because it
is built into the process model.  Normally if you spawn off a new
execution it is separate from your original execution, and the new
execution would not terminate by calling the terminate method on your
original execution.  You would have to either do a terminate on
each execution or use the terminate all method of the application
manager. Hope this helps to clear things up a little.
Pat P.
Software Engineer
National Instruments

Similar Messages

  • Teststand api get all step parameters

    I'm trying to get all step parameters , name and ID.
    For now the I manage to get the step name and ID but how do I get eg. Step.MessageExpr?
    In the code I send you can see how far I came but the GetValString property does not work...

    Try this.  You may have to put Step.MessageExpr in the string there.
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • How can I terminate ALL test sockets from API

    I want to terminate all my test sockets (Batch model).
    Manually I do it by "Debug -> Terminate All".
    Is there any way to terminate all sockets through NI TestStand API Automation Server ?
    I succecced to terminate only one socket (object class RunState.Execution), but I didn't find any way to terminate all test sockets.
    Thank's to someone that will answer.

    Hi,
    Yes, use Engine.TerminateAll
    You will find reference to it in the TestStand Help
    regards
    Ray Farmer
    Regards
    Ray Farmer

  • TestStand API in C#

    Hi,
    we develop a software in C# which uses the TestStand API.
    we note that TestStand API allocates memory at the first execution of a TestStand sequence
    All the memory of this first execution is not deallocate at the end.
    why ?
    Is it a problem with Active X technology ?
    Is it a conserved memory for the next execution ?
    Is it possible to not have this comportment ?
    For information, we have deactivated the generation of the TestStand report.
    Thanks for the answers
    Best regards

    There is memory allocated when an execution is run for many different reasons. Please be more specific as to which memory you are referring. Choose one of the following (or add your own if I have forgotten one).
    1) Memory used by result collection (to store results under Locals.ResultList while an execution is running). These are typically freed once the process model is done processing them typically for report generation or database logging. By default the process model processes them between runs of the mainsequence on the UUT. These results are also freed when the execution completes (i.e. stops running). If you are not using a process model or do not need results for specific steps or sequences you can disable result collection on a per-step, per-sequence, or global basis.
    2) Memory used to keep the sequences and executions themselves in memory. These datastructures stay in memory as long as you have a reference to them. One additional twist with .NET is that you might not think you have a reference to them, but you really still do because .NET hasn't gotten around to garbage collecting the references yet. You can force garbage collection as follows with the following code:
            public static void DoSynchronousGCForCOMObjectDestruction()
                // To make sure activex refs are synchronously released
                // we need to call GC.Collect() and GC.WaitForPendingFinalizers()
                // at least twice, according to the following document:
                // http://msdn.microsoft.com/en-us/library/aa679807%28v=office.11%29.aspx
                // The reason we have to do it twice is that the the first call
                // might just sweep the objects into generation 2 rather than collecting
                // them immediately.
                GC.Collect();
                GC.WaitForPendingFinalizers();
                GC.Collect();
                GC.WaitForPendingFinalizers();
    3) Memory used by code modules being loaded. This memory is freed when the step settings on your code modules say to unload your modules, but the behavior is somewhat different depending on the adapter. Some adapters can unload code modules on a per-code module basis, but the .NET adapter can only unload code modules when all code modules and .NET objects created by the .NET adapter are no longer supposed to be loaded or referenced. That is because in .NET the only way to unload code modules is to unload the appdomain containing them. TestStand uses a single appdomain for the .NET adapter and unload that appdomain when all .NET code modules referenced by the adapter are unloaded and all .NET references gotten from those code modules into TestStand are no longer in scope.
    Hope this helps explain things.
    -Doug

  • Some Executions Are Not Terminated by Using Terminate All in Parallel Process Model

    Hi,
    This issue confued me recently, I'd like to use a parallel model process, and to terminate all execution at once.
    If there's some action steps in the sequence, it seemed all execution will be terminated.
    However, I put a wait function instead of action steps, there are some executions not terminated while I pressed the Terminate All button in the toolbar.
    Hope someone can give me some help. Thanks a lot.
    ps. the number of testsockets is set to 9 in my teststand.
    Solved!
    Go to Solution.
    Attachments:
    Terminate_Test.seq ‏7 KB

    Hi, Ting,
    Thanks for your help.
    I'd like to add some additional remarks,
    What I'd like to know is what cause the termination unstable in such a situation.
    The timing seemed to play an important role, but it is not my orignal concern.
    I used the testsocket of the last one to send the TerminateAll() command, but the choise is an accident...
    Originally I take the first testsocket to send TerminateAll() command, it works "well".
    I've notice the terminating action is always done in the reverse order of the testsocket(i,e, from the last testsocket to the first one),
    it seemed to make each testsocket go to cleanup and then not allow the testsocket continue.
    If we trace the executions more detailedly, it can be found the executions not terminated are actually received the command of the TerminateAll().
    They went to cleanup, and waited for the following "not continue" procedure, but somehow it missed so that they survived to repeat the execution.
    This consquence is a little like the termination is terminated...(not tongue twister...XD)
    If my postulation is true, it is safe to put the TerminateAll() command to the first testsocket so that the latter executions will be terminated before the first one terminated.
    If I put it to the latter testsocket or the last one, the termination will be terminated and some executions will revive.
    If I skip the wait function in the cleanup, the situation is not optimistic as my thought, the last testsocket will revive itself and back to the terminate command to send it again so that it makes me feel that it is better if I skipped the wait function.
    The above is my unconfirmed idea, maybe it totally wrong, if someone can correct my understanding I would be greatly appreciated.
    BTW, it is really special case, so we can take it easy, hope this will not add your loading and we can discuss freely as an amateur

  • Activating locks using TestStand API

    Hello,
    I have a question... how do I lock and unlock a lock, created in TestStand, in Visual Basic (by using the teststand API)?
    Greetz Jan Toebes

    Hello,
    To understand you correctly you are trying to perform a lock or unlock through Visual Basic. For this you have to use the synchronization server, which has a different API for itself. You can get more information about this under "TestStand Supplemental Reference Help" section in the TestStand Help.
    For simplicity sake, lets assume that you have a lock step created in teststand and you want to perform an unlock using Visual Basic.
    To perform this task, you need the SyncManager. This is the main class for all Synchronization objects. This class helps manage the creation and sharing of the different Synchronization objects between threads. You must create all Synchronization objects using this class.
    To get the appropriate instance of the TestStand Synchronization Manager call the Engine.GetSyncManager TestStand API method. The Engine.GetSyncManager method returns the TestStand Synchronization Manager for the appropriate process based on the name of the Synchronization object. So the call would be
    SyncManager = Engine.GetSyncManager(* Name_of_the_lock_Step)
    where the Name_of_the_Step is the actual name of the lock step that we created in TestStand. The "*" before that indicates that this lock step was created in a separate thread and is being shared.
    Now Mutex is the class that implements the Lock synchronization and is used to implement the Lock step type in TestStand. So using the SynCManager will get an instance of this Mutex class by using:
    Mutex = SyncManager.GetMutex(* Mame_of_the_lock_step)
    Now using Mutex you can perform an unlock by using:
    Mutex.EarlyUnlockMutex ( threadId)
    Please refer to the help for more information regarding these functions. I hope this helps.
    SijinK
    National Instruments

  • Visual Studio TestStand API runtime enable/disable XML reporting file creation

    I am looking for a Visual Studio C# solution to selectively disable creation of the report generation XML file using the TestStand API.
    These XML files are useful for active troubleshooting for technicians, but wind up cluttering important directories with useless information most of the time.
    I am aware that the XML file creation can be disabled through the TestStand Sequence Editor menu item Configure | Result Processing | Output Name Report | Enabled unchecked option.
    This is helpful, but:
    1. I have not found a way to check-uncheck this feature at runtime.
    2. I do not believe that this would be an effective solution for my instal-less Base Deployment Paradigm.
    Any help or ideas would be appreciated!
    Solved!
    Go to Solution.

    Thank you for the quick and concise response James_Grey!
    This is useful, complete, and implementable but not exactly what I was hoping for.
    I was hoping to be able to enable/disable the XML file creation for the currently executing instance of the engine prior to sequence start.
    I would rather not disable reporting through a configuration file that would effectively disable it for all uses of TestStand until it was re-enabled again.
    Are my expectations unrealistic?
    Does anyone have any idea how creation of the XML file can be enabled/disabled for an active instance of the engine prior to sequence start through the API without altering the file based configuration of TestStand?
    I have seen some postings around 2008 that indicate this can be done, but I was unsuccessful implementing those solutions in TestStand 2013.

  • Load a VI (including TestStand API) in TestStand

    He,
    I'd like to load a VI in TestStand without LabVIEW.
    LabVIEW Version 8.5
    TestStand Version 4.0
    The PC with TestStand just have LabVIEW Runtime Engine 8.5, and the VI is used to import data in station globals; Also, This VI calls TestStand API and TestStand Engine.
    On a PC with LabVIEW and TestStand, all is OK.
    But, on a PC with Runtime only, even if I configure Adapters in TestStand and Select LabVIEW Run time 8.5, an error message is displayed (unable to load VI ... )
    I have tested with a simple VI (dialog box), all is ok;
    But with VIs thaht called API TestSTand, error is displayed
    Do you have an idea ?
    Thank you for your responses
    Solved!
    Go to Solution.

    Yes, I understand that you use TestStand in development system and the VIs are in an llb there. What I ASKED was where you placed the TestStand VIs on the runtime only pc. It sounds like you did not place them anywhere. If you didn't, how do you think the top level VI is going to work? You don't think that these VIs are included in the runtime engine do you? They are not. Only the LabVIEW primatives are in the runtime engine.
    You should really consider using the deployment tool.

  • TestStand API External Component Modified Since Last VI Save

    I'm using TestStand 3.5 with LabVIEW, and deploying my code across multiple stations.  The code is managed by Perforce (source code control).  I'm keeping the stations identical by installing NI software from the same CDs (which I'll refer to as an "Original Station"), but it seems that over time the TestStand API will somehow be externally modified ("Modified Station"), which causes LabVIEW to recompile the VI.  The Explain Changes dialog box states "VI recompiled.  External component modified since last VI Save."  If I save the recompiled changes on a Modified Station and submit the changes, an Original Station opening the VI will then recompile VI, stating that an external component has been modified since the last VI save.  If I resave the VI on an Original Station, then the next time I open it on a Modified Station the recompile will occur.
    This is problematic, because there will be a performance hit if LabVIEW has to recompile when opening VIs.  In addition, it makes debugging difficult, because LabVIEW will prompt to save changes on all the VIs if they were saved on a different station state.  Not to mention the unnecessary copies made in the source code control to maintain the history of the recompiling.
    My current solution is to reinstall TestStand on all the Modified Stations.  I set any TestStand strict typedefs that I use to non-strict typdefs, mass compile the TestStand addon folder in vi.lib, and then the station becomes an Original Station again.  Overtime, it will modify itself and turn into a Modified Station.  Since these stations are at multiple sites, it is very inconvenient to manage.
    My questions are the following:
    1. What is causing this external modification?  Is there anyway to prevent it, so that the installation and code will not get modified so that all will remain Original Stations?
    2. If it is not preventable, how can I force all stations to become a Modified Station, so at least they are all the same?
    I've attached LabVIEW 8.5 VIs that demonstrate the VI differences.  I've observed this behavior in LabVIEW 7.1 and 8.2 previously.  If anyone also experience this behavior or has a work around, please post to this thread.  If NI has insight on what is causing this behavior and how to prevent it, it will help me out greatly.
    Thanks!
    Attachments:
    test_recompile_original_lv85.vi ‏7 KB
    test_recompile_modified_lv85.vi ‏7 KB

     Wilbur,
    Do you have more than one version of TestStand or LabVIEW on the stations?   Switching the active version of TestStand changes the registered version of the TestStand API which I believe is the external change that forces a recompile.  If version switching is the cause of the problem you could prevent these changes by not sharing any TestStand VIs between different versions of TestStand.  If each version of TestStand has its own VIs then a VI is compiled against one and only one engine version.
    -Rick Francis

  • I am trying to have some LabVIEW code called in a New thread exit when the testStand sequence terminates

    I have a Sequence that launches a sequence in a New Thread that happens to launch some LabVIEW code.  The problem is when the LabVIEW code finishes, it will not close even when the TestStand sequence terminates. Is there a way to tell this LabVIEW code to Exit, I've tried the Quit LabVIEW function, but that causes a C++ RunTime Error.  The LabVIEW code does end though, and it is set in the VI properties to:
    Checked - Show Front Panel When Called
    Checked - Close Afterwardds if originally closed
    The sequence call that the LabVIEW code is launched from has the following options:
    - New Thread
    Unchecked - Automatically wait for the thread to complete at the end of the current sequence
    Unchecked - Initially Suspended
    Unchecked - Use single threaded apartment
    Any clues on this would be appreciated.

    Hi ADL,
    Everything should close correctly if you check the checkbox "Automatically wait for the thread to complete at the end of the current sequence" in the thread settings.
    With it unchecked, I am seeing the behavior you are. 
    Gavin Fox
    Systems Software
    National Instruments

  • IPhone makes a random water drop sound through out the day. All notifications are turned off? Not sure what the cause is.

    My iPhone randomly makes a sound like a drop of water into a puddle.  I've turned off all notifications and it till does it.  Any suggestions?

    Do you have an app called Life360?
    See this thread: My 4s started making this strange sound like a ping/water drop! What is it?

  • Possible to disable all notifications in iOS 5?

    In iOS 4, when I wanted to take a nap, I would go to settings->notifications->off.  That would disable all notifications, so I would only be woken by a phone call or a text message, not by a notification.  In iOS 5, I no longer see a way to turn off all notifications.  The only way to do it is to silence or turn off my phone, but then I will miss important calls and text messages.  Is there a way to turn off all notifications while leaving the ringer on, without having to turn off the notifications app-by-app?
    If not, I hope Apple restores this functionality.

    God, this is annoying.  I tried the workaround suggested to turn off cellular data and wi-fi.  This almost solved the problem.  But I quickly discovered that it didn't work quite the way I expected it to.  I turned off data and wi-fi and went to take a nap.  I was awoken by a reminder (apparently, those are activated by the iPhone, rather than pushed by the cloud).  And then, when I re-enabled cellular data and wi-fi, I received an iMessage from my wife that she had sent a few minutes earlier.  I had read elsewhere that SMS/MMS would go through even if data and wi-fi were turned off, but apparently that's not the case with iMessages (if someone else has experience with this, please confirm).  In iOS 4, I could turn off notifications with the click of a button, in which case I would be awoken by text messages and unbothered by calendar reminders, which is exactly what I wanted.  Now all I've got is a clumsy workaround that gives me the opposite result. 
    I read that if you plug something into the headphone jack, you'll only hear the iPhone speaker if the phone rings.  I'd be interested to know whether you hear the speaker when an SMS/MMS/iMessage arrives as well (which is what I want), and in no other circumstances.  Maybe I'll experiment with this after I finish my nap.  If someone else knows whether this is an effective workaround, please post here.
    And if anyone knows of a better workaround, please post that as well.
    By the way, I've left feedback at
    http://www.apple.com/feedback/iphone.html I encourage all of you to do the same.

  • How do you stop Terminate Workforce - Notification - Supervisor what is the Buisness Event trigger?

    We have reports to selected on Position Mgt - recently this triggered workflow notification to a supervisor despite the fact that the supervisor did not have workflow security - anyone have any success in turning this off?
    Message:
    From: [email protected] [mailto:[email protected]]
    Sent: Wednesday, January 28, 2015 8:57 AM
    To: Supervisor Name
    Subject: An employee has been terminated
    An Employee has just been terminated.
    Name: 
    Emplid: 
    Rcd#:  0
    Termination Date: 
    This e-mail message has been brought to you by PeopleSoft workflow technology.
    Terminate Workforce - Notification - Supervisor

    Hi,
    here are 3 samples your can start with:
    Email solutions | Assure Dynamics developing dynamic LiveCycle and Flex solutions

  • Terminates all java virtual machine process

    How I can terminate all java virtual machine process which is running on a computer
    thanks
    daniel

    Too big topic to cover. Check out
    http://java.sun.com/j2se/1.3/docs/guide/intl/fontprop.html
    namely Specifying Fonts on Win32 Platform
    (http://java.sun.com/j2se/1.3/docs/guide/intl/fontprop.html#win32)

  • Integration Directory - how to terminate all logons?

    I was importing RFC definitions from R/3 in ID. Laptop battery went down and got disconnected with SAP XI,IB.
    After 5 mins, restarted laptop (powered by wire). Opened same SWCV in Integration Directory to change the connection data to point R3 system instead of XI SAP. It gives message "Object SWCV myswcv is currently being edited by user myIDuserid"
    This is what I did sofar, but no luck
    -logon to XI system, transaction SM04. Terrminate all connections with SAP XI.
    Please advise how to terminate all logons in Integration directory? Thanks

    Hi,
    You can go to 'index page' click on 'administration'. In that you will find on the left side 'administration of locks and caches'. You can click 'lock overview' and unlock the objects.
    Regards,
    P.Venkat
    Message was edited by:
            Venkataramanan

Maybe you are looking for