LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading a file via tcp/ip

I have used the open application reference and the open vi reference with the invoke node to remotely activate a vi and this works fine. The vi on the remote comuter creates an output file which i then need to get onto the local computer and I am unsure how to do this, can anyone help, im sure it cant be too hard but i dont really understand the vi client and vi server tcp/ip examples shipped with labview. Im sure it cant be too hard but its just not clicking for me. Can anyone tell me how to do this
0 Kudos
Message 1 of 6
(3,667 Views)
You need to develop a pair of VI that work together to do this.

Before I wander off into to the details of what you are asking, I want to first ask what is leaving you wondering about the TCP/IP examples?

I would like to make sure you understand those fundementals before I "snow" you with suggested app spec's.

I am willing to work with you on this if you would like.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 6
(3,667 Views)

There is a really helpful tutorial on Basic TCP/IP Communication in LabVIEW on National Instruments' website you might want to take a look at. There is also an Application Note on their website discussing some of the more intricate details of it also. These two resources are pretty useful for starting off with TCP/IP communication in LabVIEW.

J.R. Allen
Message 3 of 6
(3,667 Views)
I believe that I just don't understand the concepts behind TCP/IP connections. What constitutes one? How do you get an IP address, do you have to be connected to the internet or do you just need a phone line. Most things I read just dive straight in to servers and clients, which is which, what is on my computer and what is on the remote computer. I need a simple example that shows me how they work and basically explains it in laymans terms. The knowledge base example i read on activating a remote vi made sense after reading it a few times, but tcp/ip... im struggling. Ive read the stuff on basic tcp/ip connections and as i understand, i need a vi that writes the file to a certain spot so that when i connect to that computer it can read the file (can it copy it
to my computer). I have written a vi that i run on my computer which connects through a ip address and activates a vi on another computer. This vi creates an output file that i need on my computer. Can you try to fill in the gaps in my patchy knowledge.
Thanks
Ridge
0 Kudos
Message 4 of 6
(3,667 Views)
Thanks,
I had already read the first one and am trying to get my head around the app note. I am determined to get it going so i might just do some more reading then see how we go.
Thanks again
0 Kudos
Message 5 of 6
(3,667 Views)
Hi Ridge,

I would like to take a stab at answering your questions while avoiding writing a book in the process.

The questions you are asking go down below where you generally work with TCP/IP in the LabVIEW environment. When you are using a PC on a local area network (that may, or may not be connected to the internet) there are a number delivery mechanisms available for moving messages about between machines and the application running on them.

I will try to give you a layman's tour through some of what is going on to move this information around by starting at the bottom and touching on just enough to answer some of your questions.

About 20 years ago the OSI 7-layer model came out describing how people should organize their communications schemes such that many different applications from different vendors would play nice together. This 7-layer model broke the whole process down starting at the TOP which I believe they called the application interface layer down to the bottom which talked about the physical layer, things like wires and transcievers and the like.

Looking back I would have to say that the 7-layer model has worked rather well as far as it has been adhered to. Getting back,

The physical layer also talks about how data will be put on the wire and taken off. Examples of physical layers are things like
Ethernet
Token-Ring
etc.

In the case of ethernet you have any number of computers virtually all sharing the same wire to do the talking. No two can talk at the same time otherwise they would step on each other. This is called a collision. The whole thing works sort of like a party line with a buch of people taking turns having different conversations. Same thing happens on ethernet. Seperate device take turns saying what they have to say and then letting others talk.

To make it fair for all there is a limit of how long your message can be. This keeps one device (person) from tying up the line. If I remeber correctly that was somthing like 4096 bytes or there abouts.

So how does allow larger transferes? That is where the 7-layer model kicks in. In the next higher level, above ethernet and token ring and the like, are the transfer protocols. The transfer protocols are responcible for moving data using the physical layer. Examples of transfer are TCP, UDP, DECnet, LAT, etc.

As in the case of TCP (Transfer Control Protocol ?) they have they trem Protocol buied in them. They all utilize the physical layer to provide what ever service they provide using a set of rules to interact with a conterpart on another part of the physical layer. (boy was that a bad sentence).

Returning to the earlier anology of th ephone conversation. You could have many conversations taking place in different languages as long as the listener and the talker where speaking the same language. same way over ethernet. One talker could speak TCP (english) as long as there was a listner listening for TCP (english) and intermitantly another talker could be talking UDP (spanish) to a different listner listening in UDP (spanish). TCP is just the protocol, or set of rules that are used to interact.

To take the next step up we have to introduce another complication to our party-line analogy. Let say Bill and Bob want to talk english while Sue and Sally want to talk english?
New problem, new rule.
Whenever talking, all conversations must consist of the following format.
Talker,Listner,message.

Eaves droping would sound like,
Bob Bill How are you?
Sue Sally The tangent of the circle would tell us that.
etc

This new rule is analogous to the IP part of TCP/IP. When you are asking for an IP address you are looking for a name that you can use when you are talking. You could use the IP you where born with (static IP), or you could pick up an alias and use it to do some random talking if you want.

WHo decides? The network admisitrator. On my network at home, I set up all of the IP addresses. At work, I have to request one if I need one.

One of the things a network administrator can do is set things up so that there is one machine on the network that gives out aliases to anyone that asks. This is a dynamic IP address. In this case, any to two individuals could talk using aliases, by contacting the the name server and finding out what is the current alias of any other machines.

I have carried on here for quite a while so I wil call it here. I just wanted to explain what is going on below LbVIEW.

Ben

(Legal disclaimer:
I was just talk of the top of my head here. I know TCP/IP are technically two levels tied together, and what ever happened to layers 4-6 anyway?)
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 6
(3,667 Views)