03-06-2024 10:46 AM
Hello,
i have finally a connection to my device with SSH protocol , using the LIBSSH2 addon from VIPM.
it works but my problem is that it takes 500 ms each time i ask for a value. and so 3 seconds to get the answer for the table.
if you have any suggestion for me to try to get this as a normal speed , that would be really great and helpful
it is LIBSSH2 1.2.4 ; Labview 2021-32bits, windows 10 64bits
03-06-2024 12:10 PM
Have you tried with Putty to see how your unit responds? That would be my first thing to look at to debug.
03-06-2024 12:44 PM
I just installed the LIBSSH2 library and did a little digging. It looks like the read is flat out timing out. It has no way, as far as I can tell, of stopping the read when the Line Feed is read.
I handle SSH by using an open-source SSH .NET library wrapped around a class. This library has WriteLine and ReadLine methods that work perfectly for your situation.
03-06-2024 01:11 PM
Thank you.
I understand that each read or write will take 500ms whatever we do with libssh2. Correct ?
You solution Iis getting a bit technical for me. would you share an example of how to immlement and use it in labview ?
Thank you
Emmanuel
03-07-2024 02:41 AM
Hello again , thank you very much.
i guess what you propose in explain there : Using Custom .NET Class Library in LabVIEW - NI
if so , it seems simple enough for me finally.
but
i can not build the .dll here , could you share it ? ( i do not have c# , or VB here)
could you also share an example of the labview code ?
that would be great.
03-07-2024 06:03 AM
Hello,
ok sorry i found the dll in the package
https://www.nuget.org/packages/SSH.NET
i am now trying to use it , and have this problem :
i tried this : Error Loading .NET Assemblies in LabVIEW - NI
but no progress.
any advices ?
regards
Emmanuel
03-07-2024 07:53 AM
Hello,
i can now load the Renci.SshNet.dll in labview 2021SP1 32bits , using the constructor node . ( it is a windows 11 64bits ) and the DLL is from
- i can load the version 2023.0.0 but the 2023.0.1 or 2024.0 will not load : 'an error occurred trying to load the assembly'. not the biggest problem so far.
- i end up with all the possible methods , but have no experience on how to use it and the documentation is not..
does someone have some code example on how to porceed next :
what i am willing to do is something like i did with the SSH LIBSSH2 but faster as this library is very slow ( i have an anwser after 500 ms) so i need to to connect to the device , send message end read answers ?
any suggestion , help highly appriciated.
regards
Emmanuel
03-07-2024 07:55 AM
Hello,
i can now load the Renci.SshNet.dll in labview 2021SP1 32bits , using the constructor node . ( it is a windows 11 64bits ) and the DLL is from
- i can load the version 2023.0.0 but the 2023.0.1 or 2024.0 will not load : 'an error occurred trying to load the assembly'. not the biggest problem so far.
- i end up with all the possible methods , but have no experience on how to use it and the documentation is not..
does someone have some code example on how to porceed next :
what i am willing to do is something like i did with the SSH LIBSSH2 but faster as this library is very slow ( i have an anwser after 500 ms) so i need to to connect to the device , send message end read answers ?
any suggestion , help highly appriciated.
regards
Emmanuel
03-07-2024 08:18 AM
I just spent way more time than I should have stripping out my SSH class to sit on its own. Hopefully this works for you.
I don't remember which version of the DLL I grabbed. You will need to have the .NET framework installed to match the DLL. For instance, if the DLL was built for .NET 4.0, you will need to make sure you have .NET Framework 4.0 installed.
03-07-2024 10:07 AM
Thank you Very very much , look very promising.
It seems it is connecting but then i do not get answer to the message.
i was thinking maybe it is because you use the DLL 2023.0.1 and for some reason i can'y load any dll after version 2023.0.0 on my computers.
i tried to replace the 2023.0.1 by the 2023.0.0 in the folder , but then it is not working at all anymore.
anyway i attach the screenshot, in case you have a suggestion.
would be a possibility that you rebuild it with the 2023.0.0 dll , any version of .NET seems to load here , see if it helps ?
Emmanuel