LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Launch Python script

Solved!
Go to solution

Hello, I need to lauch a Python script form Labview. Where I can find a procedure or example that lists all necessary operation to do it? Thank

 

0 Kudos
Message 1 of 6
(393 Views)

Do you just want to launch as if you were calling it from command prompt?

 

If yes, you need to use System Execute VI

https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/vi-lib/platform/system-llb/system-exec-vi....

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 6
(382 Views)

Thank you. Probably I managed to launch the script (I have no Labview errors).

This script print a PASS/FAIL string in the command windows (I tried form Windows, with command prompt).

How can I get the string that is printed by the script?

 

0 Kudos
Message 3 of 6
(364 Views)

Hi V.,

 


@V.Life wrote:

Probably I managed to launch the script (I have no Labview errors).

This script print a PASS/FAIL string in the command windows (I tried form Windows, with command prompt).

How can I get the string that is printed by the script?


  • How did you call the Python script?
  • Which LabVIEW version do you use?
  • Can you use those CallPython nodes in recent LabVIEW versions?
  • Did you search in the example finder for example VIs on those CallPython nodes?

The CallPython node would allow you to (easily) send/receive data to/from your Python code!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(358 Views)
Solution
Accepted by V.Life

I used System Execute. Labview is version 2023 Q3. Is it possible to use the "Standard Output" line of the System Exec function to get all data printed by script (it is composed by more lines of text)?

0 Kudos
Message 5 of 6
(343 Views)

Hi V.,

 

have you tried the Python node yet?

 


@V.Life wrote:

I used System Execute.

Is it possible to use the "Standard Output" line of the System Exec function to get all data printed by script…?


Have you tried? It is as simple as connecting a string indicator!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(336 Views)