Sign in to follow this  
Followers 0
pro17

CJ1M capable of Serial Gateway (Modbus) on CPU serial port?

22 posts in this topic

Hi, I am looking at specification in this site: Omron CJ1 specification linkl It states: So I can use built in serial port (host link port) for serial gateway communication / modbus RTU? Does this depend on CX-Programmer version I use? Someone please confirm, since I am trying to do this but am having lots of problems. Best regards, JinX Edited by pro17

Share this post


Link to post
Share on other sites
Hi JinX, In my experience, you must use an additional communication card like CJ1W-SCU31 to communicate with modbus-RTU protocol (slave protocol is built in, master protocol must be made with protocol macro software if I remember correctly) Edited by VAU_RMA

Share this post


Link to post
Share on other sites
Ahem..... Clarification: Serial Gateway (CompoWay/F master or Modbus master) This means if a Modbus slave (inverter or servo-drive, etc) or Compoway/F Slave (Temp Control, etc.) is attached to a serial port on CJ1 or CJ2 PLC, then a host can hookup to the CPU port and tunnel through the PLC and out the port directly to the slave. This allows programming software or parameter software not to be attached directly to the Modbus or Compoway/F slave. You need Protocol Macros to cause the PLC to issue Modbus or Compoway/F command to the slaves. I'm sure PMCR will want to comment also.

Share this post


Link to post
Share on other sites
Wow !?! That is a twist! I bet majority does not understand serial gateway like this. I mistakenly thought CMND function does what you clarified (just like PMCR function can). Especially because on CP series PLC you can use a program to communicate with Modbus protocol (easy modbus) on CPU serial port. Please refere us to the manual where we can read this. Does this mean I can use a software on a PC, sending FINS commands (like 2804 for Modbus) to the CPU RS232 unit, which will strip off FINS header and forward Modbus message through serial port, and then return it back? thx, JinX Edited by pro17

Share this post


Link to post
Share on other sites
The full implementation of 'Serial Gateway' involves 3 specific FINS commands. 2803 = CompoWay/F 2804 = Modbus/RTU 2805 = Mosbus ASCII Of these 3 FINS commands for Serial Gateway, only 2803 (CompoWay/F) is implemented on the built in port for CJ1, CS1, or CJ2. All 3 FINS commands are implemented in SCUxx modules, such as SCU21, 22, 31,32, 41,42. Basically a Serial Gateway FINS command is a FINS command, with another command wrapped up inside. So, for Modbus/RTU it is the Modbus/RTU command wrapped up in a FINS command. The SCU module then pulls the Modbus/RTU command out, calculates the CRC16, sends the command, waits for the response, wraps the response back up inside a FINS packet, and delivers it back to the original device.

Share this post


Link to post
Share on other sites
Hi PMCR, thx for your answer. That is exactly what I thought CMND should do. I expected it to work also with CJ1 built in port (please see specifications: link in my first post). FINS commands manual states: Edited by pro17

Share this post


Link to post
Share on other sites
You are reading the information correctly, but I think that the information is incorrect. From W342-E1-15, the description is as follows: I have also tested this morming with CJ2H. It will handle CompWay/F, but not Modbus RTU. I do not know of any intention to add Modbus RTU into CJ series built in ports.

Share this post


Link to post
Share on other sites
Thank you PMCR, my manual is W342-E1-11. I still hope/wish Omron will "enable" Modbus RTU for built-in serial ports. I got SCU unit, and everything is working as it should. Thx, JinX

Share this post


Link to post
Share on other sites
Hi everybody I'm Yuri it's my first post, I prefer not open a new topic because I think I'm not OT with my questions. I have to control 4 Inverter Yaskawa V7 (waiting for V1000) through Modbus I have a CJ1M-CPU22 with a SCU-41. It's my first time with modbus and initially (4 days working) it was like climb a wall then I found the EasyModbus from PMCR and now the wall it's smaller. Now I'm able to command them. My questions (for the moment ) are : In the "EasyModbus from PMCR" the inverters are connected in 485 way (2-wire), there are difference in comunication speed if they will be connected in 422 way (4-wire). How should I change the program for use it in 422 wiring? Someone already know what I need to change when I connect the V1000 inverters? (I think that I will recive them today or tomorrow) I already saw that the max baud rate of V7 is 9600. One more day working on this project, this evening I will got new questions. Thanks Yuri

