10-16-2021 12:39 PM
Hi everyone, I'm a noob to LabVIEW and I'd like some help~
The GPIO device https://numato.com/docs/32-channel-ethernet-gpio-module-with-analog-inputs/ I'm using is only configurable over Ethernet. In order to configure it I will have to log in to the TCP/IP connection. I could control the I/Os with Hyper Terminal. Now I want to control it with LabVIEW but I don't know how to log in wirelessly within LabVIEW.
I know this is pretty dumb but how can I enter username and password after reading?
10-16-2021 01:21 PM
According to the manual for your Device (thank you for providing the link!), this is really a "Serial" device that can communicate either over an Ethernet port (using a Serial Communication over Ethernet program such as PuTTY) or as a Serial Port over the USB connection.
LabVIEW knows how to do Serial Communication with VISA, and you can communicate to a Serial Device (which is what you really have) either through USB or through TCP/IP. Here's what I'd suggest you try:
LabVIEW includes VISA functions to do just what MAX lets you do. They can be found on the Instrument I/O Palette on the Block Diagram (under VISA, of course).
Bob Schor
10-16-2021 03:02 PM - edited 10-16-2021 03:02 PM
Thank you so much for responding Bob!
My goal is to make a GUI on LabVIEW for I/O control over ethernet. My Laptop and my device are using the same Ethernet network but my laptop will not connect to the device (but for testing purposes I can connect with a USB). Will this still be considered Serial?
Actually, I have done all these steps yesterday. Unfortunately when I was at step 3, Max didn't show me anything so I added the TCP/IP resource manually, which it worked because there isn't a cross(x) next to it. That is a good-to-go sign right?
What VISA or TCP functions/commands will I need for this device if I want to control it with Ethernet?
The pics I posted earlier were the ones using TCP, but I am still struggling with what functions I should be using, and the entire Host&Client thing with TCP.
Please help.
10-16-2021 04:56 PM
The MAX screen shows it all! You are, indeed, using "VISA over TCP/IP".
I noticed that you "blocked out" the IP Address on your Front Panel -- you didn't need to do that, because it is part of the 192.168.x.x "non-routable" IP addresses used by most WiFi Routers. "Non-routable" basically means that it basically defines a "Private Network", one that involves your Router and anything/everything connected to it (like your GPIO cards). If I wanted to "hack in" to your (I presume "home") Network, I'd have to connect to the only "listener", your Router, and (of course) you have configured your Router to use WPA2 security, right?
Notice the entry under Network Devices that says "TCPIO::192.168.10.189" and other stuff. That's your "189gpio" device. Note the entry below it shows an Error on the Device icon -- that is from a formerly-connected gpio that was assigned an IP Address of 192.168.10.240, but is not currently connected.
Look at the remaining numbers: "::23:SOCKET". This means that you have a VISA connection over TCP/IP (a.k.a. Ethernet, or WiFi) that uses "Socket" 23.
Go back to your Computer, plug in your GPIO, open MAX, and click on the Network Device that shows a "working device" (like Socket 23 in the picture you sent). Then look in the right-hand pane and see if you "see your Device". If so, try to open a Test Panel and establish a VISA connection.
So now you need to learn how to "talk serial" to your device using VISA. Here is a link to a tutorial on setting up such communication -- it discusses Communication using "true" Serial Ports (a.k.a. RS-232). There's a bit of a "trick" to configure a Serial Port over Ethernet -- I've done it, but I'll have to go look for "how I did that". Or, better, do what I just did and Web Search for "LabVIEW Serial Communication over Ethernet" and look at the October 2020 Knowledge Base article (print it out for yourself).
Good luck. This should get you "mostly there".
Bob Schor
10-16-2021 08:46 PM
I have used a similar module from Numato (32-channel relay, also Ethernet). I was very impressed with it, especially for the price.
1. The USB connection is just for configuring the device.
2. These devices use a Telnet protocol to communicate. Which means you will have to handle Telnet option codes.
So I did not use VISA for my driver. I used the TCP/IP functions. Part of connecting is to specify the connection port (23 is specifically allocated for Telnet by some internet authority). There is a simple TCP Write, which will just send what you tell it. And then the TCP Read has an option to read a specific number of bytes or to stop at a Carriage Return + Line Feed. I typically use the CRLF option for this. So I read a line and then I have to search for 0xFF and then either 0xFD or 0xFE. For each of those I found, I replied back the exact same code to act as an acknowledgement of the option code. If you don't do this, the rest of the session will not work.
10-16-2021 09:59 PM
I like Crossrulz' method, particularly because he's actually used these boards!
Bob Schor
10-17-2021 12:33 PM
@Bob_Schor wrote:
I like Crossrulz' method, particularly because he's actually used these boards!
I liked the method because I could reuse the class I had already made for other Telnet interfaces. I just had to add the handling of the option codes for these boards since the previous interfaces did not use them.
10-18-2021 11:54 AM
Thank you so much for replying crossrulz! Notes taken!
I have tried to run some examples using TCP/IP functions but I am still a bit confused. From what you said, I will need to make a host vi and client vi, the host will be my laptop/the network and the client will be GPIO device, right?
Would you mind explain a little more about "For each of those I found, I replied back the exact same code to act as an acknowledgement of the option code." and how to code it please? Does it mean I can enter the log in info (If you could see the two screenshots attached to the first post)?
10-18-2021 12:00 PM - edited 10-18-2021 12:06 PM
@EE_KK wrote:
From what you said, I will need to make a host vi and client vi, the host will be my laptop/the network and the client will be GPIO device, right?
No, you will only need to make a client VI. The GPIO device is already the server.
@EE_KK wrote:
Would you mind explain a little more about "For each of those I found, I replied back the exact same code to act as an acknowledgement of the option code." and how to code it please? Does it mean I can enter the log in info (If you could see the two screenshots attached to the first post)?
I somehow know you would ask for that.
Read Data:
Respond to Option Code:
Log In:
10-18-2021 12:44 PM - edited 10-18-2021 12:57 PM
I realized I don't have the telnet functions installed so I went looking for the package, but I can't find it, and https://forums.ni.com/t5/LabVIEW/Deprecation-of-Internet-ToolKit-so-no-more-Telnet-support/td-p/2381... . Does it mean I can't use telnet functions anymore? 😞 This is the very first time using LabVIEW so I'm not familiar with all the elements, would you label the items please? I really appreciate your time and help!