Bret (Customer) asked a question.

Has anyone set up an OPC-UA Client on C2-NRED? I'm trying and it's been a struggle.

I have a piece (actually 3 identical pieces) of equipment running a Beckoff PLC that is supporting Industry4.0 over an OPC-UA Server.  

 

I started with Node Red running on a PC and used the node-red-contrib-opcua, and got it reading data on the pc.

So I want to get that data onto a dashboard in the production area, Bought a CM5-RHMI and the C2-NRED

 

node-red-contrib-opcua ver0.2.301 on the C2-NRED is giving me an error

ERR_UNKNOWN_BUILTIN_MODULE

and a few of the nodes in that are greyed out including the OpcUa-Client node that worked for me on the PC. I tried a few different things to resolve that to no avail.

 

The next thing I tried was to install a different node, node-red-contrib-iiot-opcua ver4.1.2 This one appears to have installed correctly and completely, but I haven't been able to make connection to the OPCUA Server(s) getting an error

Error: Invalid lockfile specified :/usr/local/nred/.node-red/node_modules/node-red-contrib-iiot-opcua/node_modules/node-opcua-client/dist/certificates/client_selfsigned_cert_1024.pem.lock

I've done some looking into that error and I'm finding recommendations that involve getting into character prompt, I'm not sure how to get there with the C2-NRED, and generating a new certificate.

 

I'm an old Ladder code guy learning some new tricks, but feeling stumped. I'm pretty confident this can work, but not sure what my next step is.

 


  • ADC_Click_PE01 (AutomationDirect)

    I just installed node-red-contrib-opcua ver0.2.301 to test and did get the same error, but only the OPCUA-endpoint node is greyed out and that seems to be because of a dependency that is not compatible with the C2-NRED modules version of node.js. If you do not need the Endpoint you can redownload the v0.2.301 package and make sure you have internet connectivity on the C2-NRED module and then install again.

     

    If you want or need to stick with the node-red-contrib-iiot-opcua ver4.1.2 package when adding new OPCUA-IIoT-Connector under security tab check Use Individual Certificate Files and then change the both the public and private paths to some like /usr/local/nred-work/opcua_certs (after the last slash can be anything you like, but the /usr/local/nred-work/ must stay the same). This is the directory path required to write files to the C2-NRED module.

     

    Hope this helps

    Expand Post
  • Bret (Customer)

    The saga continues,

    node-red-contrib-opcua ver0.2.301

    OK, so I removed and reinstalled node-red-contrib-opcua and as you described everything installed except the endpoint node... until I tried to deploy a flow with the client node, then I got an error and then the client node disappeared from the palette, and greyed out in the Nodes tab in User Settings. Incedentally, on my PC install of Node Red, the Endpoint node is also greyed out, but shows "in use" in the nodes tab, my guess is that it is needed to run beneath other nodes.

     

    node-red-contrib-iiot-opcua ver4.1.2

    Next, I went back to node-red-contrib-iiot-opcua and the advice on the certificate issue was helpful, I do seem to be further down the path, now getting an

    "Error: Client Not sessionActive On Read"

    I thought I would try it on the PC install of Node red and troubleshoot there. Installing there, I noticed there that there are warnings in the install, that it is no longer supported and has memory leaks, and not to use it for production.

     

    @opcua/for-node-red

    a 3rd OPCUA client node I've looked at, but the compatibility test

    https://automationdirect.github.io/CLICK-PLC/Node-RED/C2-NREDModuleVersionCheck/CompatibiltyCheck.html

    suggests that there is no version available of that one that is compatible with the C2-NRED.

     

    Open to further suggestions, but at this point, I think my next step is to use the PC install of Node Red as a gateway, and write the data to the PLC.

    .

    Expand Post
    • ADC_Click_PE01 (AutomationDirect)

      I have also checked for other OPCUA packages that could work. I can get the node-red-contrib-iiot-opcua package to read and write from a OPCUA server, but if the depreciation is an issue then that will not work.

       

      If helpful, we do have the C2-OPCUA module that is a server and exposes the CLICK addresses that you add as nodes for the server. Then clients can read and write data over OPCUA protocol to the CLICK, but if you have another server already the C2-OPCUA cannot connect to that server as it is not a client.

      Expand Post
      • Bret (Customer)

        Well, I don't know if the node-red-contrib-iiot-opcua package is a problem or not. I haven't gotten it to connect yet, And I may have an unrelated problem as this is my first adventure in this standard.

         

        Right, coincidentally I started with a C2-OPCUA card and when I found that both sides are servers and couldn't connect without a "client gateway" that led me to building that in Node Red, and then the idea of putting the Node Red on the PLC as an OPC-UA Client in place of the "client gateway" and C2-OPCUA. I think it's a great idea, and the nodes for reading/writing to the Click Address table is super cool, I just been stuck trying to make the OPCUA communication work, everything else appears to work.

        Expand Post
  • KristjanH (Customer)

    You can skip the extra steps of (1) reading data into Click to (2) serve from a CM5-RHMI.

     

    Since you are able to read the Beckhoff data into Node Red, you can create the dashboard directly in NR. Very good instructions from AutomationDirect on creating NR dashboards:

    https://www.youtube.com/watch?v=AcD5uEvCmD0

     

    I guess you don't want to serve the dashboard from the PC. You can install and run NR on a RaspberryPi.

    Expand Post
  • DWoodlock (Customer)

    Wondering if someone has reached out the maintainer of the node-red-contrib-opcua author/maintainer?

     

    makes me wonder if something needs done on the backend to work with this chip. I’ve used NR on various devices, but first time I’ve heard of this error.

    • Bret (Customer)

      Update - I'm currently understanding that the version of node.js running on the C2-NRED is not compatible with the version of the OPCUA endpoint node I was trying to run. I've implemented the NR part of my project on a PC server and sent the data from there to the PLC. Not as elegant a solution but it's working, and onward to the next project. Maybe there will be a firmware update that updates the node.js and I'll come back to it someday