Home > Net >  C # call RsiOPCAuto. DLL connect OPC server, an error: no registration interface (abnormal hresult:
C # call RsiOPCAuto. DLL connect OPC server, an error: no registration interface (abnormal hresult:

Time:11-25

In the use of c # reference RsiOPCAuto. DLL connect OPC server, using the server IP address can query to the OPC service name, but when connect to the OPC server to get data, suggest not registered interface (abnormal hresult: 0 x80040155), consult everybody how to solve ~ 7 \ WIN10 system environment are reported this error,
The test code:
RsiOPCAuto. OPCServerClass OPCServerList=new RsiOPCAuto. OPCServerClass ();
Object serverList=OPCServerList. GetOPCServers (txtTestIP. Text. The Trim ());

If (serverList==null)
{
MessageBox. Show (" failed to obtain OPC server information, please check to see if the IP configuration right ");
The return;
}
The else
{
Foreach (string progId (Array) in serverList)
{
CboOPCName. Items. The Add (progId);
}
CboOPCName. SelectedIndex=0;
TxtInformation. Invoke (new DelegateDispy (Display), and "query OPC server success");
}
//link OPC, is the following sentence error ~ ~ ~ ~ ~ ~ ~
OPCServerList. Connect (cboOPCName. Text. The Trim (), "192.168.1.105");//an error here ~ ~ ~
OPCServerList. OPCGroups. DefaultGroupIsActive=true;
  •  Tags:  
  • C#
  • Related