viktorvm / PLCMonitor

1 stars 2 forks source link

Can I able to view live variable from OPC DA? #1

Open tejasklodha opened 7 years ago

tejasklodha commented 7 years ago

Dear Sir,

I am getting below error while run your code on :

_opcServer.Connect(new Opc.ConnectData(new NetworkCredential()));

Error is as below:

An unhandled exception of type 'System.Exception' occurred in PLCMonitoring.exe
Additional information: Ошибка подключения к серверу opcda://localhost/RSLinx Remote OPC Server

What is resolution. I am also change server name as : "opcda://localhost/Graybox.Simulator" but still error same as below

An unhandled exception of type 'System.Exception' occurred in PLCMonitoring.exe
Additional information: Ошибка подключения к серверу opcda://localhost/Graybox.Simulator

Kindly guide If I am doing wrong. My requirement is simple that " I want to fetch Live variable from PLC(OPC DA Server)"

Thanks,

viktorvm commented 7 years ago

Hello!

Variable _opcServerVendor should be "Graybox.Simulator". Check with some other OPC Monitor (for ex. Matrikon OPC Explorer) if this server works fine on your PC, may be the reason is some DCOM issues.

tejasklodha commented 7 years ago

Yup ....

I already checked with matrikon opc explore and "graybox.simulator" working fine and populated live variable.....

viktorvm commented 7 years ago

Comment try..catch in a code, see what exception exactly you get.

And, by the way, this program reads only variable from instance _plc.StatusTags of PLC class. They are diagnostic tags from SLC500 PLC from Rockwell. Your server does not have such. You will need to change program to work with OPC-server you need. However connection should pass.