TestStand internal mechanism: call sequence/ architecture c++ code module adapter, .dll functions

I would like to know more about this particular aspect of TestStand's architecture:
What exactly happens "internally" (class/seq diagram ?)when a c/c++ dll code module adapter step invokes/ calls an exported .dll function (testStand sequence executed from sequenceEditor) ?
My guess (wrong/correct ?) is that:
I execute
SeqEdit.exe
which hosts
teengn.dll
which hosts
cppAdp.dll
which hosts
"myDllWithExportedFunctions.dll"
and (finally) directly calls exported functions of "myDllWithExportedFunctions.dll"

Christoph -
Your binary file presentation at a high level is correct.
The object relationship is:
- The Sequence Editor is just a client of the TestStand engine.
- The Engine is the creator of all TestStand objects.
- The Engine creates the Sequence File object for the Sequence Editor.
- The Sequence File has a reference to a Sequence object, i.e. RunState.SequenceFile.Data.Seq["MainSequence"]
- The Sequence has a reference to a Step object, i.e. RunState.SequenceFile.Data.Seq["MainSequence"].Main["Action"]
- The Step has a Module object, i.e. RunState.SequenceFile.Data.Seq["MainSequence"].Main["Action"].TS.SData
- The Module object uses its associated Adapter class to Load/Run code modules.
- The DLL handle and function pointer are stored
in the Module object.
- The Module object with the Adapters help knows how to call the function in the DLL.
Scott Richardson (NI)
Scott Richardson
National Instruments

