RS232 Troubleshooting Guide

April 5, 2019 by
RS232 Troubleshooting Guide
Bernat Garcia

Troubleshooting of RS232, step by step:

  • Ensure that the controller is powered between 12-24 Vdc.

  • Ensure that you are connecting the pin RX of your Industrial Shields controller with the pin TX of the other RS232 device. And the pin TX of your Industrial Shields controller with the pin RX of the other RS232 device. Besides, make sure that both GND is connected. Proper connections: 

Industrial Shields UnitRS232 Device
RXTX
TXRX
GNDGND
  • Ensure that you are using the proper switch and jumper configuration to use the RS-232 port.

    M-Duino family:
    For the RS232 communication protocol, there is not any switch or jumper to configure that affects it.

    Ardbox Analog HF w/RS-232 switch and jumper configuration:

                                                        Ardbox Analog HF w/RS-232 switch and jumper configuration














    Ardbox Analog HF w/RS-232 switch and jumper configuration






    Ardbox Relay HF w/RS-232 switch and jumper configuration:

    Ardbox Relay HF w/RS-232 switch and jumper configuration







    NOTE: In order to enable the RS-232 protocol the TOP ZONE must be configured as it is shown in the table. Although the switch name only is referenced to RS-485 it is also the same for the RS-232. 

    Enable the RS-232 protocol the TOP ZONE










    Enable the RS-232 protocol the TOP ZONE




    Note: Jumper zone 2 has no effect on the RS-232 protocol but it allows the unit to have I0.2 and I0.3 available. 

  • Ensure that both devices are using the same baud rate. 

    RS232.begin(baudrate);
  • Ensure that you are using the proper and last updated boards in your Arduino IDE.

    Installing industrial Shields boards:
    https://www.industrialshields.com/blog/industrial-shields-blog-1/post/installing-the-industrial-shields-boards-in-the-arduino-ide-63

    *Attention do not use old libraries like MDuino.h or Ardbox.h, these libraries are deprecated and can cause mapping issues to your controller. 

    M-Duino family: 
    Arduino Mega 2560 Rev3 is the controller of the M-Duino and RS-232 is controlled with the Serial2 of Arduino Mega 2560 Rev3. If for some reason you are not using our boards make sure that you are using Serial2 to control RS-232. 

    Ardbox Analog HF w/HW RS232:
    If you use the Ardbox Analog HF w/HW RS232 hardware serial you just have to include RS232.h library in your sketch and select the right board ARDBOX Analog HF w/HW RS232. Use object RS232 to write and read values through your RS232 serial port. See the below code example of how to use RS232 object.

    Ardbox Relay HF w/HW RS232:
    If you use the Ardbox Relay HF w/HW RS232 (hardware serial) you just have to include RS232.h library in your sketch and select the right board ARDBOX Relay HF w/HW RS232. Use object RS232 to write and read values through your RS232 serial port. See the below code example of how to use RS232 object.


    Software example:

    //Ensure that you are selecting the right board
    #include <RS232.h>
    
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    void setup() {
      Serial.begin(9600L);
      Serial.println("rs232-echo-simple started");
    
      RS232.begin(9600UL); //Set the proper baud rate
    }
    
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    void loop() {
     RS232.write(25);
     if (RS232.available()) {
        byte rx = RS232.read();
        Serial.println(rx);
        RS232.write(rx);
      }
    }

​Search in our Blog

RS232 Troubleshooting Guide
Bernat Garcia April 5, 2019

Looking for your ideal Programmable Logic Controller?

Take a look at this product comparison with other industrial controllers Arduino-based. 

We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.


Industrial PLC comparison >>>