SvjatoslavsKrasnikovs Posted July 18, 2017 Report Share Posted July 18, 2017 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 (http://www.modbustools.com/modbus_poll.html) 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. 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): (see in uploaded files) 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 (http://www.modbustools.com/modbus_slave.html) . 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 after “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. samplemodbusmaster232.U90 Link to comment Share on other sites More sharing options...
AlexUT Posted July 18, 2017 Report Share Posted July 18, 2017 Hi, MJ20-PRG module require external power on pins 1 & 6, and it use MJ20-CB200 and MJ10-22-CS10 for this. And it cannot use DTR and DSR signals. Use MJ20-RS module instead of MJ20-PRG. It require 4 wires cable from RS232-CB1 set. *This cable is crimped as "cross". 2-3-4-5 pins of one connector crimped to 5-4-3-2 pins of other connector. Everything should work. Link to comment Share on other sites More sharing options...
SvjatoslavsKrasnikovs Posted July 19, 2017 Author Report Share Posted July 19, 2017 Thank You for the reply. Well, I do not have an access to MJ20-RS module at the moment. All I have is MJ20-PRG, MJ20-CB200 and MJ10-22-CS10. If I'll power up pins 1 and 6 of a MJ20-PRG through MJ10-22-CS10 (just like in a picture attached) will I be able to use my MJ20-PRG as a RS232 module ? Or do I need to change the schematic in any way (attach series resistor to +5V line, etc.) ? Thank You Link to comment Share on other sites More sharing options...
SvjatoslavsKrasnikovs Posted July 25, 2017 Author Report Share Posted July 25, 2017 Any change to get a response ? Link to comment Share on other sites More sharing options...
AlexUT Posted July 26, 2017 Report Share Posted July 26, 2017 Hi Svjatoslavs, Please use next documents for PRG adapter: https://unitronicsplc.com/wp-content/uploads/2016/06/MJ20-PRG_TECH-SPEC_10-09.pdf https://unitronicsplc.com/wp-content/uploads/2016/06/JZ-PRG_INSTL-GUIDE_10-09.pdf Last one include CS10 adapter wiring. I will recommend to connect contacts 1 and 6 of a MJ20-PRG to contacts 6 and 1 ofh MJ10-22-CS10, connected to RS232 port of PC. Or connect contacts 1 and 6 of MJ20-PRG to +24 V by resistor (24-5.5)/0.1~=185 ohm. You have to use GND with Tx and Rx signals. Tell us how it works. Link to comment Share on other sites More sharing options...
SvjatoslavsKrasnikovs Posted July 27, 2017 Author Report Share Posted July 27, 2017 Thank You so much for trying to help me. I've sketched a rough connection schematic, according to what You've suggested. Is it right ? On the JZ20-PRG to JZ10-22-CS10 side, the connection is standard (through MJ20-CB200 cable). However, after the DB9 of MJ10-22-CS10 I'm braking the connector (DB9) into individual cables (on a breadboard). The +24V will be used from the PSU (I'll use bench PSU , with GND connected). Link to comment Share on other sites More sharing options...
AlexUT Posted July 27, 2017 Report Share Posted July 27, 2017 Hi Svjatoslavs, Schematics seems to be right. What your test show? Is communication working? By the way, what Arduino MODBUS stack do you use? Link to comment Share on other sites More sharing options...
SvjatoslavsKrasnikovs Posted July 27, 2017 Author Report Share Posted July 27, 2017 Heh, seemed that my potentiometer is simply not powerful enough (burned it). I'll find a "larger" resistor, then retry. I'll post full experiment report when I'm done. Link to comment Share on other sites More sharing options...
AlexUT Posted July 27, 2017 Report Share Posted July 27, 2017 Hi Svjatoslavs, Resistor of 180 ohm with current 0.1 A dissipate 18.5 V* 0.1 A=1.85 W. You should use 2W resistor. So variable resistor should be powerful... B.R. Link to comment Share on other sites More sharing options...
SvjatoslavsKrasnikovs Posted July 31, 2017 Author Report Share Posted July 31, 2017 Hi. Finally found a 2W 180 ohm resistor. Connected everything according to the schematic above, and well, nothing happens. The 2W resistor is also overheating over the time. Link to comment Share on other sites More sharing options...
AlexUT Posted July 31, 2017 Report Share Posted July 31, 2017 I used 3x560 ohm resistors in parallel. This equivalent to ~187 ohm. Resistors connected between +24 V and contacts 1 & 6 of PRG adapter. *Wires 1 & 6 cut in the middle of cable. Wires 2 and 5 connected to 0V of PLC. *I used 6 wires phone cable (cross-crimped) and open it in the middle. Opposite to PLC cable end connected to MJ10-22-CS25 adapter, then to USB-to-Serial converter. Following is Get result from PLC Additional to this, I tested 560+560=1120 ohm resistor. Online (Debug) mode works. Please use 1.1 kohm 2W resistor and test communication. I hope it will work. *MJ10-22-CS25 adapter include inside 2 diodes, Zenner diode and electrolytic capacitor. Please post your results for feature readers. Link to comment Share on other sites More sharing options...
SvjatoslavsKrasnikovs Posted July 31, 2017 Author Report Share Posted July 31, 2017 I'll try to reproduce the experiment ASAP. I do not have the MJ10-22-CS25 though. I have a MJ10-22-CS10 can I use it in the same way ? Thank You. Link to comment Share on other sites More sharing options...
AlexUT Posted July 31, 2017 Report Share Posted July 31, 2017 MJ10-22-CS10 designed to provide power to PRJ adapter from PC COM port. More important is to use proper connection of Rx and Tx wires. *Used by Unitronics phone cables are crimped as cross. Following document include CS10 adapter pinout: http://media.klinkmann.fi/catalogue/en/Unitronics/Unitronics_Manuals_Jazz_Port_Install_en_0511.pdf Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now