OPC UA subscriber not operational

dsa28
2024-10-22
2024-11-29
  • dsa28 - 2024-10-22

    Hello All,

    Hopefully I can get some help configuring an OPC UA subscriber in a CODESYS runtime in a Raspberry Pi 5 that tries to retrieve data from an OPC UA publisher (in this case running in a TwinCAT system).

    I tried to follow the steps described in the page to implement the OPC UA subscriber: https://content.helpme-codesys.com/en/CODESYS%20Examples/_ex_opcua_pubsub.html

    Seems that the example provided was created with version 3.5.16.0. Now with version 3.5.20.20 is not possible to open the complete project neither convert it.

    Anyway, after configuring all IPs and ports used in the OPC UA connection function block but the connection state always shows DISABLED.

    Can someone help me to do the proper configuration of the OPC UA subscriber?

    Many thanks in advance.

     
  • r-niedermayer

    r-niedermayer - 2024-11-04

    Hi.

    As far as projects in "old version"s are concerned, these can be upgraded to newer versions at any time. To do this, the device must be updated accordingly and the copilers and library versions must be adapted.

    You can find instructions on how to proceed in the online help/FAQ:
    https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_changing_compiler_version.html
    https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_cmd_update_device.html

    See also 4.3.22.4 "How to open an Example Project" within the following pdf for more details on the single steps:
    https://forge.codesys.com/lib/counit/tickets/_discuss/thread/3e991befbc/ca97/attachment/Public%20FAQ-v13-20240610_075228.pdf


    Regaring your OPCUA connection state always showing just "DISABLED", without knowing both sides of the assembly in detail, one can only approach the problem theoretically.

    We can give a chekclist on how to proceed:

    • Fist, please recheck the communication settings in the OPC UA connection function block to ensure that the server URL, endpoint URL, and other settings are correct and match the configuration of the OPC UA server.

    • Verify that the OPC UA server is running and accessible.

    • -You can try to connect to the OPC UA server using a separate client, such as UAExpert, to ensure that the issue is not related to the OPC UA server itself.

    • Test the security settings in the OPC UA connection function block to ensure that the correct security policy and certificate are selected.

    • If you are using a dynamic connection to the OPC UA server, probe that the connection settings are correctly configured and that the OPC UA client is able to establish a connection to the OPC UA server.

    • Also, please loock into the log files for any errors related to the OPC UA connection function block, these should be listet there.

    • The log files may also provide additional information about the issue and help you to further troubleshoot the problem.


    FYI - Please see https://content.helpme-codesys.com/en/CODESYS%20Communication/_cds_obj_data_source_communication_opc_ua_server.html:

    Her you can finde the Communication settings via OPC UA Server -> layout Browse Live Server:
    The client connects to the server and detects the existing variables and types.

    From Information Model The client reads the data structure (layout) of the OPC UA Server from the information model set here and as a result receives the information about available variables and types.

    A connection to the server is not required.
    The list contains the information models installed in the OPC UA Information Model Repository.

    "Read Connection" Settings from IEC Variable (option set):
    - The connection settings used by the device are not read here from the dialog, but at runtime from the IEC variable specified here.
    - For this possibility, please see the Using a Dynamic Connection to an OPC UA Server (https://content.helpme-codesys.com/en/CODESYS%20Communication/_comm_use_dynamic_opc_ua_server_comm_settings.html)

     
  • dsa28 - 2024-11-29

    Hi,

    Thanks for the reply.
    Please note that the information and links provided are related to OPC UA Client/Server. My problem was related to OPC UA Pub/Sub.

    In the end I have managed to establish OPC UA Pub/Sub communication between Codesys and TwinCAT systems. Keep in mind that OPC UA Pub/Sub example is not provided in the latest library version 1.1.0.0. The user needs to download the previous version to get the example.

    During the configuration I ended up with some doubts regarding the usage of IEC_ARRAY type in the dataset definition (see attachment).

    Can you please give more information on how to use this type?

    Many thanks.

     

Log in to post a comment.