LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Buffered Shared Variable Server-Side Write Buffer Warning

I am hosting several buffered and non-buffered network shared variables on a PXI RT system and reading the variables on my PC.  The buffered variables consist of arrays with sizes as specified in the variable buffer settings (or smaller).  The RT system application collects the data at a rate of 100 Hz and posts the data to the different variables.

 

On my client PC, I have noticed that the after a while, I start having warnings returned from the buffered shared variable read nodes.  The warnings are first "0x8BBB003C : The shared variable server-side write buffer is full" and then "0x8BBB003D : The shared variable server-side write buffer overflowed."

 

I have checked the CPU usage on my RT system and on average the use is about 12% on each of the 2 cores.  Also, my 100 Mbit network is utilization on the PC is 7% on average.

 

As my RT system runs longer and longer, the rate at which these warnings occur gradually increases until eventually they are all I get and I stop getting updated data from my RT system.  If I stop my client application, it takes a few seconds to stop, but then on re-start everything appears to be fine and I have started the process over.

 

I have also observed in Distributed System Manager that the value of the buffered arrays in question is reported as "Unknown Bad Quality" at the same interval as the buffer overflow warnings.

 

I am using LabVIEW 2009 SP1 and 2009 SP1 RT.

0 Kudos
Message 1 of 8
(5,358 Views)

This tutorial is excellent for explaining how to use the LabVIEW Shared Variables. The network buffering section has some great information that is applicable to your issue. Take a look at the article and let me know if you have any more questions.

 

Is there a specific reason you are using buffered sharved variables? Have you considered using real-time FIFO  enabled shared variables in your application?

Stephanie A.
Americas Marketing Manager
National Instruments
0 Kudos
Message 2 of 8
(5,337 Views)

Thank you for the tutorial...I have read through it and several articles in the white papers and forums.

 

I am specifically using buffered shared variables because I need to stream large arrays of data collected at 100 Hz on my RT system to a host PC.  Without buffering I find that I lose data.  I am using real-time FIFOs with shared variables at other places in my application and they are certainly helpful.

0 Kudos
Message 3 of 8
(5,332 Views)

Show us the client code that reads these buffered NSV's, how do know that your client is polling at >100hz?

If you have access to LV2010 you might want to look at the new streaming API which would be better suited for this kind of application.

0 Kudos
Message 4 of 8
(5,319 Views)

First, why does it matter what rate my client polls the buffered shared variables?  The error I am seeing is a server-side write buffer error...which from reading through the SV white papers deals with the server buffer that transfers data to the clients overflowing.  If I am not reading fast enough on the client then shouldn't I get a client-size buffer error?

 

My client code polls each buffered SV in its own while loop with the timeout feature turned on and set to 400 milliseconds.  When a value is read, the value is passed to another buffered SV hosted on the client PC.  With this setup, I expect my client should read the latest value of the SV as soon as it is available on the client.

 

Thank you for the LV 2010 suggestion, however I don't have the option of changing to LV 2010 at this time.

0 Kudos
Message 5 of 8
(5,299 Views)

If you do not need to read each and every sample from your RT target then turn off buffering and just bind your NSV's together.

If you want to process each sample then you will need a pretty fast loop on the client side to keep up with

the 100 hz data rate.  In your case you obviously are not reading fast enough so what difference does it make

whether the server or the client buffer barfs first?

0 Kudos
Message 6 of 8
(5,291 Views)

Please read up on how the timeout function of the shared variable read node works.  In short, the timeout specifies the maximum amount of time to wait for a new value to arrive in the buffer, if one has not already.  Just because I am specifying a 400 ms timeout doesn't mean my loop takes 400 ms to execute a single iteration.

 

I do need to read each and every sample...that is why I am using buffering in the first place.  My loop on the client side has no trouble keeping up.  My client loop spends most of its time waiting for the next value to arrive, and as soon as one does it reads it immediately.  This keeps my client buffer as empty as possible given the bundling of values together when transferring between the server and client in the shared variable engine.

 

Can anyone please explain the meaning of the server-side buffer overflow error I am seeing?  What typically causes this error?  Does it imply my network connection is not fast enough between the server and client so the server can't unload it's buffer fast enough?  Does it imply that the CPU on the RT server can't keep up?  Is there any way to increase the side of the server buffer?  Should I be seeing timeout errors on the shared variable writes on my server code since the server buffer is overflowing?

0 Kudos
Message 7 of 8
(5,217 Views)

A few suggestions:

 

1. Enable the RT-FIFO option on your NSV's

2. Use the SV Flush vi to force the SVE to transmit the buffered data.

 

Keep in mind that the RT-FIFO option and client side buffering only work for the NSV nodes not the SV API.

 

BTW, How big are your arrays?

and what do you have your buffer size set at?

0 Kudos
Message 8 of 8
(5,208 Views)