TestStand interop threading conflic

Ok, I'll detail my project first and then introduce my dilemma:-
I am creating a driver to control some environmental chambers (sort of like a small class driver). I need to be able to set parametres for this driver eg. temperature, max humidity alarm, dew point alarm etc.etc... Having "set it off", I want to continue executing whatever testing needs to be performed; there is no necessity for the driver to discuss anything more with TestStand, it knows what it needs to do and will get on with it. At some point in the sequence, I will likely access some properties in the class, so that I know what the temperature is or if the device has reported any errors etc.ect..
Problem:- For the class to continue to "supervise / control" it's device, it needs to be working in it's own thread. I have proven that this isn't the case, even though the data is persistent.
If I try and create my own thread to instantiate my class in:-
myClass = new myClass();
Thread myThread = newThread(new ThreadStart(myClass.myMethod()));
there apears to be some conflict with the threading in the interop api:-
Error    
 1 The type or namespace name 'ThreadStart' could not be found (are you missing a using directive or an assembly reference?)                  
Error
2 Cannot create an instance of the abstract class or interface 'NationalInstruments.TestStand.Interop.API.Thread'    
I have tried using system.threading and any combination I could think of but its never happy even pre-compile time.
I can't be the first person to want to do this, so my question is: How ? or, am I approaching this driver in the correct way ? Is there some other way of doing what I want to do ?
Many thanks
Solved!
Go to Solution.

LizzardSB wrote:
Thanks Doug,
Yes, this was the line of thought I was going down; there is no "using system.threading", I removed this early on to get rid of another array of errors. I have also tried being more explicit as you say:-
NationalInstruments.TestStand.Interop.API.
Thread myThread = new NationalInstruments.TestStand.Interop.API.Thread(new NationalInstruments.TestStand.Interop.API.ThreadStart(myClass.myMethod)));
Here are the errors:-
Error 1 The type or namespace name 'ThreadStart' does not exist in the namespace 'NationalInstruments.TestStand.Interop.API' (are you missing an assembly reference?)
Error 2 Cannot create an instance of the abstract class or interface 'NationalInstruments.TestStand.Interop.API.Thread'
I found this from the interop Api:-
// Summary:
//     Threads are elements of an Execution. Each thread maintains a call stack  
//     that contains a SequenceContext object for each active sequence invocation. 
//     You can obtain a thread of an execution by calling the Execution.GetThread
//     method.
Looking at the public interface, I can see that there are a number of thing you can do with your existing thread eg.
DisplayName, Resume etc.... but it's not clear of how to create a new one ? There is no Execution.GetThread.
You are using the wrong class. You don't want the National Instruments version of the Thread class in this case, you want the .NET framework one. These are Microsoft APIs you are trying to use, not National Instruments ones. If you want to create a TestStand thread then you need to use completely different APIs.
Probably something more like the following in order to use Microsoft's APIs:
System.Threading.Thread myThread = new System.Threading.Thread(new System.Threading.ThreadStart(myClass.myMethod)));
-Doug

