11-22-2010 08:09 AM
Using CVI 2009 SP1 I've been developing an OPC Server through the Network Variable Engine but I don't find a way to set the Data Quality Status (Good / Uncertain / Bad) and Sub-Status (Sensor Failure / Device Failure).
I see there are two functions:
but no CNVSetDataQuality( ).
How can I implement a complete Data Quality feature in my OPC Server?
11-23-2010 04:41 AM
Hi vix,
I'm sorry but I haven't more information about this issue. Read the following information, I hope that can help you.
http://zone.ni.com/devzone/cda/tut/p/id/3259
http://zone.ni.com/devzone/cda/epd/p/id/1958
Ciao!
11-23-2010 04:46 AM
ciao Simone,
unfortunately I've been developing an OPC Server, not a Client
11-23-2010 10:41 AM
Hi Vix,
The CVI Network Variable Library is not suitable for developing OPC servers. The 'quality' can only be set by OPC servers and other entities and hardware that generate data - the quality cannot be set in the CVI Network Variable Library. You can find a lot of information about developing OPC servers at http://www.opcfoundation.org/
11-24-2010 01:10 AM
The CVI Network Variable Library is not suitable for developing OPC servers.
Strange, because there are some documents on the NI site saying the opposite...
You can find a lot of information about developing OPC servers at http://www.opcfoundation.org/
I choose CVI because I'd like implementing an OPC server in an easy and quick way...
11-29-2010 01:53 AM
Hi Mohan,
if you confirm that with CVI 2009 SP1 it's not possible to set the data 'quality', I'll write a new Product Suggestion in the CVI Idea Exchange Forum.
I agree with you that
'quality' can only be set by OPC servers and other entities and hardware that generate data
so I think that the 'quality' parameter should be added to the Network Variable Library functions that generate data (i.e.. CNVSetScalarDataValue( ), CNVSetArrayDataValue( ), ...)
I suggest these new prototypes:
12-06-2010 09:31 PM
Hi Vix,
Yes, CVI 2009SP1 and 2010 do not support setting quality on network variable data.
About creating OPC server using CVI Network Variable Library:
The knowledgebase article you linked above has a totally misleading title. I will get someone to change this appropriately.
Network variables use a protocol called PSP which is unrelated to OPC. The Network Variable Engine (NVE) makes all network variables accessible to OPC clients - in this sense, your network variables appear like OPC server items to OPC clients. This mechanism lets your Network Variable publisher (writer) programs behave like simple OPC servers. But in reality the server is the NVE and it does not support setting quality and other OPC attributes from Network Variable programs. It is not just a matter of the CVI Network Variable Library not providing a way to set the quality - the server and internal protocol differences prohibit this.
The second CVI User Group item you linked above seems to be a case where the user only needed the above functionality where PSP data is made available to OPC clients. I am quite sure there is no way for this application to explicitly set the OPC quality.
Currently, CVI does not provide any tools to create full-fledged OPC servers. The closest you can get to OPC servers using NI software is using the DSC Module with LabVIEW. This module provides a pre-built OPC server that you can use to publish your own OPC data. There is no corresponding module in CVI. I am providing a link to the relevant topic in the LabVIEW DSC Module Help file:
I hope the above is sufficient for your use-case. If not, you can also develop OPC servers using other 3rd party tools. Refer to the OPC Foundation for more details.