LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Socket flow Conrol

I have looked at the samples. But the reader only reads data and attributes, and the writer only writes data and attributes. The problem is that the reader is being overwhelmed with data and the writer must be signaled to not send. The means the reader must also be capable of writing a flow control to the server object. And the writer has to be able to read the flow control attribute. This requires each object to be both a reader and writer. And this is what D.S. Does not seem to want to do. besides throwing in a writer time delay. Window DDE has a acknowledge function for this.
Download All
0 Kudos
Message 1 of 4
(3,346 Views)
DataSocket does not have a built in handshaking mechanism which is what it sounds like you are looking for. There isn't a flow control method. You can use a separate DataSocket for this though. Just an integer value that the writer sets to 0, then sends the DataSocket data, then waits for the reader to set the item back to 1 before sending the next data. Basically, use a separate DataSocket item for flow control since there isn't a built in mechanism.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 4
(3,346 Views)
I do not believe this will work with each application have a reader and a writer. Please look at the attached code and tell me what I am doing wrong. You have no samples of the type of flow control on your site or app. notes.
Download All
0 Kudos
Message 3 of 4
(3,346 Views)
I wrote an example of how to do handshaked datasocket communication using an extra socket. This is for a 1 writer to 1 reader configuration, not a 1 writer to many readers configuration.

The way it works is that the writer program writes a 800KB data buffer to dataSocket then waits for the reader to increment another dataSocket that indicates it has read the buffer. It then writes another buffer and waits again, etc. You will notice that the first couple of data updates on the writer and the first data update on the reader are ignored in this example since they just are trigger from the creation and initial update of the socket.

To use the example, run the hsWriter project, then run the hsReader project. Press the Start button
on the server and watch as the data buffers are transferred without data loss. This example is written in CVI 6.0.

I hope this helps,

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 4 of 4
(3,346 Views)