Similar Messages

  • Problem calling more than one instance of a dll from TestStand

    Hi,
    I've posted this message in the LabWindows forum a few days ago and haven't gotten any answer. I have made a DLL with the evaluation version of LabWindows 7.1 to connect to a Telnet server and perform various commands. This DLL is used with TestStand 3.1 . In TestStand, I have to connect simultaneously to the same Telnet server twice to start an application with both of those connection, with different parameters. I use Threads in TestStand to call the DLL and everything seems to be fine on that side. I enter the DLL at the same time for both threads but it seems that the 1st thread waits until the 2nd thread is at the end of the function before he executes the InetTelnetOpen command to start the Telnet session. Is it normal that we can only have one Telnet connection at a time?
    To see that I've placed some time stamps in a log. For the first Thread, almost a minute passes by between the first 2 time stamps but in the 2nd thread it take less than a second.
    Yet, they both wait for eachother to exit the DLL as the time stamp at the end of the execution is the same.
    I really need some enlightenment here ;-)
    Louis
    Attachments:
    TelnetTest.txt ‏3 KB

    Tiwi,
    The blocking that InetTelnetRunScript does is probably there for a reason. That method is probably not safe for multiple threads to call into at the same time. There is likely another way to do what you are trying to do that can be done in parallel. Perhaps with lower-level telnet function calls. I recommend you post to the CVI forum asking if there is another way to do what you are trying to do from multiple threads in parallel. This does not sound like a teststand issue. If you are calling into your dll from multiple testand threads, then the code in your dll function is being executed in parallel. The cvi function you are calling however, might not be reentrant (reentrant means able to be called by multiple threads in parallel) so it is making one of your threads block until the other completes. I suspect there is a different way to do what you are trying to do that will not have this problem, but I think the changes that you will need to make will be in the dll and not on the teststand side. I recommend you post to the CVI group and explain what you are trying to accomplish and see if they have a solution for you.
    Hope this helps,
    -Doug
    P.S. Each process on the Windows operating system (of which teststand is one) can only load one copy of any particular dll at a time. Also, loading multiple copies is not something that would be likely to solve the problem you are running into. One possibility is to use the call executable step type and create an executable that does what your dll function does, but that is probably not the best solution and might still end up blocking at the same location. The best solution is probably to use an alternate method of accomplishing whatever you are trying to do with the telnet function you are calling that does not have the limitations of that function.

  • Why does the DLL function executed by call library node fail when the Vi is re-opened?

    Development System
    OS: Windows XP
    LabVIEW: version 10.0
    DLL: Custom 
    Compiler: Visual C++ 6.0
    Function Prototype: __declspec(dllexport) const char * test(void)
    We have developed a DLL for use.  The DLL compiles cleanly.  The DLL includes a function test.  The test function validates the functional capabilities of the DLL.  I have followed the examples online, and I have used the import shared library tool in LabVIEW.  The VIs created use the call library node. 
    When I create a VI calling the test function from the custom DLL using the call library node the VI executes the DLL function test flawlessly.  I close the VI.  When I re-open the VI and run it, I get an error code from the DLL.  However, if I go to the block diagram and set the path for the DLL in the configure call library node again then the VI executes the DLL function test flawlessly again. 
    I have to set the path for the DLL in the configure call library node every time I open the VI.  The examples I downloaded from the community do not require this.  What might the DLL be missing?  What am I missing? 
    Solved!
    Go to Solution.

    I think it was rather unfair of me to ask for help with my DLL issue without disclosing more detailed information.  As a corrective action, I have attached a zipped file.  The zipped file contains the entire VC++ 6.0 project for compiling the DLL, the DLL, and the VI I have been using to test it. 
    ###NOTE####
     As a prerequisite to compilation and usage of the DLL you'll need to have installed Python 26 on your system.   
    You may obtain the MSI for correct version of Python from the following location:
    http://www.python.org/ftp/python/2.6.6/python-2.6.6.msi
    ###NOTE###
    Thank you very kindly for any assistance offered!
    Thanks,
    Bill
    Attachments:
    C_DLL_PYTHON_AND_LABVIEW2010.zip ‏1685 KB

  • 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

  • Teststand Manager Controls in Code Modules

      I am trying to understand how UI controls work in code modules called by TestStand steps.  I can pass a reference to an Application Manager (perhaps the application manager?) to my code module using RunState.engine.GetInternalOption(InternalOption_ApplicationManager).  Does the sequence editor have an application manager?  Or the engine?  Is this the same as the Application Manager control I put on the front panel of the code module?  What about SequenceViewManagers and ExecutionViewManagers?  Can I create those in my code modules to display sequences or executions?  Or can I somehow get those from the sequence editor/engine, or from the Application Manager?
    I know that I just asked a lot of questions, but I guess what I am looking for is some general guidelines for using the manager controls in code modules.  This all came about by an attempt to display an Execution View Manager control in my code module.  Feel free to ignore the following description of my various attempts to get this to work.  This exercise helped me understand the managers a little bit more, but I'm still a little confused.
    Suppose I want to create a custom step type for debugging to display the variables for the current sequence context on the front panel of a code module VI.  (LabVIEW 8.6, TestStand 4.1.)  In my code module, I call ExecutionViewMgr.ConnectVariables to connect to a VariableView control.  Where do I get my ExecutionView Mangager from?  I tried two methods:
    1) create an ExecutionViewManager control; set the manager's current execution using ExecutionViewMgr.Execution (pass RunState.Execution from TestStand to the code module).
    It seems like this should work, but when I run my sequence from the sequence editor, the ExecutionViewMgr.Execution property node returns error -17500.
    When I run from a LabVIEW Operator Interface (using the LabVIEW environment, not the exe), I don't get an error.  But I must connect a list control using ExecutionViewMgr.ConnectExecutionList, and select the execution from the list when the code module is running.  Then I can see the variables when I select the execution in the list.  However, the execution display on the OI goes blank.  I can see either the variables on my code module or the execution on my OI, but not both simultaneously.  It appears that an execution cannot be attached to more than one manager at once (I guess that's reasonable).
    2) pass the result of RunState.engine.GetInternalOption(InternalOption_ApplicationManager) to the code module; set the manager's current execution using ApplicationMgr.GetExecutionViewMgr() (pass RunState.Execution from TestStand to the code module, then as a parameter to GetExecutionViewMgr() ).
    In this case, I would expect that there is no ExecutionView Manager associated with the execution when running from the sequence editor.  But the ApplicationMgr.GetExecutionViewMgr() function returns a non-Null reference.  ExecutionViewMgr.ConnectVariables() causes an error dialog to be displayed (from the function itself, not from TestStand), although it doesn't actually output an error (and the VariableView control remains blank).  The error is "Unable to connect Variables View control."  (See attachment.)
    When I run from my LabVIEW OI, it works perfectly--I see the variables on my code module's UI, and the execution appears on the OI simultaneously.  I guess this makes sense since the TestStand engine is returning the Execution manager that was already created by the OI.
    Attachments:
    Error Dialog.PNG ‏20 KB

    TestStand only allows a single ApplicationMgr per process, creating a second one will error. So the engine will always return the one in either the UI or the Sequence Editor. Events should be seen by both handlers. You have to be careful to ensure that your extra handler does not mess up the UI's handler if yours is called first, like preacknowledging a message. As far as setting up a handler in a code module, you should be able to. However, we have not fully tested this capability, so we cannot say that we fully support this because you might run into issues. In addition, using LabVIEW might present additional issues that might not be seen in other development environments like CVI and Visual Studio. Performing some functionality that can process messages in a COM callback can cause potential hang conditions, to the less you do in a callback the better when using LabVIEW. Keep in mind that you have to ensure that you unregister your handler if the code module returns to the calling execution and you no longer want the handler to be called.
    Attempting to use a new TestStand UI control in a different thread than the UI thread is not recommended because we have done almost no testing on this use case because it is not done in typical UIs.
    Now, for customers that want to create a nice GUI that includes serial number prompting, but still want to be able to work with the Sequence Editor, I suggest that you implement a behavior that works with a supporting GUI, but support an alternative when a non-supporing GUI is present.
    For example, you could do the following:
    1. The process model can send a custom UI message synchronously to the GUI to ask for a serial number. The custom message would contain a reference to a property that contains (a) a boolean to indicate that the UI will "respond" to the message, (b) a string for specifying the serial number, and (c) a notification object from the TestStand Synchronization Server.
    2. When receiving the UI message, a supporting UI will set the boolean to True, duplicate the reference passed locally, and acknowledge the UI message.
    3. When the UI message returns, the exectution will determine if the UI supports the message. If yes, the exectution will (a) wait on the notifcation (b) When the user enters a serial number, the GUI will set the string property and then pulse the notification, and release the reference to the properties passed via the UI message. (c) The execution will return from the notification wait, read the serial number, and continue execution.
    If no, the execution will need to use the default process model prompting or custom prompting that you devise when using the Sequence Editor.
    The process model could use a UI message to determine if the GUI is supportive of this mechanism once instead of with each serial number prompt, but you get the idea.
    Scott Richardson
    National Instruments

  • Is it possible to launch the SequenceAnalyzer from a C# code module in a Custom TestStand Editor

    The Sequence Analyzer is not available in the Custom TestStand Editor Mode GUI.
    Is it possible to add the Sequence Analyzer to a menu in the custom TestStand Editor?
    Is it possible to launch the sequence analyzer from a C# code module, this method is then called from a sequence call back.
    Best regards
    Patrick

    From the TS Help:
    TestStand Sequence Analyzer Application
    Select Start»All Programs»National Instruments»TestStand»Tools»TestStand Analyzer or run <TestStand>\Bin\AnalyzerApp.exe to launch the stand-alone TestStand Sequence Analyzer application. Use this application to analyze projects outside of the TestStand Sequence Editor.
    The sequence analyzer application window contains the following tabs:
    Files—The files and directories to analyze.
    Rules—The rules to use for analysis. Use this tab to enable, disable, and configure rules for analysis in the current project.
    Options—Contains the project options that control the analysis and determine whether the sequence editor automatically saves the current analyzer project.
    Messages—Contains the list of messages for the most recent analysis of the current project, sequence file, or workspace file. The sequence analyzer overwrites the content of the Messages tab each time you start an analysis session.
    Analysis Summary—Contains a summary of the most recent analysis of the project.
    Command-Line Usage
    You can use the following command-line syntax to open an analyzer project:
    AnalyzerApp.exe "C:\My Documents\MyProject.tsaproj"
    CTA, CLA, MTFBWY

  • Use the same code module for several steps in the sequence

    Hello All,
      I have been trying to set up a sequence that uses the same code module for all of the steps in the sequence, but am having trouble referring back to it when I need to send it commands.  I have gotten as far as calling the VI in a new thread so that it can be run asynchronously.  I can run the simple sequence and it will indeed open the VI, and move on to the next step.  When I close the VI manually from the front panel, the sequence in TestStand completes, as expected.  So it appears that I have that much working. 
      My question is how to call the separate thread from the main sequence or other sub sequences when I need to edit the parameters.  If I insert an Action step, I am required to select a VI file, but from what I can tell, it opens a different instance of the file, and does not provide an interface with the other instance running asycronously.  My next guess was to use a Statement step, but I was not able to figure out how to configure the lookup string to call the VI parameters.  Beyond that, I'm not sure how to proceed.  Please advise.   
      My intention is to start the code module VI (asynchronously), run several different subsequences within the main sequence that call that same VI and edit it's parameters, close everything and report on the results.  If I am misunderstanding how TestStand is supposed to work, please let me know. 
    Thanks,
    GSinMN    
    Solved!
    Go to Solution.

    What I do is use a Queue to send data to the asynchronous VI.  So it can run and do whatever, but also recieve the commands from the queue.  I use an Action Engine that holds the queue reference and sends the commands.  So you really just have to call the Action Engine from your sequences.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Creating variables/parameters from a code module that persist when the sequence is over

    I am creating variables/parameters programmatically in a code module (C#) by passing in the Locals object and calling the method 'NewSubProperty'.
    I've also tried SetValNumber with PropOption_InsertIfMissing.
    But it seems they are only being created in that instance of the sequence, because they are gone when the sequence is over. I really wanted them to persist.
    I wanted to avoid creating station globals dynamically like this, but maybe that's all I can do to make them last.
    Any ideas would be gratefully appreciated.
    Thanks,
    Ronnie
    TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
    Solved!
    Go to Solution.

    Hi,
    Check out the links on this response
    http://forums.ni.com/ni/board/message?board.id=330&message.id=11226&query.id=267719#M11226
    It maybe of help
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • RunState.Caller.Sequence.AsPropertyObject does not return the comment

    RunState.Caller.Sequence.AsPropertyObject.Comment    gives a null string
    but  RunState.Caller.Sequence.AsPropertyObject.Name  does give the right name of the sequence
    any idea what teststand  is doing here

    Hello,
    I develop an application operator of testsrand in c#, and I etulise the order dowry Net, I want to get  the current sequence execution in a listview in c#
    I do not arrive introduced the code
    RunStat.CallStack in my code
    here my code
    private void btnStart_Click(object sender, EventArgs e)
    affichageDeroulementTest.Clear();
    // Execution de Programmme
    myExecution = myEngine.NewExecution(mySqFile,
    "Test UUTs", mySqFile.GetModelSequenceFile(out sDummyString), false, 0, null, null, null);
    Please
    it is somebody can help me has recovers the sequence in the course of execution
    thank you;

  • CALLER ID not working for International incoming calls

    Hi,
    I've a strange issue where CALLER ID not working for International incoming calls, it shows INTERNATIONAL UNKNOWN NUMBER in the phone display, but the number shows correclty in Verizon Call assistant !!!
    Any clue?

    yashshankar wrote:
    Hi
    I recently  purschased an Online number but the caller id does not work for incoming calls.How do we resolve this problem?.
    Regards
    Yash
    You didn't mention what country your Online Number is in.  Not all of Skype's Online Numbers are eligible for use as Caller ID when calling telephones or sending SMS messages.  If your number is from one of these countries (Chile, Denmark, Estonia, Hong Kong, Poland, Sweden, the UK and the US), then it can be used this way.  Otherwise, you can use a mobile number from countries other than Japan or Mexico as Caller ID with Skype, after the number goes through a verification process where Skype sends SMS messages with codes to that number.
    To get to these settings, log into your Skype account here on the Skype web site using the "Account" link at the top of this page.  You'll see a screen that would include your current Caller ID settings, and a link to change that.  If your Online Number is from one of those countries I referenced above, just select it and you're done. 
    Hope that helps!
    Patrick
    Location/Ubicacion: Arizona USA
    Time Zone/Hora Local: UTC/GMT -7
    If this message has adequately addressed your issue, please click on the “Accept as Solution” button. If you found a post useful then please "Give Kudos" at the bottom of my post, so that this information can benefit others.
    Si esto mensaje le ha ayudado, por favor haga clic en "Aceptar como solución". Si encuentra un mensaje útil, por favor "Da Kudos" al final del mensaje, por lo que esta información puede beneficiar a otros.
    I am not a Skype employee. No soy un empleado de Skype.

  • INTERNAL.HTTP_RESP_STATUS_CODE_NOT_OK HTTP response contains status code 50

    Hi Gurus,
    I am getting error message "INTERNAL.HTTP_RESP_STATUS_CODE_NOT_OK HTTP response contains status code 500 with the description Timeout" when I call a proxy to retrieve data from external database (oracle) through XI (Synchronous Call). This proxy works fine if the data size is limited to 120 MB but terminates with above message if data size is larger may be > 130 MB but some time it works as well with this data size.
    Me & our basis team are working hard to fine out the issue but still could not succeeded. we have applied the OSS Note 807000  but still we are getting the error message. To make it more clear I am sending SQL Query to Reciever (Oracle) from SAP through ABAP proxies.
    If I check the status of messages in "Monitor for processed XML messages" the message has status icon which says "Log version" I am new in XI Please help me to solve the issue.

    hey...try increasing the synchronous timeout parameter. I think the default is 180 secs.
    I would suggest you look at redesigning the the interface  to pull the data in smaller pieces...120 Mb is really big...Pi gives max throughput at around 5 mb...
    Dont worry about the log version....It just persisted in the system when a job is still running... try looking at the same message after a while...it would have changed its stsatus.
    Arvind R

  • Cache server internal Mechanism

    Hi all,
    I want to know architecture & internal mechanism of cache server. Also if possible give me some material @ same.
    Thanks & regards.

    Hi,
        Here I am giving the link, it may be help for you.
    http://www.dbuggr.com/milly/description-explanation-business-objects-enterprise-architecture-comp/
    Regards,
    Narendra.

  • How to call sequence in LabVIEW by providing sequence file path.

    Hi,
        Please provide me a solution to call sequence file from LabVIEW ActiveX API's by inputting sequence path to LabVIEW user interface.
    Thank you
    Yuvaraj
    Solved!
    Go to Solution.

    Here is a link that I gave some pointers on how to run an Open Sequence file via Single Pass.
    http://forums.ni.com/t5/NI-TestStand/Direct-execut​ion-of-the-sequence-when-UI-launches/m-p/2000819#M​...
    How are you launching this sequence, is the user selecting the sequence on disk?    Is it already open in a SequenceViewMgr control?
    Would an operator interface be more applicable to your situation?
    Thanks,
    PH

  • Compare two sequences loaded in a C# code module.

    Hi,
    Is it possible to compare two sequences loaded in a C# code module using functionality from the TestStand API?
    Best regards

    Hello,
    Here you can find a related post:
    http://forums.ni.com/ni/board/message?board.id=330&message.id=26058&requireLogin=False
    Let me know if you have further questions or if this doesn't help you.
    Kind Regards,
    Thierry C - Applications Engineering Specialist Northern European Region - National Instruments
    CLD, CTA
    If someone helped you, let them know. Mark as solved and/or give a kudo.

  • Teststand step to call a new instance of Teststand environment

    I'm trying to create a troubleshooting step and I would like this step to be able to open a new instance of the Test Stand environment. If the troubleshooting step is encountered, i would want the current sequence to pause execution, open a new Test Stand sequence that will allow the engineer to perform troubleshooting steps from a parallel TestStand window, and when the troubleshooting test stand environment is closed to return to the calling sequence.
    [DL]
    Solved!
    Go to Solution.

    Hello Daniel,
    I think your best bet would be to just have the steps break on failure so you can then troubleshoot from within TestStand. If you open a new instance of TestStand you will not really be able to troubleshoot the sequence you just ran, it will be troubleshooting a new sequence. 
    Best Regards,
    Adam G 
    National Instruments
    Applications Engineer

Maybe you are looking for

  • HP Solutions Software Installation (HP C7250 All-in-one) after Upgrading from Windows 8.0 to 8.1

    Received errors when trying to open HP Solutions following upgrade to Windows 8.1 (64 bit).  Tried re-installing drivers and software.  Software downloads but will not install.  Print and Scan Doctor says software not installed.  Anyone deal with thi

  • Sending po printout by fax server

    hi! i have a very urgent problem, we implemented fax server for sending purchase order printout to the vendor. we used userexit vn00001 for recieving the vax number of the agent. we need to get also the country code and change it to te country code o

  • How can I delete an extra calendar

    Besides my normal calendar on iPad I accdently created a other one. Both gets synced with icloud. My problem is that I cannot delete the extra calendar. Every time I delete it from my calendar app, its back in a few seconds from icloud. I then delete

  • Transitions don't work (stay black)

    Hello, I hope somebody can help me with the following problem: I'm using Adobe premiere elements 7, and I'm trying to put some transitions between the videoclips. But only two transitions are working, it is possible to edit the other transitions and

  • Run speedgrade without NVIDIA

    Hallo, Is it possible tun speedgrade on the latest macbook pro's 15" without NVIDIA? Thanks