Guest proxi Posted November 27, 2003 Report Posted November 27, 2003 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 Quote
JimRowell Posted November 27, 2003 Report Posted November 27, 2003 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 Quote
Guest proxi Posted November 28, 2003 Report Posted November 28, 2003 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.