LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Internet Over Serial

I am currently working on a small module that has multiple serial ports but no ethernet port, It has come with a serial-to-ethernet adapter but no software and is manufactured in china so information is a little hard to get. My suspicion is that the serial-to-ethernet is designed to allow communication of an RS232 or RS485 communication over long ranges with readily availble ethernet cables.

I was wondering if anyone knew whether it is even possible to use the serial connection to connect to the internet and if so where a good starting place would be to write the labview code to enable it.

 

Thanks in advance.

0 Kudos
Message 1 of 11
(3,921 Views)

Hi ogk.nz,

 

Your module is having serial to Ethetnet adapter, so using the adapter you can connect LAN cable to PC and communicate to LabVIEW .You can use TCP/IP protocol or UDP protocol to communicate.

0 Kudos
Message 2 of 11
(3,892 Views)

My suspicion is that the serial-to-ethernet is designed to allow communication of an RS232 or RS485 communication over long ranges with readily availble ethernet cables.

What makes you think this? Have you tried connecting it to an ethernet network?

 

It's certainly possible to connect to the internet from a serial port, using a modem and dial up connection, but it might well be easier just to get a working serial to ethernet adapter

 

MC

0 Kudos
Message 3 of 11
(3,848 Views)

Is the adapter actually serial to ethernet, or is it just wiring the pins of a serial cable into an RJ45 connector? If it's serial to ethernet, then it must support some protocol running on top of ethernet that carries the serial data. In that case the underlying protocol is probably TCP or UDP and there's minimal additional work required to connect it to the internet. However, it's more likely that it simply transfers the serial data over an ethernet-style cable, possibly with some amplification to allow a longer cable run, since this is much cheaper and less complex. In that case, there are protocols that allow Internet Protocol (IP) to run over a serial line, notably PPP and SLIP. Your module would need to support one of those protocols in order to connect to the internet.

0 Kudos
Message 4 of 11
(3,824 Views)

I have attached a couple of photos of the adapter, and they appear to be the simplest and cheapest method of simply connecting the serial pins an RJ45 connector, hence my original inclination towards the adapter simply being used to allow serial communication over a LAN cable.

 

One thing that I did find interesting however was that when I tried to find whether pins 2 & 3 on the serial connector corresponded to anything in the RJ45 connector with a multi-meter I was unable to find if they were connected to anything. This does throw the usefulness of the connector into doubt completely. 

 

In terms of using SLIP or PPP from a labview format, how hard would it be to develop my own protocols/does anyone know of any that are floating about out there, a quick search only seems to have revealed this thread containing anything about developing a connection over these methods.

 

Download All
0 Kudos
Message 5 of 11
(3,803 Views)
Looks like you're right about the adapter. While I'm sure it would be possible to implement the necessary protocols, it might prove to be a substantial amount of work. You might want to consider a proper serial to ethernet converter. I've used ones from Lantronix before with good results, but there are plenty of other suppliers too.
0 Kudos
Message 6 of 11
(3,789 Views)

Yeah, now I just have to convince my supervisor that there is no proper way of connecting to the internet with this adapter, even though it looks like it should work. 

 

Well thanks for the help anyway guys.

0 Kudos
Message 7 of 11
(3,786 Views)

ogk.nz wrote:

In terms of using SLIP or PPP from a labview format, how hard would it be to develop my own protocols/does anyone know of any that are floating about out there, a quick search only seems to have revealed this thread containing anything about developing a connection over these methods.


I probably shouldn't have mentioned PPP and SLIP, I suspect I've just added confusion. You don't want to write a TCP stack and SLIP or PPP server in LabVIEW, and even if you did, it probably wouldn't accomplish what you want. What exactly is the remote device? Why do you want it to be on the internet? If the only way it can communicate is over serial, then it's going to need to be connected to a computer. Put the computer on the internet and write a service that accepts commands from the internet and relays them over serial to the device, if that's what you need.

 

SLIP and PPP both run Internet Protocol (IP) over a serial line connection, but they still require a physical connection to a single, possibly remote (via modem), machine. That machine is connected to the larger internet and acts as a gateway or router, relaying packets between the larger network and the serial connection. I don't think this helps with what you want to do.

0 Kudos
Message 8 of 11
(3,777 Views)

Yeah, PPP and SLIP once I looked at the wiki pages made a little bit more sense, however in terms of internet connectivity the module was originally bought to replace a computer with internet access as it has a much smaller power draw and so can run longer on batteries. I am in the middle of adapting a piece of labview code from the computer to the smaller device running on windows CE. However they also wanted me to add in the ability to upload its data to a remote location. Hence the needing an internet connection. 

 

I am currently leaning towards the solution of saving all of the data onto an SD card to be switched out at the necessary times as a simpler and more cost effective method, especially considering that there is going to have to be a person on-site daily to recalibrate all of the instrumentation. There is a single USB port to go along with the 4 serial COMPorts, however given that the device is running on windows CE I don't like the odds of a 3G modem working so I probably won't even bother to bring it up.

0 Kudos
Message 9 of 11
(3,765 Views)

You may have already looked at this or it may be outside your budget, but if the device only needs to run LabVIEW code and you do have the budget for it, consider one of the NI compact RIO units. They offer a full TCP stack and ethernet as well as serial communication, and can run off a battery.

0 Kudos
Message 10 of 11
(3,752 Views)