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: 

LabVIEW TCP Read throws timeout error

Solved!
Go to solution

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.

GirishVrishab_0-1652676408129.png

 

0 Kudos
Message 1 of 13
(1,825 Views)

Is it a requirement to use the native LabVIEW TCP palette?  It would be a lot easier to use LabVIEW System Exec.vi instead.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 13
(1,813 Views)

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. 

0 Kudos
Message 3 of 13
(1,801 Views)

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).

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 4 of 13
(1,792 Views)

@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.

GirishVrishab_0-1652676408129.png

 


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?

0 Kudos
Message 5 of 13
(1,777 Views)

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.

0 Kudos
Message 6 of 13
(1,769 Views)
Solution
Accepted by GirishVrishab

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.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 7 of 13
(1,757 Views)

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.


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
Message 8 of 13
(1,742 Views)

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?

GirishVrishab_0-1652776315151.png

 

0 Kudos
Message 9 of 13
(1,714 Views)

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 13
(1,711 Views)