Posted 1 Mar 2017 Hi, can anybody help me with an analogue input on a plc 5/15 via a 1771 IFE card. The input has been used with a 0-10vdc input, however there is some nasty compute functions to create a logarithmic curve for the Scada. we now need a linear calculation from 2.2v-8.5v. 2.2v = 0.0005mpa through to 8.5v = 1000mpa. I am familiar with the slc but the commands are somewhat different Cheers Share this post Link to post Share on other sites
Posted 1 Mar 2017 (edited) See text for the scaling formula. The raw data value range for 0-10v input is 0-4095. So.. 2.2v=901 raw data value 8.5v=3481 raw data value use these value for the raw input min/max in the scaling formula. You can use a "CPT" compute instruction for this, as the PLC5/15 does not have a "SCP" instruction. ScalingFormula.txt Edited 1 Mar 2017 by Mickey 1 person likes this Share this post Link to post Share on other sites
Posted 2 Mar 2017 Thanks Mickey, I have done as you say and it worked thanks. C an you help me with the requirements compute function? I want low scale to read 0.0001 and high scale to be 1000. Dave Share this post Link to post Share on other sites
Posted 2 Mar 2017 Your other post said.. .001 at 2.2v This post says .0001 at 2.2v Which is it? Quote 0.001 @ 2.5 v, 0.01 @3.5v5v, 0.1 @ 4.5v, 1.0@5.5v, 10@6.5v, 100@7.5v, 1000@8.5v. Share this post Link to post Share on other sites
Posted 2 Mar 2017 Hi, sorry trying to write these on my phone which isn't going to well! It should be 0.001@2.5, 0.0001 anything lower than 2.5v Thanks Share this post Link to post Share on other sites
Posted 2 Mar 2017 (edited) Then construct your compute instruction as following. (((1000-.001)|(3481-901))*(Raw Input-901))+.001=Scaled Value ( this is for a 2.2v min per your first post) (((1000-.001)|3481-1024))*Raw Input-1024))+.001=Scaled Value ( this is for 2.5v min per your last post) Only you know the correct min voltage. Edited 2 Mar 2017 by Mickey Share this post Link to post Share on other sites
Posted 2 Mar 2017 (edited) Also from your other post.. Quote 0.001 @ 2.5 v, 0.01 @3.5v5v, 0.1 @ 4.5v, 1.0@5.5v, 10@6.5v, 100@7.5v, 1000@8.5v. This is linear starting from2.5v through to 8.5v Those values are not linear to your voltage range. For example 5.5 v is 50% of your range would have a scaled value of 500 (if linear) ?? Edited 2 Mar 2017 by Mickey Share this post Link to post Share on other sites
Posted 2 Mar 2017 Ok thanks, the measured min v is 2.5v, the transducer goes under scale at below 2.2v is what I was trying to explain. Thanks for the replies, sorry for the confusion Share this post Link to post Share on other sites
Posted 2 Mar 2017 Here is a handy tool for linear response. Created by John Soltesz scaling chart.xls 1 person likes this Share this post Link to post Share on other sites
Posted 2 Mar 2017 (edited) Hi, thanks for that. Sorry for dragging this out but they don't seem to be the values I am expecting. This is off a vacuum welding machine. the datasheet for the transducer (mpa) 8.5v at atmosphere 1000mpa, then 7.5v at 100mpa, 6.5v@10mpa, 5.5v@1mpa, 4.5v@0.1mpa, 3.5v@0.01mpa, 2.5v@0.001mpa, any lower iunder scale for the instrument. As it is a vacuum machine they are particularly interested in the lower values. is it am exponential formula? Thanks again sorry Edited 2 Mar 2017 by Til123 Edit Share this post Link to post Share on other sites
Posted 2 Mar 2017 (edited) I am not a math geek. So hopefully those that are will jump in. It is definitely not the formula I provided above. Which is an equation for a straight line. Edited 2 Mar 2017 by Mickey Share this post Link to post Share on other sites
Posted 2 Mar 2017 Note that the pressure points are steps of 10 with voltage in 1V steps. That is a logarithmic scale (Log-base 10). Vacuum pressure => measured by sensor => output as analog logarithmic value => analog input into PLC => scaled/converted back into pressure I do not believe you will be successful in converting the analog value back into a 1:1 vacuum pressure value. Share this post Link to post Share on other sites
Posted 3 Mar 2017 As stated above, the relationship is logarithmic. Mpa = antilog base 10 (input volts - 5.5) The CPT instruction can't handle that, so your alternative is to build a table of values that you can index into using the analog input. You have limited memory in a 5/15 so you'll have to decide what resolution is practical for your application. Share this post Link to post Share on other sites