Detecting unassigned variables in TestStand?

Is there a method to detect unassigned/unused variables in TestStand as exists in the Visual Studio C# environment? If not, I would request that a method be made available eventually. They can accumulate and are difficult to clean up manually.

Russell,
There is not method that I am aware of that will do this simply. You can however write your own tool to check for unused variables using the TestStand API. It's not a trivial task, but basically, you want to determine what variables you are using as a property objects, such as Locals, Parameters, or FileGlobals. Then you can create a temporary copy of the property object adding the subproperty objects to it, and using that copy, scan through the sequence (for parameters and locals) or file (for FileGlobals), removing from your object copy any subproperties that is being used or referenced. What you have left are the unused subproperty objects, which you can either use as a reference to remove the original version or document to the developer for manual removal.
-Jack

Similar Messages

  • JDeveloper 11g not detecting unused variables

    I just switched to JDeveloper 11g. It appears not to be detecting unused variables in Java code. The 10g version would detect these. I verified that the unused syntax color was set up to be obvious (bright red in my case). Example:
    public int getXXX ()
    int abc = 2;
    return XXX;
    10g would highlight abc as unused, 11g is not.
    I am using JDeveloper 11.1.1.0.1
    I am using Java 1.6.0_11 for both running JDeveloper and for compiling my code.
    Any suggestions? Is this a known limitation?

    Hi,
    for a quick test I only had a newer internal build by hand and here the sample code works. So if this was an issue in the current build then it is fixed
    Frank

  • How can I extract a file name / path from a local path variable in TestStand?

    I have local TestStand string variable, call it 'locals.path', that contains a path to a file including the file name (c:\inputs\input.txt). I need to be able to split up the path (c:\input) and the file name (input.txt) and save them into 2 local variables. What is the best way to do this?
    After reading through some of the other forums, it looks like there are some built-in functions that can accomplish this, but I am unable to find how to use them anywhere on the NI web site. One forum said to use the File I/O>Strip Path.file function. How is this called? Is this function in a DLL?
    I know that there are a number of DLLs that are installed with TestStand into the c:\windows\system32 directory. One forum made note of CVI_OpenFile / CVI_ReadFIle functions in the cvirt.dll that I used to solve a problem that I had in the past. The problem is that I had no idea that that these functions even existed and would have never known unless a similar question had been posted previously. Is there some place that these DLL function interfaces are defined or documented? Is there a function that can extract the file name out of a string for me?
    Thanks,
    Mike

    Hi,
    There sound like functions in say LabVIEW or CVI.
    I have attached a small example which may help. (I have not allowed for any error trapping, if say you dont find the file and cancel)
    Regards
    Ray Farmer
    Message Edited by Ray Farmer on 10-16-2006 10:04 PM
    Regards
    Ray Farmer
    Attachments:
    Sequence File1.seq ‏33 KB

  • Using variables in TestStand 4.0

    Hi, I am new to TestStand and I am still a bit puzzled about:
    1. The differences between using Locals / Parameters / FileGlobals / StationGlobals in practices.  (Especially between Locals and FileGlobals, I can’t notice any differences when using them)
    2. When and how you would use a “Object Reference” / “ Container” variable.
    I am hoping that someone can share some demonstrating examples or readings.
    I am also interested to know the most common way/best practice to pass&share variable between sequences.
    I want to avoid using “StationGlobals” because it appears to me that a StationGlobals variable is attached to a particular station/PC, if I run the same sequence file on another machine I will then need to redefine all StationGlobals variables.  (Am I right about this?)
    To get around, I have been using “Parameters” and “Locals”, however I have to say it is tedious and easy to make mistake to pass a top level variable to a subsequence at several levels down. 
    It got to be a better way… A variable type that is global to all sequences but not hardware dependent?
    Thanks a lot.
     Phillip

    Hi Ray,
    It is much appreciated for your thorough answer, it was very good.
    However I had trouble to implement some of suggested solutions.
    *Using FileGlobals with “All Executions Share the Same File Globals”:
    Maybe explaining the application I want to achieve will help. 
    I have Sequence A, B and C.  Sequence A is the top level sequence.
    In A.seq, a “Sequence Call” is used to call B.seq in which a VI is called to initialize a instrument and pass its handle back to A.seq.  (Using a parameter)
    Later in A.seq, another “Sequence Call” is used to call C.seq in which another VI is called to request for a measurement.
    Basically what I am trying to do is to store the instrument handle into a global variable so it can be used by any other subsequences/vi inside A.seq.
    I have tried A.seq with either “Separate File Globals of Each Execution” and “All Executions Share the Same File Globals” under the properties setup.  In both cases, the “File Globals” I created in A.seq, is not available in C.seq.
    (From reading the helps, I think this option is for the situation where I have parallel sequences running.)
    *Using TestStand API PropertyObject.SetVal
    I used “Set Property Value.VI” to create a StationGlobals with the “InsertIfMissing” set to true.  It works fine normally but the problem is that the StationGlobals I want to insert is a custom type and “New Value” input only accepts a string/numeric/Boolean.
    Regards
    Phillip

  • "Detecting" a variable from an externally-loaded SWF via SWFLoader

    I load an external SWF file from a click event.  Then, when the interactions has reached the end of the presentation, we'd like it to unload itself, and go into another state.
    Is that possible?  ( actually transformed the SWF into a component using Flash Builder 4 hoping that would be easier to detect variables and events)
    Thanks,
    Doug

    It is possible, but you'll have to wire up the communications between the
    SWFs

  • Pulling in a variable into TestStand from an externally running LabView Vi ?

    Hello,
    My coworker has a problem and I'm tyring to help him.
    We have a functional test written by an outside company, using TestStand 4.1
    He has a LabView Vi with an Thermotron driver that monitors  a chamber temp and outputs an INTERVAL number ( 1 intervel every x minutes)
    That interval number is written to text file.
    We would like to loop the Main function of the TestStand sequence based on that Interval number, but I'm unsure how to read that variable from within Test Stand.
    I can either pull interval numbers from the text file, or set up logic in the VI to make a true / false flag based on interval numbers
    i.e. interval 30 - 60 run the test....61 to 75 pause (dont run test)....76 to 125 run test...etc
    Can you tell me how I might pull that interval into TestStand ?
    Is there a way without incorporating the stand alone VI in question into the Test Seq ?
    Thank you for any advice in advance !
    Solved!
    Go to Solution.

    Hi,
    Are you saying that you want to read this value stored in your text file and use this value to set the number if iteration of your test sequence loop.
    You will need a piece of software that will obtain the value from your file and then pass this back into TestStand to store in a teststand variable, probably a local. TestStand doesn't have the built in function to directly read the data from your file.
    Therefore you will need a code module attached to say an Action Step Type. The code module can be written in any one of the supported language, as you mentioned LabVIEW then maybe this is your perferred language. So your VI need to obtain the data from your file and return the value back to TestStand and you do this by sending your data out of your VI via its connector pane and then in teststand assigning a Teststand variable to your output connection of your VI.
    I am assuming you have the basic knowledge of setting up a Step in TestStand.
    Regards
    Ray Farmer

  • Mapping labview variables to teststand sequence context variables

    hi,
    how can i map variables from a vi (which is loaded in a test sequence in teststand) to teststand sequence context variables ?
    if my question is not clear enough then plz let me know.

    Sure I can help!
    You can use either method:
    Rodéric L
    Certified LabVIEW Architect

  • Programati​cally create local variable in TestStand

    Can somebody please explain the process of creating a local variable programatically?  I have searched the forums but haven't found what I am looking for yet.
    I have an array of unknown size.  I use a foreach loop to step through the array and grab the data that I need.  I need to put that string in a Local String Variable that I can use later.
    Any help is much appreciated.
    Matt
    Solved!
    Go to Solution.

    That did exactly what I wanted it to do thank you.  Now I want to take it one step further...
    I have a local variable array called RI_Equipment that is of an unknown size.  The array contains a container data.  I want to create a variable of name ri_nameField+"_ID" and then set the value of that variable to what is contained in RI_Equipment[x].ri_IDField.  Hope that all makes sense.  Below is the statement I have in TestStand however TS tells me that this will cause a run-time error.  What am I doing wrong?
    Locals.NewSubProperty(Locals.RI_Equipment[Locals.l​oopcounter].ri_nameField+"_ID",PropValType_String,​False,"",0) = Locals.RI_Equipment[Locals.loopcounter].ri_IDField
    Matt

  • How to create a local object reference variable in teststand sequence file programatically using C#

    I want to create a local object reference variable in a TestStand sequence file programatically using C#.

    Hi,
    Accoring to your reply in this Thread
    http://forums.ni.com/ni/board/message?board.id=330&thread.id=26984
    Just try this example. There you will create a numeric variable during excuting a sequence!
    Hope this is what you are looking for. 
    Please attach all your questions here.
    juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=
    Attachments:
    CTestStandDialog.zip ‏31 KB

  • Create variables in TestStand with the PropertyLoader

    Hello,
    I whant to read several csv-files with the property loader of TestStand 3.1 (all FileGlobals or StationGlobals). The problem is, if the variable doen'st already exists the property loader doesn't work.
    The variable I am ready in the CSV-file are alway different and I can't create manually the variable at first in TestStand or in the sequence file, before I can load them with the property loader.
    Is there a possibility to create dynamically variables (Globals or Locals) with the PropertyLoader? If not, what can I do?
    Cheers,
    Risotto

    Antonio,
    Thank you for your answer. I read and understood the post http://forums.ni.com/board/message?borad.id=330&message.id=8395#M8395.
    Anyway, this still not really helps me. I will try to explain my problem:
    We are actually upgrading from TestExec to Teststand/Labview. For our products (embedded electronic), we write for each SW release about 20 testplans in TestExec (which would be 20 sequences with Teststand). Each testplan use the same 2 symbol tables (where are defined about 100 variables definition and constants). From product to product and from SW release to SW release, there is always new/changed/deleted variables and constants. The name of the symbol table is always the same, only the contents is changing. TestExec reads this symbol tables at load-time of a test plan, so that you don't have to define the variables and constants separately and you can directly use them. Usually this variables and constants are related to voltages, currents, PWM duty cycle and so on....
    Now we are trying to do almost the same thing with Teststand. We create 2 CSV-files which contains our variables and constants and we whant to link them in all the 20 sequences. We tried to use the property loader, but you need to define in each of the sequence files all the variables and constants, which is a bit unconfortable. Please see the attached file for a more graphical explanation.
    What is the best was in Teststand to do something like with TestExec?
    Regards,
    Risotto
    Attachments:
    TestExec_Teststand.doc ‏29 KB

  • Passing variables from TestStand

    I appologise for another probably stupid question: I would like to use a variable / parametre (which ever you choose to call it) within my method. It appears that all of the templates are configured for outputs only. eg:-
    public void DummyFunctionName(out double[] measurements, out String reportText, out bool errorOccurred, out int errorCode, out String errorMsg)
    I have tried creating my own method with in types but it seems that the format for methods is fixed someplace else; maybe in the Interop.api ? I don't know ?
    I have also verified that it is impossible to pass into something that is defined as out.
    Solved!
    Go to Solution.

    Thanks Norbert,
    Maybe I wasnt clear in my question: I am trying to create methods who take parametres and return variables. If I change any of the types in the template to be an "in". eg.:-
    public void DummyFunctionName(in double[] measurements, out String reportText, outbool errorOccurred, outint errorCode, out String errorMsg)
    This is the response from the compiler:-
    Error 1 Type expected \\locationofmydrive Templetes\MultiNumericLimitArrayDataSourceCSharp.NET\dotnet.cs 6 32 
    Error 2 Identifier expected; 'out' is a keyword \\locationofmydriveTempletes\MultiNumericLimitArrayDataSourceCSharp.NET\dotnet.cs 6 58 
    .....and another 22 similar errors.

  • Read local & globalfile variables in TestStand 3.5 & using C#

    How do I read (and write) file globals and locals from C#? Code snippet below desn't work.
    //Get process model file globals
    SequenceFile aSequence = axExecutionViewMgr1.Execution.GetModelSequenceFile();
    //aSequence = axSequenceFileViewMgr.SequenceFile.GetModelSequenceFile(out modelDescription);
    //Get fileglobals for sequence file
    PropertyObject aProperty = axExecutionViewMgr1.Execution.GetFileGlobals(aSequence);
    //Get Order Id (in file globals)
    string anOrderId = aProperty.GetValString("CurrentOrderId", 0);
    I've done it before in VB6 (and TS 2.0) and there it works fine, se below snippet.
        Set myExec = myEngine.NewExecution(Nothing, aSequenceName, aModelFile, False, ExecTypeMask_Normal)
        'Get process model file globals and the order report object
        Set aSequence = myHelper.myExec.GetModelSequenceFile
        If Not (aSequence Is Nothing) Then
            'Get fileglobals for sequence file
            Set aProperty = myHelper.myExec.GetFileGlobals(aSequence)
            If Not (aProperty Is Nothing) Then
                'Get Order Id
                anOrderId = aProperty.GetValString("CurrentOrderId", 0)

    I have a similar issue and have tried the above solutions.  Unfortunately, it did not resolve the problem.
    As a last resort, I fully removed everything TestStand, LabWindows-CVI and LabVIEW. 
    Started fresh with TestStand 3.1.  Still get the same error messages (see below).
    The dll's exist in the folder.  And they worked before.   
    The whole nightmare started with the installation of a newer version of CVI (let's not go there).
    I downloaded and installed the very latest version of the CVI-Run Time Engine.  Still the same problem.
    Been deleting and re-installing everything all day. 
    Message Edited by Ray.R on 10-14-2009 04:28 PM
    Message Edited by Ray.R on 10-14-2009 04:29 PM
    Attachments:
    TS-error.PNG ‏12 KB

  • How to include a carriage return in a TestStand string variable

    Is there anyway to add a carriage return to a TestStand string variable. I am sending commands to an instrument using the Rs232 serial bus and they need to be terminated with a carriage return ie "\r". I know you can creat a DLL and return the string variables to TestStand but is there a beter way ?

    Hi Paul,
    Sorry about that, just noticed I left off the "" in my last response.
    Try "\\r".  that should solve it.
    Regards
    Ray Farmer
    Message Edited by Ray Farmer on 09-15-2005 09:14 AM
    Regards
    Ray Farmer

  • How to specify a unique integer for each local variable defined in TestStand?

    I have a .net application that reads all TestStand local variables, but for the .net application each local variable should have a unique integer number. Iterating through the locals and storing the index is not a good solution, because if a local variable is moved or deleted, the index will change.
    Does anyone know how to do this in TestStand or having an idea how to this in my .net application?
    Thanks.

    Thanks Doug for your reply. Using a GUID is not an option because this ID is too long. I will try to explain why I need this ID for. I have a lot of C# code that generates code to deal with a lot of instruments. For example to configure a device, user defined variables can be used to specify some settings or to store results. These variables are not stored in the generated code with a name but with an integer number. Now I want to try to be use all our existing device driver code with the TestStand sequencer. So, I need a translation between the name of a TestStand local variable and an integer number. After constructing the interface to my code I want to read all the variables from TestStand and now I need the integer ID to do the mapping to my variables. I know that I can use use your proposition 2 by encoding the unique ID into the name of the variable and parse the name of the variable to get it back, but this is not an automated way. This will be rather difficult if there are several hundreds of variables. For this reason I am looking for an alternative way. Looking forward for your response. Best regards   

  • Accessing TestStand Variables using Applicatio​n Manager

    I am working with an Operator Interface written in LabWindows/CVI 7.1.  I need this program to be able to access station globals and local variables in TestStand 3.1.  This Operator Interface was originally written for TestStand 2 and uses the older functions like TS_NewEngine, TS_EngineSetProperty, TS_PropertyGetValString, etc.  This has caused some problems when I try to use these functions with TestStand 3.1.  I can run the code fine in the debugger, but my executable just quits as soon as it encounters one of these older testStand functions (I can't tell which one).  I have been trying to incorportate the Application Manager, Sequence File View Manager, and Execution View Manager into the existing code without altering the GUI's appearence (keeping with the standard LabWindows text boxes and not using ActiveX controls).  I cannot figure out how to access variables in testStand using the Managers.  Here is the code I am using so far:
    //Define Panel Handles and ActiveX Control Handles
    typedef struct
     //panel handles
     int              m_pnMain;
     int              m_pnExecute;
     // ActiveX control handles:
     CAObjHandle applicationMgr;     // invisible control, manages Startup/Shutdown, and other application functions
     CAObjHandle sequenceFileViewMgr;   // invisible control, manages a SequenceView control that displays loaded sequence files
     CAObjHandle executionViewMgr;    // invisible control, manages a SequenceView control that displays executing sequences
     CAObjHandle m_oEngine;
     } ApplicationWindow;
    static ApplicationWindow gMainWindow; // this application only has one window
       // load the panels for the main window from the .UIR file
       errChk( gMainWindow.m_pnMain = LoadPanelEx (0, "Symtx Operator Console.uir", PN_MAIN, __CVIUserHInst));
       errChk( gMainWindow.m_pnExecute = LoadPanelEx (gMainWindow.m_pnMain, "Symtx Operator Console.uir", PN_EXECUTE, __CVIUserHInst));
       // prepare to use the TestStand ActiveX controls
       errChk( GetActiveXControlHandles());
       tsErrChk( TSUI_ApplicationMgrGetApplicationWillExitOnStart(g​MainWindow.applicationMgr, &errorInfo, &appWillExitOnStart));
       if (!appWillExitOnStart)
        // show a splash screen while starting up
        errChk( splashPanel = LoadPanelEx(0, "Symtx Operator Console.uir", SPLASH, __CVIUserHInst));
           errChk( InstallPopup(splashPanel));
       // make TS engine conveniently accessible
       tsErrChk( TSUI_ApplicationMgrGetEngine(gMainWindow.applicati​onMgr, &errorInfo, &gMainWindow.m_oEngine)); 
    The code shown above works fine.  I tried to add the following lines to access the station globals:
       // Get station globals
       m_oGlobals = gMainWindow.m_oEngine.NewPropertyObject( 3, False, "", 0); 
       m_oGlobals = gMainWindow.m_oEngine.Globals;
    and got the following error when I compiled:
      290, 39   Left operand of . has incompatible type 'CAObjHandle'.
    which referred to
    m_oGlobals = gMainWindow.m_oEngine.NewPropertyObject( 3, False, "", 0); 
    If anyone can help I'd greatly appreciate it.

    Hi there,
    The reason the code for TestStand globals does not work is because CVI does not support using the TestStand API in this way.  This can be a little confusing because in the help it lists using these methods and functions to access the properties you were looking for, however, in CVI you still have to use the TS_ functions to access different properties.  Usually it is TS_objectToOperateOn.  For example TS_Engine will always be getting properties or executing methods of the engine.  I have put some code below that should accomplish the same thing you were looking to do.  Hope this helps out!
        int error = 0;
        ErrMsg errMsg = {'\0'};
        ERRORINFO errorInfo;
        CAObjHandle myGlobals;
        //Get the globals from the engine
        tsErrChk (TS_EngineGetGlobals (myEngine, &errorInfo, &myGlobals)); 
        //Store the last user name into a local string
        tsErrChk (TS_PropertyGetValString(myGlobals, &errorInfo, "TS.LastUserName", 0, &lastUserName));
    Error: 
        // FREE RESOURCES
        if (lastUserName != NULL)
             CA_FreeMemory(lastUserName);
        // If an error occurred, set the error flag to cause a run-time error in TestStand.
        if (error < 0)
             *errorOccurred = TRUE;
            // OPTIONALLY SET THE ERROR CODE AND STRING
             *errorCode = error;
             strcpy(errorMsg, errMsg);
    Pat P.
    Software Engineer
    National Instruments

Maybe you are looking for

  • HT201269 How can I transfer my old iTunes library to a new computer?

    I just got a MacBook Pro and I'd like to be able to access the iTunes library from my old computer on it. I've tried Home Sharing but it doesn't allow me to transfer my old library to my new computer, it just allows me to listen to the songs from it.

  • How can I view only UNSAVED images/metadata?

    I rotate photos in bridge, but these metadata changes are not saved to the actual image until saved in Photoshop. If I missed saving a few photos during my initial steps, how will I know which photos still need to be saved if i can only see the modif

  • Retrieving clob locator

    I am having trouble retrieving a clob locator from a column despite being able to set it in a previous statement. The clob is always returned as null. This happens to both an 8.1.6 and 8.1.7 with the latest classes12.zip Thanks, -elliott Here is my c

  • Can't sync my ipod

    Whenever I try to sync my ipod, a msg saying 'An unknown error has occurred [.50]. Anyone know what's up?

  • Is it possible to include text over an image from i-photo?

    I wish to overlay one of my images with a caption but have no idea of what I would initially have to do with the original image to get to the stage of including text/wordart etc. Can anyone help?