LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Too slow cycle time when using network variables

Hi there!

One the one side I have a LabView VI. In that VI a value is set to a shared network variable. This happs in a while loop with no extra delay.

Thus this should run at maximum speed (and my machine is pretty fast) 😉

 

On the same machine I have a C++ application using the CVI library functions. This application has registered a simple data-callback for the same shared network variable using "CNVCreateSubscriber".

 

What I expected was that the callback would be called pretty often (every 1ms or faster).

The strange thing is: the updates come in EXACTLY every 10ms. Even when I change the number of transferred and subscribed variables from 1 to 100 the 10ms don't change. This seems to be somewhat slow...

 

So I guess there is some kind of bottleneck limiting the transfer rate.

  • Could it be the LabView VI?
  • Or maybe the configuration of my network variables?
  • Or the C++ application (do I need to do some some special configuration via the CNV functions)?
  • Or some hardware/software problems on my computer?

Thanks!

0 Kudos
Message 1 of 13
(5,255 Views)

 "flush shared variable data" is the command to flush the buffer.  Otherwise it defaults to either 10ms or until its full.

0 Kudos
Message 2 of 13
(5,213 Views)

That sounded like a good idea. But sadly it did not work... Smiley Sad

 

I added a flush-block to my sending loop and made sure it got called by using the LabView debugger.

(BTW: My sending-loop is just a simple while(true)-loop that sets a shared network variable and then calls the flush).

 

Still the cycle time was "magically" limited to 10ms...

0 Kudos
Message 3 of 13
(5,197 Views)

Hi Boris,

 

from my understanding, as i read in this following article, the behaviour you see is expected (scroll down to point 3. Network-Published Shared Variable):

 

Using the LabVIEW Shared Variable

http://www.ni.com/white-paper/4679/en/

Message 4 of 13
(5,195 Views)

Yes, that is correct. But as KB9NVH pointed out, there is a flush-block that should solve the problem.

 

From the document you referred to:

...you will find a new function in the Shared Variable palette called Flush.vi.  Use this VI to force the transmit buffers in LogosXT to be flushed through the shared variable engine and across the network.  This will drastically lower latency.

 

But somehow this seems to have no effect in my case.

0 Kudos
Message 5 of 13
(5,191 Views)

Hi,

 

ok, i will do some further research on that. What are the Versions (LabVIEW, CVI, OS) you are using?

0 Kudos
Message 6 of 13
(5,187 Views)

Thank you!

 

I'm using LabView 2010 SP1 on Windows 7 x64. The CVI Version seems to be 2013 (?).

0 Kudos
Message 7 of 13
(5,182 Views)

Hi,

 

can you check the attached project on your system? Just run both VIs and check if the Benchmark indicator (Y-X) is showing 0,001?

0 Kudos
Message 8 of 13
(5,177 Views)

Yep, it's showing 0,001.

0 Kudos
Message 9 of 13
(5,170 Views)

OK, so everything is working as expected. How are you doing it then?

0 Kudos
Message 10 of 13
(5,168 Views)