Greetings Jamal ...
first the good news ... I got the program that you emailed and was able to open it with RSLogix5000 version 17 ...
now the bad news ...
this application is a genuine mess ... before you go any further, you need to CONFIRM exactly what range and data format your field device (pressure transmitter) is using ... that will have to come from the manufacturer's documentation for that piece of equipment ... in order to move this discussion along, I'm going to assume (gosh I hate that word) that the device being used in the program you sent to me uses the following configuration:
4.0 mA = -407.853 (inches Water Column???) ...
20.0 mA = 830.397 (inches Water Column???) ...
this may or may not be true – but I can't tell from here ... the values are based on the setup in your existing program ... anyway - let's move along based on that assumption ...
(1) whoever set up your SCP (scaling) apparently didn't go by the manual for the 1769-IF8 analog input module that you're using ... I've attached some of the most pertinent information below ...
DISCLAIMER: I have never worked with this particular model of analog module ... what I'm writing is based on how I interpret the manual (which might be wrong) ... possibly some other forum member more familiar with this module can confirm or correct me ... (I'll bet more than pocket change that I've got it right) ...
it looks like the original programmer (you?) chose to use the "Raw/Proportional Counts" format for each channel of this module ... that's unorthodox – but it's OK as long as it's done correctly ... (it is NOT done correctly in your existing program) ...
the book gives that format system a FULL RANGE set of values from -32767 to 32767 ... it looks like the programmer (incorrectly) interpreted that to be:
4.0 mA = -32767 data reading
20.0 mA = 32767 data reading
based on how I interpret the manual, I think the values shown above are incorrect ... working out the math, I think that the following values would be more accurate ...
4.0 mA = -29821 data reading
20.0 mA = 29085 data reading
in other words, based on a FULL SCALE range of 3.2 mA to 21.0 mA the values would be as follows ...
3.2 mA = -32767 data reading
21.0 mA = 32767 data reading
the CATCH is that most field devices do NOT range from 3.2 mA to 21.0 mA in order to neatly match the range of the PLC's analog input module ... so the values must be mathematically adjusted to work correctly ... apparently the original programmer missed that fact ...
summing up so far ... it looks like all of the original scaling was done based on the WRONG correlation of values ... (the old saying "garbage in – garbage out" comes readily to mind) ...
but it gets much worse ...
(2) whoever wrote those SCP Add-On Instructions got the internal formula wrong ...
this is the formula that's currently being used in the calculation:
Output = (((Scaled_Max - Scaled_Min) / (Input_Max - Input_Min)) * Input) + (Scaled_Min - (Input_Max * ((Scaled_Max - Scaled_Min) / (Input_Min - Input_Max))))
you should be able to correct the mistakes in this yourself ... if you need help, there are many forum members who can guide you ... personally I won't make any suggestions (for the reasons mentioned below) ...
(3) in the program you sent, each of your SCPs is followed by an ADD instruction which provides an "offset" to the results of the SCP ... the rung comment documentation says that this is done to "correct for inaccuracies" ... this is NOT the way this is supposed to be done – and in using this "offset" approach the flawed data becomes even MORE skewed ...
in other words, instead of tracking down the inaccuracies and fixing them, someone has tried to slap a band-aid on the problem – and in so doing has merely made matters worse ...
summing up ...
this is as far as I can go with this project ... you've asked for help on "how to scale" and I've done my best to show you where your problems lie ... this system appears to be related to "gas" flow and pressure control ... I can only assume (I still hate that word) that this involves some element of danger and I am not comfortable offering any suggestions on how you should go about fixing the obvious problems ...
I highly recommend that you make another post in this thread and give me permission to attach a copy of the program that you sent to me by email right here on the forum ... perhaps other forum members might be able to help you with your problems ... personally I'm not willing to make any specific suggestions on how to proceed based on what little I know about your system ...
I'm just guessing here – but I've got a hunch that you're trying to swap out one pressure transmitter with another in an effort to "fix" a problem with controlling your system ... I'll bet (pocket change only) that merely setting the original transmitter up correctly would go a long way toward solving the problem ... that's my best guess based on what little you've been able or willing to tell us about this project ...
finally ...
I have asked repeatedly for you to give us more information about this system – and about your involvement in it ... that information has not been provided ... this is the best I can do for you ... I truly hope that this has been helpful – and I sincerely wish you the best of success with your project and with your future career ...
in closing: give me permission and I'll post the program for you ...
.