Sign in to follow this  
Followers 0
python01

CC-Link clarification needed

12 posts in this topic

I have never used Mitsubishi CC-Link so it seems a bit confusing. As far as I understand you use TO/FROM instructions to communicate and the memory used for data exchange is on Master so if master puts out some bit value to location H167 the remote station would read that value using FROM instruction from location H167 is that correct? And I guess the same goes for the other way around. Looking through existing program I see the following in the (D) field of FROM or TO instruction: K4M532, what does the K4 mean? I have also seen K2, K1 and then M..., I guess the M is the bit where you want the data to be read from or stored to but don't know what the rest is there for. So lets say we want to communicate M268 from the Master rack position H14 to Remote station rack position H10 and store it in M502, The instruction for master would be: TO H14 H167 K4M268 K1 The instruction for remote would be: FROM H10 H167 K4M502 K1 Am I getting it right? Thanks.

Share this post


Link to post
Share on other sites
What type of PLC are you using Q, FX or A I have only used CC Link with Q series Between the 2 CPUs you should have 32 M registers and 4 D registers that are automaticly updated at a CC-link scan rate I would assume this is the same for FX as well as you can put both on the same network (I think). Each module is assigned 32bit min so you take the devices you assigned as RX and RY and the assigned module number. Device number = RX + (module number - 1)* 32 This depends on your settings as well, CPU's should be configured as intellegent module stations with 4 points eg Master RX = X100 RY = Y100 RWr = D100 RWw = D104 Remote module RX = X200 RY = Y200 RWr = d200 RWw = D204 module number = 1 So if you toggel y100 from master X200 will match it in the remote device A value in master D104 will be reflected in remote device D200 if module is # 2 add 32 to X and Y. Not sure about the D registers so on and so forth For Manual tranfer of data see below For Q series the comands are RIRD RIWT to read and write and can be found in the manual for QJ61BT11N For FX you are correct From and To are used and can be found in the manual for FX2n 16CCL M

Share this post


Link to post
Share on other sites
I am using the FX series PLC, I have no idea about anything other than that. Hello, I'm sure someone here can explain this better than I can, but I will take a whack at it.... Yes, you use the to/from commands to read/write to the CC-Link master station. I don't quite know how to describe what the k4, k2 etc. means, but I can tell you with bit devices it makes it read from/write to consecutive devices, for example, FROM K0 H0A K4M0 K1 broken down would translate to: From K0: The rack location of the master module, H0A: Buffer Memory H0A (or simply buffer memory HA) is the buffer memory number of the CC-Link module status. That buffer memory location has 16 bits associated with it, bit 0 through bit 15 each signifing a module error or something of the sort. (See CC-Link master manual section 4.6.3), K4M0 K1 means those 16 bits in buffer memory HA are now transmitted to the PLC as bits M0-M15 in one word. As far as your to and from example above, you only read and write to the master module, so the first thing that follows your to and from command will be the same, I like to use a constant, instead of a hex number but that is just my personal preferance. So if I wanted to write to the same buffer memory that I read from in my example above the command would be TO K0 H0A K4M20 K1. When you write to that particular buffer memory (H0A) there is a different set of 16 bits that are being written to, (also in section 4.6.3) So those 16 bits would be represented in the PLC as M20-M35. Also, In the FX3U programming manual section 5.4 goes over the whole k2, k4 thing in detail. I hope some of this helps, I could send you a sample program if you would like. Regards, plcdp Edited by plcdp

Share this post


Link to post
Share on other sites
First of all your 'K4M532' question. Most PLCs can store data as single bits or as 16-bit registers, but there is sometimes a need to move groups of bits where the group size required is less than 16. Rather than allow you to move any size of group, the early Mitsubishi PLCs provided a way to move groups of 4, 8, 12, 16, 20, 24, 28, or 32 bits. To move 1 group of 4 bits, say [M100 to M103] to [M200 to M203] use the command MOV K1M100 K1M200, K1 means one group of 4 bits. So, K4M532 means move 4 groups of 4 bits (i.e. 16 bits) starting at M532 ( up to M547). This structure is a legacy from the days before arrays etc... As well as data registers in the PLC CPU, each special function card has its own set of registers called Buffer Memory Registers (BFMs). The TO/FROM commands transfer data from the PLC CPU to and from the BFMs. You need to know the header address of the card, which is not simply the slot address. If you have a 32 way input in slot 0 (X00 to X1F) and a 32 way output in slot 1 (Y20 to Y3F), then a CC-Link in slot 2 will have the header address H4, because the next I/O number would have been X40 or Y40. In your case you've identified the card as being at header address H14. For CC-Link each station writes relay devices to an output buffer at 160hex ( to 1DFhex). For CC-Link each station reads relay devices from an input buffer at E0hex ( to 15Fhex). The master's output buffer data becomes the slaves input buffer data, and vice-versa. Your command "TO H14 H167 K4M268 K1" writes 16 bits (M268 to M283) to BFM 167hex in the card. Your command at the other end would be "FROM H10 HE7 K4M502 K1" Turning on M268 in the master turns on M502 in the slave. The same is true for the following 16 bits, so M275 turns on M509, and M283 turns on M517.... P.S. CC-Link is a typical master/slave network. If the slave sends data back via its local BFM 167hex it is read by the Master from its local BFM E7hex. Any other slave monitoring the dat exchange can read the data sent from the master to the above slave by reading its own copy of E7hex and can see the data sent back from the slave to the master by reading its own copy of 167hex.

