Hi. I have a Unitronics JZ20-R16 (Jazz2) controller I’ve programmed to run a simple air ventilation system in my house (The thing is running great btw.). I also have a self made Arduino based data logger (I use it to monitor and log my energy consumption, temperature, etc.) I’m not building those things or mass producing, Arduino electronics is my hobby - I just use it to stay sharp.
So I decided to cross-integrate my air vent. Controller with my data logging unit (I want to see the status of my air vent. Controller unit on Arduino). So for starters the task is to simply send a 16bit int to Arduino and receive another 16bit int from the Arduino.
The communication protocol of the choice was MODBUS through RS232 interface (as I already have MJ20-PRG; MJ20-CB200 and a MJ10-22-CS10). I’ve decided to use JZ20-R16 as a Master (Arduino as a Slave) in a 9600 baud 8N1 configuration (default for JZ20-R16). For Arduino’s RS232 interface I’ve used TTL-RS232 converter (MAX3232 based) :
Experiment 1:
In order to see if the Arduino’s MODBUS feature is working I’ve connected Arduino to my PC using the given connector and a RS232-USB converter. Arduino was configured as a slave and ModbusPoll software (Modbus Master Simulator) simulated a master. I was able to both read a holding register from Arduino (03) and also write a register (06). Those are the desired options. The program is attached.
Experiment 2:
In order to see how MODBUS is working on JZ20-R16 I’ve hooked it up to my PC using my MJ20-PRG; MJ20-CB200 and a MJ10-22-CS10 later connected to RS232-USB converter. I’ve uploaded a program (by pressing buttons 1 and 4 I send an int or correspondingly request an int from slave):
It make the JZ20-R16 work as a Modbus master on a RS232 interface. In order to simulate a slave I’ve used ModbusSlave software (Modbus Slave Simulator) . Once again, the combination worked perfectly. Once again all the required commands worked.
Here’s the photo of my hookup:
Then I’ve noticed a possible cause for future problems : lines 4 and 7 of my MJ10-22-CS10 are actually used in this communication. It turned out that the RS232 communication with JZ20-R16 require 6 wire communication instead of 3 wire communication I’ve expected from RS232 interface. Due to the requirement of RTS and DTR signals!
I’ve turned on my scope and actually saw those signals on pins 4 and 7 of MJ10-22-CS10 connector going high after the “handshaking” with my slave simulator was done.
With PC USB disconnected:
PC USB Connected:
MudbusSlave enabled “handshaking”:
Successful communication:
CH3/4 are the DTR and DTS signals correspondingly. At this point I’ve realizes that sue to those signals I would not be able to connect my Unitronics to my Arduino, as the TTL-RS232 connector simply do not support DTR and DTS signals. So after hooking up my Arduino to Unitronics I see the following on the scope:
Both DTR and DTS signals are on 0 instead of HIGH, which prevents the JZ20-R16 from accessing the modbus.
The questions:
- Is there any chance to make JZ20-R16 communicate over RS232 without use of DTR/DTS signals?
- Is there an option to tweak those signals (connecting them to +5V permanently)
- Use of other TTL-RS232 converter?
- Any other way to make Arduino and JZ20-R16 communicate over RS232 interface using MODBUS
Thank you for the patience.
