Jump to content

Passing LV Class to TestStand as a parameter

Recommended Posts

Hi all,

I came across developing some custom step types in TestStand with LabVIEW code modules. My LabVIEW code module is architectured with LVOOP concept. But now I wonder how can I pass an LV Class object to TestStand for further use in other step types.

Currently I managed to store it in a LV Global and use it later. But are there any other way?



Link to post
Share on other sites

Hi there Mirash

Firstly what version of TestStand are you working with ?

From what I remember ,there are a few issues with dynamic dispatch not working as it should from TestStand. You have to provide a wrapper around the vi's and let LabVIEW dynamically dispatch. If you try to do this from TestStand you end up always calling the parent method.

You also need to specifiy the LabVIEW class as part of the step settings else come deployment time the TestStand deployment utility see multiple vi's with the same name and throws an error. (It doesn't see the .lvclass part of the name)

Good luck


Link to post
Share on other sites

Hi Chris,

Thank for the reply.

I am using TestStand 4.2 and LabVIEW 2009 SP1.

Obviously I wanted to use the dynamic dispatch functionality. but I am kind stuck in the initial stage itself ;).

When I inserted a LabVIEW Action step type with a code module having a Class as output, I am getting the properties as shown below.

Code Module Properties.PNG

Now I am not sure how do I pass this Parent Class Out to a different code module. As this type is shown as Unknown, I am not able to pass this to a variable also.

parden me if this issue is very silly, but some how I am stuck here.

Looking forward to here form you,



Link to post
Share on other sites


you need to pass the class data out of the LabVIEW action step to a TestStand variable (of data type Object Reference) and then pass it as an input param to the next LabVIEW step that needs the class data however I am not sure if that is available to you using TestStand 4.2, not sure if TestStand 4.2 allows LabVIEW classes to be passed as an object ref.


Link to post
Share on other sites
you need to pass the class data out of the LabVIEW action step to a TestStand variable (of data type Object Reference) and then pass it as an input param to the next LabVIEW step that needs the class data however I am not sure if that is available to you using TestStand 4.2, not sure if TestStand 4.2 allows LabVIEW classes to be passed as an object ref.

You're absolutely right - TestStand 4.2 doesn't support the LVOOP object, so the best bet to to flatten it to a string and pass it around in TestStand as a binary string <- note the emphasis, as passing it around as an ASCII string will corrupt it.

TestStand 2010 supports the LVOOP object, but does not support dynamic dispatch.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By Bryan
      TestStand Version(s) Used: 2010 thru 2016
      Windows (7 & 10)
      Database: MS SQL Server (v?)
      Note: The database connection I'm referring to is what's configured in "Configure > Result Processing", (or equivalent location in older versions).
      Based on some issues we've been having with nearly all of our TestStand-based production testers, I'm assuming that TestStand opens the configured database connection when the sequence is run, and maintains that same connection for all subsequent UUTs tested until the sequence is stopped/terminated/aborted.  However, I'm not sure of this and would like someone to either confirm or correct this assumption. 
      The problem we're having is that: Nearly all of our TestStand-based production testers have intermittently been losing their database connections - returning an error (usually after the PASS/FAIL banner).  I'm not sure if it's a TestStand issue or an issue with the database itself. The operator - Seeing and only caring about whether it passed or failed, often ignores the error message and soldiers on, mostly ignoring every error message that pops up.  Testers at the next higher assembly that look for a passed record of the sub assemblies' serial number in the database will now fail their test because they can't find a passed record of the serial number. 
      We've tried communicating with the operators to either let us know when the error occurs, re-test the UUT, or restart TestStand (usually the option that works), but it's often forgotten or ignored.
      The operators do not stop the test sequence when they go home for the evening/weekend/etc. so, TestStand is normally left waiting for them to enter the next serial number of the device to test.  I'm assuming that their connection to the database is still opened during this time.  If so, it's almost as though MS SQL has been configured to terminate idle connections to it, or if something happens with the SQL Server - the connection hasn't been properly closed or re-established, etc. 
      Our LabVIEW based testers don't appear to have this problem unless there really is an issue with the database server.  The majority of these testers I believe open > write > close their database connections at the completion of a unit test. 
      I'm currently looking into writing my own routine to be called in the "Log to Database" callback which will open > write > close the database connection.  But, I wanted to check if anyone more knowledgeable had any insight before I spend time doing something that may have an easy fix.
      Thanks all!
    • By Srinivas Iyer
      I am trying to do the following (LabVIEW2019, TestStand2019, Windows 10)
      Create a new sub-property under RunState.Engine.TemporaryGlobals as Measurements.TestName_DateTimeStamp 
      My TS expression:
       //get a handle to runstate.engine.temporaryglobals
      Locals.tmp_prop_object = RunState.Engine.TemporaryGlobals,
      //create a new obj ref type property under this
      Locals.tmp_prop_object.AsPropertyObject.NewSubProperty(Locals.name1, PropValType_Reference, False, "",0),
      where Locals.name1 is Measurements.TestName_DateTimeStamp (e.g: RunState.Engine.TemporaryGlobals.Measurements.RxGain12_16_58AM)
      I now want to assign a LabVIEW class object to this property as:
      RunState.Engine.TemporaryGlobals.Measurements.RxGain12_16_58AM = Locals.tmp_obj_ref
      where Locals.tmp_obj_ref is the output terminal of a LabVIEW class and tmp_obj_ref is a TestStand variable of type Object Reference
      If I do it like this in the expression window, I can see that my RunState.Engine.TemporaryGlobals.RxGain12_16_58AM has been assigned a LabVIEW class object
      However, the value RxGain12_16_58AM is known to me only at run-time, so I cannot hard-code the assignment expression as above.
      Any pointers on how to achieve this?
      Basically if,
      Locals.name = "RxGain12_16_58AM" (created at run-time)
      then i want to be able to assign, during run-time:
      RunState.Engine.TemporaryGlobals.RxGain12_16_58AM = Locals.tmp_obj_ref

    • By MRedRaider
      15. FIFTEEN. That's the number of current job postings  in my group. We're hiring! This is the most fulfilling, challenging, and rewarding position I've held. Job specific requirements listed on the website.

    • By Jean LINISA
      Je recherche pour une mission longue durée (1 an minimum) en région parisienne un(e) ingénieur(e) LabVIEW & TestStand expérimenté(e).
      Une certification CLD/CLA et/ou CTD serait fortement appréciée.
      Un backgroud en électronique/mécatronique serait un plus.
      Disponibilité ASAP
      Français obligatoire.
      Contactez-moi en MP ou par Mail
    • By Avital_Testview
      Hi all,
      We're excited to announce the public release of TVI – our industry-proven test management framework for LabVIEW:
      TVI is a flexible and easy to use test sequencer and reports generator for LabVIEW based functional testers.

      Key features:
      Simple and easy to use user interface Very short learning curve Creating test sequences in few clicks Viewing results in real time Exporting of data in various formats (CSV, PDF, HTML) Seamless integration with LabVIEW enables to write/edit tests directly from TVI (developer mode) Editing sequences and test parameters on the assembly line stations (runner mode, no need for LabVIEW) (TVI does not require TestStand to run)
      See it in action here: https://youtu.be/7Job4qMc66w

      We’d love to get any feedback!



  • Create New...

Important Information

By using this site, you agree to our Terms of Use.