# Alternatives for PLC B&R data extraction

**URL:** <https://discourse.nodered.org/t/alternatives-for-plc-b-r-data-extraction/27343>\
**Category:** Industrial\
**Created:** [27 May 2020 04:51 UTC](https://discourse.nodered.org/t/alternatives-for-plc-b-r-data-extraction/27343 "2020-05-27T04:51:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![PSamuel](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@PSamuel](https://discourse.nodered.org/u/PSamuel)\
**Post date:** [27 May 2020 04:51 UTC](https://discourse.nodered.org/t/alternatives-for-plc-b-r-data-extraction/27343/1 "2020-05-27T04:51:30Z")

</div>

**How do I extract data from a B&R PLC with Node-Red?**

**What are the alternatives?**

---

<div class="post-metadata">

**Author:** ![seth350](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/seth350/32/4617_2.png) [@seth350](https://discourse.nodered.org/u/seth350)\
**Post date:** [28 May 2020 03:48 UTC](https://discourse.nodered.org/t/alternatives-for-plc-b-r-data-extraction/27343/2 "2020-05-28T03:48:06Z")

</div>

You have a few options.

MQTT, TCP/UDP, HTTP, OPC-UA, Modbus TCP, and maybe Ethernet/IP.

Which would you like?

---

<div class="post-metadata">

**Author:** ![PSamuel](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@PSamuel](https://discourse.nodered.org/u/PSamuel)\
**Post date:** [11 June 2020 05:03 UTC](https://discourse.nodered.org/t/alternatives-for-plc-b-r-data-extraction/27343/3 "2020-06-11T05:03:38Z")

</div>

• OPC-UA  
• Modbus

Help!!

---

<div class="post-metadata">

**Author:** ![Martin45](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/martin45/32/81884_2.png) [@Martin45](https://discourse.nodered.org/u/Martin45)\
**Post date:** [11 June 2020 08:04 UTC](https://discourse.nodered.org/t/alternatives-for-plc-b-r-data-extraction/27343/4 "2020-06-11T08:04:16Z")

</div>

Unfortunately, B&R PLC node does not exist yet...

---

<div class="post-metadata">

**Author:** ![machadotiago](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/machadotiago/32/23776_2.png) [@machadotiago](https://discourse.nodered.org/u/machadotiago)\
**Post date:** [11 June 2020 15:15 UTC](https://discourse.nodered.org/t/alternatives-for-plc-b-r-data-extraction/27343/5 "2020-06-11T15:15:18Z")

</div>

Hi folks!  
we are the developers of the [S7](https://flows.nodered.org/node/node-red-contrib-s7), [Ethernet/IP](https://flows.nodered.org/node/node-red-contrib-cip-ethernet-ip), [OPC-DA](https://flows.nodered.org/node/node-red-contrib-opc-da), [DDE](https://github.com/netsmarttech/node-red-contrib-dde) and [PCCC](https://flows.nodered.org/node/node-red-contrib-pccc) nodes (just to name a few), and most of this nodes were sponsored by customers who wanted some IoT integration (mostly with [ST-One](http://netsmarttech.com/)).  
For B&R we know that there are 2 possible protocols (INA and PVI), but until we find a project that can pay the development bill, it is not worth for us invest on this Node.  
Now, if you have a commercial usage for it, please let us know because maybe we can help you 😉 .

---

<div class="post-metadata">

**Author:** ![seth350](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/seth350/32/4617_2.png) [@seth350](https://discourse.nodered.org/u/seth350)\
**Post date:** [12 June 2020 03:01 UTC](https://discourse.nodered.org/t/alternatives-for-plc-b-r-data-extraction/27343/6 "2020-06-12T03:01:48Z")

</div>

It doesn’t need to exist.

OPC-UA is the best and recommended way to exchange data from a B&R PLC. Not to intend that it is the only way.

When I get back to work, I will send you some screenshots on how to set it up.

---

<div class="post-metadata">

**Author:** ![Martin45](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/martin45/32/81884_2.png) [@Martin45](https://discourse.nodered.org/u/Martin45)\
**Post date:** [12 June 2020 04:51 UTC](https://discourse.nodered.org/t/alternatives-for-plc-b-r-data-extraction/27343/7 "2020-06-12T04:51:15Z")

</div>

Is it possible without B&R PLC protocol implementation?

Even If it uses OPC-UA, doesn't it need B&R PLC protocol implementation?  
(Maybe that might not be node type)

---

<div class="post-metadata">

**Author:** ![machadotiago](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/machadotiago/32/23776_2.png) [@machadotiago](https://discourse.nodered.org/u/machadotiago)\
**Post date:** [12 June 2020 12:13 UTC](https://discourse.nodered.org/t/alternatives-for-plc-b-r-data-extraction/27343/8 "2020-06-12T12:13:35Z")

</div>

I know Siemens and Rockwell PLCs quite well, but to be honset I never saw the configuration software for B&R PLCs, and because of that I have some questions that maybe you can help me:

1. Is OPC-UA supported by all B&R PLCs (old and new hardwares)?
2. Is there any additional license required to make OPC-UA work on B&R PLCs or it is a standard functionality?
3. Does it comes with OPC-UA running by default, or the user must turn it on first?
4. In case the user needs to turn the OPC-UA ON first, is the configuration process easy or painfull?
5. With OPC-UA you can access all PLC variables once it is ON, or the user must configure it one by one on the PLC?

---

<div class="post-metadata">

**Author:** ![seth350](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/seth350/32/4617_2.png) [@seth350](https://discourse.nodered.org/u/seth350)\
**Post date:** [12 June 2020 13:36 UTC](https://discourse.nodered.org/t/alternatives-for-plc-b-r-data-extraction/27343/9 "2020-06-12T13:36:54Z")

</div>

- Is OPC-UA supported by all B&R PLCs (old and new hardwares)?
  - All X20 PLC, PowerPanels (HMI/PLC), and current IPC support OPC-UA.

- Is there any additional license required to make OPC-UA work on B&R PLCs or it is a standard functionality?
  - No license needed for OPC-UA connectivity

- Does it comes with OPC-UA running by default, or the user must turn it on first?
  - Default is OFF, must be enabled using Automation Studio (development software)

- In case the user needs to turn the OPC-UA ON first, is the configuration process easy or painfull?
  - Very simple. Go to Physical View tab, right click the PLC at the top of the config tree, select Configuration, then expand OPC-UA.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/9/a9194399359baa940aab3407535bd56097f643f2.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/0/00a9e7166d2eec26a190f394ad577348743733b4.png)

- With OPC-UA you can access all PLC variables once it is ON, or the user must configure it one by one on the PLC?
  - User must add variables/structures that they would like available in the OPC-UA variable  
mapping.

Expand the CPU folder, expand Connectivity, then right click on OpcUA, then select Add Object. The toolbox will open to the right of the screen.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/06a5b9c887cec8c0adaa6556faa8696fc820a05d.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/8/5856fe673e4be3b5adac6206308f20c25181acaf.png)

Double click the OPC UA Default View File to add it.

Now double click the added OpcUaMap.uad file to start mapping OPC-UA variables.  
You can then right click on a variable, and select Enable.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/5/85c19751750fca1df64454acc58de5faf60b9dea.png)

---

<div class="post-metadata">

**Author:** ![seth350](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/seth350/32/4617_2.png) [@seth350](https://discourse.nodered.org/u/seth350)\
**Post date:** [12 June 2020 18:42 UTC](https://discourse.nodered.org/t/alternatives-for-plc-b-r-data-extraction/27343/10 "2020-06-12T18:42:15Z")

</div>

I used OPCUA-IIoT node in order to make the connection to the B&R PLC.

You must be able to complete my previous post in order to do this, or you must know that the OPC-UA server is enabled.

Next thing is that you must know where the data you want to read is located within the PLC. OPC-UA uses namespaces to organize it's content. Not only the data/variables you enable are available, there are also many other variables available with information about the server, clients, connections, etc.

In B&R land, the namespace for a global variable or a program local variable is 6.  
You may see it as `ns=6`.

This namespace must be provided when asking the OPCUA server what data you want.

Within a namespace, there is a hierarchy of data. The server provides you a way to indentify which folder to dive into, or what data you want to read.

You do this by including the address string after the namespace id inside your request.  
For example, to get the value of a blower's air pressure located in a structure data type located in global variables.

`ns=6;s=::AsGlobalPV:bdBlower.Sensors.AirPsi`

If the variable is a local program variable, you would define it like this.  
`ns=6;s=::MyLocalProgramName:someLocalVar`

Download/install the OPCUA-IIoT node from the pallete manager.

Add an OPCUA-IIoT inject node and OPCUA-IIoT Read node.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/39af5ae56eb3f6eb35d05d666a5ccc3b08a0fdd8.png)

Open the inject node, setup the inject properties and enter in the variables you would like to read.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/f/8f31979346a18bd6596daca5459184844a55de70.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/3/b38dd0da85dc70686a0c4d0153834c8d0c5b130c.png)  
Click Done

Open the Read node and configure it.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/1/41d7f26d566cb3ca13701b260f4105d2ce93940d.png)  
You will need to setup the connector at first. Click the pencil icon to the right of the connector box.  
The endpoint should be the PLC's IP address and the default port number is 4840.  
In the Security tab, depending on how the server was setup, it may require you to use a certificate to connect to it. I set mine up for no security for the time being.  
Leave the settings in Strategy tab as their default.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/b/fb63a763dcb3c8c5d1100eab40f8c04572abf433.png)

Place a regular debug node at the end of the Read node and connect it. Then click deploy.

You should start seeing some activity in your Debug log.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/4/c484d088e7b902ae51d71a0af454dd95478c3bbc.png)

From there, extract the data you need and pass it on to the rest of your flow.  
I hope this helps!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [26 June 2020 18:42 UTC](https://discourse.nodered.org/t/alternatives-for-plc-b-r-data-extraction/27343/11 "2020-06-26T18:42:23Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
