arthurb4x

Convert code Fx1n to QnCpu .Help needed

27 posts in this topic

Hello , I dont have much experience in PLC coding but need to remove an old Fx1N with a QCPU . The program has several STL statements as State relays and dont know how to convert them for the new QCPU . I did export the old program as cvs and then imported it to a new project but I got many yellow code ( Errors  I assume ).  So far I managed to find the corresponding  Special registers needed M8002 to SM402 and for   [ ZRST M3 M200 ] used the [FMOV K0 K1M3 K200] but I am stuck at [ZRST S0 S100] asit gives me error plus it gives me yellow on each line there is a S device plus there are many STL that I dont know the equivalent of in QCPU .

Help and guidance is needed,

Thank you in advance 

Arthur

PS. Please forgive me for my bad English as is not my first language .

Attached is the full program in GXWorks2 1.91V

me commente_greasepump_91_X15.gxw

Share this post


Link to post
Share on other sites

You are not going to be able to convert the stl to a Q

Or in fact many instructions.

 

Stl in the fx is a set of conditional steps where only the active step is scanned.

 

You would be better with an fx3 or fx5....Or it's a rewrite.

1 person likes this

Share this post


Link to post
Share on other sites
Just now, Ron_S said:

You are not going to be able to convert the stl to a Q

Or in fact many instructions.

 

Stl in the fx is a set of conditional steps where only the active step is scanned.

 

You would be better with an fx3 or fx5....Or it's a rewrite.

Thank you Ron 

So how are "sets of conditional steps where only the active step is scanned"  expressed in Q ?

Share this post


Link to post
Share on other sites

In short, they aren't.

The Q doesn't have that function.

In the fx, individual steps are defined by a line -----------------[ STL S20] etc

(program for s20 here)

STL S30 and so on

If stl s30 is active, none of the other steps are scanned

 

1 person likes this

Share this post


Link to post
Share on other sites

The system Q supports SFC that 's why it's not needed.

 

1 person likes this

Share this post


Link to post
Share on other sites

So the only way is to rewrite it based on SFC , If I understand correctly . I find the manual for SFC programming https://dl.mitsubishielectric.com/dl/fa/document/manual/plc/sh080041/sh080041x.pdf very intimidating for a noob like myself .  Can someone help/guide me thru this process of converting the program to Q , and maybe some tutorials about mitsubishi SFC .

Thank you in advance,

Arthur

Share this post


Link to post
Share on other sites

Just read your FX code and make write down the SFC chart on paper.

Than recreate it in SFC. For all the transitions use ----(TRAN) as an output. 

 

1 person likes this

Share this post


Link to post
Share on other sites

What should I use as input for the (TRAN) 

the FX code is just some initial conditions and a section of manual use for the outputs then 5 STL statements and some Error routines on the end . for as I understand it .

Edited by arthurb4x

Share this post


Link to post
Share on other sites

That would be the part in front it the ----[SET Sxxx]  in your FX code.

You can also recreate the STL yourself with SET RST instructions i suppose. 

 

Edited by Gambit
1 person likes this

Share this post


Link to post
Share on other sites

What should I do about the [ ZRST S0 S30 ] that cant be converted . It gives me error when I try ..( The Sxx are the STL statements ).I have already started the SFC prog 

Share this post


Link to post
Share on other sites

Is that a Reset of the whole SFC ?

If it programmed at the beginning you wouldn't need that. If it is part of the SFC than you can make a R block and use 999 to reset all SFC's

or just define the ones needed to be deactivated 

 

1 person likes this

Share this post


Link to post
Share on other sites

I am finding it very hard to implement TRAN . Can I just remove them altogether ?

QCPU_test_1.gxw

Since S0 was taken I had to rename them 

S0 is now S1

S1 ----> S2

S10 --->S3

S11 ---->S5

S20 ---->S4

QCPU_test_1.gxw

Edited by arthurb4x
upload file

Share this post


Link to post
Share on other sites

What is the problem with TRAN (transistion)

Capture.JPG

Edited by Gambit
1 person likes this

Share this post


Link to post
Share on other sites

No these are the conditions for going to the next Step/Block 

1 person likes this

Share this post


Link to post
Share on other sites

yes.

so M12 and X11 should be your condition before TRAN 

You can find this example in the FX programming manual

Capture1.JPG

Edited by Gambit
1 person likes this

Share this post


Link to post
Share on other sites

don''t use the brackets. Juts type TRAN or use the drop down button and remove the -[ ]-

1 person likes this

Share this post


Link to post
Share on other sites

You can remove the S4 as you are already in S4.

You are using the SFC so all the -[Set S...]-  and  -| |- S..  at the beginning are no longer needed.

1 person likes this

Share this post


Link to post
Share on other sites

Your problem is not in the code but your SF structure

 

Capture3.JPG

1 person likes this

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