LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Very slow VI to NI OPC server connection

Hi,

 

I am trying to use C#.net with NI OPC server and Labview VI to read, write and graph data from Allen Bradley 1400 Micrologix PLC. The program works, but is maddeningly slow. Data is read from the PLC by the server very quickly but from the latter the VI reads once in twenty or even thirty minutes. The interval varies randomly. VI to C#.net code communication is however very fast. I tried to change to KEPWARE and Matrikon OPC servers. In all cases the server to Labview VI communication is very slow. I found a link on this topic dated 2009: http://forums.ni.com/t5/LabVIEW/PLC-OPC-connection-to-labview-datasocket-very-slow/td-p/842003 however, it did not clarify the user's query: how to tie a numeric control to the OPC data and then to feed that to the VI (instead of data binding the VI (graph) to the OPC data). 

Or, can I use the NI OPC and any dlls directly, while avoiding the VI altogether?

 

Can any help resolve this problem ASAP? Thanks in advance,

 

Paul

 

 

0 Kudos
Message 1 of 9
(4,612 Views)

Ni OPC Server is a full OPC server and you can conenct to it with any OPC Client. The Kepware OPC Server provides an OPC Automation Wrapper and examples with its install. This is a legacy projdct from the OPC Foundation but you could use it to create a C# project to connect to the NI OPC Server and read data. For a little money you can get the Kepware ClientAce Product which is a .Net Client SDK. 

 

 

Fred Loveless
Kepware Technologies
http://www.kepware.com
0 Kudos
Message 2 of 9
(4,606 Views)

I agree Fred and as I've stated I have been able to connect with both the OPC servers. But the point I'm interested in is the speed of data transfer between any of these OPC servers and the VI. Why is it so slow and inconsistent?

0 Kudos
Message 3 of 9
(4,601 Views)

NI is an OPC Client and it connects, passes an update rate to the server that it wants data polled at and then waits for data changes. What is the update rate that is set for this? Is a deadband set for the data and if so what is it set to? Is the update rate set such that polling is done but data is changing to a value and then changing back before the next poll of data is done?

 

You can use OPC Diagnostics in NI OPC server or KEPServerEX to see the Groups being added and what thier poll rates are set to as well as data changes being sent back. We use this to diagnose issues like this all the time. Kepware support can provide a document on how to understand the diagnostics if you contact them.

Fred Loveless
Kepware Technologies
http://www.kepware.com
0 Kudos
Message 4 of 9
(4,599 Views)

NI is an OPC Client and it connects, passes an update rate to the server that it wants data polled at and then waits for data changes. What is the update rate that is set for this? Is a deadband set for the data and if so what is it set to? Is the update rate set such that polling is done but data is changing to a value and then changing back before the next poll of data is done?

 

You can use OPC Diagnostics in NI OPC server or KEPServerEX to see the Groups being added and what thier poll rates are set to as well as data changes being sent back. We use this to diagnose issues like this all the time. Kepware support can provide a document on how to understand the diagnostics if you contact them.

Fred Loveless
Kepware Technologies
http://www.kepware.com
0 Kudos
Message 5 of 9
(4,598 Views)

Sorry for the delay in replying. I shall try to perform the diagnostics today. However, will the following info help:

Will there be any problem if more than one OPC servers are ON on the PC, even though only one is being used for data collection (NI, MAtrikon, Kepware)?

Update rate: 50ms; Time bias:0 min; Percent deadband:0; Keep Alive rate (ms): 0 This is grayed out ;Active State checked

Interfaces tab: All values for Required & Supported columns Yes except for IOPCPublicGroupStateMgt:No.

Request timeout: 1000 ms; Inter request delay:0; Request attempts: 3; AutodemotionIntervalMS:10000;Quality of all parameters:Good;

Item update interval: 250ms

Data Logger: data type: all are DWords, Good

Default group update rate: 50ms

 

Thanks

0 Kudos
Message 6 of 9
(4,591 Views)

Hi,

 

Is there a chance that this slow connection between Labview and NI OPC server will be eliminated if the DSC is used instead of Data Sockets? I need to monitor hundreds of tags from several instruments (PLC based). Hence the data acquisition needs to be fast. At present it is about once in ten to twenty minutes and inconsistent at that.

 

Thanks in advance.

 

 

0 Kudos
Message 7 of 9
(4,559 Views)

No problem having multiple servers. on the PC. An OPC server will not do anything unless a cleint is requesting data from it. The poll rate is probably set faster then the PLc cna provide the data so that means the that the server will go into a continuous poll mode and get data at the rate the device can provide it. All requested items will still be checked at the update rate to see if value or quality have changed since the last time it was check and if so an update is sent to the client (LabView).

 

I do not know if removing the data socket and using the DSC will improve performance. That answer will have to come form someone that knowns LabView better than I do.

Fred Loveless
Kepware Technologies
http://www.kepware.com
0 Kudos
Message 8 of 9
(4,555 Views)

Thanks Fred. However as mentioned earlier, the OPC server shows that it is updating its data from the PLC quite fast and correctly. I verified this with the MMI display on the machine too. The problem is that Lab view doesn't seem to pick it up from the OPC server at the same rate as the OPC server updates its data from the PLC. Further, the data for each variable is fed to a corresponding numerical control in Labview.  

Strange, no NI guys seem to be offering any advice. Hope I can get this through with your help.

0 Kudos
Message 9 of 9
(4,553 Views)