LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DataSocket PSP Data Buffering

Solved!
Go to solution

I have a VI that writes to a network shared variable using DataSocket.  The DataSocket URL uses PSP.  I have another VI that reads the network shared variable also using DataSocket.  I am experimenting with data buffering to see when data is lost if the Writer VI writes faster than the Reader VI.  Is data buffered using DataSocket with PSP in the URL?  If not, I expect data will be lost.  If it is buffered, I don't expect data to be lost until the buffer is full or overflows. 

 

Attached is a project with the network shared variables and the Writer and Reader VI.  VIs compare reading and writing directly using a shared variable node and using DataSocket.  With DataSocket, I am experiencing data loss as if there is no buffering.  When using the shared variable node, I do not see data loss.  Run the Reader.vi.  It will read two network shared variables every two seconds.  One variable is read using DataSocket and one is read using a variable node.  Next, run the Writer.vi.  It will write to two network shared variables every 0.5 seconds.  One variable is written using DataSocket and one is written using a variable node.  Since the Writer VI is writing four times as fast as the Reader VI data will need to be buffered to avoid data loss.  Monitor the Buffered Sequence and BufferedDS Sequence front panel indicators in the Reader VI.  Buffered Sequence is data from the variable node.  BufferedDS Sequence is data from the DataSocket Read.

0 Kudos
Message 1 of 4
(3,303 Views)

Hello,

 

I believe your question is answered in this document:

http://digital.ni.com/public.nsf/allkb/7179F100C803748E862566C1005290FA?OpenDocument

There is no buffering in the DataSocket server and this is reiterated in the link above.

 

-Zach

0 Kudos
Message 2 of 4
(3,286 Views)
Does PSP in the DataSocket URL change the data buffering?  Attached is a page from 'LabVIEW 8.5.1 help/fundamentals/networking in LabVIEW/concepts/choosing among LabVIEW communication features' mentioning lossless data transmission for DataSocket with psp protocol(2nd row in table).  Does lossless data indicate one packet will be guarantied to be sent from the writer and received by the reader; or, does it provide the guaranty with additional packets buffered?
0 Kudos
Message 3 of 4
(3,278 Views)
Solution
Accepted by topic author GlennD

PSP does not change the data buffering. Using the PSP protocol is only guaranteeing that you do not lose the data. Thus, if data is written, it is guaranteed to be received. However, if you overwrite the data before it is read, you will lose the data point in that sense. The key here is that it is lossless transmission. Additional packets being sent to the server will overwrite the data currently on the server in the order in which they are received. Some more information on the PSP protocol can be found in this article:

http://zone.ni.com/devzone/cda/tut/p/id/4679

 

-Zach

0 Kudos
Message 4 of 4
(3,261 Views)