OpcUa_any Server Url Change During Runtime

Hi,
I am using OpcUa_any Device on our B&R PLC as a Client, we have established connection to a Siemens Sinumerik server which works perfectly. I know we can change our PLCs IP address during runtime easily, but is there any way how to change ServerEndpointUrl on OpcUa_any device (configuration) during runtime? Ideally on visualization, I know this is possible using OpcUaC library, but since our application is simple, I’d rather avoid coding it.
I’m happy to provide more details if needed.
Thank you!

Hi, as far as I know this is not possible. You can use hostname in ServerEndpointURL, otherwise solution would be ASOPCUAc library, as you already know. You can use this wrapper to make your live easier EasyUaClnt a simplicity wrapper library based on AsOpcUac

2 Likes

Using hostname might actually help solve having to configure this on site, but if there will be a requirement of having this configuration option in the future, I will definitely make use of the EasyUaClnt library, thank you!

1 Like

I don’t know exactly what you want to do,
but is used a opcuaserver configuration in mappview to connect to several servers

in another project i constuctred the endpoint url frome some input

itoa(OPC_IP_Byte_1, ADR(tmpString1));
		itoa(OPC_IP_Byte_2, ADR(tmpString2));
		itoa(OPC_IP_Byte_3, ADR(tmpString3));
		itoa(OPC_IP_Byte_4, ADR(tmpString4));
		itoa(OPC_Port, ADR(tmpString5));
		//opc.tcp://192.168.0.199:4840
		
		resultStringOPC := CONCAT ('opc.tcp://',tmpString1);
		resultStringOPC := CONCAT (resultStringOPC,'.');
		resultStringOPC := CONCAT (resultStringOPC,tmpString2);
		resultStringOPC := CONCAT (resultStringOPC,'.');
		resultStringOPC := CONCAT (resultStringOPC,tmpString3);
		resultStringOPC := CONCAT (resultStringOPC,'.');
		resultStringOPC := CONCAT (resultStringOPC,tmpString4);
	  		resultStringOPC := CONCAT (resultStringOPC,':');		
		resultStringOPC := CONCAT (resultStringOPC,tmpString5);
		OPCEndpointUrl := resultStringOPC;

and used this part in the OPC_Read demo file

ServerEndpointUrl := OPCEndpointUrl;
UA_ConnectionGetStatus_0.Execute := 1 ;
UA_ConnectionGetStatus_0.ConnectionHdl := ConnectionHdl;
UA_ConnectionGetStatus_0.Timeout := T#2s;
UA_ConnectionGetStatus_0();

with regards
sven

3 Likes