Share this post


Link to post
Share on other sites
Yuri You will not need to change anything in the program to support RS422. The program and Protocol Macro will work for RS232, RS422, or RS485. The only thing that you will need to change in the setup of the SCU module is 'Full Duplex' instead of 'Half Duplex'. The throughput will not increase on RS422, as the Modbus communications are still a command / response format, so you will not truely be able to take advantage of the full duplex capabilities of RS422. Edited by PMCR

Share this post


Link to post
Share on other sites
PMCR First of all thank you very much for your program Easymodbus, you open me a new world. This morning I received 4 new V1000 Inverters I installed them instead the 2 V7 that i used for my trying and..... obviously NOT working. First I checked the comunication settings, adress,baud rate, parity, RTS and are all correct (tomorrow morning I will check again) Second I check the hardware connection (2-wire - 485 way) and terminal resistance (ON just on the SCU and on the last inverter), it's good. I saw that V1000 Parameter H5-06 "Drive Transmit Wait Time" is at 5 ms instead of 10ms in the corresponding parameter of the V7, changed it but no result. The problem is that on the display blink "Call" and on the SCU41 card, blink SD1. I think that if there was some problem in comunications, on the display must blink "CE" so I think that there is no comunication, It's right? In W220 I found D5000 function 03 first and than D5010 function 03, D5020 function 03, D5030 function 03. I forget to download the parameters from the two V7 that was working, I will do it tomorrow and I will use the convert function of CX-Drive, hoping to find something. Best regards Yuri

Share this post


Link to post
Share on other sites
Hi, YES YES. Now working Some hardware plus parameters problem. Now I restart with the developing of the machine's program and I noticed that if I press and release the start button of one motor (bit 0 register 0001H) more than one time, the motor starts and stops for all the times that i have pressed the button even if i do not touch more the button. What does it depend? Is it possible not "memorize" all the button pressions? I Just need that inverter goes into RUN state when the bit 0 register 0001H is at 1 and stop if the same bit is at 0 like a normal I/O terminal connection S1-S2. Best regards Yuri

Share this post


Link to post
Share on other sites
Here is how I would handle your situation: If you are using Modbus Function Code 0x05 (Force Single Coil): Start Button - When pressed, this does a MOV of #FF00 into the D6xx4 register (D6004 for the first write item, as an example). Stop Button - When pressed, this does a MOV of #0000 into the D6xx4 register (D6004 for the first write item, as an example). If you are using Modbus Function Code 0x0F (Force Multiple Coils): Start Button - When pressed, this does a SETB instruction on the specific bit in the D6xx4 register. This will Set the bit on, and leave it on. Stop Button - When pressed, this does a RSTB instruction on the specific bit in the D6xx4 register. This will Reset the bit, and leave it off.

Share this post


Link to post
Share on other sites
Hi, Like first trying I used Function Code 0x10H. Es. IN 0.00 (Start button) commands OUT 40.00 and then I fill DM 6000...6009 Flag p_On MOV #0001 D6000 MOV #0010 D6001 MOV #0001 D6002 MOV #0001 D6003 MOV 40 D6004 MOV #F000 D6009 Resgister 0001 - bit 0 = RUN Resgister 0001 - bit 1 = FWD . . . (taken from inverter the manual) In this way when I press 0.00 motor starts to move. when I release it motor stops. I will try to use yours suggestion, I think that I need to "play" with the edges of the inputs for obtain the same results, right? Another question, Is it right fill the DM5000....DM5009 Flag p_On MOV #0001 D5000 MOV #0003 D5001 MOV #002c D5002 MOV #0001 D5003 MOV D5004 100 MOV #F000 D5009 ( I do the same for 4 inverter, actually #F000 is in D5039) Resgister 002c - bit 0 = RUN (1=RUN) Resgister 002c - bit 1 = STOP (1=STOP) Resgister 002c - bit 3 = Frequency reached (1=FqRe) . . . (taken from inverter the manual) In this way, monitors the status of inverter and I can use the bits of the channel 100 in the program. but I noticed W220 0103 and then 0203...till 0403 (the last drive) continuously W221 1388 and then 1392...till 13A6 (the last drive) continuously furthermore the speed in W216 is from 87 to 105 I think is a little bit too much for 4 inverter (baud rate 19,200), for this reason I'm thinking of a programming error, no? Thanks Best regards

