How to connect Linux ARM PC to Allen Bradley PLC - plc

I am trying to connect my NVIDIA Jetson Xavier NX device to Allen Bradley PLC. The Jetson device is basically a Linux ARM PC, with a regular Ethernet port.
While creating a "Module" with the Allen Bradley LogixDesigner, it is asking me for different connection parameters:
| Assembly Instance | Size
Input | ??? | ???
Output | ??? | ???
Configuration | ??? | ???
Since my Jetson PC connects to the PLC using Ethernet/IP cables, I am confused what parameters these could be. I went through Rockwell automation literature, but unable to find out clear answers about this. I am adding this as a Generic Ethernet/IP module in LogixDesigner, but still being asked for this information.
I have also asked my PC manufacturer (AdlinkTech), and they don't seem to have any answers as well. Any help in this regard would be highly appreciated!!

Ethernet/IP is a specific protocol that some industrial devices, such as Allen-Bradley PLCs, use to communicate over Ethernet. Messaging in Ethernet/IP can be split into two types: Implicit Messaging and Explicit Messaging.
Implicit Messaging is when you set up a predefined structure of data that communicates at regular intervals between the two devices. This is most commonly used when you are dealing with an I/O device that needs to continually send or receive data from the PLC. On your Allen-Bradley PLC, when you create a Generic Ethernet/IP device in LogixDesigner, you are attempting to set up implicit messaging, and the 6 numbers that it asks for define the data structure that gets passed in that message.
Explicit Messaging, on the other hand, is a message that gets communicated on-demand in the program. On an Allen-Bradley PLC, this is done via the MSG instruction. There are different types of messages that can be set up this way, which you will see when you configure your MSG instruction.
In order to get your device to talk to the Allen-Bradley PLC, your device needs to act as an Ethernet/IP server. You'll probably either need to install Ethernet/IP server software on your PC to do this or write your own. More details on the Ethernet/IP protocol can be found on the Ethernet/IP Developers Guide from ODVA, the standards organization in charge of Ethernet/IP.

Related

Reading KNX using Raspberry Pi 3 GPIO

My dad wants me to make kind of a smart home.
I would like to interface with KNX (a home automation protocol) using the GPIO on a Raspberry Pi 3. Ideally, I would like to build a web interface for it, but I don't have a clue how to interface with KNX in the first place.
Any suggestions?
It wont make sense for you to interpret and understand the KNX bus communication protocol directly. There is a massive specification behind the KNX bus which deals with so many problems from device addresses to collision detection. It would take years to master it and unless you develop KNX devices you really should not spend your time on it. You will be better off by doing the following:
Buy a KNX/IP gateway/interface such as https://www.mdt.de/en/products/product-detail/system-devices/system-devices/ip-interface.html
Understand that KNX bus traffic can be routed/tunneled to your home LAN/WIFI
Play around with one of the KNX libraries on GitHub. For example for C#: https://github.com/search?l=C%23&q=knx&type=Repositories&utf8=%E2%9C%93
If you want, have a look at my experimental .NET Core project which starts a radio streaming process when someone touches a button (in the bathroom in my case). It runs on any operation system (so Raspberry and Linux are fine) and you can find it here: https://github.com/ThomasZeman/KnxNetCore
check this website : http://michlstechblog.info/blog/raspberry-pi-eibknx-ip-gateway-and-router-with-knxd/ that might help. also there are special knx 2 ip devices sold by electronic stores
You can't connect the KNX bus to anything on the pi. The KNX bus has its own electrical specs, and you need specialized hardware to connect to it.
Such hardware is available, but probably a KNXnet/IP device (such as the Siemens N148) is a better option.
I see two options for you:
A) use an IP interface (e.g. the ones from MDT) and access the IP interface from your raspberryPi (e.g. with http://calimero-project.github.io/)
B) use a TPUART controller, which makes KNX TP telegrams accessible (r/w) to UART - see http://www.konnekting.de/konnekting-lernen/l1-knx-mit-arduino/

How to start with OPC UA -- sampling and collecting data from a PLC device?

