LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Developing an OPC server: set data quality

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:

  • CNVGetDataQuality( )
  • CNVCheckDataQuality( )

but no CNVSetDataQuality( ).

How can I implement a complete Data Quality feature in my OPC Server?

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 1 of 7
(5,117 Views)

Hi vix,

 

I'm sorry but I haven't more information about this issue. Read the following information, I hope that can help you.

 

Developing an OPC Client Application Using Visual Basic

http://zone.ni.com/devzone/cda/tut/p/id/3259

 

Developing an OPC Client Application Using Visual Basic

http://zone.ni.com/devzone/cda/epd/p/id/1958

 

Ciao!

______________________
Simone S.
Academic Field Engineer - Med Region
0 Kudos
Message 2 of 7
(5,097 Views)

ciao Simone,

unfortunately I've been developing an OPC Server, not a Client Smiley Wink

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 3 of 7
(5,094 Views)

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/

 

0 Kudos
Message 4 of 7
(5,077 Views)

 


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...

 

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 5 of 7
(5,055 Views)

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:

  • CNVSetScalarDataValue (data, type, value, quality)
  • CNVSetArrayDataValue (data, type, &array, NofDims, dims[], quality)
  • ...
Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 6 of 7
(5,019 Views)

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:

OPC Servers in DSC Module

 

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.

0 Kudos
Message 7 of 7
(4,941 Views)