Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Read OPC tag via Data Socket In C#

HI...

How do I read/write an OPC tag

Thanks...

Steph
0 Kudos
Message 1 of 2
(5,132 Views)

Hi Steph,

To read/write any OPC Tag you need to just add the tag name to the OPC URL when using the DataSocket in C#.

example:
opc://machine_name/server_name/tag_name

To learn more about using OPC, I would suggest looking at the following links:

- OLE for Process Control 
- OPC Resources 
- Developing an OPC Client Application Using Visual Basic

For C# you can start with the DataSocket shipped example located at:
C:\Program Files\National Instruments\MeasurementStudio\DotNET\Examples\DataSocket\ReaderWriter\cs

I dont think there is an example program written at this time to communicate with OPC from C# but am very sure that the above links would provide you with all the information needed to create one.

I hope it helps,
Rajiv

0 Kudos
Message 2 of 2
(5,105 Views)