LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dstp Hlp(refering to Messenger vi in the tutorial provided by ni: TCP ip intro

Hi
I'm using LABVIEW6i so I couldn't run the vi provided by the tutorial.But fooloeing the instructions I built it myself.Now I've faced the following problems:
1)when I run the vi for the first time the last message which was written by the the other client is displayed.while debugging it I observed that the timedout Output goes false for the first 2(or one) times but after that it switches to true and waits until the other client sends some mesagesWhy does this happen and how can I avoid it?
2)when i run the program without the data socket server running the vi starts to show blank messages from the receiver.How can I avoid this?
Thanks for your attention in advance.
0 Kudos
Message 1 of 6
(3,081 Views)
It would be helpful if you could give the URL to the tutorial. I have not been successful in finding "TCP ip intro".

Datasocket works like a bulletin board you would see if you were driving down the road. If something writes to the bulletin board (an advertiser), then your datasocket reader(you sitting in a car) can see the data. If your datasocket reader is doing something else like watching other traffic and several writes have taken place, only the most recent data is seen by the reader. This is because datasocket was lossy before buffered datasocket in LabVIEW 7.0 was introduced.

Before you can do any communication with datasocket, you have to start the datasocket server. If you think about it, how would datasocket read receive data if no b
ulletin board exists. (if you missed it, the bulletin board is the datasocket server).

There are two ways to create items (specifically called datasocket data items) on the datasocket server. Think of the the items as specific ads on a multiad bulletin board. You can create static items. This is rarely done and requires the use of Datasocket Server Manager. The other method is to dynamically create datasocket data items. I suspect this is what you are doing. When you first starting writing to the datasocket server the datasocket data item is created. At this point the reader will have something to read. The datasocket data item remains valid while all readers and writers to the datasocket server are active. When nothing is reading or writing (it could be just writing), the datasocket data item is removed. You can see this in action by going to the diagnostic page on the datasocket server.

I suspect the behavior you are seeing in 1 is related to the behavior described in
the above paragraph. I cannot say for sure because I do not have your code. I recommend using a shipping example for datasocket. They are found by going to the help menu of LabVIEW. These examples work.
Message 2 of 6
(3,081 Views)
Hi
First of all I should really thank u for your help .
If you search ni for "TCP/IP and DataSocket LabVIEW User Group Presentation" you can find the mentioned tutorial.I've also attached my own vi.
Meanwhile how can I use dstp to transfer files. It seems I should use ftp: ... Is there any good example on the subject(I couldn't find one! as an enthusiast can u help me)
I appreciate your attention in advance
0 Kudos
Message 3 of 6
(3,081 Views)
Here is some code that will transfer files. I tired to write it so that you can put the same code on two different computers running LabVIEW and it will work. There is a VI that I used in the beginning that I took out of an example program for launching the datasocket server. You can remove it if it causes problems. You can find the examples by going to help >> examples >> communication >> datasocket .


There are a bunch of resoures on NI's site. For a general overview, go to the advanced search and look for datasocket in just the tutorals. I did not find anything that discusses datasocket from the beginning, but there is a lot of intermediate to advanced
level stuff.

I want to remind you that datasocket server by default is set to not allow remote computers to write to it. This way you do not have to worry about researchers in Antartica using your computer for their applications. This means that the writer can only write to the localhost aka 127.0.0.1 aka the computer infront of you. Reading on the otherhand is open wide. Anybody can read data items off your server if they know the data item's name.

Look for
Configuring a DataSocket Server
for info on changing your computer to allow remote computers to write to the server. It is going to require a lot of trial and error before everything becomes clear.
0 Kudos
Message 4 of 6
(3,081 Views)
Hi
Opening your vi LV asks me about the following vi
"Launch DS Server if Local URL".Would you pls provide me with that?
Can I use the same method for transfering any kind of files using the Read file function instead of the Read characters from file function?(If yes, what should the type input of DataSocketRead function be then?
Best Regards
0 Kudos
Message 5 of 6
(3,081 Views)
You can find the VI by opening LabVIEW 6.0 >> help >> examples >> communication >> datasocket >> ds writer.vi. You can also just remove it as I mentioned in the last posting and launch datasocket server manually.

I chose to read the file as characters out of convienice. This does not mean that the VI is limited to text files. You should be able to open any file, interpreted the data as characters, send the characters, receive the characters, write the data to file, and have the identical file on the receiving side. If you perfer, you can change the method of reading the file to read it as an array of u8s or i8s--it does not matter because you are not interpreting the data in LabVIEW. All you need is a data type tha
t will hold your file data for transmission.
0 Kudos
Message 6 of 6
(3,081 Views)