Stuart_Wales

GX Works 2.... Convert SFC to Ladder

30 posts in this topic

Hi all,

Is it possible to convert from function block to ladder, if yes, can someone guide me where to do it?

Also, when we get a new machine via a machine builder, when uploading for the first time on site using GX Works 2 (new software to us), we can't upload the comments. I'm sure we could when using GX Developer?

Share this post


Link to post
Share on other sites

You want to copy from Structured FB or SFC?? You want to convert to simple ladder or structured Ladder?

And regarding the comments, it's the same as in GX Developer: The comments must have been downloaded in the beginning for you to be able to upload them...

Share this post


Link to post
Share on other sites

Hi mate,

 

Convert to simple ladder yeah.

On comments topic, both machine builders have said that they sent comments to PLC? This is where the issue is, I've got a new machine with PLC project but no comments, the .zip file they have now sent me is in SFC... I want to convert to ladder to gain the comments.

Share this post


Link to post
Share on other sites

You cannot convert it directly in the SW. I'm not sure what happens if you try to upload a SFC project, but test to download the SFC code and then upload it - I think it will be standard simple ladder after upload (but not entierly sure)

Regarding the comments, if they didn't selected to download them you cannot see them in the upload window (see attached picture of how it looks IF the comments are downloaded in the first place).

device_comments.png

Share this post


Link to post
Share on other sites

Thanks mate.

In both occasions where we've used GX Works 2 to upload, comments selection has been there, but then after upload..... no comments.

 

 

Back to trying to gain the comments:

I can see comments on the function blocks, but the 'global comments' are empty. I have the below, plus empty global comments.... and then an upload from machine which is just ladder logic and no comments.


 

 

 

Untitled.png

Share this post


Link to post
Share on other sites

Yeah, the image you have is not SFC but Structured Ladder (the IEC variant of Simple Ladder). The comments here, together with the placement of the functions are a "graphical" layout hence you need the source files to be able to read out information. That is why you get Simple Ladder when you upload the projects. Structured Ladder is compiled to IL before it is downloaded and the process is (almost) irreversible.

So basically the "comments" you are talking about are only visible in the original Structured Ladder project. You will never convert these to Simple Ladder since they are graphical and not in the program itself (only stored as graphical information in the source files).

1 person likes this

Share this post


Link to post
Share on other sites

That makes sense. Thank you mate! Appreciated.

I'm down to the machine builders tomorrow so will get it put onto a disc for me (we're not trusted to use memory sticks on site).

Share this post


Link to post
Share on other sites

Morning mate...

...after a trip to the machine builders, they have shown me that they have commented the project under the 'global label' section. Not 'Global device comments', as I was expecting (see attached image). Is there a way I can transfer/dump these into the global device comments??

EBS1.png

Share this post


Link to post
Share on other sites

Sorry, but you cannot export Global Labels to Global Device Comments...

P.S. Why do you want to convert the whole project including comments to simple ladder? Any "special" reason?

Share this post


Link to post
Share on other sites

We are a simple ladder skillset only. This is the first time we've ever seen structured ladder, never mind understand and troubleshoot it.

So I suppose my next question is, if machine builder has written in structured ladder, then we'll never be able to monitor and edit in simple ladder?

Share this post


Link to post
Share on other sites

I see. No, you cannot monitor or edit the current project in Simple Ladder. However, what you can do is to implement more POU's and set them up as Simple Ladder. You cannot edit anything existing but you can add routines and programs.

Another option is to just start learning Structured Ladder. It looks a bit overwhelming in the beginning, but after you get a hang of it it's really a lot easier to get an overview of the complete code (especially if it's a big project with lots of code). I would suggest trying it out for a little while, and ask questions here if you run into problems with understand Structured Ladder vs. Simple Ladder.

Share this post


Link to post
Share on other sites

I will have a look for some guides/tutorials for structured ladder.

Thanks for the replies mate! Very appreciated.

Share this post


Link to post
Share on other sites

Structured ladder is a compiled language, so what actually gets sent to the controller is good old fashioned machine code (Instruction List).  I have had success before downloading a program in GX Works2 structured ladder and then uploading in simple ladder in GX Developer.  But keep in mind the upload is what the compiler generated, not what the original program looks like.  So someone would have to go through it and understand how it converted.

The PLC didn't learn a new programming language, the programmer got a new tool.  Hardware is still same as it ever was.

Share this post


Link to post
Share on other sites

Hi Mate,

I managed to finally connect today. Schoolboy error which I wont go into haha...

It's not that bad to follow. The way the programmer has written it, is to global map all inputs to like a phantom label, then use that label as the input... not the physical 'X0' etc. Same with outputs.

