Sign in to follow this  
Followers 0
wlederer

How to copy a program in GW2 from one project to another?

18 posts in this topic

I am trying to combine different programming examples downloaded from Mitsubishi into one project in GX Works2. At first, it was Modbus TCP Client for FX3U. It worked correct with the unit FX3U-ENET and with Modbus Slave program running on an external laptop. Another example was FX3MBModbusRTUMaster_V100 wich supposes to work with FX3U-485ADP-MB and with an external sensor. When I opened this example separately, there was no problem with compilation, actually, the project was ready to download. After that, I copied the program FX3MBModbusRTUMaster_PRG and pasted it to the TCP project. I could not find any *.sul files in the ModbusRTU project. So, I right clicked the FX3MBModbusRTUMaster_V100 library, chose "Save As" and saved it with the same name in the TCP project. Then opened the TCP project and installed this library, added the new program to the existing task and clicked "Rebuild All". There was an error: FX3MBModbusRTUMaster_PRG "Wrong device or label. Not declared(Ladded block No.9)". The error message was pointing to the function block: +ModbusComm FX3MBModbusRTUMasterCh1. What did I wrong? regards, Waldemar

Share this post


Link to post
Share on other sites
If there was not an SUL file, you don't have a library. In that case, the function blocks must be in the actual project. Open the project which came in the archive you downloaded, and check the FB/FUN pool for your command. Copy it and paste it into your new project.

Share this post


Link to post
Share on other sites
Agree with Crossbow. Did you get alle the FBs? Note that some of the FBs in the library are for internal use in the "Main FB". If you're missing one of the internal FBs you will get an error.

Share this post


Link to post
Share on other sites
Thank You for the answers. What is confusing, if the programming example for FX3U Modbus RTU Master for GX IEC unzipped, the library file FX3MBModbusRTUMaster_V200.sul is present. If the similar example for GX Works2 unzipped, in the folder the library file is missing, but in the project the library is installed. OK, this time I tried to do other way round, at first, opened the example for Modbus RTU meaning to add the TCP option later. The RTU project was OK, no errors after compilation, but the function block used was: FX3MBModbusRTUMasterCh1. The Ch1 in my setup is used for USB Board, so I deleted this block and selected the FX3MBModbusRTUMasterCh2, named it as ModbusCommCh2 and connected labels. After “Rebuild All” an error came up: “A function block instance has not been declared. (Ladder block No. 9)” Pointing to the rung where the function block was replaced. The error code C2015. What is wrong? Regards, Waldemar

Share this post


Link to post
Share on other sites
You've simply forgot to declare the FB in the header of your main program POU. If you change the instance name (the name on top of the FB) to another name I would guess that you will be directed to declaration of the FB with your desired name. Declare it wherever you want it and you're good to go...

Share this post


Link to post
Share on other sites
You are right, thank You very much. Now there is no error by compilation, but another problem. After downloading the program the PLC's LED "Error" is flashing. The Diagnostics shows Moderate, Syntax Error No 6506, Error Step 544. How to use the information, to fix the problem? How to find step 544? Regards, Waldemar

Share this post


Link to post
Share on other sites
I guess, what the problem is. Though, the programming example is labeled as GX_Works2, the old functions like MOV_M. SET_M ... are not replaced with MOV, SET.... But, why compilation did not show errors? Going to replace them myself. Will see what happens. Regards, Waldemar

Share this post


Link to post
Share on other sites
Way to go! Seems like someone at Mitsubishi forgot to actually update the library instead of just changing the name....!??!?

Share this post


Link to post
Share on other sites
Replaced functions, but after download the "Error" LED was still flashing. Tried another program GX IEC Developer V7.04. Downloaded the programming example FX3MBModbusRTUMaster_V200, replaced the function block FX3MBModbusRTUMasterCh1 with FX3MBModbusRTUMasterCh2. After compilation there was no errors, 2 warning only. After download, at first there was no errors, but no "Run" as well. After clicking "RUN-STOP" to stop and back to run, the "Error" LED start flashing. The Diagnostics did show the Syntax error 6506, step 513. The same reaction was when I tried "Online-Change Mode" on my programming laptop. Disconnection the unit FX3U-ENET did not help. May be settings for FX3U-485ADP-MB are wrong? Regards, Waldemar

Share this post


Link to post
Share on other sites
GX IEC Developer libraries should NOT be used in GX Works2. There is an option in the latest versions of GX Works2 to support the _M commands. Tools, Option. Project section, Common Setting. Check the box marked 'Use Dedicated Instruction of GX Developer, GX IEC Developer'. Not sure what the oldest version to support this is.

Share this post


Link to post
Share on other sites
If your have a BD card installed (any but the CNV-BD), the first comm ADP module is CH1 and the second comm ADP module is CH2. Also: Download your libraries again, I'm pretty sure that the libraries for GW2 are correct, so you should download them from Mitsu and re-install them to ensure that they are really GW2 libraries.

Share this post


Link to post
Share on other sites
Thank You kaare_t, in the programming example FX3U Modbus RTU Master for GX IEC Developer there is the separate library file FX3MBModbusRTUMaster_V200.sul, but in the similar example for GX Works2 the library is inside the project. Don't know where to get it separately. regards, Waldemar

Share this post


Link to post
Share on other sites
Thank You Crossbow, could not find the option You mentioned in the Version 1.55H. Regards, Waldemar

Share this post


Link to post
Share on other sites
Found that the PLC version I use (FX3U V2.23) is too old for the Modbus. http://forums.mrplc....showtopic=15248 Is it possible to upgrade firmware? Regards, Waldemar Edited by wlederer

Share this post


Link to post
Share on other sites
Firmware upgrade is not possible. And you need to contact Mitsubishi about your software, 1.55 is quite old. Current in USA is 1.91V.

Share this post


Link to post
Share on other sites
Thank You very much for the help. I'll try to get the newer PLC and software. Now, to add the Modbus RTU to an existing project, we have to: 1. Download the appropriate programming example for GX Works2, e.g. FX3MBModbusRTUMaster_V100 2. Open the example, open the library used, then right click and "copy as" with a new name (if no separate library download available). 3. Copy the program in the example e.g. FX3MBModbusRTUMaster_PRG. 4. Paste the copied program into the actual project. 5. Install the new library into the actual project. 6. Add the new program in the task. Is that correct? Regards, Waldemar Edited by wlederer

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