06-07-2012 08:03 AM
Hi, everybody. There are 2 questions:
I create opc server with some tags. Now I want to read datas of some tags, if they updated. I try to use datasocket functions, but there are some problems. For ex, I look for 2 tags in loop. If the second tags update, but first not, i will not see update of second tags.
so i want to put two tags into group, and then look for update this group. If one data of tag update, i will do another actions. Questions, can I group programmaticly tags in LabVIEW 10.0?
2) The second questions. I also want to use read tag.vi. But I can`t understand what kind of url i need
there is url to tag: opc://localhost/National Instruments.Variable Engine/\\.\OPC_lib\OPC1\SIKN\Records\SIKN\Visc
can somebody help me, what i need to put as url control to Open Tag Reader.vi and Read Tag.vi.
Thanks in advance
06-08-2012 01:20 PM
Hey rusl,
For your first question, I believe the issue here has to do with your use of the DataSocket Read function and the input of True you're using with the Wait for Updated Value Input as well as your Timeout of -1, or no timeout. The DataSocket Read is then going to wait the timeout period, which is set to indefinite, for the first value to change before returning the value change of the second tag. I would recommend you either use a finite timeout or accept every value and parse the values based on if they've changed. I would also recommend you use the standard architecture of opening, reading/writing, and closing your DataSocket. There's a good example of this architecture which can be found in the NI Example Finder by, from LabVIEW, selecting Help >> Find Examples. Then select Networking >> DataSocket >> OLE for Process Control (OPC) >> NI Demo OPC Client.vi.
For your second question, information regarding the necessary inputs for the Open Tag Reader and Read Tag functions can be found here:
Open Tag Reader VI
http://zone.ni.com/reference/en-XX/help/371618G-01/lvdsc/open_tag_readerc/
Read Tag VI
http://zone.ni.com/reference/en-XX/help/371618G-01/lvdsc/tag_read_tag/
Hope this helps!
--Ryan S.