Jump to content

TestScript: Free Python/LabVIEW Connector

Recommended Posts


From release blog...

Summary: Test engineers typically add manual-control screens to LabVIEW applications. While it would be helpful to repetitively execute varying parts of those manual-control screens, LabVIEW is not optimal for dynamic scripting, or on-the-fly sequencing with flow control.  (Imagine editing the source code of Excel each time you wanted to create a macro.)  And while Python is built for scripting, it requires advanced custom coding to interface with LabVIEW. 

Announcing TestScript: a free Python/LabVIEW connector from Wineman Technology that is simple to add to your existing LabVIEW application and abstracts complex Python coding,  allowing you to easily use Python to control LabVIEW or vice versa.

  • Like 2
Link to post
  • 3 months later...

TestScript is written in Python 3.  If you are looking at calling Python 2.7 modules from LabVIEW, this is what Enthought's tool does (at present, anyhow).  TestScript enables you to use simplified Python 3 scripts to control a LabVIEW application or use a LabVIEW application to run and get results from a Python 3 script.  Because we've defined the Python-to-LabVIEW interface internally, scripts can literally be one line:

myVoltage = xDMMRead()

We can do this since, with comments and whitespace, TesScript contains 3,000 lines of Python code under the hood.  Can you write in Python 3?

And it's free.

Link to post

For clarity:

Currently:  The Enthought Python Integration Toolkit for LabVIEW lets you "Call Python functions directly from LabVIEW, and pass arrays and other numerical data natively" in both Python 2.7 and 3.6, is available for sale at ni.com, includes the Canopy development environment, and from what I understand helps solve some deployment headaches (e.g. Python packages).

The Python node that got released with LabVIEW 2018 lets you call Python functions from LabVIEW in Python 2.7 and 3.6.

TestScript is a free tool that lets you use LabVIEW to run Python 3.x scripts (that call Python functions) and retrieve the results back in LabVIEW ***and also*** lets you launch a Python script from your LabVIEW application that calls LabVIEW functions (that you expose from your application) from Python (e.g. to automate your LabVIEW manual control screen behavior on-the-fly:  flip relay, acquire data, log data, repeat overnight).  Examples included.

Link to post

I haven't head of TestScript before.  Sounds interesting.  But I have tried both the Enthought toolkit as well as the LabVIEW Python Node.

I've been majorly impressed with the Enthought toolkit.  I've passed fairly large data to/from Python and the performance has been pretty great.  And it certainly does solve some deployment headaches.  It has a building mechanism that is able to generate a self-contained python environment with only required libraries for running your code.  You can copy/paste this environment directly onto a deployed machine and it will run!  No need to install and configure a python environment from scratch for every deployed machine. 10/10 recommend

Link to post

That's great insight.  At the end of the day, the Enthought toolkit and the LabVIEW 2018 Python Node are optimized for directly calling Python functions from LabVIEW.  Pretty cool.

TestScript is optimized for running Python scripts from LabVIEW which can call Python functions or custom LabVIEW functions.  If you return values (scalars or arrays) back to LabVIEW at the end of a script, they are returned as a string.  Example script we include (where we pass an array of numbers as a script argument when launching it from LabVIEW):


# Use list comprehension to create a list of floats to sum up.
addends = [float(i) for i in locals()['arguments']]



Since you're familiar with the tools, I'm interested in your feedback if you get a chance to checkout TestScript.  Just email testscript@winemantech.com to connect!


Link to post

That sounds indeed like a gap-matching tool when it comes to calling LabVIEW code from Python!

I am urged to try it out ASAP, as I see that romance between LabVIEW and Python has already started, but still misses the spark. TestScript indeed promises a lot to kindle up this fire. 

Link to post

I agree:  WYSIWYG DevX and parallelized UI, control, DAQ, and logging meets a readable, exploding, scientific text-based sequencing environment!

TestScript lets you expose any number of LabVIEW actions (flip relay, read DMM, turn on power supply, etc.) and call those directly in your Python script:  xFlipRelay(), xReadDMM(), xPowerSupplyOn().  We recommend having, for example, the front panel button that flips your relay call the same code as the corresponding Python function.  This way, the code behaves identically whether it's being called via manual control screen or Python script.

Please check out the examples, and reach out with product ideas!  We're already folding TestScript into our own projects and loving it.


Link to post

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 drjdpowell
      I am just starting on trying to be able to use Python code from a LabVIEW application (mostly for some image analysis stuff).  This is for a large project where some programmers are more comfortable developing in Python than LabVIEW.  I have not done any Python before, and their seem to be a bewildering array of options; many IDE's, Libraries, and Python-LabVIEW connectors.  
      So I was wondering if people who have been using Python with LabVIEW can give their experiences and describe what set of technologies they use.
    • By Yaw Mensah
      I have installed Labview 2020 on Dedian Buster using the rpm to deb conversion method via alien. Due to Architecture mismatch i deleted the *i386.rpm files before conversion.
      My Problem is that after creating a project at "Build Specification"-> "rigth click" i am only able to select "Source Distribution". Application does not show up as an option. 
      I will be grateful for any suggestions.
      Thank you in advance.
    • By javier_r
      VIPM.io now allows you to post LabVIEW Resources, Ideas, and Tools. For example, you could post a link to a video tutorial or blog article about a package. You can also post ideas, like feature requests or new tools. Best of all, package developers are notified when you post your ideas and resources, and you can comment and discuss posts with the community. Take a look at this video to learn more: https://www.vipm.io/posts/664960df-f111-4e13-989a-24be8207182d/

    • By Shuvankar Das
      I want to connect My ccd camera with labview. The details of my system is given bellow. I cannot connect it please help   OS:  WINDOWS 7, 64bit   LabView Run-Time 2013(64-bit) NI-IMAQ 4.8 NI-IMAQdx 4.3   Camera: QICAM Monochrome Cooled (QIC-F-M-12-C) Model QICAM Resolution 1392 x 1040 Sensor 1/2" Sony ICX205 progressive-scan interline CCD Pixel Size 4.65 x 4.65µm Cooling Type Peltier thermoelectric cooling to 25˚C below ambient Digital Output 12 bit Video Output FireWire (IEEE 1394b) Max. Frame Rate 10 fps full resolution @ 12 bits Pixel Scan 20, 10, 5, 2.5MHz Mount Type C-mount optical format  
    • By javier_r
      Hello everybody!
      Wondering how many people have tried the new vipm.io site. We have added a ton of features to make it easy to Discover LabVIEW Tools and there are some cool ones coming soon.
      Check it out and let me know what you think 😀

  • Create New...

Important Information

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