Sign in to follow this  
Followers 0
Guest ishu-san

Omron CJ1G and CQM1H

17 posts in this topic

Greetings! just found this great site and this smart forum.... I am working on my thesis. My task is to connect 2 CQM and 1 CJ PLCs and to connect the CJ to a LAN with the Ethernet module. Currently I am trying to connect the CJ with a CQM thru the RS422/485 port of the Serial Comm Unit. Is it possible? Do I need CX-protocol to solve this problem or is it possible to configure everything usig CX-Programer i am a beginner so excuse my stupid questions thanx

Share this post


Link to post
Share on other sites
Firslty, not a stupid question. Actually quite a difficult scenario for new players..... Solution 1.... Get controller link modules for all PLC's invovled....draw back is hardware cost...advantage simple and seamless and flexible and super fast data link setup between PLC's. Modules required 2 X CQM1H-CLK21 & 1 X CJ1WCLK21.... Opps Forgot to mention that the CQM1 CPU's will need to be the CQM1H-CPU51 / 61 MODELS for this solution to work. Solution 2.... Buy a serial communications card for the CJ1 PLC, namely a CJ1W-SCU21/41 and CX-Protocol. The in built comm's ports on the CPU do not support this Protocol Macro software. The SCU21 has 2 x RS232 where the SCU41 has 1 x RS232 and 1 x RS485/422. In this scenario, i would suggest to use a multidrop network such as RS422/485. The two CQM1's will need to be assigned a node number (0 to 31), may i suggest 1 and 2. Assignment is done thru the PLC setup. U will also need converters to convert the RS232 port on the PLC to the RS422/RS485 standard. I use ADAM 4520 units. I will post a Hostlink Protocol Macro if i can find one and u need it. Modules Required: 1 x CJ1W-SCU21 or CJ1W-SCU41, 2 or 3 RS232 to RS422 convertors (ADAM 4520), Protocol Macro Software.... Solution 3..... Look at this link...Jay has been knid enough to upload a sample PLC Ladder Logic Hostlink Protcol program... . U will still need convertors as stated in solution 2. Hostlink communications Modules Required: 2 or 3 RS232 to RS485 convertors (ADAM4520), a little bit of know how... Hope that helps for now.....

Share this post


