Skip to Content

Welcome!

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

This question has been flagged
1 Reply
49 Views

Hi, I am trying to use the arduino base PLC to connect to a display via RS232 but couldn't get it work.


I have tried to follow the DIP switches and header configs as per the manual and shorting the Tx and Rx of the RS232 port but doesn't seem to be working. I have attached photos showing the setup and the testing code below.

/*
 * STEP 1 ONLY until you see "echo 25":
 *   - Unplug LCD completely
 *   - Short PLC RS232 terminals: RX <-> TX only (pins under RS232 label)
 *   - TOP DIP ON OFF ON OFF
 *   - LEFT: RE OFF, I0.4 ON, DE OFF, I0.5 ON
 *   - Zone 3: both shunts on RS-232 HARDWARE (not RS-485)
 */
 
#include <RS232.h>
 
void setup() {
  Serial.begin(9600);
  while (!Serial && millis() < 8000) {
    ;
  }
  RS232.begin(38400);
  Serial.println(F("STEP1: LCD UNPLUGGED + RX-TX short"));
  Serial.println(F("Waiting for echo 25 ..."));
}
 
void loop() {
  static unsigned long t;
 
  RS232.write((uint8_t)25);
 
  if (RS232.available()) {
    int v = RS232.read();
    Serial.print(F("echo "));
    Serial.println(v);
  }
 
  if (millis() - t >= 1000) {
    t = millis();
    Serial.println(F("ping (no echo yet, RS232 path dead)"));
  }
}
Avatar
Discard
Best Answer

Hi, thanks for the detailed test and the photos.

Our support team has already reviewed this case with you directly: the configuration you used is correct, so we are handling it as a hardware issue through support.

If anyone else sees the same behaviour, please contact our support team with the exact model, version and photos of the setup.

Avatar
Discard