TestStand - Reload Sequence Files On Start

I have a question. I am mantaining a OI and some of the users would like to set ApplicationMgr.ReloadSequenceFilesOnStart to ReloadFile_All but some of them strongly prefer the ReloadFile_None option, as this is harcoded on the OI I would not like to deal with two versions of the OI. Is there a way to access this by means of an .ini file or something like that. I have been trying to access this property using an Activex step that calls the TestStand API but I haven't been succesful so far.
Thank you for your help,
Iñaki

Hi Inaki,
As part of your OI code:
1)  Prompt the user to ask which option he/she would like
2)  Save the option in your own .ini file.
Upon starting, your OI code can programmatically read this .ini file to determine which option to call.  One can also make a button that can change this setting whenever the user would like.
Also, please note the response that AndyMc provided in the other discussion.
If you would like further assistance, please let me know how you are accessing the TestStand API (i.e. CVI, LabVIEW).
Cheers,
David Goldberg
Cheers,
David Goldberg
National Instruments
Applications Engineer

Similar Messages

  • Reload sequence file when changes on disk

    Hi,
    I wrote a custom user interface based on the TestStand (TS) Operator Interface. When I run a sequence file on it and I edit it in the TS editor and I restart an execution, it seems to keep loading the first one when I launch the execution. The only way I can do this is by restarting the GUI.
    I read a lot and tried many things and I can’t figure out what do I need to do to have the sequence file reload from disk on the 2nd execution after changes has been made.
    I tried many thing and it seems to work when I release the seq file 2 times (!). But, as expected, the 2nd time it get released, I get an error that the file was unloaded from the TestStand Engine. And the weird thing is that I don’t get the error when I run the 1st time or I don’t make changes to the seq file.
    Do you see anything wrong? Or have another suggestion how I could achieve that?
    Can I see which seq files are in the internal cache? That could be useful to debug.
    Thank you.
    A code snippet in C# is in attachement.
    Attachments:
    C#-code.rtf ‏2 KB

    A few more ideas:
    1) Are you perhaps using this file path with an ApplicationMgr or SequenceFileViewMgr API? You need to make sure that this file is not open by the ApplicationMgr or assigned to a sequencefileviewmgr as well. The applicationmgr or sequencefileviewmgr likely have a strong reference to the sequence file if you have assigned it or opened it with one of their APIs. You might want to try switching entirely to the applicationmgr APIs instead of using the engine APIs as that's probably less likely to lead to conflicts between the two.You could try ApplicationMgr.OpenSequenceFile() and ApplicationMgr.CloseSequenceFile().
    2) Have you tried this with a simple, empty sequence file and simple default Sequential process model to verify that it's not related to anything in the sequence file you are running or any code elsewhere in your application? It's possible for code in the sequence or process model itself to be calling GetSequenceFile or GetSequenceFileEx.
    3) Have you tried adding a delay between WaitForEndEx() and ReleaseSequenceFileEx()? This is not that likely to be the cause, but perhaps there is additional code required to execute in the execution thread after WaitForEndEx returns before the sequence file can be unloaded. If you add a small delay (i.e. Thread.Sleep(1000) between those lines of code it might work. This would not explain why the file couldn't be reloaded when you use GetSequenceFileEx with the UpdateFromDisk flag though so probably is not the problem.
    I tried to reproduce this problem in the sequence editor by running an
    execution with a sequence file, closing the sequence file, overwriting
    it with a different sequence file and reopening it and I was unable to
    reproduce the problem. I got the new file opened as expected. This is
    the equivalent situation since there is a completed execution still
    open. The sequence editor does not use the Unload flag on
    ReleaseSequenceFileEx, but it does use the UpdateFromDisk flag on
    GetSequenceFileEx() and it seems to work, correctly loading the new
    version of the file in this case. So there must still be something different in your case. I suspect that it's not the execution that has the extra reference in your case, but something else, perhaps the ApplicationMgr or SequenceFileViewmgr.
    Also, as a side issue, if you are writing a custom UI, I'd recommend using UIMessages to determine when an execution completes rather than WaitForEndEx(). Basically handle the ApplicationMgr.UIMessageEvent and look for UIMsg_EndExecution and check that the execution associated with the UIMessage is the one you care about. Using the UIMessage like this has a couple of advantages:
    1) It allows your UI to go back to executing in it's main message processing loop (Some things will not work correctly without this).
    2) It gives you the potential to track and handle running multiple executions in parallel. Just look for and track the multiple UIMessages that such executions generate.
    Please let us know if any of these ideas helps or if you are able to figure out the cause of the problem. If you are still unable to get it working and can't figure out the cause, please attach an example program and sequence files which reproduce the issue.
    Hope this helps,
    -Doug
    Message Edited by dug9000 on 03-02-2010 10:03 AM
    Message Edited by dug9000 on 03-02-2010 10:04 AM

  • To pass parameter values to the object reference of action step in sequence file of teststand programatically using C#.

    //Initialize the Engine
                EngineClass myEngine = new EngineClass();
                myEngine.LoadTypePaletteFilesEx(TypeConflictHandlerTypes.ConflictHandler_Prompt, 0);
                Step myStep = myEngine.NewStep(AdapterKeyNames.DotNetAdapterKeyname,StepTypes.StepType_Action);
                myStep.Name = "object";
                DotNetModule dotnetmodule = myStep.Module as DotNetModule;
                dotnetmodule.SetAssembly(DotNetModuleAssemblyLocations.DotNetModule_AssemblyLocation_File,@"C:sequence.dll");
                dotnetmodule.ClassName = "CN";
                dotnetmodule.MemberType = DotNetModuleMemberTypes.DotNetMember_GetProperty;
                dotnetmodule.MemberName = "ISI";  
    mySequence.Locals.NewSubProperty("object", PropertyValueTypes.PropValType_Reference, false, "", 0);        
    Sequence mySequence = myEngine.NewSequence();
                mySequence.Locals.NewSubProperty(varName, PropertyValueTypes.PropValType_Reference, false, String.Empty, 0);
    mySequence.InsertStep(myStep, 0, StepGroups.StepGroup_Main);
                SequenceFile seqFile = myEngine.NewSequenceFile();
                seqFile.InsertSequence(mySequence);
    seqFile.Save("C:\\mySeq.seq");
    I have done this,dynamically creating a sequence file in teststand programatically through c#.
    Problem is
    1.I created an action step and object Reference variable for the step, but i am not able to pass  parameter values to the objectReference 
    2.I am not able to load the sequence in to the main Sequence of the sequence file in the teststand. How can I do these two things.

    Hi,
    have you ever followed on my Links ?!?!?
    If not please jump to this one
    http://forums.ni.com/ni/board/message?board.id=330&thread.id=26880 
    and read the the answer from Mannoch
    starting with this words:
    Anthony -
    Currently, functionality for retrieving the Metadata Token for a class constructor or member is not fully provided in the TestStand .NET Adapter API. The DotNetModule.GetConstructorMetadataToken() and DotNetModule.GetMetadataToken() methods only return the correct Metadata Token when the member/constructor prototypes have already been loaded. Thus, in the case of your code, when you call DotNetModule.GetMetadataToken(), the method is returning -1 because the member prototype for the Step you are referring to has not yet been loaded.
    That means have to do a workaround for your stuff.
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • How can I restore FileGlobals in a Client Sequence File that is reloaded?

    Hi,
    I'm using TS2.0.1f1 and dynamic client files (search "DynamicClientModel" to see an example) in order to load different test sequences depending on what product should be tested.
    We do something like this,
    newseq = IEngine.GetSequenceFile(...)
    Execution.ClientFile = newseq
    Do testing
    IEngine.ReleaseSequenceFileEx(newseq)
    Goto
    The first time a client sequence file is loaded it will copy the default FileGlobals from RunState.ProcessModelClient.Data.FileGlobalDefaults (TS does this automatically).
    The problem though is that after calling ReleaseSequenceFileEx() the actual sequence isn�t really disposed. Since when we later start over with another prod
    uct that uses the same client sequence file the GetSequenceFile() call returns the same copy that was used before and doesn�t copy the FileGlobals from RunState.ProcessModelClient.Data.FileGlobalDefaults, there by the second time the same sequence file is used, the FileGlobals don�t have there default values.
    So, to get back to the subject, how can I make sure that the second time around the FileGlobals have there default values?
    (Keep in mind that all this is done within the same execution of the processmodel.)
    I�ve included a short demonstration of this in the attached zip file.
    Any help appreciated.
    Cheers,
    Hans
    Attachments:
    TestModelFileGlobals.zip ‏12 KB

    Hi Scott,
    Thanks for the answer, I had been thinking about option nr 1 in particular but that would require more changes than I'm prepared to do right now.
    I tried option nr 2, but instead of adding that line to the client sequence file I made the copy operation in the process model like this.
    Execution.ClientFile = Locals.ClientSeq
    Locals.ClientFileGlobalsRef = Execution.GetFileGlobals(Locals.ClientSeq)
    Locals.SerializedCopy = ""
    [RunState.ProcessModelClient.Data.FileGlobalDefaults] PropertyObject.Serialize(Locals.SerializedCopy, "Test", 0)
    [Locals.ClientFileGlobalsRef] PropertyObject.Unserialize(Locals.SerializedCopy, "Test", 0)
    This seems to do the trick, although option nr 2 does seem a bit like doing things the way they weren't
    supposed to be done.
    Regarding option nr 1, are there any �Best Practice� documents, guides or examples on how one should best manage Engine and Execution lifetimes? Or to put it differently when to spawn new Executions and or Engines during the span of working with several units of the same product type and/or different product types?
    Cheers,
    Hans

  • How do I find the path to a TestStand sequence file using LabVIEW

    My LabVIEW application launches a bunch of teststand sequences, provided it has the complete path to each of them. I want to make it more flexible by providing it just the name of the TestStand sequence so that it will go and find the path to the sequence by searching a directory structure. TestStand has a neat FindFile() function that can do this, but I need to do this from within LabVIEW. Is there a way to do it?

    There are a few ways to do this depending on how you are getting the sequence files.  If you are calling the GetSequenceFileEx method, you can just pass the GetSeqFile_FindFile (0x20) flag in the SequenceFileFlags property.  If you are using the ApplicationMgr.OpenSequenceFile method, this is automatically done for you.
    If you want to use the FindFile function in general, you can use the Engine.FindFile method.
    Allen P.
    NI

  • Edit Items in TestStand Sequence File Combo Box?

    Hello All,
      I am creating a basic user interface VI Project, based off of the examples included with TestStand.  In the "Simple" example, there is a Open Seq File button, and an associated combo box to select the Sequence File to run.  For my application, I would like to limit the sequence file options from which the operator can choose (not allow the operator to browse the entire hard drive to find a sequence file).  Using basic Labview functions, I would have done this with a regular combo box, and use the "Edit Items" option to load file options into the drop-down menu.  However, the TestStand UI combo box does not allow this, presumably because it is an ActiveX control, and configuration is different from normal Labview functions.  Is it possible to pre-load the TestStand UI combo box with allowed sequence files?  Or, if there are other suggestions on how to accomplish the requirement, I am open to them as well. 
    Thanks in advance,
    GSinMN       

    One idea is to use the native LabVIEW controls.  Then hide the TestStand UI controls and update them from the events triggered by the native LabVIEW controls. I have had to do this before on UIs when the customer wanted a certain look and feel.
    So basically have the native LabVIEW combo box set like you want.  When the user makes a selection, in the event for that selection update the hidden TestStand Sequence File Combo Box witht he correct sequence file.
    Another option is to use events for the Sequence File Combo Box and just filter and force certain behavior.
    Hope this helps,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • How to launch a specific TestStand sequence file from command line?

    I've written a TestStand sequence file launching other sequence files.
    When I launch it via the TestStand GUI, it works well.
    Now, I would like to launch it via command line. Could you indicate me how to proceed?

    Hi,
    I think this link can help you:
    How to Run a Sequence File When Opened from Windows Explorer
    http://digital.ni.com/public.nsf/websearch/146D372C1F807E6D862567E7004881AB?OpenDocument
    regards,
    Alexandre D
    NIF

  • Help:set up simple test sequence, operator selects particular test then teststand links to part of sequence file and performs test

    Hi,
    I am extremely new to TestStand, please see question below and offer advice.
    I want to set up a simple test sequence.
    I want a message to popup on screen that asks the operator which unit of 6(max 10) Units to test(i.e. there are say 6-10 box's to select from).
    Then the sequence goes to the particular part of the sequence and performs the test on which ever unit was selected.
    What is the best way to do this?
    Could i use message popups to do this?and if so what do i need to do link it to the correct part of the sequence file?
    Do message popups only allow 6 options to select from?
    Thanks,
    Solved!
    Go to Solution.

    Hi,
       You can do using message popup method. You can ask the user which unit want to execute by inserting message in message expression in message popup step settings.Something like below
    "Enter unit number to execute 
     1.  Unit1
     2.  Unit 2
     10. Unit 10"
    then check "Enable response text box" from options tab in step settings.When user enters unit number you can get the user entered value by inserting the below statement in post expression of message popup step settings
        Locals.String = Step.Result.Response 
        Note : String is a local variable to be defined.
    Convert that string in to number and send that output to switch expression there by you can use a sequence call step to call sequence whichever to be executed. (I hope your each unit will be seperate sequence file)
    I hope these resolves your problem. If you don't understand let me know so that I can develop a small example and send it to.
    Cheers,
    krishna 

  • Sequence files documentation in TestStand 4.0.1

    How can I generate sequence files documentaton in TestStand 4.0.1 for all sequences from particular workspace (tests suite) in automatic way? Is there any seqence already written or mayby TestStand 4.0.1 provides some extention of sequence files documentation tool known from TestStand 3.x

    It's not trivial, but if you look at the ForEach.seq tool sequence (Components\NI\Tools\ForEach.seq) you can use that as an example of enumerating all .seq files under a particular directory and performing an operation on them. That tool opens and resaves all the sequence files under a particular directory. With some work it could be made to generate sequence file documentation instead. Also I think there's a sequence in ForEach.seq that you could call to get back an array of all sequence files' absolute paths under a particular directory which you could then loop on and call into the documentation sequence with.
    Hope this helps,
    -Doug

  • How to pass value for value field of return parameters for an action step in teststand sequence file programatically using c#

    I used a method LoadPrototypeFromMetaDataToken(token,options) to load the return type parameters. I am unable to set the value field in the return parameters for an action step in teststand sequence file programatically using C#.How can I do that.

    Continue here

  • Is it possible to create a distributi​on kit or executable file out of a Teststand sequence file that uses CVI standard prototypes​?

    How can i create an executable file or distribution kit of a sequence file in teststand?. I'm using CVI standard prototypes.

    If you want to distribute your sequence files to other machines, there are a few things you must consider.
    1. Create a TestStand Run-Time Engine installer. You can do this by selecting Tools>>Run Engine Installation Wizard.
    2. Distribute your Operator Interface.
    3. Distrbute your code modules (in your case CVI) and sequences.
    We do not have a tool similar to that of Assemble VIs for Distribution for CVI. You will need to ensure that all of your code is copied to the target machine and that TestStand is able to resolve the paths for where these files are located (i.e. Configure>>Search Directories).
    PLEASE REFER TO THE CHAPTER IN THE TESTSTAND USER MANUAL TITLED "DISTRIBUING TESTSTAND".

  • Programatically select a step in a sequence in a sequence file loaded in TestStand sequence editor using C#

    Hi all,
    I have written C# code to load a sequence file dynamically in TestStand Sequence editor. The code is as follows...
    myEngine.PostUIMessage(mySequenceContext.Execution, mySequenceContext.Thread, UIMessageCodes.UIMsg_OpenWindows, 0, null, mySequenceFile, true );
    The code is working fine and I could view the Sequence file opened in TestStand Sequence editor.
    Now, I wish to select one sequence in the opened sequence file to get the details of  the sequence programatically. In other words, I want to simulate a mouse click to a sequence and view the steps associated with that sequence.
    Can anybody give some clues...
    Thanks in advance.

    Hi,
    Also I am getting error like "Index out of range. Source:  TSUISUPP.SelectedSteps   at NationalInstruments.TestStand.Interop.UI.Support.SelectedSteps.AddStep(Step val)". Error code: "-17500; Operation Failed." My code is like
    mySequenceFile = myEngine.GetSequenceFileEx(@"D:\dynamic loaded sequence.seq", 0, TypeConflictHandlerTypes.ConflictHandler_UseGlobalType);
    mySequence = mySequenceFile.GetSequenceByName("First");
    Step myStep = mySequence.GetStep(2, StepGroups.StepGroup_Main);
    SequenceContext mySequenceContext = mySequenceFile.NewEditContext();
    mySequenceContext .AsPropertyObject();
    myEngine.PostUIMessage(mySequenceContext .Execution, mySequenceContext .Thread, UIMessageCodes.UIMsg_OpenWindows, 0, null, mySequenceFile, true);
    ApplicationMgr applicationMgr = (ApplicationMgr)myEngine.GetInternalOption(InternalOptions.InternalOption_ApplicationManager);
    SequenceFileViewMgr sequenceFileViewMgr = (SequenceFileViewMgr)applicationMgr.GetSequenceFileViewMgr(mySequenceFile);
    sequenceFileViewMgr.SelectedSequences.Clear();
    sequenceFileViewMgr.SelectedSequences.AddSequence(mySequence);
    sequenceFileViewMgr.SelectedSteps.AddStep(myStep);
    I am sure that my Sequence selected in the Sequence file loaded has more than 2 steps. Please help me in solving this problem and that in the previous post.
    Thanks,
    Biju kuttan

  • Know steps names of called sequence file using sequence call step type in TestStand

    Hi,
        I have a problem in accessing step names in called sequence file using "Sequence call"step type in TestStand 4.0.
    I would list out all step names of called sequence file. Is it possible to do through C#.NET? If, yes, Please explain to me in detail with possible example.
    Thank you,
    regards
    RKK

    Hey RKK,
    I want to first set your expectations for the forums.  This is not a place for people to review and rewrite your code for you; this is a place for specific and general questions.  I am not saying your question in this thread is inappropriate, because it is a good questions.  We should just not post code and ask others to fix it here.  If you are looking for this type of service we have alliance members that can help you write your TestStand Operator Interface (www.ni.com/alliance).
    As for you question about getting the sequence names for a sequence file that is not the currently running sequence file, you will need to open a reference to that sequence files and then use the API calls that I mentioned in my previous posts.  You can use the Enigine.GetSequenceFileEx function to open a reference to sequence file, and you will need to close the reference with the Engine.ReleaseSequenceFile function when you are done using it.  After you have a reference to this external Sequence File, you can use the example dll and sequence I previously sent you.  I also attach a new sequence file (SeqFile2.seq) plus an updated GetNames.seq to illustrate how to use the above mentioned functions.  I hope this helps.  Have a great day!
    Best Regards,
    Software Engineer
    Jett R
    Attachments:
    GetNamesOfSequencesInFile.zip ‏52 KB

  • How to load programmat​ically from CVI the specific sequence file in TestStand 3.1

    I am trying to implement TestStand from Windows/CVI 3.1. I need to insert a specific sequence file in TestStand, with all other sequences unloaded. I used TSUI_ApplicationMgrCloseAllSequenceFiles() and TSUI_ApplicationMgrOpenSequenceFile(), but after Username/Password prompt, the TestStand loaded all the old sequences. How to eliminate this?

    Hello,
    I created a function that calls those two methods. When I made a simple CVI button and in a callback for it, I call my function, it does successfully close all open sequencefiles and then load the one I specified; however, it does not work when I call the function just before the call to RunUserInterface! I am very surprised by this and will be bringing it up with our R&D department. There is a simple work-around. Instead of closing all open sequencefiles at the beginning of the OI, close them at the end instead. I have modified the full-featured OI for you and tagged in the code where I made changes. This should do exactly what you want (you may want to change the code around to make it a little cleaner...I left more in code in than I needed for instructive purposes). Please let me know if you have any questions about this. Take care!
    Regards,
    Aaron B.
    National Instruments
    Attachments:
    TestExec.c ‏55 KB

  • TestStand 2.0 Engine deleting sequence files on shutdown?

    TestStand 2.0.1
    We're running into quite a bizaar problem where TestStand sequence files seem to vanish from the filesystem after exiting TestStand. We haven't been able to reliably reproduce the problem, but occasionally after we run some tests either using the operator interface or sequence editor, either the sequence file we were running, or another sequence file in that same directory gets deleted. Has anyone else seen anything like this?
    --Peter

    That sounds like a very unique issue. I have a few questions for you.
    Is it only one sequence file that gets deleted? If the sequence file you are running does not get deleted, but another one does, is it always the same files every time that gets deleted?
    If we can get this nailed down to a pattern, we can probably figure out
    what is causing this issue. One other thing that would be worthwhile
    checking out is if this problem is limited to just one computer or
    multiple computers. Is your testing station limited to just the one
    computer? If not, does this problem happen on multiple machines?
    Another thing you might want to try is to put each sequence file in a different directory. If you have the sequence files in different directories, does the problem still occur?
    Russell G.
    NI Applications Engineering

Maybe you are looking for