A Little Scaling Help

Oceansoul

Member
Join Date
Apr 2010
Location
England
Posts
307
If someone has 5 min to spare, would you mind helping me to explain how the scaling has been done in the following code. Usually i can understand the scaling (i know how it works etc) but they have done it in a strange way in in this case and i dont quite grasp it. Its RSLogix 500 code.
 
Sorry I forgot to add, specificly its the flow meter scaling that confuses Me. I6.2 I think. If I had done it I would have used scp or compute, but they did it weird :/
 
Sorry to be negative about this.....

Since the code is devoid of any symbolic references, and very sparse comments, and you only "think" it is I:6.2, then you will have to provide more information.

I for one don't feel inclined to trawl my way through largely uncommented code to see how they have done it "weird". I don't think a spare 5 minutes is enough under the circumstances.

Personally, I would be adding comments and symbols to this code as I deciphered it.
 
It appears that I:6.2:

First moves to N9:4 in File 5, Rung 004, then
when I:1.6 = 2, gets COPied to Output O:1.2 on Rung 011, then

In File 12, Rung 007, I:6.2 gets MULtiplied by 1000, saved in N7:51,
then N7:39 is divided by N7:51 and saved back to itself,
then ADDed to N7:40 and saved back to itself in N7:51,
then in File 12, Rung 0040, if N7:51 is within certain LIMits,
in File 12, Rung 0041, N7:61 is subtracted from N7:51 and the result is saved in N7:71,

then N7:71 is DIVided by N7:81 and saved back to itself- N7:71,
then N7:61 is ADDed to N7:71 and saved in N7:71,
then N7:71 is MOVed BACk to N7:61 (which has the effect of doubling the sum of N7:71 + N7:61 on EACH scan that Rung 0041 is TRUE).

I could not find where N7:71 and N7:61 are used elsewhere, so it may be inside an Indirect Address, or used by an operator panel.
 
Last edited:
If I had done it I would have used scp or compute, but they did it weird :/

sorry – but no ... the processor being used in your program is an SLC-5/02 ... it doesn't support SCP or CPT instructions ...

you can find a detailed answer to your question in Part #2 of my write-up on "Scaling with y=mx+b" available from the Sample Lessons page of my website ... you might want to read the whole thing – but the material that you're looking for starts on page #28 with the discussion for Figure #13 ... pay particular attention to the operation of the DDV (Double Divide) instruction ...

basic answer: let's assume that your 1746-NI4 input module is reading a 4 to 20 mA signal – and so the UNSCALED values it reports range from 3277 to 16384 ...

Ladder File #12 - Rung #7 scales the signal from I:6.2 to a range of 0 to 1000 ...
 
Last edited:
The processor is a 5/02 processor, so the SCP instruction is out of the question, so is any floating point.

A little help about what kind of range and what units you think the analog input is being scaled to would help.



(edit, I see Ron beat me to it. If you'll look in the manual for your module in the programming examples chapter you will find an example that very closely matches the scaling method in ladder 12. )
 
Last edited:
Ok i was a little short this morning. I ment I:6.1, but thats no matter now.
I know its a terrible program, but thats just how it is, and im slowly adding comments.

As Lancie said
It appears that I:6.2:

First moves to N9:4 in File 5, Rung 004, then
when I:1.6 = 2, gets COPied to Output O:1.2 on Rung 011, then

I know about this part. This is kinda irrelevant, the card in slot 1 is a Direct Comms Module. O:1.2 is not a real output and is written to a supervisory PLC 5 as a Remote I/O rack (dont ask, its old). I:1.6 is also a bit from the PLC 5.

The bit i was intrested in was the scaling, like Ron said with the DDV. I guess as the 5/02 doesnt do CPT they had to do many calcs, each overwritting the previous. Ill read up on the DDV.

What i was specifcally intrested in was finding what the flow was scaled to. I have since found out it is 0-3500. Which is then /100 in the PLC 5 so its 0-35.00 ml/d.
 
Last edited:

Similar Topics

Hi, Need a little bit guiding using SISTEMA software. As I understand a subsystem consist of components and are the same category. I'm confused...
Replies
11
Views
2,637
Good morning everyone, I've got 2 servo driven axes that each use a Heidenhain glass slide to the motion controller for position and velocity...
Replies
4
Views
1,401
RSLogix 500, what is the little image next to the ladder in the project tree? it looks like a little blue bug with a red dot on its back. just...
Replies
5
Views
2,043
Hi everyone, trying to get data out of a digital encoder that is little endian into my Siemens S7-1200 controller that is big endian...it's an...
Replies
7
Views
3,374
Hello all. I was starting to get into a new project (that will probably never see the light of day because $$$) at the plant I work in and...
Replies
26
Views
5,553
Back
Top Bottom