Share this post


Link to post
Share on other sites
Guys, Thanks for great info. Smahon, So if I want to transfer only 1 bit, then I don't need the Kx at all in front of M268, just M268 alone? And one more thing just to clarify, if I changed the K1 at the end of TO command in my example to K2 this would mean that 32 bits will get transfered (M268 to M299) and in fact will do the same as specifying K8M268 K1?

Share this post


Link to post
Share on other sites
Sorry to Hi-jack your post Python but i'm in the same sort of position as you are. I've been given a job to modifiy a system which has 8 FX CPUs, 2 FX2Ns and the rest FX1Ns. these are all linked using i believe CC-Link. What is confusing me is that the M and D registers dont marry up between the PLCS, so what i would expect to see is say M0 on each PLC being one bit for the whole project not just one PLC. The site have also added in new Valves which i'm meant to be adding to the software, these are all on different different PLCs, so how do i add these extra outputs to the CC-link system? If someone could just run through the information i have here and point me in the right direction of understanding! the Comms section gives me some code stating the following, From K0 H0E0 K4M1000 K2 To K0 H160 K4M100 K2 From K0 H2E0 D1000 K4 To K0 H1E0 D100 K4 Because all of these programs have been uploaded by the Customer i have very little annotation on them, which would have made things a hell of alot easier than it is!

Share this post


Link to post
Share on other sites
Though troublesome, but is possible try to understand the uploaded programs, and then add new algorithms.

Share this post


Link to post
Share on other sites
NovaluationGSi What units are you using? FX2N-16CCL-M master? FX2-32CLL slaves? The posted code is from the master? What are the dials set to on each unit? (Station no. and no. of occupied stations.)

Share this post


Link to post
Share on other sites
ummm, i think i'll be fighting a loosing battle, all i have been given for this job is the PLC programmes and 3 HMI programs. You are right, the info i have posted is the Master as that i believe to be the Main control panel. If i go to one of the other programmes i find code like this, From K0 K25 K4M0 K1 Next Rung From K0 K0 K4M100 K2 From K0 K8 D100 K4 To K0 K0 K4M50 K2 To K0 K8 D50 K4 As for knowing what units are installed etc i have no idea, but i can get hold of that information from the Customer as i will need to know it due to driving outputs on different PLCS with conditions from the Master PLC. I know this wasnt going to be an easy job, but never thought it would be as complicated as this!

Share this post


Link to post
Share on other sites
NovalutionGSi, do not dramatize the situation, it is difficult, but it may be solved. Sometime often we restored the electrical schematics by analyzing PCB. Restore the algoritm from program code is easier...

Share this post


Link to post
Share on other sites
So you've just got to add some bits and/or words to be sent from station x to station y? "From K0 K25 K4M0 K1" Ignore this for now, it reads the comms status. Next Rung From K0 K0 K4M100 K2 this reads remote outputs (from the master) into local addresses M100 to M131 (32 bits) K0 - 1st expansion module, K0=1st address of that module, K4M100 destination address, K2 = 2words in length. The good news is that this means the no. of stations for this unit need only be 1.(dial set to zero). From K0 K8 D100 K4 This reads 4 words from the remote master to D100 to D103. To K0 K0 K4M50 K2 This reads bits M50 to er... M81 to the remote master. To K0 K8 D50 K4 This reads D50 to D53 out to the remote master. This hardest part of this will be finding out how many bits and or words are already being sent. If you need to send five words rather than four then you need to adjust the dials and master configuration. If you have unused words in the existing configuration then there's very little to do. Edited by Veganic

Share this post


Link to post
Share on other sites
That makes alot more sense to me now. the Customer has spread the new outputs over 3 different PLC locations due to the position of the Valve or spare outputs. The M100 to M130 makes sense to what i've seen else where in that programme. hopefully this pointer has got me on the right track. Cheers Veganic

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