I am setting up a test situation using DataSockets.
It will eventually be used between a host, and an RT board, but for right now, it's all in one VI.
I use DS Open, DS Write, DS Read, and DS Close.
I want the connection to buffer my data, as the two ends will run anynchronously.
The URL I use is:
dstp://localhost/XXX
Here's the sequence of events:
DS OPEN (BufferedReadWrite) (the sender end)
PROPERTY Write(BufferMaxBytes=1024, BufferMaxPackets=10)
DS OPEN(Buffered Read) { the receiving end }
PROPERTY Write(BufferMaxBytes=1024, BufferMaxPackets=10)
DS WRITE(Sender, 1)
DS WRITE(Sender, 2)
DS WRITE(Sender, 3)
DS WRITE(Sender, 4)
DS WRITE(Sender, 5)
DS READ (Rcvr) ==> Display 1
DS READ (Rcvr) ==> Display 2
DS READ (Rcvr) ==> Display 3
DS READ (Rcvr) ==> Display 4
DS READ (Rcvr) ==> Display 5
DS CLOSE (Sender)
DS CLOSE (RCVR)
So that's the basic sequence. If I set the MAX PACKETS property down to 4 or 3, I get only the latest 4 or 3 values, as expected. Fine.
But I would like to use the BUFFER UTILIZATION property to tell from the sending end whether the buffer is nearly full or not.
PROBLEM 1:
The BUFFER UTIL(Bytes) property does NOT report a number of bytes, but apparently a fraction of the MAX BYTES I specified.
PROBLEM 2:
The BUFFER UTIL(Packets) property does NOT report a number of packets, but apparently a fraction of the MAX PACKETS I specified.
PROBLEM 3:
No matter where in the sending chain I put a property node to read the buffer utilization, it always reports 1/N for the packet utilization, where N is the MAX PACKETS I gave it. If I set MAX PACKETS to 10, it reports 0.1 after opening, 0.1 after the first write, 0.1 after the 2nd write, and 0.1 after the last write. It doesn't matter if I overflow the thing or not.
PROBLEM 4:
If I put a property node in the receiving chain, I get weird answers, as well. with MAX PACKETS = 0, I get 0.4 after the 1st read, 0.3 after the 2nd, 0.2 after the 3rd, and 0.1 after the 4th. Fine.
But I get 0.1 after the FIFTH read (the buffer should be empty).
And I get 0.1 before the FIRST read (the buffer should be half full).
The Utilization in bytes is similarly useless.
Anybody know what I'm missing?
Why isn't this property more meaningful?