05-19-2008 05:25 PM
05-22-2008 12:18 PM
05-23-2008 01:53 PM
06-02-2008 04:22 PM
08-28-2008 04:05 PM
This is mostly on topic - I'm curious because I'm working on a winsock DLL that allows IPv6 and IPv4 TCP from LabVIEW and I'm trying to make the functions as compatible with the existing functions as practical (so a user can mostly just drop these in as replacements for the native LabVIEW functions). So, do all modes of the TCP read command (Standard, Buffered, CRLF, Immediate) clear the hardware buffer? Buffered and CRLF documentation says they don't return any bytes if certain conditions aren't met (timeout, no CRLF in string). Do these bytes get read and discarded? Or does the LabVIEW implementation peek at the port (which seems to be a cardinal sin in sockets programming) to see how much data is there before it decides whether or not to return any, or does LabVIEW retain these bytes in an internal buffer that gets served up on the next Read call (seems unlikely).
Thanks,
Mark
08-28-2008 04:34 PM
Mark,
No peeking is happening.
As unlikely as it may seem LabVIEW maintains an internal read buffer that will hold on to the bytes that are read and not returned to the diagram.
By the way- I am very interested in your IPv6 project.
09-02-2008 10:55 AM
OK - so if LabVIEW is maintaining the buffer, then it would be appropriate to just create the Immediate and Standard modes inside the DLL as pure Winsock 2 calls and then manage the Buffered and CRLF modes at the VI level. This is easier for me since I'm no C/C++ wizard 😉 I plan on posting the completed DLL, VS project, and VI library on the LAVA site when complete. Also, this is a continuation and refinement of some example code that Christian Loew at NI wrote as a proof of concept for using IPv6 inside LabVIEW. What I'm doing is making the interface as much as possible a direct drop-in replacement for the Native TCP/IP LabVIEW functions and making it usable for IPv4 or IPv6 calls. If you have a need for this, let me know and I'll let you know when I get it ready for public consumption (should be soon).
BTW, not to doubt your advice, but how do you know how LV handles the read internally?
Thanks,
Mark