Sign in to follow this  
Followers 0
Colin Carpenter

Converting a programme ....

8 posts in this topic

I've been given a job to convert a programme from an Allen Bradley SLC500 to an existing Mitsubishi Q02 PLC. I have the programme from the AB PLC and can view all sections, addresses, comments etc. The Mitsubishi programme will be written in IEC Developer V7.40 in "graphic ladder" mode. Although the Allen Bradley IO count is not huge, ( 8 analogue ins, 4 analogue outs, 24 digital ins, 16 digital outs), the programme is pretty long and complicated and it's controlling a set of equipment that I know very little about, so I have two methods that I can employ .... either go through the code and work out how the thing works, then write new Mitsubishi code accordingly, or, just copy all the code from the SLC500, work out how to re-programme some of the AB commands that I'm not sure of, and hope that I work out how the hardware works as I'm going through it. I get the impression that the first method would take a long time to understand, and my resultant code would probably be strewn with bugs as there are bound to be things that I don't really understand about the hardware, so I'm tempted to go for the "mind numbingly boring" second option, which just copies the code. So, if I did go for this method, I now have the problem of making sure that I get all the internal bits and words correctly translated to their correct Mitsubishi addresses. I've thought of various ways of attacking this, but to date haven't really come up with a perfect method. Human errors in translating the addresses will be the biggest problem for me as concentration wanes. The SLC500 uses "word and bit" addressing for it's internal elements, for example B3:10/7 means (File 3) (Word 10) (Bit 7), but Mitsubishi internal bits are just defined as Mxxxxx where xxxxx is a decimal number. The SLC500 is adress based, so the address has to be typed in and the description and symbol names will come in accordingly. The IEC software is "name based" with the address lookup table being defined in the global variables. I have considered using the "word and bit" addressing system to write the code ( say I map B3:10 to D2000, then B3:10/7 can be writted as D2000.7 in IEC), which I'm tempted to do for accuracy, but then I end up with a programme written with addresses not names, which will make fault finding a little difficult, and I don't know a way in IEC of converting the addresses to names without lots of cutting and pasting. I'm rambling a bit here, but you can see the things I've considered, and I just wondered if anyone else has had to do this and what method they employed? Thanks, Colin

Share this post


Link to post
Share on other sites
Colin, I haven't used the Mitsubishi Q02 PLC but, I have converted alot of other plc programs. If the Mitsubishi Q02 PLC can import tag data base from excel I would convert the logic using the "word and bit" addressing system , then translate a tag data base in excel then import it into this project. Ernie,

Share this post


Link to post
Share on other sites
Hi Colin, Happy New Year (Scot in Oz) and well done in the Ashes. I have converted a Micrologix 1500 (rewrite not copy) with a larger I/O and Analogue count than you mention to a FX3U however I understood the machine (Shuttle Rotomould Oven with Recipes) and convinced the client that this was the best long term solution he accepted. Now on face value this seems the longer solution but in my experience during commissioning this saves a lot of time. I have also taken the track (requested by the client) to copy code for a Toshiba T1 to a Toshiba S2T (different I/O allocation and functions) In my opinion the project took much longer to commission due to all the issues you raised ie. Typo, wrong address and function issues. You appear to have considered all aspects, my thoughts are! 1. Do you have a reasonable time frame for the conversion 2. Who will support the code after conversion (Very Important) Best of Luck Ray Edited by Cetronic

Share this post


Link to post
Share on other sites
Hi Colin, I have done tons of work with both SLC and Mitsubishi. I suggest checking out some of old posts like "learning mitsubishi" , "transition from AB to Mitsubishi" etc. for example check http://forums.mrplc.com/index.php?showtopic=1104 M bits are normally used only for temporary storage (they get cleared when PLC power is restarted). If you want to compare N7 or B3 files to something in Mitsubishi, the closest relative is D file. You can address it bitwise too. MOV K50 D100 (use entire register) but you can also use D100.0 to D100.F on contacts and colis of your ladder. the only problem with that is that you cannot comment them individually. You can also access M bits as register to berform bitwise operation, copy or evaluatesomething. For example MOV K4X0 D100 copies 16 bits from X0 to D100 (K4 means 4 nibbles or 16bits, K4X0 means 16bits starting with X0, that is X0...XF) If it was me I would definitely work on understanding process. Imho, blindly translating someone elses code (specially if long and convoluted) is possible but something i would attempt only as a last resort (but that is me...). retentive version of M are L bits (latched / retentive). in small PLCs M and L are in same file (one part if retentive the other is not, ranges are listed in datasheets for particular PLC). i don't have much time but if you send me the code, i will look into it and try to get you going. good luck

Share this post


Link to post
Share on other sites
Thanks for all the replies and it's good to know that I've not missed anything and that there is no real foolproof method of doing this. I exported the database from the AB software into Excel, then spent a morning going through and allocating Mitsubishi addresses in the form Dxxxx.x to keep faithful to the word and bit address format of the original, then imported the database back into the software to have a look and it possibly looks larger, scarier and more complicated than it did before. I'm coming to the conclusion that this is one piece of software that's better left on an AB PLC ... especially when I noticed that there are DH+ comms involved to other PLCs, so I think I might be stepping backwards from this one, after strongly suggesting to the customer that he stays with the AB. I'm sure it could be done with a lot of time and effort, but I could also end up in a right old mess .....

Share this post


Link to post
Share on other sites
Actually Panic, in GX Works2, you can now comment bits in a word in the Q processors. I don't recall all the limits, but it can now be done. Welcome back!

Share this post


Link to post
Share on other sites
Thought I'd try that in IEC Developer V7.04 and sure enough, you can actually give a name to a single bit of a D word. Well spotted.

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