Sign in to follow this  
Followers 0
Guest proxi

Melsec Medoc and SFC programming

3 posts in this topic

Hi, I am working with Mitsubishi FX2N PLC with Melsec Medoc Software (v2.40a). I'm trying to use SFC language but am facing a software problem that I'm unable to work out: There are two PLCs connected by a serial cable (N:N network). According to the documentation, setting up the communication requires that special code (LD 8038, MOV K1 D8176) is written at step 0. That works fine when only using IL or LD POUs, but with SFC, the communication doesn't work. I have found out (by downloading compiled code as IL from the controller) that the reason is that compiler implicitly puts SFC initialization code at the beginning of the program, so that my network code begins at instruction 2 or so and stops working. Has anyone faced that problem? It seems a compiler bug to me, but there might be a way to work around it. Please help me if you can. Cheers, Janusz Gregorczyk

Share this post


Link to post
Share on other sites
Hi Proxy I'm curious as to what the 'SFC initialization code' is that you refer to. Can you give an example? Also, that version # you mention... is that Medoc Plus or Medoc 32-bit? By the way, I'm sure you've thought of it already but until the answer is found, you could send your code to the plc and then bring it back as IL, insert the instructions you wish (in IL), and then send it back to the plc (a lot of fooling around, I know). Jim Rowell

Share this post


Link to post
Share on other sites
Hi Jim. I'm using Melsec Medoc Plus. Assuming that code generator is set up to use state variables range beginning from S20, the first two instructions implicitly inserted before my code are: LD M8002 SET S20 S20 is the initialization step of the only SFC POU. This obviously breaks the communication. I've already tried the method you suggested (tweaking program code downloaded as IL) and it worked. With this approach, however, debugging gets difficult. Thanks for your reply, Janusz Gregorczyk

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