ccolson Posted April 15, 2004 Report Posted April 15, 2004 Boy this web site has been great so far. I have been given what normally would be a pretty simple project, however the customer is requiring a mitsubishi processor. I have a tiny bit of experience using these for standard input/output programs, however this will be the first time I have used analog with the mitsubishi processor. I am looking for something that is similar to the scp (scale with parameters) function that is used with Allen-Bradley software. Is there a simple function or will I need to do the math. Basically, my analog inputs (4-20mA) are the following; one pressure transmitter (0-150 PSI), and two temperature transmitters (0-300 deg F). I would like to scale the analog values over the desired ranges (i.e. 0-150 and 0-300). Before I dig into each math step to accomplish this I thought I would ask all of you to see if there was an easier method. Thanks again for all the help.
panic mode Posted April 15, 2004 Report Posted April 15, 2004 (edited) What deep math, it's just the grammar school stuff (famous linear conversion or for dummies - "match one side and stretch"). So you have analog input 4..20mA right? lets say 4mA is giving you 100 counts and 20mA signal will change reading to 500 counts. You want to translate this into 0-150psi or whatever so 4mA (or 100 counts) will show zero after scaling. ok your analog is 100..500 counts so to match it with 0..150 simply subtract 100 from what you read to get the 0 value on lower side of the range. This way your range will shift from 100..500 down to 0..400 and 0..400 counts relates to 0..150psi (one side matches)? And if you multiply your 0..400 counts by something to get 0..150 ("stretch") you are done. The magic factor is simply 150/400=0.375 ----| |------------[E* D10 E0.375 D12] Even without specialty instruction, it takes only two instruction to do it (add or subtract and multiply or divide). In case you got the factor wrong (400/150=2.666666) simply divide instead of multiply ----| |------------[E/ D10 E2.66666 D12] Edited April 15, 2004 by panic mode
panic mode Posted April 16, 2004 Report Posted April 16, 2004 No takers? Maybe it's not as simple as I tought. Here is formula that emulates Allen Bradley's SCP instruction A - Input (raw value) B - Output (engineering units) A1 - Raw value low limit (count at 4mA for example) A2 - Raw value high limit (count at 20mA for example) B1 - Engineering value low limit (-15degF for example) B2 - Engineering value high limit (+135degF for example) Conversion formula looks like this: B=(A-A1)*k+B1 Where k=(B2-B1)/(A2-A1) Happy scaling
Sleepy Wombat Posted April 18, 2004 Report Posted April 18, 2004 The old familar linear equation... y = mx + b m = gradient = dy/dx.......
ccolson Posted April 20, 2004 Author Report Posted April 20, 2004 Thanks for the reply, I was not trying to insinuate that the math was hard. I was simply looking for a quick, one step instruction. Oh well. Thanks again for the help.
eccan Posted September 7, 2012 Report Posted September 7, 2012 time to revisit this - is there a command like "scale with parameters" available for the FX3U yet?
eccan Posted September 7, 2012 Report Posted September 7, 2012 The FX3U lets you use the SCL command. That works pretty easy!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now