LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview webserver quitting problem

I am using Labview 10 with crio9074. When I start the webserver, Labview completely quits after about an hour. Any suggestions?

0 Kudos
Message 1 of 8
(2,746 Views)

Hi Skysurfer,

 

I'm Jamie an Applications Engineer at NI UK.

 

One reason why the webserver may be hanging/quitting is the overuse of sockets with constantly opening and closing TCP connections, this can use up all available sockets and result in the TCP connection locking up. If this is the case ensure that any Open and Close functions are located outside structures where possible, especially while loops.

 

Hope this helps with your cRIO application.

 

Thanks

 

Jamie

 

 

Jamie S.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 8
(2,742 Views)

Thanks for the reply. I don't use any open or close functions.

0 Kudos
Message 3 of 8
(2,717 Views)

You may want to watch your ram to see if you have a memory leak. This is just a shot in the dark, some more information about your setup would be useful.

 

Kyle K.

Product Manager for Product Data
National Instruments
0 Kudos
Message 4 of 8
(2,704 Views)

Thanks for the reply. I'm using LV 10. Attached is a sample program that I wrote that updates a graph for every iteration of the while loop. When I use the web server, Labview totally shuts down after about an hour of running. I've noticed in the Remote Panel Connection Manager that the Total Bytes/sec constantly increases to a value of 1.6M before the program shuts down. I believe this has something to do with the problem. Any suggestions?

0 Kudos
Message 5 of 8
(2,689 Views)

You are building 6 arrays in the loop. Plus you get several extra copies for the graph.  Those arrays will keep growing until you have memory allocation problems. The better way is to decide on the maximum size you need for the arrays and initialize the arrays outside the loop.  Then inside the loop use Replace Array Subset to pu tthe data values into the arrays.  No arrays growing, no change in memory usage.

 

Also, the graph is about 540 pixels wide.  If you send more than 540 points (per plot) to the graph, LV will reduce it to the number of pixels anyway, so why waste the bandwidth.  Do the data reduction before passing it to the graph.

 

Lynn 

 

0 Kudos
Message 6 of 8
(2,684 Views)

I speeded up your VI by a factor of 100 and found that the memory usage goes from about 8 KB at the beginning to over 2 MB after an hour.

 

Lynn

0 Kudos
Message 7 of 8
(2,678 Views)

Lynn,

Thanks for your input.

0 Kudos
Message 8 of 8
(2,652 Views)