LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automating Labview

Solved!
Go to solution

I was trying to find documentation on automating labview.  We have some automated testing that takes hours and I would like to write a batch file or power shell script that could look launch the labview test and based on log file information re-run that same test a few times and if it fails, not re-run the test.

Is there a link to more information on calling labview and then checking the results a few hours later after the test is done and re-running it if successful?  

0 Kudos
Message 1 of 7
(893 Views)
Solution
Accepted by Warren_NBA

If you make a VI that is set to "run when opened" (or make a wrapper VI that runs when opened) you can use this in a script:

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z00000159rmSAA&l=en-US

 

Or, if you need/want to call a VI with different values, you can build it (possibly with a wrapper VI) as an EXE, then call it, using this to pass it values:

 

https://zone.ni.com/reference/en-XX/help/371361P-01/lvprop/app_command_line_args/

 

 

0 Kudos
Message 2 of 7
(877 Views)

Why not just implement this retest logic in LabVIEW?

 

Is this is an application built into an exe that you don't have source access for?

0 Kudos
Message 3 of 7
(875 Views)

Not possible.   We have iPhones with bluetooth scanners.  They need to fire off the correct labVIEW test and the results need to be posted to a Postgres SQL database.  My understand (we have the Professional Edition) is that labview can through .NET post the results to the postgres database.   I just need a batch file to launch labView in "batch mode" and run the correct test (which I know based on the unit the tech is working on).

I think we have 3 subscriptions (or 3 PC's with labView professional).   I could be wrong, we may only have 1 subscription and 1 labview computer... but plan on deploying multiple labViews so we have more than 1 automated testing PC (eventually).

0 Kudos
Message 4 of 7
(861 Views)

@Warren_NBA wrote:

Not possible.   We have iPhones with bluetooth scanners.  They need to fire off the correct labVIEW test and the results need to be posted to a Postgres SQL database.  My understand (we have the Professional Edition) is that labview can through .NET post the results to the postgres database.   I just need a batch file to launch labView in "batch mode" and run the correct test (which I know based on the unit the tech is working on).

I think we have 3 subscriptions (or 3 PC's with labView professional).   I could be wrong, we may only have 1 subscription and 1 labview computer... but plan on deploying multiple labViews so we have more than 1 automated testing PC (eventually).


I fail to see how that makes anything not possible.

 

It sounds like what you want to do is:

 

  1. Start test execution
  2. Log results to Postgres SQL DB.
  3. Repeat the test if the result was a failure. I assume up to some number of repetitions.

That is all quite possible within the application created by LabVIEW itself.

 

Sidenote: 

You know that LabVIEW is a development environment, right? "... plan on deploying multiple labViews" is like saying you plan to deploy multiple Pythons or multiple Visual Studios. If you have a LabVIEW Professional license, then you have access to the application builder. If you plan to deploy to multiple test stations, I assume in a production environment, you should be deploying compiled executables that run using the runtime engine.

0 Kudos
Message 5 of 7
(841 Views)

You don't need a LabVIEW license if you deploy the code to an executable. You just need the Runtime license, which is free. You only need the full license to develop the code, and you can use .bat files to call .exe's just fine. You should be able to do all of that without TOO much modification of your existing code.

 

Also, check this out:https://forums.ni.com/t5/NI-Linux-Real-Time-Documents/Tutorial-PostgreSQL-with-LabVIEW/ta-p/3491581

 

Skip the linux part (it's just setting up the database) for some ways to implement PostgreSQL into your LV app.

0 Kudos
Message 6 of 7
(837 Views)

I would write the test automation in LV and have it send the result to the DB, but if you really want to control it from some other program/system you have several options:

- Make a DLL and call on testing functions from another program

- Make small .exe's that you can call from e.g. a batch script

- Make a webclient that runs in the background that you can send commands to

- Script a mix of tests in TestStand

(there's more)

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 7
(726 Views)