LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Monitor OPC Items with DataSocket Sampling Frequency Insufficient (4 Hz)

I have an application where LabVIEW is being used to read data from multiple items via OPC with the DataSocket VI. My program looks very similar to the "Monitor OPC Items using DataSocket" sample provided in LabVIEW's help section. The exception is that I have multiple OPC items (4) being read and in my while loop there are calculations and logging that occurs.

 

The problem: When I run my program and select items from either my actual OPC server or one of LabVIEW's example OPC servers I can only achieve a sampling frequency of 4 Hz. This is without a 'Wait (ms)' function in the loop and with the 'Wait (ms)' function being connected to any number less than 250 (which is the 4 Hz). In other words, without a 'Wait' or with a 'Wait' tied to zero the program still only refreshes at 4 Hz. I get the same problem when running LabVIEW's sample program with either sample OPC server items or my real OPC server items. Analyzing the timestamps of the samples it's also clear that this is an average of 4 Hz and the value of the delay is not consistent. I'd say it's 250 ms delay with a deviation of about 70 ms.

 

Things I've tried:

-Use the 'Wait' function to adjust the loop frequency of reads. Effective up to 4 Hz but not possible to go faster.

-Wire False to the DataSocket Read VI's waiting for data terminal. Same issue regardless whether it's True or False.

-Use LabVIEW sample code and OPC demo items interchangeably to determine if the issue is caused by my code or OPC server, which it isn't.

 

Is there a limit to how fast the DataSocket Read VI can execute? If not then what could be bottlenecking the sampling frequency? The calculations being performed are minimal and even if I remove them I still don't get past 4 Hz. Any help is greatly appreciated!

0 Kudos
Message 1 of 1
(1,999 Views)