09-13-2015 10:50 PM
There's a response lag for the turning on and off of the light. For instance, when I on the light in labview, the actual lamp will only turn on awhile later. Could it be because the TCP is constantly listening and waiting for a client to connect after every loop?
09-18-2015 12:18 AM
Can you post the sketch for the Yun?
The VI's loop isn't constantly listening and waiting for a client connection (that happens at the start outside the loop), but it is waiting to read 50 bytes (or 1000 bytes in the attached VI) of data from the TCP connection. Do you know how much data there is in a single response from the Yun? If it's less than 50 bytes, the TCP Read will wait until it has received exactly 50 bytes, and only then will the loop continue.
As a simple test try setting the TCP Read timeout to 10ms and see what happens. You'll probably get a bunch of read errors, but just see if the light is more responsive. If it is, then your TCP Read is slowing things down.
One way of ensuring the TCP Read reads the exact number of bytes is to send a header along with the TCP data. Have a look at the Simple TCP example LabVIEW project for details on adding and reading a header. It basically requires two TCP Reads, one to read the header, and then a second one to read the data.