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 Unit | RS232 Device |
RX | TX |
TX | RX |
GND | GND |
- 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 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.Â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); } }
RS232 Troubleshooting Guide