TestStand interop conflic thread

OK, I'll detail my project first, and then introduce my dilemma: -.

I'm creating a driver to control some environmental chambers (a bit like a small driver class). I need to be able to define settings for this driver for example. temperature, humidity max alarm, dewpoint alarm etc.etc... Having 'set it off', I want to continue to run some tests should be performed. There is no need for the driver discuss what more with TestStand, he knows what he must do and will get on with it. At some point in the sequence, I have access probably some properties in the class that I know what the temperature or if the unit has reported errors etc.ect...

Problem:-for the class to continue to "monitor / control" it's device, it needs to work in its own thread. I proved that this is not the case, even if the data is persisted.

If I try and create my own thread to instantiate my class in: -.

myClass = new myClass();

Thread myThread = newThread (new ThreadStart (myClass.myMethod (()));

It apears to be some collide with the thread in the api interoperability: -.

Error
1 the name type or namespace 'ThreadStart' could not be found (missing are you 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 tried using system.threading and any combination I could think, but its never happy even to the compile time.

I can't be the first person to want to do this, so my question is: how? Alternatively, I approach this driver in the right direction? Is there another way to do what I want to do?

Thank you very much

LizzardSB wrote:

Thank you Doug,.

Yes, it was the line of thinking that I was going down; There is no "using system.threading", I removed it from the beginning to get rid of another table of errors. I also tried being more explicit that say you: -.

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 name of the namespace or type "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 by the Api interop: -.

Summary:

The threads are elements of an execution. Each thread manages a call stack

that contains a SequenceContext object for each call in the sequence active.

You can get a thread of execution by calling the Execution.GetThread

method.

Looking at the public interface, I can see that there are a number of things you can do with your existing thread for example.

DisplayName, CV etc, but it's not clear how to create a new? There is no Execution.GetThread.

You use the wrong class. You do not want the version of National Instruments of the Thread class in this case, you want the .NET framework, one. Here's the Microsoft APIs you are trying to use, not National Instruments ones. If you want to create a TestStand thread, then you need to use any other API.

Probably something like more than what follows, in order to use the API from Microsoft:

MyThread System.Threading.Thread is new System.Threading.Thread (new System.Threading.ThreadStart (myClass.myMethod)));.

-Doug

Tags: NI Software

Similar Questions

  • How to determine the Thread of execution for PostUIMessage,

    Greetings:

    I'm trying to develop an application TestStand with two Interfaces (in addition to the sequence editor) user, and I need to be able to view messages from interface user back and forth between two user interfaces.

    So far I managed to create a user interface, and I can post messages for the user interface of a TestStand sequence to my user interface. large.  I spent the reference Application Manager in the constructor of the UI object.

    Now, I want a button on my first UI to cause a user interface message to send to my second UI... The PostUIMessage options I have are Engine.PostUIMessage or Thread.PostUIMessage... in both cases that I need the thread, I don't think I have unless I pass it explicitly in the constructor.  Ideally, I would like to pass only a single object in the constructor (to keep things simple).

    I tried to create versions of my first UI that pass the engine reference, or reference to the SequenceContext, but I seem to be impossible to extract the info that I need these.  For example, the SeqContext, in theory I can get the engine and the Thread, but when I try to get the reference of the AppMgr of engine

    TsEngine = seqContext.Engine;
    AppMgr = TsEngine.GetInternalOption (InternalOptions.InternalOption_ApplicationManager) (ApplicationMgrClass);

    I get the following exception:

    The instance of the .NET class could not be found.

    Impossible to object cast COM type 'System.__ComObject' to the class type 'NationalInstruments.TestStand.Interop.UI.ApplicationMgrClass '. COM components that enter the CLR and do not support IProvideClassInfo or who have not any registered assembly are wound in the __ComObject type. Instances of this type cannot be cast to any other class; However they can be cast to interfaces as long as the underlying COM component supports calls QueryInterface for the IID of the interface.
    Source: SidecarLib to

    What I really need to move the app Manager frame of reference and sequence and the thread as separate arguments my constructor, or I missed something that causes the exception above?

    Thank you very much

    Tom MacLean

    It seems I've found the problem.

    The code sample that I created on my user interface is from the article "launch of a floating .NET form in TestStand.  In this example, the reference of the Application Manager is in a member of the class defined as:

    Class AppMgr ApplicationMgr;

    If you try to get the referral of Application of the motor as this handler:

    AppMgr = seqContext.Engine.GetInternalOption (InternalOptions.InternalOption_ApplicationManager) (ApplicationMgrClass);

    It is then the exception mentioned above is generated.   If, however, the reference to Application Manager is defined as:

    ApplicationMgr AppMgr.

    and it is extracted in the context of the sequence as follows:

    AppMgr = seqContext.Engine.GetInternalOption (InternalOptions.InternalOption_ApplicationManager) (ApplicationMgr);

    everything works as I had planned (without exception).

    I hope that it can save someone else some grief.

    See you soon,.

    Tom MacLean

  • Compilation warnings TestStand ActiveX controls in WPF 2012

    Hi all

    I use the TestStand (ApplicationMgr, SequenceMgr, ExcutionMgr) ActiveX controls in my project written in WPF 2012.

    After that I put the controls on the form, there are a few referrences automatically included in my project. But when I compile, I had the following warnings in the output window:

    CSC: warning CS1762: a reference has been made to the embedded PIA 'c:\Windows\assembly\GAC_MSIL\NationalInstruments.TestStand.Interop.UI\5.1.0.226__ad9244eb3b825cd8\NationalInstruments.TestStand.Interop.UI.dll' because of an indirect reference to that assembly established by the Assembly "c:\Program Files (x 86) \National Instruments\TestStand 2013\API\DotNet\Assemblies\CurrentVersion\NationalInstruments.TestStand.Interop.UI.AxControls.dll". You want to change the property "Include the Interop Types" or another Assembly.
    CSC: warning CS1762: a reference has been made to the embedded PIA 'c:\Windows\assembly\GAC_MSIL\NationalInstruments.TestStand.Interop.UI.Support\5.1.0.226__ad9244eb3b825cd8\NationalInstruments.TestStand.Interop.UI.Support.dll' because of an indirect reference to that assembly established by the Assembly "c:\Program Files (x 86) \National Instruments\TestStand 2013\API\DotNet\Assemblies\CurrentVersion\NationalInstruments.TestStand.Interop.UI.AxControls.dll". You want to change the property "Include the Interop Types" or another Assembly.
    CSC: warning CS1762: a reference has been made to the embedded PIA 'c:\Windows\assembly\GAC_MSIL\NationalInstruments.TestStand.Interop.API\5.1.0.226__ad9244eb3b825cd8\NationalInstruments.TestStand.Interop.API.dll' because of an indirect reference to that assembly established by the Assembly "c:\Program Files (x 86) \National Instruments\TestStand 2013\API\DotNet\Assemblies\CurrentVersion\NationalInstruments.TestStand.Interop.UI.AxControls.dll". You want to change the property "Include the Interop Types" or another Assembly.
    CSC: warning CS1762: a reference has been made to the embedded PIA 'c:\Windows\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll' because of an indirect reference to that assembly established by the Assembly "c:\Program Files (x 86) \National Instruments\TestStand 2013\API\DotNet\Assemblies\CurrentVersion\NationalInstruments.TestStand.Interop.UI.AxControls.dll". You want to change the property "Include the Interop Types" or another Assembly.

    When I change the property "Include the Interop Types", I rather the errors. Can anyone give some advice? What does the warning message? How do I get rid of the warnings or do I just ignore them?

    Thank you very much!

    Kind regards

    According to the text in the warnings, it looks like you had always incorporate true on some of the meetings.

    Try changing all those in warnings to not stir, and then the warnings will probably disappear.

    -Doug

  • TestStand on Windows 2K 3 x 64 deployment issues

    Holil:

    I hope that there can someone advise me.

    I recently tried to build an application TS to deploy on a server running WIndows Server 2003 x 64, and I ran into some difficulties.  On my development system, (32-bit Windows XP pro), I built a deployment TS Installer.  I transferred to the destination machine.  Installation failed... He says that many files were missing from different CAB files.  I tried again... the second time I had more luck... the installation seems to take.  Using the License Manager, I turned on my setup using my development license (my deployment license has not yet arrived).  I tried to run my application and I get an exception that seems to indicate that the ActiveX DLL are not saved:

    Unhandled exception: System.Runtime.InteropServices.COMException (0 x 80040154): C
    Lass did not registered (Exception from HRESULT: 0 x 80040154 (REGDB_E_CLASSNOTREG))
    at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance (Guid & clsid, Obj
    ECT punkOuter, Int32 context, Guid & iid)

    I tried to register these manually to help

    regsvr32 "D:\Program NIUninstaller Instruments\TestStand 4.1\API\DotNet\Assemblies\CurrentVersion\NationalInstruments.TestStand.Interop.UI.AxControls.dll"

    but he complains that this DLL has no DllRegisterServer entry point.  (Is this the wrong DLL to register?)

    I tried to uninstall my deployment and installation the teststand full... and the SeqEdit seems to work fine.  (He must have registered the DLLs required, no?)  My app, however, still does not. I try to install Visual Studio to see if I can rebuild the application on this system with better results.

    I missed an important step?

    Thank you!

    Tom MacLean

    I think the problem was I have to target the solution for a x 86 platform... not any platform.  If I have other problems with this particular application, I was able to recreate the example Simple OI in a new project with the same exception that I had with mine, and change the target platform does the job.

  • PostUIMessageEx go c#

    Hello

    I managed to send my message by sequence of TS PostUIMessageEx and manipulate in my IO.

    It is a way to send the same message from PostUIMessageEx of dll c#?

    I am trying following but not succseeded

    public void UDPConnect (SequenceContext seqContext, out Boolean result, out String reportText, out bool errorOccurred, out int errorCode, out String errorMsg)
    {

    PropertyObject propertyObject = seqContext.AsPropertyObject ();

    Thread.PostUIMessageEx (NationalInstruments.TestStand.Interop.API.UIMessageCodes.UIMsg_UserMessageBase + 3, 0,0, "Hello", propertyObject.GetValInterface ("Locals.Thread", 0), true);

    }

    Please find attachment.

    Thank you very much

    Whence the 'thread '? You get the context of the sequence. The wire is an object, you must make the call on that.

    Hope this helps,

    -Doug

  • How to call a sequence on a computer remote programmaticylly (using c#)?

    Hello TS classmates!

    I have succeedd local call from c# sequences inside but I cannot determine how to modify the code to call the sequence on a remote host.

    Any suggestions?

    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 NationalInstruments.TestStand.Interop.API;

    namespace WindowsFormsApplication1
    {
    partial class CallRemoteForm: form
    {

    Engine myEngine;
    Run myExecution.

    public CallRemoteForm()
    {
    InitializeComponent();
    myEngine = new Engine();
    }

    ' private void btnExecute_Click (object sender, EventArgs e)
    {
    SequenceFile = myEngine.GetSequenceFile mySequenceFile (tbSequenceFile.Text, 0);

    myExecution = myEngine.NewExecution (mySequenceFile, "Sequence1", null, false, 0, null, null, null, ');
               
    }

    ' private void btnClearResult_Click (object sender, EventArgs e)
    {
    tbSequenceResult.Text = myExecution.ResultStatus.ToString ();
    }

    }
    }

    Best regards

    weltaran

    Hello weltaran,

    The TS remote execution works in the following way:

    You have a local engine with a local Executive who runs a sequence. This call sequence can be configured in

    the sequence editor to be run in a new local thread of execution, or on a remote computer, which can be configured in the

    step sequence-call the sequence file. This requires to set the options appropriate to the computer station remote and configuration of DCOM and Firewall settings

    as indicated in Chapter 5 of the manual ref TS. To publish a remote TS-engine to other computers to access with directX on a client computer

    is not recommended and tested by our side.

    Best regards

    Marco Brauner NIG.

  • How to pass an enum testbed

    Is it possible to pass an enum in of TestStand? Otherwise I'll have to do a string and don't compare on my case, but it would be useful as I could?

    The compiler said

    Accessibility inconsistent error 1: type of parameter 'ChamberClass.Chamber.ChamberName' is less accessible than method ' ChamberClass.Chamber.Initialise (NationalInstruments.TestStand.Interop.API.SequenceContext, ChamberClass.Chamber.ChamberName, int, out bool, out int, String)

    The enum (highlighting) is declared in my class, and so I could understand why he loves her but just on the off chance that there is a solution...?

    Fixed! No need to answer:-once more, it wasn't a question of test bench: it's because my enum is private...

  • The result of runTimeErrorAction of DisplayRunTimeErrorDialogEx of handling

    Hello

    I am trying to replace the dialog box with a custom dialog runtime error. The custom dialog box will have the same options as the original dialog box and some additional stuff. I attached a handler for the ApplicationMgr.BreakOnRunTimeError event, but I don't know what is the right way to mimic the behavior of the runTimeErrorAction.

    I'm doing this:

    var frameID = 0;
    var sequenceContext = e.initiatingThread.GetSequenceContext (0, out frameID);

    NationalInstruments.TestStand.Interop.API.RTEOptions.RTEOption_Continue:
    sequenceContext.SequenceErrorMessage = message;
    sequenceContext.SequenceErrorOccurred = true;
    sequenceContext.ErrorReported = true;
    sequenceContext.GotoCleanup = true;

    What makes the execution goes to the cleaning and the movie file will show Passed. Through conduct original execution error displays.

    NationalInstruments.TestStand.Interop.API.RTEOptions.RTEOption_Ignore:

    Do nothing

    NationalInstruments.TestStand.Interop.API.RTEOptions.RTEOption_Retry:
    sequenceContext.NextStepIndex = sequenceContext.StepIndex;

    This has no effect.

    NationalInstruments.TestStand.Interop.API.RTEOptions.RTEOption_Abort:
    e.exec.Abort ();

    It works very well.

    Can anyone help with this?

    Looking at it more carefully, it seems that the BreakOnRunTimeError event does not how I thought it was the case (and probably not the way it was intended). The definition of execution. RTEOptionForThisExecution a side-effect of maintaining the dialogue never is more displayed again. I reported this issue for further consideration. To work around this problem, the best thing you can do is to manage the AfterUIMessageEvent and RTEOptionForThisExecution to RTEOption_ShowDialog, similar to the following:

    ' Private Sub axApplicationMgr_AfterUIMessageEvent (object sender, NationalInstruments.TestStand.Interop.UI.Ax._ApplicationMgrEvents_AfterUIMessageEventEvent e)
    {
    If (e.uiMsg.Event is UIMessageCodes.UIMsg_BreakOnRunTimeError)
    {
    e.uiMsg.Execution.RTEOptionForThisExecution = RTEOptions.RTEOption_ShowDialog;
    }
    }

    Your BreakOnRunTimeError Manager would resemble the following:

    ' Private Sub axApplicationMgr_BreakOnRunTimeError (object sender, NationalInstruments.TestStand.Interop.UI.Ax._ApplicationMgrEvents_BreakOnRunTimeErrorEvent e)
    {
    DisplayMyDialog (...);
    e.breakExecution = mydialogsbreakexecutionsetting;
    e.showDialog = false; Do not display the application Manager dialog box
    e.exec.RTEOptionForThisExecution = mydialogsrteoption;
    }

    Hope this helps,

    -Doug

  • Why can I not see classes in my c# dll?

    This seems to be a stupid question, which will be one obvious answer, but I'm stuck then...

    I'm using Visual c# express 2008 to make my dll and would like to invite my methods of TestStand 2012. I took the default model of Dotnet, added the ref to the project and kept deliberately simple in order to this test; It's here: -.

    usingSystem;

    usingSystem.Collections.Generic;

    usingSystem.Linq;

    usingSystem.Text;

    usingNationalInstruments.TestStand.Interop.API;    TestStand base API.  Add \API\DotNet\Assemblies\CurrentVersion\NationalInstruments.TestStand.Interop.API.dll to your project as a reference.

    usingSystem.Runtime.InteropServices;

    namespace

    TestStand_IF

    {

    classDummyClassName

    {

    publicvoid DummyFunctionName (SequenceContext seqContext, reportText, outbool errorOccurred, outint errorCode, outString errorMsg outString)

    {

    reportText =

    String.Empty;

    errorOccurred =

    fake;

    error code = 0;

    errorMsg =

    String.Empty;

    Try

    {

    INSERT YOUR SPECIFIC HERE TEST CODE

    reportText = ' Success! ';

    The following code shows how to access the properties and variables via the API TestStand

    PropertyObject propertyObject = seqContext.AsPropertyObject ();

    String username = propertyObject.GetValString ("StationGlobals.TS.LastUserName", 0);

    }

    catch (e COMException)

    {

    errorOccurred =

    true;

    errorMsg = e.Message;

    error code = e.ErrorCode;

    }

    }

    }

    }

    I add a "string value" not in TestStand and alsign my dll but there is nothing to select the class of root area. I remember similar problems with perhaps a dozen years in C - having to mark the export functions and verify that the type library has been included, but I don't think that this is the case here.

    Hello

    Try

    Public DummyClassName

    Curt

  • Is there a c# example to use the event handler ExpressionEdit Custom Button control

    TestStand 4.1

    VISUAL C# 2008

    I've added the event handler for ExpressionEdit events as I would any event handler:

    exprEdit.ButtonClick += new NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEventHandler (_ExpressionEditEvents_ButtonClickEvent);

    Then, I create the event handler using the syntax

    public void _ExpressionEditEvents_ButtonClickEvent(NationalInstruments.TestStand.Interop.UI.ExpressionEditButton btn)

    {

    }

    I get the following error when I compile Isaiah:

    Error 1 no overload for delegate matches '_ExpressionEditEvents_ButtonClickEvent' 'NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEventHandler '.

    I guess that means that I don't have the right parameters or types in my statement of event handler, but it corresponds to the object browser.  Any ideas on what I'm missing?

    See my last edition but I think you want your handler to look like this:

    Public Sub exprEdit_ButtonClick (ByVal sender,
    NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEvent
    (e)

  • Button changes style when it is connected to the application manager

    I connected the standard axButtons for the application handler in a custom IOS built in CSharp using Visual Studio 2008.  When I run the OI, the buttons change to standard style (edges rounded, etc.) what looks like a classic style (square edges, no color gradient, etc.).  At first I thought this might be a limitation of CSharp, but when I ran the CSharp UI executable (comes with Teststand), the buttons seem correct.  Is there a reference that I haven't added or something?  I followed (copied about) the code found in the CSharp UI complete, leaving aside the functions that I didn't need.

    This is the only true code on both buttons.  It's pretty simple, so I imagined what a project property that I have install incorrectly.  I have also included the namespaces I've included.

    Thanks for any help

    using NationalInstruments.TestStand.Interop.API;

    using NationalInstruments.TestStand.Interop.UI;

    using NationalInstruments.TestStand.Interop.UI.Support;

    using NationalInstruments.TestStand.Utility;

    Connect sequence controls

    this.axSequenceFileViewMgr1.ConnectCommand (this.axEntryPoint1Button, CommandKinds.CommandKind_ExecutionEntryPoints_Set, 0, CommandConnectionOptions.CommandConnection_NoOptions);

    this.axSequenceFileViewMgr1.ConnectCommand (this.axEntryPoint2Button, CommandKinds.CommandKind_ExecutionEntryPoints_Set, 1, CommandConnectionOptions.CommandConnection_NoOptions);

    Shawn-

    No problem. I've attached a zip file that contains the recommended manifest file and the updated project file that references. I didn't create the manifest file, place the file in the directory of the project file, add the manifest file to the project, select the file in the control of the ring on the settings tab application to embed the manifest, rebuild the project and run.

  • Download the station template

    Dear all,

    I use c# example of user interface and I would like to know what kind of model of station and how many stations the sequence is configured. (before the execution of the sequence)

    How can I get the type of station (batch\sequential) and number of stations with the relevant objects (axApplicationMgr\axSequenceViewMgr\axExecutionViewMgr)

    TNX

    Hi Jürgen,

    Thanks for the quick and helpful response

    ' Private Sub axApplicationMgr_DisplaySequenceFile (object sender, NationalInstruments.TestStand.Interop.UI.Ax._ApplicationMgrEvents_DisplaySequenceFileEvent e)
    {
    String t = string. Empty;
    e.file.GetModelSequenceFile (to t);

    }

  • Two parallel executions, calling a DLL function

    Hello

    Since this test takes about 6 hours to test my USE, I plan to use the parallel model to test 2 UUT at the same time in parallel.

    I implement the test code as a DLL of CVI.

    However, to my surprise, it seems that the steps that call a DLL function actually traveled in one series, not in parallel:

    Test 2 power outlets if one enters and executes a DLL works, the other waits for the first to complete its operation and return. While the other runs on the same copy of the DLL, so that the DLL global variables are actually shared between executions.

    So if a DLL will take 5 minutes to complete, two executions in the running at the same time take 10 minutes. This isn't a running in parallel in every way.

    What I want and expect also TestStand, was to completely isolate the copies of these two executions DLL such as test two casings could run at the same time the same DLL function by arbitrary executiong their copy of the function, completely isolated from one another.

    So they separated globals, discussions, etc., and two parallel jacks take 5 minutes to run a step, instead of 10.

    Such a scenario is possible?

    If not, how can I use my test in parallel (in truly parallel) when the use of 2-socket test?

    (1) Yes, he'll call the multiple executions in TestStand calling into the same dll in memory the same copy of this DLL. Thus dll called in this way must be thread-safe (that is written in a way that is safe for multiple threads running the code at the same time). This means usually avoiding the use of global variables among other things. Instead, you can store the thread shows in local variables within your sequence and pass it in the dll as a parameter as needed. Keep in mind all the DLLs your dll calls must also be thread-safe or you need to synchronize calls in other DLLs with locks or other synchronization primitives.

    1 (b) even if your dll are not thread-safe, you might still be able to get some benefits from parallel execution using the type of automatic planning step and split your sequence in independent sections, which can be performed in an order any. What it will do is allow you to run Test a socket A and B Test to another socket in parallel, and then once they are then perhaps test B will take place on one and test one run on the other. In this way, as long as each test is independent of the other you can safely run them in parallel at the same time even if it is not possible to run the same test in parallel at the same time (that is, if you can not run test on two Sockets at the same time, you might still be able to get an advantage of parallelism by running the Test B in one take during the tests in the other. See the online help for the type of step in autoscheduling for more details).

    (2) taken executions (and all executions of TestStand really) are threads separated within the same process. Since they are in the same process, the global variables in the dll are essentially shared between them. TestStand Station globals are also shared between them. TestStand Globals file, however, are not shared between runs (each run gets its own copy) unless you enable the setting in the movie file properties dialog box.

    (3) course, using index as a way to distinguish data access are perfectly valid. Just be careful that what each thread does not affect data that other threads have access. For example, if you have a global network with 2 elements, one for each grip test, you can use safely the decision-making of index in the table and in this way are not sharing data between threads even if you use a global variable, but the table should be made from the outset before start running threads , or it must be synchronized in some way, otherwise it is possible to have a thread tries to access the data, while the other thread is created. Basically, you need to make sure that if you use global data which the creation/deletion, modification and access in a thread does not affect the global data that the other thread use anyway in or we must protect these creation/deletion, modification and access to global data with locks, mutex or critical sections.

    Hope this helps,

    -Doug

  • TS. SequenceContext

    Hello

    I'm creating a .NET assembly to display a dialog box to allow a user to modify, and then select properties in a new type of step, so that I have a simple class that exposes a function to display a dialog box, it works very well and the dialog box appears on the screen and this medicine works perfectly... but I need to access properties of the stage and a few other objects TS , for this, I added the argument ' TS:equenceContext ^ context ", as in the following code, it compiles correctly, no error.

    public ref class TSStepType {}

    public: void ShowSendMessageConfig (TS:equenceContext ^ context) {}
    SendMessageConfigForm ^ dialog = New SendMessageConfigForm();
    dialogue-> Show();
    }
    };

    However, when I try to call this step in the lower edit level, I get an error for this member...

    Use the existing Object (SCDTSStepTypes.TSStepType). ShowSendMessageConfig {requires no loadable Type})

    If I don't have this argument, it works very well and that the error does not clear, I tried to use the static method and tries to declare a property in the object and it gives me the same error.

    I use Visual Studio 2013, develop my Assembly with Visual C++ and I have the 2013 version of TestStand.

    Any suggestion?

    I see two problems with your code:

    (1) TS:equenceContext isn't the right class. It is a unmanaged class, you got by #import on the typelibrary or which one of TestStand headers that do. You must add the reference to the assembly that is named TestStand 2013 Primary Interop Assembly .NET API (it's also in the GAC with this name: NationalInstruments.TestStand.Interop.API.dll, but it should appear in the Visual Studio add the dialog box References with the name "TestStand" 2013 API Primary Interop Assembly). Once you have added that you can add a "using" for TestStand namespace declaration or use extended typename complete as follows:

    NationalInstruments::TestStand:Interop:API:equenceContext

    (2) dialog-> Show() is not the right way to show a modal dialog (where it will wait until the dialog box is dismissed). You must do something more like the opposite the following:

    SendMessageConfigForm ^ dialog = New SendMessageConfigForm();

    dialogue-> ShowDialog(); Displays the modal dialog box

    dialogue-> Dispose(); You must call has on the classes dialog box when you are finished with them.

    Hope this helps,

    -Doug

    P.S. - Forum turn ':' next to the ' character in a smilely. Please use ':' and ' wherever you see the smiley face.

  • interoperability c# get the name of the step

    I'm trying to use a code c# module in order to be able to read the name of the step of the call. However, my code only all returns 'Step' as the name of the object (no matter what the step is actually called in the sequence). Note that I also tried to do the same thing to get the name of the calling sequence - and it always returns 'Sequence '. Where I'm going wrong? Here's the code: (see attachment for full 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'm trying to retrieve the name of the step of the call and the name of sequence all call them all the way to the top of the stack to the root. This same method works using the steps of the Expression, but I would like to hide the mess in a single code module. Any ideas would be appreciated!

    Thank you

    Phil

    Hi Ray,

    Thanks for the tips. Unfortunately, I think I did my a little too simplistic example! Your solution is perfect for the case of the name of the step, unfortunately, this won't work for what I'm trying to do. I write a journal of custom result which is called from the ProcessModelPostResultListEntry callback and check if 'The RecordResult' is enabled on all stages of SequenceCall in the stack and if every sequence in the stack has the option "RecordResults" is enabled. (Essentially, result record should be enabled at all levels so that the result to be connected). You may think that the recall of ProcessModelPostResultListEntry would be called only if this condition is met - unfortunately, it is only affected by the combination more nested "RecordResult" step and the properties of "RecordResults" of the sequence. Therefore, frustrating, I need to check all the way to the top of the stack to the ProcessModel. The reson why it is more complex, it is that step and sequence property further to the top of the battery are accessible by using the Evaluate() method, as opposed to the lowest level in the stack that can be accessed via thisContext.Step and thisContext.Sequence.

    In any case, I worked it out in the end: in TestStand Expressions allow you to take a number of shortcuts to APIs that are not available when you use the API in a different language - so why I was able to use phrases such as:

    Locals.SequenceRef = evaluate ("RunState.Caller.RunState.Caller.Sequence"),

    Locals.SequenceName = SequenceRef.Name

    Locals.SequenceRecResult = SequenceRef.RecordResults

    whereas the similar c# code worked as expected (note that the string of RunState.Caller above is actually built dynamically depending on the depth of the call stack).

    Be more explicit in c# works correctly even if:

    seqObj = pObj.Evaluate ("RunState.Caller.RunState.Caller.Sequence");
    SequenceName = seqObj.Evaluate ("name"). GetValString ("", 0);

    SequenceReqResults = seqObj.Evaluate ("RecordResults"). GetValBoolean ("", 0);

    Although writing this response, I just found the following property:

    SequenceContext.CallerDiscardsResults

    ' Returns if any order in the call stack tells TestStand to disable the results or if any step caller in the call stack instructed TestStand do not save results.

    Typical! I think that this may be an easier to use way!

    Thanks anyway,

    Phil

Maybe you are looking for

  • How can I remove a credit card on the app store?

    How can I remove a credit card on the app store? I can't download apps because it makes me sign then goes to check and it keeps saying method declined. < re-titled by host >

  • The same mailbox on Mac OS and iPhone

    How can I get the mailboxes on El Capitan Mail and it takes the same sync with Mail in iOS 9 on my iPhone? This should be simple. I use iCloud for sync my devices. Thank you

  • Sony NW - E507 MP3 File Manager and Windows 7 problem

    Until very recently, I was using a custom PC with Windows XP Pro installed to transfer my music on the MP3 player using the "MP3 File Manager" software that connected the MP3 itself. Now, both my PC under Windows 7 64 bit and I found that I can't tra

  • single-board rio run vi

    Hello, I have deployed the vi successfully, but when I click on the button "run" in the vi, the following diagram appeared, I wonder what is the compiler and where I could find it? My only advice rio is sbRIO-9636. And Labview 2012 edition in English

  • Need to download iTunes

    Hi, I need to remove the old version of Hello. Exe to download iTunes.  Tried everything, but can not. all the step by step instructions?