Register Server at LDS
Moderator: uasdkc
-
- Hero Member
- Posts: 37
- Joined: 30 Sep 2013, 08:19
Register Server at LDS
Hello,
since I couldn't find any documentation about this I ask myself if it is possible to register a OPC UA Server based on the ANSI-C SDK at a LDS running on another machine? Could you point me to the right direction here? Is there any documentation on this?
Regards
Florian
since I couldn't find any documentation about this I ask myself if it is possible to register a OPC UA Server based on the ANSI-C SDK at a LDS running on another machine? Could you point me to the right direction here? Is there any documentation on this?
Regards
Florian
- Support Team
- Hero Member
- Posts: 3064
- Joined: 18 Mar 2011, 15:09
Re: Register Server at LDS
Hello Florian,
you can set the accordingly (see doc: http://documentation.unified-automation ... ation.html).
Best regards
Support Team
you can set the
Code: Select all
_UaServer_Configuration Struct Reference
Code: Select all
/** Configures the server to register at a discovery server in regular intervals. */
#define UASERVER_DISCOVERY_REGISTER OPCUA_CONFIG_YES
/** The URL of the discovery server. */
#define UASERVER_DISCOVERY_URL "opc.tcp://localhost:4840/UADiscovery/discovery"
/** The registration interval in milliseconds. */
#define UASERVER_DISCOVERY_INTERVAL 300000
UaServer_Configuration *pServerConfiguration = UaServer_GetConfiguration( &g_UaServer );
/* configure server to register at discovery server */
pServerConfiguration->bRegisterAtDiscoveryServer = OpcUa_True;
OpcUa_String_AttachReadOnly( &pServerConfiguration->sDiscoveryServerUrl, UASERVER_DISCOVERY_URL );
pServerConfiguration->uDiscoveryRegistrationInterval = UASERVER_DISCOVERY_INTERVAL;
Support Team
-
- Hero Member
- Posts: 37
- Joined: 30 Sep 2013, 08:19
Re: Register Server at LDS
Hello SupportTeam,
thank you!
Nevertheless now I get the following output:
|0x0| 14:42:20.337Z UaServer_Discovery: Connect to local discovery server with security failed, please check security configuration (ret=0x80ae0000)
thank you!
Nevertheless now I get the following output:
|0x0| 14:42:20.337Z UaServer_Discovery: Connect to local discovery server with security failed, please check security configuration (ret=0x80ae0000)
- Support Team
- Hero Member
- Posts: 3064
- Joined: 18 Mar 2011, 15:09
Re: Register Server at LDS
That's because the servers don't know the security certificate from each other. To accept the LDS' certificate, copy the certificate from the rejected folder to the certs folder. Also the LDS has to accept your servers certificate.
Best regards
Support Team
Best regards
Support Team
-
- Hero Member
- Posts: 37
- Joined: 30 Sep 2013, 08:19
Re: Register Server at LDS
We did this. But it still won't work.
Could this be about the issue with Hostnames and IP-Addresses? Could we just somewhere configure to put IP-Addresses in the certificate?
Thanks for your help.
Could this be about the issue with Hostnames and IP-Addresses? Could we just somewhere configure to put IP-Addresses in the certificate?
Thanks for your help.
- Support Team
- Hero Member
- Posts: 3064
- Joined: 18 Mar 2011, 15:09
Re: Register Server at LDS
Have you checked the log file of your LDS?
Best regards
Support Team
Best regards
Support Team
-
- Hero Member
- Posts: 37
- Joined: 30 Sep 2013, 08:19
Re: Register Server at LDS
We finally solved the issue about certificates and the ANSIC OPCUA Server is registered successfully at our LDS. But it seems to register with URL "opc.tcp://localhost:1243" instead of "opc.tcp://<correct_ipaddress>:1243". Is there some type of configuration we also have to adapt?
- Support Team
- Hero Member
- Posts: 3064
- Joined: 18 Mar 2011, 15:09
Re: Register Server at LDS
Hello,
for the own server URL is used what was set with UaServer_Initialize() as a_sEndpointUrl.
Best regards
Support Team
for the own server URL is used what was set with UaServer_Initialize() as a_sEndpointUrl.
Best regards
Support Team
-
- Hero Member
- Posts: 37
- Joined: 30 Sep 2013, 08:19
Re: Register Server at LDS
In Servermain():
/* Create EndpointURL and ApplicationURI strings */
GetFQHostname(szHostname, sizeof(szHostname));
OpcUa_SnPrintfA(szEndpointURL, sizeof(szEndpointURL)-1, "opc.tcp://%s:%u", szHostname, UASERVER_PORT);
OpcUa_SnPrintfA(szApplicationUri, sizeof(szApplicationUri)-1, "urn:%s:%s", szHostname, UASERVER_APPLICATIONURI);
szEndpointURL is set to "opc.tcp://<correcthostname>:1234" not the localhost.
/* Create EndpointURL and ApplicationURI strings */
GetFQHostname(szHostname, sizeof(szHostname));
OpcUa_SnPrintfA(szEndpointURL, sizeof(szEndpointURL)-1, "opc.tcp://%s:%u", szHostname, UASERVER_PORT);
OpcUa_SnPrintfA(szApplicationUri, sizeof(szApplicationUri)-1, "urn:%s:%s", szHostname, UASERVER_APPLICATIONURI);
szEndpointURL is set to "opc.tcp://<correcthostname>:1234" not the localhost.
- Support Team
- Hero Member
- Posts: 3064
- Joined: 18 Mar 2011, 15:09
Re: Register Server at LDS
Hello,
Which LDS (vendor, version) are you using exactly? Older LDSs of the OPC Foundation had the problem that they replaced the hostname in the response, although the server registered correctly.
Maybe you can check the log files of the LDS?
When the hostname was set correctly with UaServer_Initialize() , there should be no problem.
Best regards
Support Team
Which LDS (vendor, version) are you using exactly? Older LDSs of the OPC Foundation had the problem that they replaced the hostname in the response, although the server registered correctly.
Maybe you can check the log files of the LDS?
When the hostname was set correctly with UaServer_Initialize() , there should be no problem.
Best regards
Support Team