5/27/2010 9:00 AM | |
Posts: 147 Rating:
|
Hi It is quite straightforward to do a scaling, since you can do it all by yourself. Since you don't mention your CPU, I'll assume you're using S7-300. First you have to make sure that you get the proper value (usually in a PIW variable) Then, if you check the SIMATIC S7-300 S7-300 Module data you can see the analog value represantation in chapter 5. The manual informs you that the maximum value you can get using 4-20 mA (that is 20mA) is at 27648, and the minimum (0 mA) is 0.(you can get higher than that actually, but is an overflow...) You have to find the represantation of 4mA (= 300 litres). That is 27648*4/20 = 5529.6 (approx. 5530) Then, by applying simple arithmetic (20mA == 27648 == 2000 litres & 4mA == 5530 == 300 litres) you solve the equation for a, b: y = a*x + b (y is litres, x is mA) For y = 300, x = 4mA => 300 = 4a + b For y = 2000, x = 20mA => 2000 = 20a + b Solve this and you get a=106.25, b= -125 Then it is easy, you get y = a*x + b (y is litres, x is mA) with a=106.25, b= -125. From here, it is straightforward to implement this arithmetic in you CPU, any language you are using. Just take care to convert the PIW word value to real first (ITD, DTR commands in STL). Do the same for getting the the actual decimal value, instead of the value in mA, where it should be easy. glhf Aristotelis |
This contribution was helpful to
1 thankful Users |
5/27/2010 9:43 AM | |
Joined: 10/7/2005 Last visit: 6/6/2023 Posts: 2966 Rating:
|
Hello MecoMatic not too sure about the "4mA = 5530 raw AI value= 300 litres" part of Aristotelis's equation (4mA as a raw AI value is "0" as far as I'm concerned assuming the instrument is a 4-20mA and the AI card is setup to be4-20mA). Anyhow, assuming you areusing an S7 300 or 400, you'll finda pre-programmed Analogue Input scaling Block in form ofFC105 (SCALE) in the "TI-S7 converting Blocks" library (which is part of the "Standard Library"). Click "F1"on it and you'll get the context sensitive help which tells you how to use it. I hope this helps |
Cheers |
|
5/27/2010 10:28 AM | |
Posts: 147 Rating:
|
Hi Fritz, Indeed I assumed that the AI card is set up as a 0-20 mA. Anyway, info about the problem is inadequate and I did a lot of assumptions, but the underlying mathematics remain the same. You just change the numbers.(and getting a better resolution in your values) |
This contribution was helpful to
1 thankful Users |
2/15/2015 6:33 PM | |
Posts: 7 Rating:
|
How did you that sir , I want also to enter K1 & K2 , SO PLEASE CAN U HELP ME ?! :) |
Follow us on