LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview 2021: SSH function - Not interactive

There is a new function called "OpenSSH Exec" available in LabVIEW 2021. On calling this function and sending Username, Password, IP and Linux command, i am getting the response. But the challenge here is its not interactive - My Requirement is - when i send a Linux command, i need wait for parameter and then enter a value and then wait for 2nd parameter, again enter value and so on till all parameters are feeded with values. This works perfectly well when i try with command line ssh. But when i send same Linux command on above LabVIEW function, it responds with all parameters in 1 shot without waiting for my input value. Image shown below for reference. Any one has worked on ssh function in LabVIEW and have any suggestions to handle this? I suspect this function is sending return key internally till some End of text/response is received.

GirishVrishab_0-1655369549192.pngGirishVrishab_1-1655369584349.png

 

GirishVrishab_2-1655369774161.png

 

0 Kudos
Message 1 of 9
(3,784 Views)

NI is supposedly working on a session-based SSH (see the current LabVIEW Roadmap).  What I do currently is use a .NET library (SSH.NET) and I built a class wrapper around this library.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 9
(3,763 Views)

Another option is to use the Encription Compendium library from https://lvs-tools.co.uk/software/encryption-compendium-labview-library/

Not free but it beats trying to cook your own LabVIEW library if you just want to use something rather than DYO (develop your own).

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 9
(3,754 Views)

Hey Girish

 

Did you solve this? I am having the exact same problem you posted

 

Please let me know

 

Ana

0 Kudos
Message 4 of 9
(3,145 Views)

Hey arohr,

 

From NI Labview, it's not possible to have interactive SSH session. Every time we poll on SSH in labview, it creates a new instance. So, i had to use Python method and call it from Teststand wherever SSH session was needed.

 

Thanks

Girish

0 Kudos
Message 5 of 9
(3,113 Views)

ok, thanks

 

I ended up using third-party ALAB SSH toolkit

 

Ana

 

 

0 Kudos
Message 6 of 9
(3,104 Views)

How did you go about using the python method to call an SSH session?

0 Kudos
Message 7 of 9
(3,005 Views)

I have used Paramiko library (available online). Its pretty simple to use.

0 Kudos
Message 8 of 9
(2,983 Views)

Do you have to call it from testStand or would the library load directly if I use the native python module within Labview?

0 Kudos
Message 9 of 9
(2,961 Views)