Share this post


Link to post
Share on other sites
OK. I did not understand that you needed Registers for Start / Stop. I am used to using Coils for this function. Normally, this is the way that I write the code. Set the D5xx0 (node number), D5xx1 (function code), D5xx2 (Starting register or coil), D5xx3 (number of registers or coils), D5xx9 (End of List) on the P_First_Cycle bit. Same for D6xx0, D6xx1, D6xx2, D6xx3, and D6xx9. You do not need to rewrite those items (the ones above) each time you write your data. Then in your ladder code, you only need to change the D6xx4 data. Every time my ladder sees a change in the data in D6xx4 (and D6xx5 if you are using 2 registers), it will write the data to the drive. So, when you want to start the drive, move a #0001 into D6004. When you want to stop the drive, move a #0000 into D6004. You can use the rising edge of the 'start' button and the rising edge of the 'stop button' to move the data. The important thing to see is that every time the data changes in D6004, my code writes that to the drive. As far as your question on reading... You are trying to move 100 into D5004. This is incorrect. The response from the inverter will come back into D5004. If you want to see that in channel 100, MOV D5004 to 100. If reading is still not working for you, look at the results of the Writes to the drive. Tell me what is in D6009 after you start or stop the drive. If D6009 = #FFFF, then you may have a wiring problem on the data going from the V1000 to the SCU card. D6009 = #FFFF means that the response back from the drive when you started or stopped was not a good response. D6009 = #0000 means that the response was a good response. If D6009 = #FFFF (meaning the responses are not good), then the reads in D5xxx will probably not be good either.

Share this post


Link to post
Share on other sites
Thank you again. I think I have understood, monday morning i will try to change my code for using the coils. I read about the use of register in inverter's manual but maybe I have not well understand. Actually I write D5004 in 100 more then a problem is a curiosity. Sorry for my writing errors, I found them rereading my posts, I hope you can understand how I appreciate your suggestions. Best regards

Share this post


Link to post
Share on other sites
I am not telling you that you need to change your code from Registers to Coils. Looking at a V1000 manual, Registers seem to be correct. If writing the register is working for you to start / stop, do not change to coils. I am used to working with Omron inverters which do start / stop through coils. 1.05 seconds for reading the data from all 4 inverters is actually not that bad for Modbus. Higher baud rate would help some.

Share this post


Link to post
Share on other sites
Yuri, Do you only have 1x push button that you want to control the inverters with? If so, then you may need to use something like a flip-flop.

Share this post


Link to post
Share on other sites
Today I have tried to use coils, but have been not immediate success so i decide to work with registers. Solved with logical solution. @lostcontrol I have two buttons, 1 for start and 1 for stop but just in automatic mode, in manual mode, the start button does an impulsion move (same button 1=RUN - 0=STOP) Thanks

Share this post


Link to post
Share on other sites
Hi It's me again I'm trying a new "toy", CJ2M CPU31 but I have a problem with the modbus comunication with the inverters. 1) I just changed the CPU and removed an ETN21 card that I used for ethernet comunication 2) Do again table I/O on the new CPU 3) Check the protocols inside the SCU (all OK) 4) Set the SCU parameters like in the manual. 5) On the inverter display blink "call" 6) If i put back the CJ1M CPU, everything is fine. Do you have some suggestion? I still not check the CJ2M's manual, I will do immediatly after send this question. Best regards Yuri

Share this post


Link to post
Share on other sites
Yuri Check to see that you have made the SCU settings ('User Settings', 'Protocol Macro', baud, parity, etc), and that you have downloaded these to the PLC. These settings live in the DM area (D30,000 and above) not in the SCU itself, so they would move with the SCU to the CJ2. No program changes are necessary to move to a CJ2M or CJ2H PLC.

Share this post


Link to post
Share on other sites
Solved. just not well checked SCU parameters was remain "dafult" instead of "user setting" on port setting. Now It's everything like with CJ1M Thanks OT PMCR Can you help me with Modbus TCP on CJ2M? Yesterday I opened a new topic.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0