09-16-2013 03:38 AM
Hello everybody,
I am new to OPC and have a question (at the moment) about OPC and LabVIEW.
I have to communicate with a third party PLC through an OPC-server delievered with the PLC. The OPC-Server ist installed on my PC.
In LabVIEW, I have configured an I/O-Server (OPC Client) and have created bound variables to the configured I/O-Server.
I want to use the Tag Reader/Writer VIs to read and write data to the PLC. When I access a bound variable for the first time in LabVIEW, it takes about one second before the bound variable is registered (?)
in LabVIEW. This is no problem with one or two variables, but I have to deal with at least 170 variables. So the first access will last about 166 seconds.
When I try the same with 'normal' shared variables (I used for this test the VIs from DSC Module -> Engine Control -> Variables & I/O Servers) the first access (with registering (?) ) will last only up to 10 seconds.
So what is the difference between the 'normal' shared variables and bound variables?
Thanks in aadvance for a answer
Heinrich
09-16-2013 04:19 AM
I don't have any idea of bound variables... but shared variable is used when you have a no. of components connected together via ethernet... for example when using NI's compact rio along with touch panel and host computer via a computer switch ... the shared variable can be used to pass data among all of them....
09-17-2013 07:44 AM
Hello Heinrich,
do you mean the bounded shared variables?
In this case, you can first have a look at this example in the NI Example Finder in LabView: Networking -> Shared Variable -> Shared Variable.lvproj
It contains several VIs which illustrate the different methods of accessing shared variables (unbound and bound) and the differences between them. The comments in it offer further information, too.
To your specific question:
What exactly do you mean by registering? I guess you mean the deployment process?
Unfortunately, I couldn't find your examples...
In general, there are speed differences between different protocols. Variables are transmitted faster by the "Shared Variable Engine" than by, for example, OPC. (http://zone.ni.com/reference/en-XX/help/371361K-01/lvconcepts/sv_fp_binding/ , note at the bottom).
Regards,
Michael
09-17-2013 08:06 AM
Hello folks,
thanks fr your answers.
First: yes, I mean bound shared variables.
Second: MichaelGrupp, your link for the Example Finder did not work, because there is no item 'Shared Variable' underneath
'Networking' (I am using LV2011).
Third: I am using the VIs from 'DSC Module' -> 'Tags'; namely
'Open Tag Reader' / 'Write Tag' / 'Read Tag' / 'Close Tag Reader'.
With this VIs I can read multiple tags with one function, and do not have to use a foor loop.
Registering means for me that the variables are stored internally in LabVIEW ( I think they are using queues for this)
This is done at the first read or write access of a variable.
Regards
Heinrich
09-17-2013 10:15 AM
Hello Heinrich,
maybe you can find the example under Networking -> DataSocket -> General.
Shared Variables are broadcasted in your network, so there's no need for a registration (handshake) of the client.
Communication via bound variables is slower, because the client has to be verified via handshake at the initialization. The variable is shared only with the registered client.
The more variables you need to register, the longer it takes. With "normal" shared variables, shared via Datasocket, this is done relatively quickly, because the server doesn't need to talk with the clients (-> broadcast). On the other hand, bounded variables need to pass the registering/handshake first, this can take its time (depending on your network, PLC, etc...).
You can make one sequence for the initialization-phase, which is only executed once at startup. (I guess your process needs to be monitored continuosly after that).
Greets,
Michael