LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Weird delay reading shared variables

Solved!
Go to solution

Hello,

 

I'm working on a project were I'm monitoring some prodution lines. I'm using DSC module's OPC server to connect to PLCs on the production line and I've created bound variables on my labview project of the PLC's tags.

 

On my project I have one main VI were I show information about the production lines and were I can access several subVIs were I show other information about those lines. Then I have a VI that is running in background were I'm reading about 50 shared variables from the PLC and where I'm registering some data in a MySQL database, datalogging data on the Citadel database and registering alarms.

 

The problem I'm having is that on the VI that runs in background I noticed a delay reading the variables that are reading containers weights from the production line. It seems that all the other shared variables don't suffer any delay, only the weight variables start having some delay when the values are increasing. It also seems like that, when I'm only running that VI alone, without running the main VI, there isn't any kind of delay. I'm reading the shared variables as shared variable nodes.

 

Can anybody help me understand what's happening and how can I fix this delay? The VI that runs in background is time critical and a weird delay like that messes up my data.

 

 

 

0 Kudos
Message 1 of 4
(2,911 Views)
Solution
Accepted by topic author Mateus23

Hi Mateus23,

 

The shared variable has various buffering capabilites, including integration with the Real-Time FIFO feature in LabVIEW Real-Time.

I guess that the buffering settings are causing the unexpected behavior.

 

Check these resources:

Buffered Network-Published Shared Variables (whitepaper)

Shared Variables Properties Dialog

   - Network Page

   - Real-Time FIFO Page

 

 

~~
Message 2 of 4
(2,853 Views)

Hi nickf,

 

Thanks for the suggestion. I don't have the Real-Time Module installed. But I'll try to change my shared variables buffer settings. I've the buffering enabled on my shared variables with a buffer size of 50 elements. 

I've noticed that I get a 180121602 warning. So probably it is also related to the problem I'm having.

 

Only on wednesday I'll have the opportunity to test this. So if it works I'll say something. 

 

 

0 Kudos
Message 3 of 4
(2,838 Views)

Hi,

 

I changed the buffering settings on my shared variables. I disabled the use buffering option on the shared variables where I was getting that delay, and it seems to have worked. Until now I haven't noticed any of that delay again.

 

Thanks nickf for your help!

0 Kudos
Message 4 of 4
(2,799 Views)