artkittisakpomrasa
please recommend digital input wiring connection A or B for OpenPLC using Arduino or Wemos Ees8266 #OpenPLC
[203128%2F9174138%2Fmceclip0]
 
Thanks
Best regards.
Reply 0 0
thiagoralves
Both work just fine. With pull up, the signal is “inverted” though
Reply 1 0
artkittisakpomrasa
Okay sir, but in general, they are popularly used pull-down, right?
 
thanks.
Reply 0 0
fg71
Uno have built-in pull-up/pull-down registers, that you could configure when you setup the pin
You could use Arduino extension with your PLC logic, in other words you do not use location instead you use Arduino's API to set the pin.
Reply 0 0
artkittisakpomrasa
Uno have built-in pull-up/pull-down registers, that you could configure when you setup the pin
You could use Arduino extension with your PLC logic, in other words you do not use location instead you use Arduino's API to set the pin.
Ok, Thanks. 🙏🙏
Reply 0 0
artkittisakpomrasa
Both work just fine. With pull up, the signal is “inverted” though
the OpenPLC use Arduino DI active low or high ?
thanks.
Reply 0 0
fg71
To know exactly what OpenPLC does you need to study the hals.json and JSON value of the key source for your board.
This is xxx.cpp file that use Arduino API, if you really like to know you could make a simple example.
 
And you could simulate that in Arduino extension and use Arduino IDE serial monitor to know exactly what your digital or analog are doing.
You could still debug any OpenPLC program if you use Arduino extension to print on the serial monitor.
 
It means when LED_BUILTIN is HIGH, the state is 1 or LED is TRUE
It means when you set the state of output to True in OpenPLC it will be HIGH in Arduino API for that pin.
int state = HIGH;

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

void loop() {
  digitalWrite(LED_BUILTIN, state);
  Serial.println(state);
}
 
Reply 1 0
artkittisakpomrasa
To know exactly what OpenPLC does you need to study the hals.json and JSON value of the key source for your board.
This is xxx.cpp file that use Arduino API, if you really like to know you could make a simple example.
 
And you could simulate that in Arduino extension and use Arduino IDE serial monitor to know exactly what your digital or analog are doing.
You could still debug any OpenPLC program if you use Arduino extension to print on the serial monitor.
 
It means when LED_BUILTIN is HIGH, the state is 1 or LED is TRUE
It means when you set the state of output to True in OpenPLC it will be HIGH in Arduino API for that pin.
  1. int state = HIGH;
  2. void setup() {
  3.   Serial.begin(9600);
  4.   pinMode(LED_BUILTIN, OUTPUT);
  5. }
  6. void loop() {
  7.   digitalWrite(LED_BUILTIN, state);
  8.   Serial.println(state);
  9. }
 
Thanks.😊
Reply 0 0
thiagoralves
the OpenPLC use Arduino DI active low or high ?
thanks.
OpenPLC does not activate any internal pull up or down resistors, as not all boards support them. You can add resistors externally, or configure the internal ones on an Arduino Extension (using Arduino code).
Okay sir, but in general, they are popularly used pull-down, right?
 
It depends on your application. Normally, with just push buttons, it is common to use pull down.
Reply 0 0
artkittisakpomrasa
OpenPLC does not activate any internal pull up or down resistors, as not all boards support them. You can add resistors externally, or configure the internal ones on an Arduino Extension (using Arduino code).
 
 
It depends on your application. Normally, with just push buttons, it is common to use pull down.
Thanks /\
Reply 0 0
Reply