LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP/IP and event driven programming

Hi:
 
I am having some trouble with concepts of queuing and multithreading.  I am using it for the first time.  I have attached my vi for convenience. 
 
Background of my VI:  I am acquiring data continously via TCP/IP VIs and reading them.  If there is a new data, I save it in a spreadsheet file. (Top Loop in the VI).    The bottom left loop extracts the data and splits the string data into arrays, where each column represents a sensor type.
 
I am having problems with the other 2 loops ... "Data Display Loop" and "System Configuration Loop".
 
The Data Display Loop is event driven based on the user's events.  Depending on the type of information requested by the user, I'd like to display that information in the front panel. 
 
My problem is that the VI hangs when I use Events.   Any advise is appreciated. 
 
0 Kudos
Message 1 of 6
(3,323 Views)

Hi kmoorthy,

      I modified your VI to process the button-clicks as indicated by your comments.  Also added a tab-control to separate/distinguish array results.

Was unable to run it, though - VIs missing. Smiley Wink

Hope it helps!

Message Edited by tbd on 08-21-2006 01:18 AM

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 6
(3,295 Views)

Thanks tbd:

The VI works fine... but for some reason the elements within the "sensor data" array vanish when I hit the Stop button.  Any advise?

Thank you

0 Kudos
Message 3 of 6
(3,277 Views)

Hi Kmoorthy,

> The VI works fine... but for some reason the elements within the "sensor data" array vanish when I hit the Stop button.

>  Any advise?

Yes!  Modify the dequeue loop (which I didn't change!) so that it only unpacks data when there's no error.  Just put a case around the unpacking code that writes to the "sensor data" array .  As is, when stop is pressed, the empty string returned by Dequeue Element results in an empty "sensor data" array.

Cheers!

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 4 of 6
(3,255 Views)

great... thanks.. it works now!!

regards

0 Kudos
Message 5 of 6
(3,238 Views)
I just realized and apologize for not bringing it up earlier.  When I switch between multiple tabs, the data doesn't refresh, meaning that I see the old data. Since I am acquiring data continuously via TCP,  I get new data everytime I read from the client.  Am I missing something?
 
Thank you
0 Kudos
Message 6 of 6
(3,179 Views)