05-18-2009 10:54 AM
Hello,
I have created a program which contains two parallel loops running concurrently. One is an event loop the other is a 10HZ
while loop.reading data over TCP socket. The event loop has calbacks that use same TCP socket for writing /reading data over TCP.
Do I need to provide synchronized (I.e semaphores etc) accesss to TCP? For example, if callback event occurs before 10Hz
loop iteraion,will the 10hz loop defer until callback has completed. I believe that the labview TCP read VI is blocks until data is available and I have 5 sec timeout
in TCP read
Thanks
05-19-2009 01:51 PM
05-19-2009 05:07 PM
Hello Hershey,
Can you post a small chuck on code that displays what you are doing? I'm assuming your are trying to communicate with the same port in both of the loops. Is this correct?
05-20-2009 07:35 AM
Hello,
port shouild be the same but take quick look at code.
Thanks
05-21-2009 08:56 AM
Hello,
Here are some other VIs I am using. Perhaps you need these to understand what is going on
Thanks
05-21-2009 08:57 AM
Hello,
Last 2 VI's. Could not attach more than 3 seperately.
Thank you
05-21-2009 10:28 AM
Hello Hershey,
It looks like almost all of your TCP/IP communication takes place in SBC Communication for Encoder.vi. I looked at the VI properties for this VI and it is set to be nonreentrant. This means that this entire VI will complete before it can be executed from another spot in your main VI. Because of this you do not need to protect this VI by semaphores.