Hi everyone, I am starting to lose hope and would very much appreciate any help!
I am using an automation direct solo SL4845-RR Temperature controller and would like to read data from it, just a simple Process Variable to start with, I can't even get that to work. I have done so much research and tried everything possible.
I am using a MAX485 converter module which converts the RS485 communication to TTL so the Arduino can read it.
VCC -> 5v on Arduino
GND -> GND on Arduino
A -> Data+ RS485 on temp controller
B -> Data - RS485 on temp controller
RO - > Pin 2
DI - > Pin 3
RE -> Pin 4
DE -> Pin 5
According to the Temperature Controller manual: Temp Controller Manual
If you scroll down to Chapter 7 it has the Modbus Protocol information, I will provide it here as a reference as well, these are the DEFAULT values it has in the controller.
Protocol: Modbus ASCII
Network Address: 1
Baud Rate: 9600
Bit Length: 7
Parity: Even
Stop Bit: 1
Register for Process Variable I need to read from in Hexadecimal: 1000
**Please Note that I have changed the Protocol to Modbus RTU through the settings in the temperature controller
As for the library I am using, it is ModbusMaster by Doc Walker and here is the link: Modbus Library
I guess the only thing left is to show you the code!
#include <ModbusMaster.h>
#include <SoftwareSerial.h>
#define DE 5 //Transmit enable
#define RE 4 //Recieve enable
#define RX 2
#define TX 3
ModbusMaster node; //instance of class
SoftwareSerial RS485Serial(RX,TX);
void preTransmission()
{
digitalWrite(RE, 1);
digitalWrite(DE, 1);
}
void postTransmission()
{
digitalWrite(RE, 0);
digitalWrite(DE, 0);
}
void setup()
{
pinMode(DE, OUTPUT); //initiate both as output
pinMode(RE, OUTPUT);
digitalWrite(RE, 0); //both start at no signal for receive mode
digitalWrite(DE, 0);
Serial.begin(9600);
RS485Serial.begin(9600);
node.begin(1, RS485Serial);
node.preTransmission(preTransmission);
node.postTransmission(postTransmission);
Serial.print("Testing");
delay(500);
}
void loop()
{
uint8_t result;
result = node.readHoldingRegisters(0x1000,1);
Serial.println(result);
Serial.println(node.getResponseBuffer(0));
delay(500);
}
Now comes the issue, my output for result, is 226 which from my research means it is a communication error, usually in the form of wiring. No matter what register I try it is always giving that response which means it is time out issue?
Troubleshooting I have done
- I have tried reversing my A and B connections on module and still no luck.
- I have tried using the hardware serial on Arduino instead of software, still same outputs
- I have tried replacing my RS485 to TTL Module, no luck
- I have made sure all my settings are correct in the controller (Modbus RTU instead of ASCII, all bits, etc)
- I can't read from any register without getting that output, which means my responsebuffer obviously won't have anything in it (hence the 0 output on response buffer).
I really do not know what else to do if someone can please help me it would mean so much and I would contribute to the community with people have similar problems.
Thank you in advance, please let me know if I can provide any more info, I have attached my serial terminal output for you to see as well. Even if my temperature controller is OFF it still gives this info so there is something going on with hardware but I really do not know what, please please help me thank you
Edit: I have attached pictures of my hardware and wiring too. I am using regular jumper wires for rs485 I’m not sure if that would cause problem. I know the temperature controller is working fine because the display shows the process variable Changing correctly. Thanks