PEERPSI

SCL3(487)

31 posts in this topic

CP1L-L14DRD

CP1W-AD041

Trying to scale an input 0-10 VDC = 0-10000 millimetres. My source word changes value but my D100 word does not and I get no change in the result.

I have a SCL3(487)

D100=0000/0 offset

D101=1770/6000 X

D102=2710/10000 Y

D103=2710/10000 Max

D104=0000/0 Min

Any ideas?

 

Instruction.png

Share this post


Link to post
Share on other sites

I've manually input the D100 to D104 numbers and first parameter word value still does not change.

Share this post


Link to post
Share on other sites

Looking to specifically use the scale instruction.

Share this post


Link to post
Share on other sites

SCL3 Converts a signed BCD value to a signed binary value.

The CP1W-AD041 provides a binary value, not BCD.

Are you converting the number to BCD before using the SCL3 instruction?

Share this post


Link to post
Share on other sites

Tried using BCD as well, still not working.

Share this post


Link to post
Share on other sites

What are the actual addresses for your S source word (Right_Distance) and your D destination word (Rigth_Real_D)?

I have this set up in a CP1L and it is working.

gtsuport

Share this post


Link to post
Share on other sites

So are you moving the actual analog value into W4?

Are you properly configuring the CP1W-AD041?

Which channel on the CP1W-AD041 is the analog input wired to?

gtsuport

Share this post


Link to post
Share on other sites

I was moving the value from the input to Right_Distance which I had defined as UNIT, that didn't work of course. Now I have ADIN_VIN3, channel 3, as the source word. I see it's value appear in the SCL instruction with the suffix HEX. No change.

Share this post


Link to post
Share on other sites

The Right_Distance value must be a BCD value, valid value will contain only numbers.

The value from the analog input will be binary (may contain alpha characters).

The source word probably will be defined as HEX, but will not have alpha characters.  If it does, the instruction will error out.

Use a BCD instruction on the raw analog data.  BCD  3  W4   This will convert the raw analog to a BCD value.

See if that will work.

gtsuport

 

Share this post


Link to post
Share on other sites

Okay, thanks. Instruction working now but the math is off.

Share this post


Link to post
Share on other sites

Okay, thanks. Instruction working now but the math is off.

Share this post


Link to post
Share on other sites

Can you explain?

With the values you described above, it is working for me.

gtsuport

Share this post


Link to post
Share on other sites

SCL3 parameters are as below, with 1250 in my source I'm getting 4234 in the result. Should be a ratio of 1.67 with a result of 2083.33

D100

D100=0000/0 offset

D101=1770/6000 X

D102=2710/10000 Y

D103=2710/10000 Max

D104=0000/0 Min

Share this post


Link to post
Share on other sites

Did you enter D101 as #6000?

I just entered #1250 and my result was &2083

gtsuport

Share this post


Link to post
Share on other sites

This is what I have in HEX, I should be entering in decimal?

D100

D100=0000

D101=1770 X

D102=2710 Y

D103=2710 Max

D104=0000 Min

 

 

Share this post


Link to post
Share on other sites

The P+1 number needs to be entered in BCD.

If you enter that value as #6000 the instruction should work properly.,

gtsuport

Share this post


Link to post
Share on other sites

Only the P+1 is entered in BCD? I know have the following with 1247 as my process value and 39321 as my result.

D100

D100=0000

D101=6000 X

D102=2710 Y

D103=2710 Max

D104=0000 Min

 

 

Share this post


Link to post
Share on other sites

Your W4 value must also be in BCD.

What is the value of channel 3?

Share this post


Link to post
Share on other sites

Enter all the values D100 - D104 in HEX.

Use the values you show in Post #1.

Edited by gtsuport
More info

Share this post


Link to post
Share on other sites

W4 is processed through a BCD instruction so that the source word is now Right_Distance_BCD W7.

With D100-D104 in HEX I have a process value of 1248 and a result of 7051. Equation is Y/X x S + offset. 10000/6000=1.67, 1.67x1248=2080 2080=0=2080.

Am I missing something here?

D100=0000/0 offset

D101=1770/6000 X

D102=2710/10000 Y

D103=2710/10000 Max

D104=0000/0 Min

 

Share this post


Link to post
Share on other sites

With it entered in HEX for a process value of 1247 I get a result of 7045 for a ratio of 5.65?

Share this post


Link to post
Share on other sites

See the image below.  This is set up in a CP1L and is working properly.

SCL3_20200305.jpg

Share this post


Link to post
Share on other sites

How do I get that address and value screen you have on the bottom?

 

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