|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
remote port or service name
I was looking into a TCP connection, and can understand everything except for the remote port or service name. What am i supposed to put there? does it not matter as long as it is the same? do they have to be different?
|
|
#2
|
|||
|
|||
|
Re: remote port or service name
If you think of the IP address as the street address, the port is like the apartment or door number. For a given machine they need to match, but if they use the term outgoing port, that refers the sending computer's port.
Service names are a way of using names and letting the port number be dynamically assigned. Quite a few port numbers are reserved for a given service. It is worth reading Wikipedia on tcp/ip to get a better sense of which to use. In LV, an unwired port will be dynamically assigned to avoid a conflict and is typically the right thing for outgoing ports Greg McKaskle |
|
#3
|
||||
|
||||
|
Re: remote port or service name
can you post example code please?
|
|
#4
|
|||||
|
|||||
|
Re: remote port or service name
I'm not sure what you want demonstrated with example code, but I'll try and explain in different terms.
The input "Remote Port or Service Name" can take two inputs, an integer, or a string. When given a number, this is the TCP/IP Port on which to operate. So if you want to send/receive data on port 21 (commonly used for FTP), you would wire a numeric constant with the value of 21 to that input. If you provide a string input, LabVIEW will query the Service Locator and try and resolve your input to an existing service (which will correspond in turn to a port number). In reality, you can avoid using the Service Locator portion of this input, providing you already know which port you need to use. I'm pretty sure NI has some examples provided in the TCP/UDP sections of their examples (go to Help->Find Examples, you can search for "TCP"), and they're usually pretty helpful. |
|
#5
|
||||
|
||||
|
Re: remote port or service name
so the port can be any number than, as long as it matches the other computer's?
|
|
#6
|
|||
|
|||
|
Re: remote port or service name
There are ranges of ports that are reserved, and some low numbered ones that are owned by things like ftp. But yes. Use the same number for both, as the examples do, and it should work.
Greg McKaskle |
|
#7
|
||||
|
||||
|
Re: remote port or service name
what number would you say is the lowest i could do (or any safe one)
|
|
#8
|
|||||
|
|||||
|
Re: remote port or service name
Ports that are guaranteed open on the field (from the manual):
Quote:
|
|
#9
|
||||
|
||||
|
Re: remote port or service name
i want to get a picture from the camera by an onboard laptop, do some processing, and then send information out to the crio to read. So not dealing with any network. So is it still limited?
|
|
#10
|
|||||
|
|||||
|
Re: remote port or service name
You should just use WPILib to read the camera's stream on your laptop, this shouldn't be a problem for you, right. This will use TCP port 80 underneath. When you send data to the cRIO, I'd use UDP on any port, except 80, just pick one that isn't already in use (and yes, I know that TCP 80 and UDP 80 are technically different, but just avoid that port and make things simper, it's not like you're all that constrained).
|
|
#11
|
||||
|
||||
|
Re: remote port or service name
udp not tcp?
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|