corydoras
Crawling around Ali, I came accross this board based on ESP32 chip. Could this be a cheap small application PLC sollution.
It has lots of I/O´s. Transistor Outputs as well as both analog and digital inputs. Ethernet and rs485 for serial (modbus?)
 
 
Are the ESP32 code of OpenPLC verified as modbus master?
 
Only drawback is that inputs seem to be 12vdc, and nort 24vdc.
 
Anyone with links to similar boards that is tested with OpenPLC?
 
BR
C
Reply 0 0
fg71
First the board is made for Home Automation like ESPHome and Home Assistant API.
Its use Expender chip PCF8674 that communicate with I2C
 
So my guess would be you need to have something in OpenPLC that could communicate with I2C
 
If you are not a programmer, I would think the best approach is to contact the manufacture of that board.
They properly could give a more correct answer if the board is Arduino compatible or if there library for it.
 
 
12VDC is very common for consumer market and maybe thats why its used.
 
Other way to see it or asking, How does OpenPLC Editor works.
 
If you take a look in hals.json and any board_name.cpp the fbqn is the board to use but it also tell the compiler what library to use.
Any custom PCB with components on it are not different from any breadboard with components. It make sense to believe to do
any communication or be able to use a sketch or program we also use libraries to talk to the components.
Because a PCB are using ESP32 MCU doesn't not mean it has physical inputs or GPIO that most Arduino boards has.
The maintainer of the PCB could use I2C with a chip like GPIO expander to make I/O.
 
What people maybe do not understand is OpenPLC Editor is Arduino compatible PLC IDE. In other words any device that support Wiring API
could be connected with little change in the configuration and be used with OpenPLC Editor.
 
The hals.json and board_name.cpp are not so difficult to understand
 
To understand the pinMask lets make a example in Arduino IDE
byte data = 0b00000000;
byte pin13Mask = 0b00000001;

void setup() {
  Serial.begin(9600);
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  data |= pin13Mask;
  digitalWrite(LED_BUILTIN, bitRead(data, 0));
  delay(1000);
  
  // Set pin 13 LOW using the mask
  data &= ~pin13Mask;
  digitalWrite(LED_BUILTIN, bitRead(data, 0));
  delay(1000);
}
 
Reply 0 0
corydoras
First the board is made for Home Automation like ESPHome and Home Assistant API.
Its use Expender chip PCF8674 that communicate with I2C
 
So my guess would be you need to have something in OpenPLC that could communicate with I2C
 
If you are not a programmer, I would think the best approach is to contact the manufacture of that board.
They properly could give a more correct answer if the board is Arduino compatible or if there library for it.
 
 
12VDC is very common for consumer market and maybe thats why its used.
 
Other way to see it or asking, How does OpenPLC Editor works.
 
If you take a look in hals.json and any board_name.cpp the fbqn is the board to use but it also tell the compiler what library to use.
Any custom PCB with components on it are not different from any breadboard with components. It make sense to believe to do
any communication or be able to use a sketch or program we also use libraries to talk to the components.
Because a PCB are using ESP32 MCU doesn't not mean it has physical inputs or GPIO that most Arduino boards has.
The maintainer of the PCB could use I2C with a chip like GPIO expander to make I/O.
 
What people maybe do not understand is OpenPLC Editor is Arduino compatible PLC IDE. In other words any device that support Wiring API
could be connected with little change in the configuration and be used with OpenPLC Editor.
 
The hals.json and board_name.cpp are not so difficult to understand
 
To understand the pinMask lets make a example in Arduino IDE
  1. byte data = 0b00000000;
  2. byte pin13Mask = 0b00000001;
  3. void setup() {
  4.   Serial.begin(9600);
  5.   pinMode(LED_BUILTIN, OUTPUT);
  6. }
  7. void loop() {
  8.   data |= pin13Mask;
  9.   digitalWrite(LED_BUILTIN, bitRead(data, 0));
  10.   delay(1000);
  11.   
  12.   // Set pin 13 LOW using the mask
  13.   data &= ~pin13Mask;
  14.   digitalWrite(LED_BUILTIN, bitRead(data, 0));
  15.   delay(1000);
  16. }
 
Thank you very much for taking the time to reply and explain 🙂
Reply 0 0
Reply