Cesar
OpenPLC is a middlesoftware to work with microcontrollers like Arduino or CPU like Raspberry pi in IEC languages. It's fine. But I see my overview like this:
A PLC in industry is mainly an electrotechnical device (big electric cables) conected to a microcontroller. The same could be done maybe with switches and timers but we use an microcontroller instead (this is an electronic device) (no cables but a printed board). So the problem here is that an Arduino or a Rasperry pi cannot be converted in a PLC without the I/O circuit. A PLC is all about I/O circuit. But Arduino and Raspberry pi have only a few number of pins and an industrial application needs maybe 30 GPIO (General Purpose IO). So my questions:
- Can I multiplexe the few GPIO of Arduino to get 30?
- Should I connect several Attiny85 with I2C to get 30 GPIOs?
- Which I/O circuits are available to couple to Arduino? Are they optocouplers?
- For IIoT, is Arduino capable to use Profibus, Modbus, etc?
- How about network MQTT and OPC UA?
thiagoralves
Cesar wrote:
A PLC is all about I/O circuit.

Disagree. A PLC is a framework that consists of hardware (which as you already noticed is not present on a simplistic Arduino board) and a standardized programming interface (ladder logic, function blocks, etc). The standardized programming interface is, in my view, as important (if not more important) as the robust hardware for the very reason that on industry, you need to make sure your code is maintainable. If you write your automation code in some random C code platform, the next technician that will maintain your machine will have a very hard time figuring out what you did. That's why PLC programming languages are still very popular even after 40 years. The average Joe can read ladder diagrams and interpret them without the need for an engineering or programming degree.

Cesar wrote:
Can I multiplexe the few GPIO of Arduino to get 30?

No

Cesar wrote:
Should I connect several Attiny85 with I2C to get 30 GPIOs?

You can connect them, but then you will have to add support for them on the OpenPLC Runtime, which means, changing the current atmega328 hal file (driver)
 
Cesar wrote:
Which I/O circuits are available to couple to Arduino? Are they optocouplers?

There are several "relay modules" and "isolated input modules" for Arduino boards available. You can use any of them, as long as you can connect each IO to the correct pin. If they have a fixed mapping, like a shield for example, then you will have to modify the OpenPLC atmega328 hal file to couple with the changes. Also, if you want something robust I suggest you go after a ready-to-use platform like Automation Direct's P1AM or Controllino. Both platforms are supported on OpenPLC.

Cesar wrote:
For IIoT, is Arduino capable to use Profibus, Modbus, etc?

OpenPLC Runtime on microcontrollers support Modbus RTU and Modbus TCP. If you run OpenPLC Runtime on Linux or Windows, then you can also use EtherNet/IP and DNP3

Cesar wrote:
How about network MQTT and OPC UA?

Not supported
Reply 0 0
Cesar
Thanks a lot for technicals details. I was asking because I am trying to see the whole picture.
Please do not misunderstand me. 

First I agree about the use of IEC languages. But I believe following is a mythos:
"It is for dummies without IT background". "It is for just technicians"
No. Technicians are very intelligent and can learn fast. Technicians or mechanical engineers can understand C++ and Python as well. The IEC languages are for everybody. It is just a good framework for programming for everybody. Guido van Rossum would use it as well. So IEC language are not the alternative for "stupid people" but they are a good framework to deal with microcontrollers.

Second, I am not looking for something robust. A Siemens is robust but the main feature is that it may have a lot of IO electrical cables and because the MPU has corresponding a lot of GPIOs. I was asking first to know how can I control the operation of 30 electric appliances. I don't care if it is robust.

So for me there are two mythos.

mythos 1: IEC languages are for unskilled people in IT.

mythos 2: Siemens PLC is all about robustness. Only robustness
Reply 0 0
BPC_Eng
Out of interest, I have been designing an OpenPLC-compatible PCB for the Nano which I may make available if it works out to be viable.   Wll be laying the PCB out in the next couple of days and expect to be ordering a small batch of PCBs by end of the week.
Reply 0 0
thiagoralves
This would be pretty cool. Once you have them tested, post the info here on the forum. I'm pretty sure many users will be interested in getting one.
Reply 0 0
BPC_Eng
I will do Thiago.  In summary, it has 5 x Opto Isolated inputs set up for 24v inputs (with a local switch on the microcontroller side for manual input) , and 4 x Relay outputs.  The Analog inputs and PWM outputs are on Pin headers and only 5v tolerant, as I would like my students to consider external circuitry.
Reply 0 0
Reply