Rodrigo Balsalobre

[SOLVED WITHOUT SCL FUNCTION] What i'm doing wrong with SCLP in GXWorks2

6 posts in this topic

Hello !

I'm programming an LE3U plc, similar to FX3U plc from mitsubishi. They both use the same software to program, GX Works2. I'm trying to put the value from a pressure sensor on a scale using SCL, but as you can see the value from the port aren't converting on my scale table. What i'm doing wrong? The clp identificate as 770(4mA) 3860(20mA) and I'm trying to convert that into 0(4mA) 250(20mA). On the next image, you can see that i'm sending 20mA on this AI, and D0 reaches the maximum, and that is right, but isn't doing the scale..

SCLP.thumb.JPG.03a041c7ebf8147e0dad4b3a1

manual1.JPG.7fe02d3737229f206425b2afbcb8

5fff74361c08f_manual2.JPG.bcf994c9ffe5f3

Edited by Rodrigo Balsalobre

Share this post


Link to post
Share on other sites

you are supposed to initialize the table before you call SCL instruction. this way any accidental changes by other instructions will not cause table corruption whic is indicated by 0 values of the table points.

never used SCL but manual shows that there are five table points while you only have 2 (not sure if that is ok). assuming that following D registers are also zero values, and that max input value should correspond to last point i could see the PLC having problem with it and gives you result you asked for, not the one you wanted...

 

SCL.png

1 person likes this

Share this post


Link to post
Share on other sites
12 hours ago, panic mode said:

you are supposed to initialize the table before you call SCL instruction. this way any accidental changes by other instructions will not cause table corruption whic is indicated by 0 values of the table points.

never used SCL but manual shows that there are five table points while you only have 2 (not sure if that is ok). assuming that following D registers are also zero values, and that max input value should correspond to last point i could see the PLC having problem with it and gives you result you asked for, not the one you wanted...

 

SCL.png

Ty for the reply!
 As you can see, the number of points is represented by the first line of the table
manual.jpg.94d70dce9cee375a2db29ea44d9ad

SCLP1.thumb.png.a0e4746ae3c3d25354d17a1b

I tried your method, putting the SCL as the final line, using and not using the first line as the number of point but still dsn't working.

USING SLC AS THE FIRST LINE

SCLP.thumb.JPG.e8a675ad3df271a4dc017bb71

 

USING THE SCL AS THE LAST LINE LINE

here is when I use your method with the first line as the number of points. I tried without this first line and 5 points like you did, but stil dsn't work

imagem_2021-01-14_082426.thumb.png.41f03

Edited by Rodrigo Balsalobre

Share this post


Link to post
Share on other sites

If you can't help me with SCL anymore, could you please give me another solution for that I want?

Share this post


Link to post
Share on other sites

SOLVED ! For some reason, the SCL function just can't work for me, searching for this, I found your equation in another post, the UNIVERSAL EQUATION FOR SCALLING, "out = (in-in_low)*(out_hi-out_lo)/(in_hi-in_low) + out_low". Thank you for the help!

Share this post


Link to post
Share on other sites

Try this:

Tested with Fx3U and Fx5U CPUs...

SCL.jpg.e6a46b5f49f24b88592c841c9d3fe58f

 

 

Edited by glavanov
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