Specifying the Buffer Size Using DataSocket Functions

Complete the following steps to specify the client-side buffer size using DataSocket functions.

  1. Add the DataSocket Open function to the block diagram.

     Add  Find
  2. Wire a psp URL to the URL input or wire a shared variable control to the URL input.
  3. Right-click the mode input and select Create»Constant from the shortcut menu.
  4. Click the mode constant and select BufferedRead.
  5. Add a Property Node to the block diagram.

     Add  Find
  6. Right-click the Property Node and select Select Class»DataSocket»DataSocket from the shortcut menu.
  7. Resize the Property Node and add a terminal.
  8. Click the first white area of the Property Node and select the Buffer Maximum Bytes property.
  9. Click the second white area of the Property Node and select the Buffer Maximum Packets property.
  10. Right-click the Property Node and select Change All To Write from the shortcut menu.
  11. Create constants for each property and enter values for each property, such as 1024 for Buffer Maximum Bytes and 25 for Buffer Maximum Packets.

    LabVIEW stops filling the client-side buffer when the first buffer size limit is reached for either the Buffer Maximum Bytes property or the Buffer Maximum Packets property.
  12. Wire the connection id output of the DataSocket Open function to the reference input of the Property Node.

After you specify the buffer size on the client, you can read the buffered data.