Then going inside the function block is my standard step sequence. Not as scary as first thought....

Share this post


Link to post
Share on other sites

Glad to hear! Let us know if you run into any issues. But the instructions are basically the same so you should be able to manage pretty well...

Share this post


Link to post
Share on other sites

Good morning mate. Is it possible to add a large bit of logic to this program in simple ladder, whilst retaining the original function block style project? So have 75% of the project in function block, then an addition of about 25% in simple ladder for our production monitoring software that we always 'retro fit' after a machine has landed.

Share this post


Link to post
Share on other sites

Good evening mate!

It depends on which PLC type is used. If you are using a L or a Q CPU then you're good to go, if other then we must look more into a different solution!

If you have a Q/L then you can just add more programs and select "Ladder" then it will be simple Ladder. Just remember to register them in the Task manager...

Share this post


Link to post
Share on other sites
On ‎11‎/‎11‎/‎2016 at 6:03 PM, kaare_t said:

Good evening mate!

It depends on which PLC type is used. If you are using a L or a Q CPU then you're good to go, if other then we must look more into a different solution!

If you have a Q/L then you can just add more programs and select "Ladder" then it will be simple Ladder. Just remember to register them in the Task manager...

It's a Q03UDE, and we're away following your suggestion. Thanks for the advice! Appreciated!

Share this post


Link to post
Share on other sites
On ‎11‎/‎11‎/‎2016 at 6:03 PM, kaare_t said:

 

 

Hi Lads,

Few silly questions incoming.

So we're finally adding our standard ladder OEE software and trying to debug the structured ladder (and learning on the fly) so that we can get the counters working. As seen from below, counter is counting but we're not getting the full rung execution. We assume it's because our OEE program we've added on is red. Previously, we've gone into settings and added it to the scan (or something along those lines), but we can't see anywhere that the pre-written/structured ladder have been assigned.

Question 1: Why is the OEE program red, would this prevent the failed transfer of counter to W register?  

Honda.png

Share this post


Link to post
Share on other sites

Question 2: Having verified successfully all of the structured ladder before adding our simple ladder OEE program, we then copied in our standard OEE software and did an online edit shift+F4 command. This then gives us a message that 'nothing has changed' and the list below. I'll dive into the manual if that's the best suggestion, but are we missing something simple with running standard ladder next to structured ladder (as it's the first time we've used it, and are fairly new to GX Works) 

 

 

Honda1.png

Share this post


Link to post
Share on other sites

Question 3:

We're not up to date on the software updates, as we've never had much discipline on this topic as a business..... I am going to improve this, but on the same machine when connecting to the HMI software, we get the below message. So original writer wrote code in a newer software to ours.... which is fine.

When my colleague then updated to this level, going back into GX Works, it gives a warning of changing addresses of existing registers etc... Is this a concern?

Current status is my laptop is in 'old state' and can link to GX Works but NOT GT Designer, then maintenance laptop is in 'updated state' and able to link to GT designer but we're concerned about the addressing change when going onto GX Works.

 

Honda2.png

Share this post


Link to post
Share on other sites

1.  I think when the program is shown in red it means there is an error or it is not scheduled in the processor.  I forget, been off Mitsubishi stuff for a couple years now.

2.  Are you trying to add an entire program as an online edit?  Can't do that.

3.  Unless you used some new feature not available in the older version there will be no difference.  You should try to keep all computers on the same version and up to date though.

Share this post


Link to post
Share on other sites

Hi Crossbow, thanks for the reply.

1. Don't know on this one. Hopefully someone else could jump in.

2. Sorry mate, I was copying a few lines at a time over about 60 lines of code. So it goes in and monitors.... I just wasn't sure if it was a conflict between structured ladder vs simple ladder.

3. Yeah, we've had lots of errors in poor communication from leaving our standard/10 year plus machine supplier to a new one to the business. Our fault as our machine spec wasn't what we thought it was!!

Share this post


Link to post
Share on other sites

1. Since the program is running and compiled, the 'red' PRG is simply unused (uncompiled) code. That means, as @Crossbow is writing that it's not scheduled to run in the PLC (under task manager it is not registered), and will never do anything (e.g. it has been removed from the task manager for service reasons, no longer used etc.).

Share this post


Link to post
Share on other sites
1 hour ago, kaare_t said:

1. Since the program is running and compiled, the 'red' PRG is simply unused (uncompiled) code. That means, as @Crossbow is writing that it's not scheduled to run in the PLC (under task manager it is not registered), and will never do anything (e.g. it has been removed from the task manager for service reasons, no longer used etc.).

Hi mate,

How do we register under the task manager?

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