Similar Messages

  • Why can not find "NationalInstruments.Teststand.Interop.API" when add it from C# referenes

    Hello experts,
    I would like to learn to how to use C# IN teststand,and find an instructio about how build dll in C#.
    It said add  "NationalInstruments.Teststand.Interop.API" reference in C# references.
    However,it can not be found as attached.
    Who can help about this,appreciated for your help.
    Attachments:
    0140710152735.png ‏127 KB
    0140710152735.png ‏127 KB

    Hey Albert,
    The corresponding assembly is in your first screenshot, listed as "TestStand 2013 API Primary Interop Assembly". 
    Hope it helps, and let us know if you have any more questions about it!
    Daniel E.
    TestStand Product Support Engineer
    National Instruments

  • Teststand New Thread VS LabVIEW "Call & Forget" Asynchronous call

    Hi everyone,
    Here is an example taken from the ni.com website showing how to use LabVIEW to post a TestStand Notifier.  I have modified the example to fit the situation I needed to use it for.  I have an example which works fine (When I use a TestStand new thread to launch the Notifier VI) and an example which does not work (When I use a LabVIEW "Call & Forget" Asynchronous call to launch the Notifier VI).
    I would like to understand why it doesn't work in the second situation. The reason why I would prefer the 2nd situation which currently doesn't work is that I try to eliminate all multi-threads from an obsolete sequence written by someone else a few years ago so that I can troublesoot it and update the code to make it work with today's new reality.
    Also, for my personal knowledge.  I don't understand why the second strategy doesn't work.  The Testsand notifier reference is the same and hadled the same way.  I have included my example files with the 2 situations in seperate sequences files.
    Thanks in advance to the person who will be able to enlight me.
    Nien 
    Solved!
    Go to Solution.
    Attachments:
    New Thread Or Dynamic Call.zip ‏41 KB

    Hello Nien,
    This isn't a TestStand issue.  I suggest you take this to the LabVIEW forum.  Looking over your code your Notifer and Forget.vi is dependent on the notifier.vi.  So it's not necessarily anything wrong with the sequence steps but actually within your LabVIEW code itself.  One suggestion is to insert a simple error handler.vi in your Call Notifier and Forget.vi.  You have error wires connected to the functions itself, which is good practice but you don't have anything to inform you if an error occurs or not.  I would suggest you to run try to debug your LabVIEW code, such as using highlight execution, while you're running your code so you know where exactly the error is happening.  
    Thanks,
    Jonathan R.
    Applications Engineer
    National Instruments

  • TestStand Sequence Thread Termination

    I have created a Sequence which launches a VI to run in a parallel/background thread. This sequence gets called in my Main Sequence. In my Main Sequence, I'm trying to figure out how to terminate the background thread after the main sequence has completed all of its actions. The background thread has no pass/fail criteria, its is essentially a polling VI which is supposed to share a Queue which contains data telling the VI what to do.
    Before trying to implement this into Teststand, I successfully created an application which launches a background VI using VI server. Using Queues, I'm able to terminate and pass data to the VI running in the background from the Main VI. I'm essentially using the same approach in Teststand with no success in being able to terminate the parallel thread. Can parallel threads use the same Queue reference?
    Thanks
    Peter.

    Hi Buzz,
    Here's an example I was using awhile back to demonstate a problem. But it might help you in your solution.
    The example starts a dialog panel in a new execution. The MainSequence carries on and does something else.
    The user has the option to press the button on the dialog to close the new execution, or the mainsequence will come to an end then terminates the new execution.
    Hope it helps
    Regards
    Ray Farmer
    Regards
    Ray Farmer
    Attachments:
    StopNewExecution.seq ‏41 KB

  • Reporting pass/fail information from threads in Teststand logs

    I am fairly new to Teststand.  I am just getting started on threading techniques in TestStand. Previously, task A and B were running sequentially. To improve program run time, I am splitting the tasks into thread A and thread B.  In the sequential version of the program, task B is running certain steps and logging to a Teststand log file.  After I split the tasks into their threads, thread B does not perform the logging feature.  Before the thread split, task B would log each error using
    RunState.Step.Result.ReportText feature.   This logging thread is the last step before thread A and B rendezvous.  How do
    I enable the logging in Teststand for thread B?

    I'm not sure if you need the rondezvous or not without knowing your program design.  It may not be neccessary.  Any sequence call that calls into a new thread will need a Wait step if you want if you want it in the report.  It sounds like you don't need the rendezvous without knowing any more information.

  • How to start TestStand ApplicationMgr in a NON-GUI C# modules

    hello all,
    We used to implement our test UI in C# windows form. We put ApplicationMgr ActiveX control on the form and the ApplicationMgr can be easily accessed and started.
    Now we need to implement the UI in WPF and we have to seperate the UI and the Test Engine into different module so that the UI can call different type of Test Engines later. Therefore we have to implement the TestStand TestEngine module in a NON-GUI module. In this module we need to load a sequence file, run the sequnece file, collect test results and send back to UI to display.
    To implement this module we have a lot of questions:
    1. Is ApplicationMgr a must-have for our purpose of loading, running sequence and getting test results?
    2. Can AppliactionMgr be created in a NON-GUI module?
    3. Can we use
    NationalInstruments.TestStand.Interop.UI.Applicati
    onMgr myApplicationMgr = new NationalInstruments.TestStand.Interop.UI.ApplicationMgr();
    myApplicationMgr.Start()
    to create and start the ApplicationMgr? We have tried, but unfortunately it is not working. What did we miss?
    4. Is the ActiveX control the only way to access the ApplicationMgr? For NON-GUI module, there must be a way that we didn't find yet. Anyone have help us point to a right direction? If some example code would be great!
    Thank you very much!
    Regards,

    The ApplicationMgr makes a lot of things simpler, so I highly recommend you use it even if you aren't displaying a UI with it. You can create the control on a hidden form as follows (assuming your thread is an STA thread):
    System.Windows.Forms.Form hiddenForm = new System.Windows.Forms.Form();
    NationalInstruments.TestStand.Interop.UI.Ax.AxApplicationMgr appMgr = new NationalInstruments.TestStand.Interop.UI.Ax.AxApplicationMgr();
    ((System.ComponentModel.ISupportInitialize)(appMgr)).BeginInit();
    hiddenForm.Controls.Add(appMgr);
    ((System.ComponentModel.ISupportInitialize)(appMgr)).EndInit();
    This way you can use the ApplicationMgr without showing anything to the user.
    Hope this helps,
    -Doug

  • 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

  • Passing strong type c# object to teststand

    I am fairly new in teststand and this question that I have is critical part of the project that I am working on.
    First, I am using C#.NET in VS2008 and NiTestand 4.2.
    What I am trying to do, passing custom object from C#.NET to the sequence.
    here is my code from c#:
            private void axApplicationMgr_DisplaySequenceFile(object sender, NationalInstruments.TestStand.Interop.UI.Ax._ApplicationMgrEvents_DisplaySequenceFileEvent e)
                SequenceFile sf = e.file;
                PropertyObjectFile pof = sf.AsPropertyObjectFile();
                PropertyObject po = pof.AsPropertyObject();
                po.NewSubProperty("Locals.Test", NationalInstruments.TestStand.Interop.API.PropertyValueTypes.PropValType_Reference, false, "", 0);
    //setting up of test station
    TestStation ts         = new TestStation();
     ts.Name = "sample1";
       po.SetValInterface("Locals.Test", 0, ts);
                axSequenceFileViewMgr.SequenceFile = sf;
                //learn passing data object to sequence
    Inside sequence I want it to display the ts.Name, so I am sure that the value of the object is still intact.
    And also, what do you suggest the handling of error of this object? what event in TestStand API.
    Attached is the sequence and the .net object
    Thanks in advance for your help. 
    Attachments:
    samplesequence.zip ‏8 KB

    Hi mdba,
    It looks like you're using TestStand to call a DLL that calls into the TestStand API.  If that's your objective, you can just achieve that much more simply with a Statement step in TestStand.  
    What is the TestStation class?  Is that one that you created yourself? 
    What is your overall goal of this DLL?  It looks like you are trying to store the Station ID in a local variable.  If so, TestStand tracks this on its own and you can access it with the StationOptions.StationID property.  
    Mark E.
    National Instruments
    Schedule a Free 1-Hour online LabVIEW Tutorial with an NI Applications Engineer

  • Pass object reference from TestStand to C#

    Hi,
    I have created a GUI in .NET which i invoke in TestStand (through a custom step type). User can enter a object reference teststand variable in the UI input expression box. So i need to get the object value in that variable and use it to call some .net functions. To get the values from expression box of UI and put in TestStand step variable i use:
             PropertyObject.SetValInterface("Step.TestStationObj", 0, tsexprTestStationObj.DisplayText.Trim()); To check the value in the step variable if i do:
             MessageBox.Show("TestStation obj after setting:",PropertyObject.GetValInterface("Step.TestStationObj",0).ToString());
    But i do not get any value. Guess it is null. Is this a correct way? My intension is to get the value corresponding to a teststand object reference and pass it to C#. The C# UI control is of type NationalInstruments.TestStand.Interop.UI.Ax.AxExpressionEdit

    Thanks Andy.
    I still get the error when i am trying to pass the object created from C# to Teststand. I have explained what i am trying to do. Kindly requesting your assitance on this issue.
    I have 2 classes in C# (code given below), I am trying to pass the object of "Counter" (c1) class from the "Mainfrm" to teststand. In teststand(counter.seq), I am trying to access the function "GetCount() and SetCount()". I have attached the snapshot of the error that i get from teststand.
    Class Counter
        private int count;
        public int GetCount ()
           return (count);
        public void SetCount(int _count)
           count = _count;
    Class Mainfrm : Form
        public Counter c1;
            private void Mainfrm (object sender, EventArgs e)
                InitializeComponent();
                axApplicationMgr1.Start();
                mEngine = axApplicationMgr1.GetEngine();
                currentFile = axApplicationMgr1.OpenSequenceFile(@"Counter.seq");
                pobj = mEngine.NewPropertyObject(NationalInstruments.TestStand.Interop.API.PropertyValueTypes.PropValType_Container, false, "", 0);
                pobj.NewSubProperty("Parameters.ObjRef1", NationalInstruments.TestStand.Interop.API.PropertyValueTypes.PropValType_Reference, false, "", 0);
                pobj.SetValInterface("Parameters.ObjRef1", 0, (object)c1);
                mExecution = mEngine.NewExecution(currentFile, "MainSequence", null, false, 0, pobj, null, null);
    Attachments:
    ErrorFromTestStand.JPG ‏28 KB

  • A simple teststand applicatio​n passing object reference to C#

    Hi,
     I have a  .NET application written in C# which has a UI with  NationalInstruments.TestStand.Interop.UI.Ax.AxExpressionEdit controls. This UI is invoked by a custom step in TestStand. One of the values, entered by user in the UI is a object reference variable created in a previous step. I need to store the values entered in the UI during the edit mode of the step, into the TestStand Step variables. And during the run mode i use these values to execute the logic in C#. 
    The problem is during edit time, the object reference variable, entered in the UI, has no value. It is null. So there is no use storing it at edit time. During the runtime i am trying to retrieve the value of the object reference variable using GetValInterface(...) and GetValIDispatch(..) methods of PropertyObject. But the object returned to C# is of type System.__COMObject wherease in TestStand that object reference is of type .NET.
    I don't know how a .NET object reference is converted to COM object when it is returned to .Net function.
    Also is there any other method to send this object reference variable's (whose value is '.NET' in previous step itself) value to .NET as a .NET object only so that i can typecast to appropriate type and start using.
    Thanks.
    Please let me know if anything is not clear.
    I have attached the .Net project, .ini file for the custom step and a example sequence file.
    Attachments:
    CCustomStepObj.zip ‏23 KB

    Hello Shivapriya,
    The example you've sent doesn't compile. And it without it I'm affraid I do not understand the problem you're describing.
    You've given references to libraries that you've not attached with your files.
    For the C# I see these are the
    IADCore.dll
    InstrimentInterfaces.dll
    TestStand also seems to want to reach for the assembly named TestSystem.dll.
    I can only tell you that I have used successfully in the past the Variables in TestStand to hold .NET object references, and call methods on them and I experienced nothing similar that you describe, but I don't quite follow what is the problem here, as I can't use the example. 
    I would appriciate if you cold narrow down the example to 1 dll or something where the problem occurs and than resend it.
    Regards,
    Maciej 
    Message Edited by Mac671 on 09-28-2009 02:59 AM

  • Verifying teststand installation before initializing applicationMgr

    Hi,
    I'm having an issue with my custom .NET console when it is deployed on a station and TestStand is not installed.
    It seems to crash in the MainForm class when InitializeComponents() function is called.
    It crashes on the line in bold:
                // MainForm
                this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(191)))), ((int)(((byte)(219)))), ((int)(((byte)(255)))));
                this.ClientSize = new System.Drawing.Size(1014, 732);           
                this.Controls.Add(this.axApplicationMgr);
                this.Controls.Add(this.mainSplitContainer);
                this.Controls.Add(this.statusStrip1);
                this.Controls.Add(this.menuStrip);
                this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                this.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(54)))), ((int)(((byte)(60)))), ((int)(((byte)(146)))));
                this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
                this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
                this.MaximumSize = new System.Drawing.Size(1440, 900);
                this.Name = "MainForm";
                this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                this.Text = "GEMINI - Alstom Montreal";
                this.Load += new System.EventHandler(this.MainForm_Load);
                this.Closing += new System.ComponentModel.CancelEventHandler(this.MainForm_Closing);
                this.menuStrip.ResumeLayout(false);
                this.menuStrip.PerformLayout();
                this.statusStrip1.ResumeLayout(false);
                this.statusStrip1.PerformLayout();
                this.mainSplitContainer.ResumeLayout(false);
                ((System.ComponentModel.ISupportInitialize)(this.axApplicationMgr)).EndInit();
                this.ResumeLayout(false);
                this.PerformLayout();
    When I deploy the console, the following TestStand dlls are deployed with the console executable:
    NationalInstruments.TestStand.Utility.dll
    Interop.TSSyncLib.dll
    NationalInstruments.TestStand.Interop.API.dll
    NationalInstruments.TestStand.Interop.UI.dll
    NationalInstruments.TestStand.Interop.UI.Support.dll
    NationalInstruments.TestStand.Interop.UI.AxControls.dll
    Is this an expected behavior or a bug?
    Is there a way using the TS API to check if TestStand is currently installed (with or without valid license) on the station?
    Thanks for your help.

    I've add a try-catch in the InitializeComponents() function of the form.
    I believe, correct me if I'm wrong, that the error is in the activeX, so not easy to debug since I can't trace in it.
    I've attached the error pop-up with stack trace.
    The dlls are from TS 4.2.
    Thanks.
    Attachments:
    axmgr.png ‏57 KB

  • C# interop get Step Name

    I am attempting to use a C# code module in order to read the calling step's name. However, my code only every returns "Step" as the name of the object (regardless of what the step is actually called in the sequence). Note that I have also tried doing the same thing to get the calling sequence name - and it always returns "Sequence". Where am I going wrong? Here is the code: (please see attachment for complete source and example TestStand sequence in the "Debug" folder.
    using System;
    using System.Collections.Generic;
    using System.Text;
    using NationalInstruments.TestStand.Interop.API;
    using System.Windows.Forms;
    namespace Test
        public class TestClass
            public void TestMethod(SequenceContext thisContext)
                PropertyObject pObj = thisContext.AsPropertyObject();
                PropertyObject stepObj;
                stepObj = pObj.Evaluate( "Step" );
                MessageBox.Show(stepObj.Name);
    As a bit of background, I am trying to retrieve the name of the calling step and the name of all Sequence calls all the way up the stack to the root. This same methodology works using Expression steps, but I want to hide all the mess into a single code module. Any ideas would be appreciated! 
    Thanks,
    Phil
    Solved!
    Go to Solution.
    Attachments:
    Test.zip ‏16 KB

    Hi Ray,
    Thanks for the advice. Unfortunately, I think I made my example a little too simplistic! Your solution is perfect for the Step Name case, unfortunately it will not work for what I am trying to do. I am writing a custom result logger that is called from the ProcessModelPostResultListEntry callback, and want to check whether the "RecordResult" option is enabled on all of the SequenceCall steps in the stack and whether each Sequence in the stack has the "RecordResults" option enabled. (Basically, Result Recording must be enabled at all levels for the result to be logged). You may think that the ProcessModelPostResultListEntry callback would only get called if this condition is met - unfortunately it is only affected by the most nested combination of the Step's "RecordResult" and the Sequence's "RecordResults" properties. Therefore, frustratingly, I need to check all the way up the stack back to the ProcessModel. The reson why this is more complex is that the Step and Sequence property objects further up the stack can only be accessed by using the Evaluate() Method, as opposed to the lowest level in the stack which can be accessed via thisContext.Step and thisContext.Sequence.
    Anyway, I worked it out in the end: Expressions within TestStand enable you to take a number of API shortcuts which are not available when using the API in another language - hence why I was able to use expressions like:
    Locals.SequenceRef = Evaluate( "RunState.Caller.RunState.Caller.Sequence" ),
    Locals.SequenceName = SequenceRef.Name
    Locals.SequenceRecResult = SequenceRef.RecordResults
    whereas similar code in C# did not work as expected (note that the RunState.Caller string above is actually built dynamically depending on the call stack depth).
    Being more explicit in C# does work correctly though:
    seqObj = pObj.Evaluate( "RunState.Caller.RunState.Caller.Sequence" );
    SequenceName = seqObj.Evaluate( "Name" ).GetValString("", 0 );
    SequenceReqResults = seqObj.Evaluate( "RecordResults" ).GetValBoolean( "", 0 );
    Although, in the process of writing this response, I have just found the following property:
    SequenceContext.CallerDiscardsResults
    "Returns whether any sequence in the call stack instructs TestStand to disable results or if any calling step up the call stack instructs TestStand to not record results"
    Typical! I think this may be an easier route to use!!!
    Thanks anyway,
    Phil
    Message Edited by monkeyslikebananas on 03-11-2009 01:40 AM
    Message Edited by monkeyslikebananas on 03-11-2009 01:41 AM

  • Csharp teststand 3.5

    Hello,
    I have a little problem to call Teststand 3.5 from visualstudio 2010 with c#.
    I tried with the following Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Runtime.InteropServices;
    // TestStand Core API
    using NationalInstruments.TestStand.Interop.API;
    // TestStand User Interface Controls
    using NationalInstruments.TestStand.Interop.UI;
    using NationalInstruments.TestStand.Interop.UI.Support;
    namespace WindowsFormsApplication1
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private void Form1_Load(object sender, EventArgs e)
    private void button1_Click(object sender, EventArgs e)
    NationalInstruments.TestStand.Interop.UI.ApplicationMgr tsmgr = new NationalInstruments.TestStand.Interop.UI.ApplicationMgr();
    NationalInstruments.TestStand.Interop.UI.SequenceFileViewMgr tssfmgr = new NationalInstruments.TestStand.Interop.UI.SequenceFileViewMgr();
    try
    tsmgr.LoginOnStart = false;
    //Must set user then Start, otherwise only Start will not work.
    User userToLogIn = tsmgr.GetEngine().GetUser("administrator");
    tsmgr.GetEngine().CurrentUser = tsmgr.GetEngine().GetUser("administrator");
    tsmgr.Start();
    tsmgr.OpenSequenceFile(@"c:\Projekte\Testplan\TS1.seq").GetSequence(0);
    tsmgr.GetCommand(CommandKinds.CommandKind_ExecutionEntryPoints_Set, 0);
    tsmgr.CloseSequenceFile(tssfmgr.SequenceFile);
    catch (COMException exp)
    MessageBox.Show("Error " + exp.ErrorCode.ToString() + ": " + exp.Message);
    private void button2_Click(object sender, EventArgs e)
    Close();
    The only Error which occoured is "Error -17500: Ausnahme von HRESULT: 0xFFFFBBA4" on the Line with
    tsmgr.Start();
    Which is the correct approach to start Teststand?
    King regards,
    René

    Have you tried the user interface examples that ship with teststand?
    If not, look at the following example. C:\Users\Public\Documents\National Instruments\TestStand <version>\UserInterfaces\Simple\CSharp
    This is always a good starting point.
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • TestStand Deployment problems on Windows 2K3 x64

    Greeings:
    I'm hoping someone out there can advise me.
    I recently tried building a TS application to deploy on a server running WIndows Server 2003 x64, and I have run into a few difficulties.  On my development system, (32-bit WInXP pro) I built a TS Deployment installer.  I transfered it to the destination machine.  Installation failed ... it said that numerous files were missing from different CAB files.  I tried again ...  the second time I had better luck ... the installation seemed to take.  Using the License Manager, I activated my installation using my development license (my deployment license hasn't arrived yet).  I tried launching my application, and I get an exception that seems to indicate the ActiveX dlls aren't registered:
    Unhandled Exception: System.Runtime.InteropServices.COMException (0x80040154): C
    lass not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
       at System.Windows.Forms.UnsafeNativeMethods.CoCreateI​nstance(Guid& clsid, Obj
    ect punkOuter, Int32 context, Guid& iid)
    I tried registering these manually using
    regsvr32 "D:\Program Files\National Instruments\TestStand 4.1\API\DotNet\Assemblies\CurrentVersion\NationalI​nstruments.TestStand.Interop.UI.AxControls.dll"
    but it complains that this DLL has no DllRegisterServer entry point.  (Is it the wrong DLL to register?)
     I tried uninstalling my deployment and installing the full teststand ... and SeqEdit seems to run properly.  (It must have registered the required DLLs, no?)  My app, on the other hand, still does not run. I am trying to install Visual Studio to see if I can rebuild the application on this system with better results.
    Have I missed an important step?
    Thanks!
    Tom MacLean
    Solved!
    Go to Solution.

    LabCat,
    That's correct.  If you have the build set as Any Platform, when you install that on a 64-bit machine, the project will try to load the 64-bit versions of those assemblies, which don't exist.  You have to make sure your project is building specifically for x86 so it will run properly on a 64-bit machine.  I believe TestStand 4.2 or 4.2.1 ships with OIs that have this set as the default setting in the .NET OI source code, but your earlier version may not have had that corrected.
    Eric B.
    National Instruments

  • Teststand Api GetNumElements

    Hi,
    have passed the Sequence Conetext (ThisContext) from Teststand to my C#-Dll (VS Studio 2005).
    In the DLL I want to walk through the Sequence Context item by item (like the tree view in the Context tab of the sequence editor).
    My idea was to ask the sequence context how many elements are existing in each level and then address each item by an index and ask for its type and do further processing.
    (If it is an container, just ask how many items are contained and so on...)
    I have tried this approach: 
      static public void MyFunc(ref SequenceContext MySequenceContext) {    int Index;     string lb, ub;    PropertyValueTypes type;     int NumOfSubproperties;     MySequenceContext.AsPropertyObject().GetDimensions("", 0, out lb, out ub, out NumOfSubproperties, out type);but I'm immediately getting this error:
        Exception has been thrown by the target of an invocation.
        Root Exceptionpecified value does not have the expected type.
        Source: at NationalInstruments.TestStand.Interop.API.PropertyObject.GetDimensions(String lookupString, Int32 options, String& lowerBounds, String& upperBounds, Int32& numElements, PropertyValueTypes& elementType)
        at xxx.yyy.MyFunc(SequenceContext& MySequenceContext) in C:\\yalayalayala\\xxx.cs:line 38 [Error Code: -17500, Operation Failed.]
    I alternatively tried this
      static public void MyFunc(ref SequenceContext MySequenceContext) {
        int Index;    string lb, ub;     PropertyValueTypes type;     int NumOfSubproperties;    NumOfSubproperties = MySequenceContext.AsPropertyObject().GetNumElements();This time the error was:
        Exception has been thrown by the target of an invocation.
        Root Exceptionpecified value does not have the expected type.
        Source: at NationalInstruments.TestStand.Interop.API.PropertyObject.GetNumElements()
        at xxx.yyy.MyFunc(SequenceContext& MySequenceContext) in C:\\yalayalayala\\xxx.cs:line 38 [Error Code: -17500, Operation Failed.]
    Isn't it possible to ask for each object, how many elements it has?
    Many thanks
    Thorsten
    Sorry, I forgot to mention, that I'm using Teststand 3.1...
    Message Edited by Tho_Wa on 09-29-2008 03:50 AM

    The Sequence Context is a container, not an Array.  The functions you are trying to use are meant for objects that are Arrays.
    You should instead use the following function:
    PropertyObject.GetNumSubProperties.
    To access each individual subproperty, you can use the following functions:
     PropertyObject.GetNthSubProperty
    and
    PropertyObject.GetNthSubPropertyName
    Allen P.
    NI

Maybe you are looking for

  • Headphone output not working on Audigy 2 ZS Platinum Pro

    I've installed the (only available) beta driver for Vista under Vista RTM, but can't get the headphone output to work at all... Sound keeps playing through the line out, but no matter what i do i can't get it routed through the headphone output. Is i

  • Personal Network Drives inaccessible

    Since the upgrade to Mavericks our network users are now unable to access their Personal Home Drives We have tried using the name of the server as well as the IP Address and neither are working for us. This was working before the upgrade.. ANy advice

  • Adobe Presenter 10 - Windows - Slides not auto advancing?

    Hello, I am having a lot of trouble getting my slides to auto advance. When I preview the presentation within PowerPoint (Adobe Presenter tab, Preview, Preview Presentation), everything looks fine, but when I publish and preview in the browser, the f

  • Can anyone provide a simple css file for Apex Application

    Hi, Can anyone provide a simple css file for Apex Application please don't mention W3schools link to learn... Regards, Pavan

  • I cannot create a LifeLog Account on my Z3 compact

    ... and according to reviews in German Google Play store, I'm not the only one. Whenever I try to log into LifeLog or to create an account, I get error messages, saying either my password or ID was wrong (they are correct, I have no problems logging