Posted 4 Mar 2020 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? Share this post Link to post Share on other sites
Posted 4 Mar 2020 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
Posted 4 Mar 2020 TRY HERE http://forums.mrplc.com/index.php?/topic/30950-proble-with-scale-function-in-cp1l/#comment-145675 Share this post Link to post Share on other sites
Posted 4 Mar 2020 Looking to specifically use the scale instruction. Share this post Link to post Share on other sites
Posted 5 Mar 2020 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
Posted 5 Mar 2020 Tried using BCD as well, still not working. Share this post Link to post Share on other sites
Posted 5 Mar 2020 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
Posted 5 Mar 2020 Right_Distance W4 Right_Real_Distance W10 Share this post Link to post Share on other sites
Posted 5 Mar 2020 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
Posted 5 Mar 2020 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
Posted 5 Mar 2020 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
Posted 5 Mar 2020 Okay, thanks. Instruction working now but the math is off. Share this post Link to post Share on other sites
Posted 5 Mar 2020 Okay, thanks. Instruction working now but the math is off. Share this post Link to post Share on other sites
Posted 5 Mar 2020 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
Posted 5 Mar 2020 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
Posted 5 Mar 2020 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
Posted 5 Mar 2020 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
Posted 5 Mar 2020 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
Posted 5 Mar 2020 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
Posted 5 Mar 2020 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
Posted 5 Mar 2020 (edited) Enter all the values D100 - D104 in HEX. Use the values you show in Post #1. Edited 5 Mar 2020 by gtsuport More info Share this post Link to post Share on other sites
Posted 5 Mar 2020 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
Posted 5 Mar 2020 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
Posted 5 Mar 2020 See the image below. This is set up in a CP1L and is working properly. Share this post Link to post Share on other sites
Posted 5 Mar 2020 How do I get that address and value screen you have on the bottom? Share this post Link to post Share on other sites