From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running Python in LabView

So basically i have this python script that is being called in a Labview VI. The python script saves and displays a graph (whether a sine or cosine). However, when i run the script through labview, it does not save anything, and It doesn't display anything. What's wrong? 

if i run the python through cmd, it actually works.

I have included the vi and the python script. the python script is in txt. labview does not accept .py.

Download All
0 Kudos
Message 1 of 6
(5,162 Views)

Do you get an error code?

 

A few guesses (sorry, I don't have python):

Have you tried giving the full path to the executable?

What if you prepend "cmd /c" (see the help page)?

...

 

Also have a look at LabPython.

0 Kudos
Message 2 of 6
(5,154 Views)

actually, the labview runs fine until it says that it cnoot find the file specified. This means it cannot find the saved image. Python actually runs but does not complete its script

0 Kudos
Message 3 of 6
(5,131 Views)

Also try wiring the working directory.

0 Kudos
Message 4 of 6
(5,120 Views)

it didn't help.. the labview still gives me the same error.

0 Kudos
Message 5 of 6
(5,074 Views)

Have you read through this article: http://www.ni.com/white-paper/8493/en

 

Also, you might find this link useful: https://decibel.ni.com/content/docs/DOC-8995

 

It's also possible that you're running into an issue with admin rights. If you're not already running as an administrator, try right clicking on LabVIEW and select "Run as Administrator" and see if that clears up your problem.

 

Regards,

Brice Sorrells

Systems Engineer

National Instruments

www.ni.com/support

0 Kudos
Message 6 of 6
(5,042 Views)