05-15-2022 11:47 PM
Hello All,
I have a challenge while implementing TCP on LabView. Though I have worked on LabView, I am new to TCP protocol on LabView.
My requirement is - I have an controller connected to ethernet and i know the IP and Port of the controller. i have created below VI and TCP read always gets timeout. I know i am missing something but not clear on what i am missing. My Expected output at TCP Read is a string (password prompt). Can anyone guide me on how to proceed.
Solved! Go to Solution.
05-16-2022 12:31 AM
Is it a requirement to use the native LabVIEW TCP palette? It would be a lot easier to use LabVIEW System Exec.vi instead.
05-16-2022 01:38 AM
I have tried with LabVIEW System Exec.vi. But challenge here is LabVIEW System Exec.vi is not interactive i.e., i need to send user name and wait for password prompt and then send Password. Instead it Opens a command prompt and doesnt pass control back to Labview for sending password. Similarly, after login, i need to send multiple commands to my controller. Hence i thought Labview TCP pallete is the only solution.
05-16-2022 02:18 AM
Although I never used it this way, PuTTY for Windows has both an option for specifying a password (-pw) and an option for executing a script (-m).
05-16-2022 03:17 AM
@GirishVrishab wrote:
Hello All,
I have a challenge while implementing TCP on LabView. Though I have worked on LabView, I am new to TCP protocol on LabView.
My requirement is - I have an controller connected to ethernet and i know the IP and Port of the controller. i have created below VI and TCP read always gets timeout. I know i am missing something but not clear on what i am missing. My Expected output at TCP Read is a string (password prompt). Can anyone guide me on how to proceed.
Most SSH-Programs have options to enter the password automatically or use crypographic key logins.
Is your controller commercially available or did you develop it yourself? Do you mind telling us about it a bit more?
05-16-2022 03:27 AM
its not just logging into controller. I need to send command and receive responses for my automation very frequently. For Example, login into controller and then hold the login session and send different commands and finally close the session.
05-16-2022 04:55 AM
Then you will need to implement the whole SSH protocol or use LabVIEW 2021 or buy a 3rd party tool, see here.
Sending the command line to the SSH server using TCP is completely wrong.
05-16-2022 06:04 AM
For SSH communications, I use the SSH.NET library. It is completely open source. You just have to make wrapper VIs (I recommend making a class). I think the Labvolution SSH tool also uses this library, but adds another layer of .NET libraries.
05-17-2022 03:32 AM
Thanks Paolo. You pointed me to right path. I was not aware that Labview 2021 offers ssh support. Have you used ssh function Labview 2021? I dont see any examples to understand this function. Di you knows what is command line here?
05-17-2022 03:39 AM - edited 05-17-2022 03:40 AM
Have you ever done SSH communication through a command line tool? Basically the command line string is the same text you would enter on the SSH command prompt in your command line tool. You may have to experiment if you need to append the LF, CF/LF EOL character sequence explicitly or not but other than that it should be the same.
After each command you send you receive the response and then can send another command on that same session.