Accesing data from X20CP0291 using raspberry pi with OPC UA server inside

Hello everyone,

I have a question regarding an old PLC X20CP0291. Due to our firm wanting to expand our data collection i was task with accesing data from our powerplant (Right now its done by an external firm and its being save in some sort of SQL database).
What I was trying to do was to make an OPC UA Server on the PLC but the PLC doesn´t have support for this kind of aplication. So I was thinking about using a Raspberry pi to collect data from PLC and make it an OPC UA Server.

Unfortunately I wasn’t able to find any solution about this topic.

Do you think its a possible way of data aqusition or am I far off?

Thanks for all responds,

Dupy

Hi Michal,

I didn’t use X20CP0291, but here is some possible solutions:

Regards,
Florent

Hi Florent,

thank you very much for your suggestions.

Using the PVI is going to be troublesome beacuse right now i don’t have access to valid PVI license so I will be dealing with it as a last resort.

I will definitely look into the other two suggestion and will be back with some feedback.

Regards,

Michal

1 Like

Unfortunately PVI is no option since this requires Microsoft Windows (and brwatch ist based on PVI).

From my point of view Modbus TCP could be an option: ModBus TCP library for SGC, SG3, SG4 tar | B&R Industrial Automation

Regards,

Christoph

2 Likes

Hi everyone,

I think its about time i give some update. Sorry for the delay but I am a part-timer so I don´t have as much time for this project but here is what i came to.

So I have make some progres regarding the communication and some mistake regarding the hardware.

Firstly the mistake, I gave you the wrong PLC. The plc the powerplant is using is HMI panel 4PP420.1505-75. My thought is that the other PLC i found in the network is used on the other side as a collector of data from the HMI panel.

About the communication i found out that there is AsUDP binary object on bouth PLCs so my thinking is that they are communicating via UDP.

So my thinking is this. I would like to connect raspberry pi via UDP. I found out that you need the IP adress (that I have) and UDP port (i should be able to get it soon).

So now i have one more question:

Does B&R sends the data Unicast or Broadcast? Or does it entirely depends on how you program it?
I tried looking on internet and help and didnt find much. So I decided to write here.

Again Thanks for all the commencts and help.

Regards,

Michal

Hi,

it’s both possible: unicast and broadcast.
As default it’s an unicast as you send to a dedicated IP address, but when opening the UDP socket by using UdpOpen(), you can set an option to use broadcast (.options := udpOPT_BROADCAST).

Just to be concrete: when using broadcasting, you have not only to enable the broadcast option, additionally you have to send the packet not to a dedicated IP address, but to the networks broadcast address which is the highest IP address in your network segment.
If the broadcast address is not known, it can be determined by using CfgGetBroadcastAddr() from library AsArCfg.

Best regards!

Hi Alexander,

thanks for the reply.

I have a follow-up question regarding the security risks associated with broadcasting data. Would it be feasible to establish a Unicast communication setup involving two Masters (the old PLC and the Raspberry Pi) and a single Slave (the HMI)? Or is this architecture impossible and you have to do Multicast?

Regards

Michal

Hi,

you can use more then one instance of UDP communication by using AsUdp, so yes it’s possible to communicate to multiple remote hosts by direct addressing their IP addresses/hostnames.

As Udp is a protocol without flow-control, it should be even possible to communicate via the same socket / port on the receiver, but this would make the data assignment maybe a bit more complex. So if there’s no mandatory reason to do so, I would prefer to use different sockets/ports at the receiver to have a direct 1:1 assignment between the communication partners.

Best regards!