I am expected to design the solution for collecting/processing samples from a PLC device, and working with some control tags of the device. Please, suggest the approach. Sorry for the long question. I will split it to more questions after learning what are the smaller and more reasonable subjects/questions.
The solution for the company is built almost from scratch. There are some PLC devices, and there is a KEPServerEx (without the IoT Gateway). The PLC devices are already used through the third party proprietary software. But there is no "bigger framework" for future. From that point of view, I can introduce a modern design, but the budget is restricted.
From what I have learned so far, it seems that the KEPServerEx is a good choice for accessing PLC devices, but I have no hands-on experience with it. It seems to me that the OPC UA should be the choice over the older OPC (DA). I am also aware of the ladder way of working with PLC.
From what I have learned about "IoT Gateway" (which will not be used) for KEPServerEx, the KepServer can set the sampling frequency at the PLC tag level. And also the frequency of transferring the data can be set by IoT Gateway. The IoT Gateway then uses an internal (memory) buffer for storing the sampled values, and the tuples (tagID, value, quality, timestamp) can be read and passed to third party.
What is not clear to me is, how to do that without the IoT Gateway. I assume that it must be a basic operation. Is the (tagID, value, quality, timestamp) generic for working with PLC through any OPC server? Or is it generic only for KEPServerEx, or is it special for the IoT Gateway (optional) plugin?
I have learned that OPC Foundation added recently the Publih/Subscribe mechanism to the OPC UA. Does it require also newer version of KEPServerEx? Or can it be used with any earlier OPC server?
I am fairly experienced in programming and database things. I also have some technical background in industrial sensors, actuators,... However, I have never worked with digital automation in industry.
Thanks, and have a nice day.
Depending on the PLC you want to communicate with, and the communication network your devices will be transmitting data on, you need to purchase the appropriate driver package so that KEPServerEX can communicate with it.
For example:
If your PLC is an Omron NJ PLC, and it is on an Ethernet network with the server that KEPServerEX is residing on, you will need to use the "Omron NJ Ethernet" driver in the suite package Kepware offers called the "Omron Suite".
Regarding your question about the IoT Gateway:
From what I have learned about "IoT Gateway" (which will not be used) for KEPServerEx, the KepServer can set the sampling frequency at the PLC tag level. And also the frequency of transferring the data can be set by IoT Gateway. The IoT Gateway then uses an internal (memory) buffer for storing the sampled values, and the tuples (tagID, value, quality, timestamp) can be read and passed to third party.
This can be done without the IoT Gateway, by using the appropriate aforementioned driver, and then using another driver package to send the PLC data to wherever you would like (ODBC client, SQL Server database, etc.). It depends on what you want to do with the data you are acquiring.
When you talk to a specific device you need to know the protocol that the device uses and those protocols can vary really much.
Sometimes the manufacturer of a device provides an OPC server that shields you from this or as you mention a 3rd party Connectivity server like KepServerEx or Matrikon can be used presenting an OPC interface for your client to use.
I don't know anything about the KepServerEx or your particular requirements but normally an OPC server has a cache where values are stored from which the client can read from alternatively read directly from the hardware. Subscriptions can be configured similarly e.g. frequency, threshold etc.
The protocol from the OPC sever/3rd party to the device determines the frequency in which you can sample values. E.g. some protocols need the device to be polled for values, some are more elaborate.
If you create an OPC client then you are pretty much free what kind of OPC server you connect to whether it is a 3rd party or an OPC server from the manufacturer and having the client storing values whenever items in a subscription changes is pretty trivial.
If you are familiar with Visual Studio, then AdvancedHMI may be a possible solution. You did not mention any specific PLCs, but AdvancedHMI includes many PLC communication drivers as part of the free package. This gives you the ability to write VB or C# for transferring the values from the PLCs to a database. The drivers are not OPC drivers, but are designed to be much simpler to use and more efficient.

dose Arduino Uno capable of running an application taking input from sensors and sending them to remote database?

as I mentioned above,
does Arduino Uno capable of running application that is taking input from sensors around 6 sensors and sending that input to a remote database through out internet by using either (Wi-Fi shield, ethernet shield)?
I am asking such a question because I am going to use it in the next semester of academic year as a part of my final year project, but I am worried that it's RAM size is not enough since it is 2KB and I need to decide either using Arduino Uno or switch to Raspberry Pi.
It should be possible, altough you may have a hard time searching for a suitable driver for your database. If using MySQL, there is already a project to do exactly what you want.
Another (more flexible) approach is to write a small PC software to receive sensor data in a simple protocol you define, and write them to the database. Run it on the database machine (or any other machine, really), and then make the Arduino communicate with your proxy software instead.

Communicate with a microcontroller over ethernet

I am planning to make some microcontroller boards which would do miscellaneous tasks. For example measuring analog voltages or controlling other instruments. Each board needs to be controlled/downloaded it's data from one place. For that purpose I would use an ethernet interface and do the comnunication over that. So my question is: which would be the most suitable method of achieving that. My ideas are: run a webserver on each module and communicate with POST/GET, or run a telnet server on boards and communicate with a telnet client. The security and speed/latency is not an concern but the data integrity is.
I don't need a html based gui for modules because I will implement an application which will communicate wizh the modules periodically, gets the data from them and stores in a database. And the database is what I will use later, for examining the data for example.
An other example:
I have a board which measures measures temperature. There is a server on the board itself run by the mcu. It is connected to a router via the ENC chip. I have my pc also connected to that router. I have an application which connects to the server run by the Atmega328 and collects the data then stores to a database. It repeats this let's say in every hour. I would use an Atmega328 and an ENC28J60 ethernet interface chip. What do you recommend?

Receive BLE beacon with Raspberry Pi

I am looking for a tutorial on how to receive an iBeacon signal with a Raspberry PI.
What I am trying to do is monitor a zone of our warehouse. Once a beacon that advertises specific information enters that zone the rasperry Pi should send a REST request to a webservice.
I've found this: Can RaspberryPi with BLE Dongle detect iBeacons? but it does not quite answer my question. Does anyone know of a good tutorial how to implement something like the above?
(the easier the better, I am not exactly a programming whiz ... :-) )
Cheers,
Vitus
My company is working on tools to make doing this easier, but we do not have a tutorial available yet. We are the ones who posted the information you referenced: Can RaspberryPi with BLE Dongle detect iBeacons?
If you want to call a ReST service when an iBeacon is detected, you can use it with the detection script we provided. As the detection script runs, it writes out the identifiers of any iBeacons it sees. What you would need to do is write a separate program that reads in the output of this script, looks for identifiers that it cares about, then calls the ReST service when it sees them.
Connecting two programs by taking the standard output of one and reading it with another is a very common programming technique on Linux. You would run our program with ibeacon_scan -b and it would output the information below:
2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6 1 6 -59
E2C56DB5-DFFB-48D2-B060-D0F5A71096E0 6 9 -55
74278BDA-B644-4520-8F0C-720EAF059935 0 73 -50
You would then read this information in with your second program line by line, parsing out the three part identifier from each line. And then call your ReST Service if the identifiers match the iBeacon you are looking for.
The specifics of how you do this depend on what programming language you want to use. You could do it in C, Ruby, Perl, Java or any other language supported by the Raspberry Pi. If you have a client library for your ReST service, you probably want to build this program in whatever language that client library uses.
Full disclosure: I am Chief Engineer for Radius Networks.