Link to post
Share on other sites
Thanks for the help Sleepy Wombat! You were really quick with the answer. Since I have really limited financial situation I can not afford to buy new hardware. I will have to try to solve the problem with the existing stuff. I can see now, that I cannot connect the 3 PLCs to one network. I will try to connect the PLCs separatelly. Now I am trying to connect the CQM and the CJ thru the RS485 port. Both have serial communication cards. CQM1H has an SCB41 comm board, CJ1G has an SCU41 comm unit. I figured it out from the manuals, that the only way to do this is to use Protocol Macros and the PMCR instruction. For days I have been trying to get this thing work. :*-( Pleeeease help! I only want to achive to send one bit, thats all. At the moment I don't care about the speed or anything else. I don't really get the picture how to use the PMCR instruction between 2 PLCs. Can Someone help me with this? Is it even possible to connect these 2 PLCs using PMCR and RS485 or I am on a wrong track?

Share this post


Link to post
Share on other sites
You are trying to make something hard out of something easy. Use the program that Sleepy pointed you to above. You will have to use the CQM1 CPU RS232 port as the program is written but it could be modifed for the SCB41. BTW, you will never get Hostlink protocol to run on RS485. Only RS232 or RS422 4 wire.

Share this post


Link to post
Share on other sites
Well, the thing is that I have to use the RS422/485 port, because there is a touch panel that has to be connected to the CQM and it can be connected only thru the CPU RS232 port (as far as I know). Here, I think it would be easier if i draw it: Maybe there is other solutuons, too. It would be much easier if the touch pannel was not there, and maybe I'll get rid of it. But for now, I would like to get this scheme working. What do you think? Is is possible? Or maybe you have a better solution...

Share this post


Link to post
Share on other sites
As long as you keep the connection to RS422 4 wire (2/4 switch to the 4 position), we can make communication happen with this setup. What is PMCR 605? Has Sleepy sent you a macro? Do you have CX protocol?

Share this post


Link to post
Share on other sites
I don't have it, and I thought I can bypass it. Do I need it? Can not do without it? Oh man I am full of questions...

Share this post


Link to post
Share on other sites
I forgot to log in again. Sorry!

Share this post


Link to post
Share on other sites
OK! You forced me to read the CQM1H SCB manual. PMCR 605 is part of the Compoway/F Macro found on both CQM1H and CS/CJ PLCs. Compoway/F is used to communicate with temp controllers,process controllers and digital panel meters. Unfortunately, CJ1 uses either C or CS mode FINS commands as it's protocol. Unless you have CX Protocol software Version 1.2 or better, you are not going to be able to create a custom macro to do the above. Now, let's think about Sleepy's original suggestion which was using TXD and RXD commands to communicate from the CQM1H-SCB41 RS422 port to the CJ1 CPU serial port. Again, the attached file above can be modified for use on the SCB41 RS422 port by changing the second operand of all TXD and RXD instructions from #0 to #0200 for second port on the SCB41. Since your funds are limited, you need to investigate this possibility. It's essentially free.

Share this post


Link to post
Share on other sites
Firstly, yes you are correct in saying that 605 is a general broadcast, however this is for a compoway f protocol (used with omron process controllers, laser sensors) and will not work with the CQM1 PLC. If you look at the make up of the protocol you will notice that the start code is STX for the PLC's they will use Hostlink(Sysmacway) protocol. By default the Hoslink protocol will work on 9600bps, 7 data, even parity, 2 stop bits and 1 start bit. Hoslink protocol does not make up the standard set that comes preloaded in the serial card, therefore you would require a copy of cx-protocol, i can get you a Hostlink protocol for use with this software. Alternatively, try to write the ladder logic as per the example in my first posting. Note for this to work the CQM1Hcpu51 in the middle will need to be the master in this case (as per your diagram) as the CJ1M serial card port can not be put into a dumb RS232 port mode. The Cqm1h card on the other hand can be. See attached pic...This will allow you to use the TXD and RXD instructions in the CQM1H plc.. For example...lets say you want to read 10 values from DM0000 to DM0009 and the slave PLC addres is unit 00 The syntax of the command would be ...(note this is in ASCII) @ - header 00 - PLC node address RD - DM read 0000 - Start address for DM 0009 - number of words to read XX - FCS 2 digit Frame Check Sum *CR - Terminator @00RD00000010XX*CR where XX is the calculated FCS (frame checksum) and CR is carriage return (ASCII character (13)). The reponse would be @00RD00(4digvalDM0)(4digvalDM1)....(4digcalDM9)FCS*CR The 00 after RD is the End Code 00 means successful.

Share this post


Link to post
Share on other sites
Dear good peolpe! I have modified Sleepy's program. It took me 2 days just to figure out what is what. Now it sends data thru the rs485 port of the CQM SCB. At the other end the CJ can detect the data because the indicator is flashing. But actually I could not figure it out how to make them actually communicate, how to send thru that one bit. I know... I have no more ideas and I am tired but will keep trying tomorrow. So, basicly the slave does not have to contain any program? You just set it to Host Link mode, write some data to the memory, and thats all?

Share this post


Link to post
Share on other sites
May I suggest to look at the following commands..... KS - Forced Set KR - Forced Reset. Command to send from CQM1H to CJ1 PLC and assumming that the layout of the CJ1 PLC is Power Supply. CPU, 16ptInput , 16ptout.. then the first output address would be 1.00 this is the one we are going to force....BTW CJ1 addr is unit 00 therefore...the command will look like... @00KSCIO(SP)000100XX*CR where SP is the space character ie ASCII code 20 XX is the calculated FCS CR is carriage return ACSII code 13 The CJ1 will respond with @00KSYYXX*CR where YY is end code (hopefully 00...success!) If you are still having problems post what you have done so far and we will have a look at it for you.........

Share this post


Link to post
Share on other sites
Please find attached a FCS calculator (so you can check the FCS function in the PLC).....For example in your case as above the FCS would be 3C.... I have added this program to the download section... omron download section FCScalc.exe Edited by Sleepy Wombat

Share this post


Link to post
Share on other sites
SUCCESS! Finally it was all about setting the comm board settings right. Now I can turn on and off the light at the CJ side. Not very impressive, but it's a big result for me. A big "THANK YOU" must go to JAY ANTHONY and especially SLEEPY. Thanx for your help. But I am not finished yet. I don't understand, where does the respond arrive? Where can I find the respond for the Host Link command? I was thinking how to make the communication work the both way. As I see it there are two solutions: I can not set the CJ SCU to work in RS232/RS422, so TXD is not an option. I could switch the CQM SCB to Host Link mode with STUP and then try to send FINS commands useing CMND, but they seem to be verrry complicated. Or I could use the polling method, with constantly watching a memory location on the CJ. But for this I need to figure out the responses. It would be more elegant to send data only when it is necessary but maybe I should stick to the KISS principle, right? Any suggestions?

Share this post


Link to post
Share on other sites
Yes it would be more elegant, but more complicated..an example is Devicenet, while predominatly a Master Slave arrangement some slaves can do COS (change of state) this less common and all of the communications handling has been preprogrammed... Yes stick to the KISS principle.... Once again well done....i bet it was pretty satisfying to turn on/off that bit.. BTW There 10 types of people in this world who understand binary....Welcome to the club...

Share this post


Link to post
Share on other sites
Thanks Sleepy Wombat, for doing an excellent support job on this thorny issue. Good job! BTW... Your last post was the 1000th post in the Omron forum at MrPLC.com. The first post came from Guest Jerry Desaulniers who inquired about clearing memory in the PLC before downloading on February 12, 2002. We have 316 separate threads about issues that either confuse, challenge or gratify Omron users. I would imagine it will only take about half as long to acheive the next 1000 posts. I would like to take this opportunity to thank every member who has contributed both questions and answers over the last two years. You, the members have created an exemplary archive of examples and solutions in applications using Omron PLCs. Let's keep programming!

Share this post


Link to post
Share on other sites
Does this mean i get some sort of prize ???? Thanks for all your help Jay. This site is a fantastic resource for all....

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