Jump to content
xkenneth

Scripting the VI Tester

Recommended Posts

All,

 

I'm writing a multi-platform, multi-language enterprise application that includes the use of LabVIEW code. I'd like to be able to test my LabVIEW code using the VI Tester integrated into my integration server. In order to do this I need to be able to programatically call the VI tester (either from LabVIEW or some scripting language, preferably python) and report test results. What are my options for this?

 

Regards,

Ken

Share this post


Link to post
Share on other sites
In order to do this I need to be able to programatically call the VI tester (either from LabVIEW or some scripting language, preferably python) and report test results. What are my options for this?

 

Currently, the best way to run your tests is to programmatically call VI Tester's Run Tests.vi.

 

post-95-1246336559.png

 

This VI will return the results as a string and will return a success/fail boolean. The VI is polymorphic and supports a lot of different input types.

 

For an integration server, I would recommend creating a TestSuite that you can call that will include the tests you have validated for your application. That way you don't get any spurious results from tests under development.

 

As for calling the VI from another language, there are existing tools to use Python to call LabVIEW... Let us know if you have any feedback or suggestions once you get started that would make this process easier for you!

Share this post


Link to post
Share on other sites
All,

 

I'm writing a multi-platform, multi-language enterprise application that includes the use of LabVIEW code. I'd like to be able to test my LabVIEW code using the VI Tester integrated into my integration server. In order to do this I need to be able to programatically call the VI tester (either from LabVIEW or some scripting language, preferably python) and report test results. What are my options for this?

 

Regards,

Ken

 

Hey Ken,

 

I'm really eager to hear more about how VI Tester plays a role in your continuous integration process. We're happy to help answer any questions and brainstorm on ideas, so don't hesitate to ask...

 

Regarding calling VI Tester from Python, there are certainly a lot of ways to do this. If you're on Windows, the easiest way might be to use ActiveX.

 

Here's an example of how to run some a Test Case from Python using ActiveX:

 

# initialize the path to your test: this is just an example test case
myTest = r"C:\Program Files\National Instruments\LabVIEW 8.2\examples\JKI\VI Tester\Queue TestCase\Queue TestCase.lvclass"

# connect to LabVIEW
import win32com.client
labview = win32com.client.Dispatch("LabVIEW.Application")

# get VI reference to 'Run Tests (Path).vi'
VI = labview.GetVIReference(r'C:\Program Files\National Instruments\LabVIEW 8.2\vi.lib\addons\_JKI Toolkits\VI Tester\VI Tester API.llb\Run Tests (Path).vi')

# run the unit test by calling the Run Tests VI
returnVals = VI.Call(["Test Path", "successful?", "test details"],[myTest,"",""])

# get pass/fail Boolean (pass = TRUE)
passAllTests = returnVals[1][1]

# get test details string
testDetails = returnVals[1][2]

# disconnect from LabVIEW
labview.Quit()

Share this post


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.

Guest
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.

Loading...

×
×
  • Create New...

Important Information

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