In order to use the SCP instruction you need to get some information about your module and your sensor.
If you will look on page 1-6 of manual
1762-RM001E-EN-P You will find the following table for your IO module.
This table shows us what we can expect the IO module to return as a raw value for the input range that we have configured it for. Here we can see that with a 4-20mA transmitter with the IO module configured for raw proportional we will get a value of 6240 at 4mA. This is our input minimum. We will also get a value of of 31200 at 20mA, which is our input maximum. (It also shows the values if you configure the modules as scaled for PID)
Now we need some particulars about your level sensor. Since you haven't given us the details yet, I'm going to make up some numbers. For this example when the level sensor returns a value of 4mA the fluid height in the tank is twelve inches - this make believe sensor doesn't go all the way to the bottom of the tank, leaving 12 inches below the sensor. The level sensor returns a value of 20mA when there is 200 inches in the tank. Thus the range over which the sensor measures is 188 inches.
Now we have the numbers we need: 6240, 31200, 12, and 200. The SCP instruction looks like this:
I usually place my analog scaling right at the top of the program (rung 0 in this case) or in a subroutine that is executed before the main section of my program is executed.
I noticed in the program that you posted that you had configured the input to be scaled for PID. Should you leave it that way then you would selecct the values of 3120 and 16380 for input min and input max. Substitute the numbers for Scaled Min and Scaled Max that will match your sensor when you have them.
This method gives you the level scaled into whatever engineering units your level sensor is calibrated in. For this example I chose inches since that is what you indicated.
Working in engineering units is convenient, but the PLC actually doesn't care one way or the other, and I see in your posted program that you decided to do some direct comparrisons to the raw analog value from the card. This is perfectly legitimate, but you need to scale the reference value for the comparrison so that it fits in the range of 6240 to 31200 for raw, or 3120 to 15600 if you scale it for PID. Since I personally prefer to work with the raw values, I'll use that.
So, supposing that I wanted to know what the raw input value for 75" would be? I can use a simple relational trick to figure this out, one that is easy to remember and apply:
A is to B as X is to Y. A and B are the process variable and process variable range, X is the unknown, and Y is the raw analog span.
Remember that there is a 12 inch offset, so...
(75-12) is to (200-12) as x is to (31200-6240). I'll write this as a ratio
63 x
---- : -----
188 24960
Cross multiplying and setting the terms equal, I get 188x=1572480
and solving for x, I get 8364. I subtracted out the offset for 4mA, so adding it back in now, I get 14604. So, at a fluid depth of 75" I should read 14604 as the raw analog input value.
So if I don't want to program the scaling into the PLC but make a raw comparrison, then to check and see if the level is greater than 75 inches I would use
And finally, suppose that I wanted to turn the entire thing around, and scale numbers representing the desired value in engineering units, say 75 inches again, into raw equivalents for use in making a raw comparrison as above. I could flip the application of the SCP instruction around, and do this:
converting the engineering unit value of 75 inches, to the corresponding value for comparrison with my raw analog input. Observe that the SCP instruction gives us 14604 in N7:2, the same value we calculated above. Now, N7:2 can be compared to the raw input value from I:1.0
I hope that helps.
---------------------------------------------
Last, I have a question about something in the program you posted that is a bit troubling...
Please explain rungs 10 and 11. On rung 11 you have an output O:0/12. Then on rung 10 you have an XIO instruction performing a logical
AND NOT I:0/29. I:0/29 is labeled FROM OUTPUT O:0.0/12. Before I go jumping to conclusions, will you explain what the relationship between I:0/29 and O:0/12 is and what is wired to each one. The same thing exists at rungs 12 and 14 also.