Scale an analog input - RSLogix500

mccecim

Member
Join Date
Apr 2010
Location
Belem
Posts
24
Hi,
I'm using a Micrologix1500 and it doesnt have the SCP (Scale with parameters) block. I have a 1769-IF8 analog module and need read the inputs (4-20mA) considering that my flow rate is from 0 to 280 m³/h (minimum and maximum scaled values). How can I calculate this using the math operations (ADD, SUB, DIV, MUL)?

Thanks,
 
Scaling a range to another range:
Old range: 333 to 13366 (Laser count)
New Range: 166 to 3996 (Encoder count)


NewValue = ( ( (OldValue-OldMin) * (NewMax-NewMin) ) / (OldMax-OldMin) ) + NewMin

This line is an example in-use, since NewMax and NewMin were constant values (and others) I put the end value.
N7:1 = ( ( ( N7:49 - 333 ) * 3830 ) / 13033 ) + 166

On AB PLC’s use vertical bar “|” not forward slash “/”

You can do this with R8 real numbers and a mix of real & integers.
 
Last edited:
TL;DR



https://www.plctalk.net/qanda/showpost.php?p=841644&postcount=10


If you do not understand proportions, please get someone who does to check your result.


If you are familiar with the SCP instruction, here is a translation from SCP to Aabeck's excellent post:




Code:
SCP            Aabeck's formulation
===            ====================
Input          OldValue
Input Min.     OldMin
Input Max.     OldMax
Scaled Min.    NewMin
Scaled Max.    NewMax
Output         NewValue
 
mccecim said:
...I'm using a Micrologix1500 and it doesnt have the SCP (Scale with parameters) block...

Some clarification, if memory does not fail me...

The MicroLogix 1500 does support the SCP instruction. However, if of a certain firmware vintage, it may not support either the use of the Floating Point data type at all, or the use of the Floating Point data type with the SCP instruction. This is important because the Floating Point data type is widely used with the SCP instruction. For an existing program, where there is an obvious requirement for scaling, but the available SCP instruction was not used, it is usually because the Floating Point data type was not available.

At OS Series C OS FRN 6 the Floating Point data type was first introduced and could be assigned as an operand for many instructions, but not the SCP instruction. At the next release, FRN 7, support was added for use of the Floating Point data type with the SCP instruction.

I knew I'd mentioned this before...

"Different FRN" - SCP & Floating Point

What is the current OS Series & OS FRN for the MicroLogix 1500 controller? If it's pre OS FRN 6 or 7 then you could look to flash it to latest, if possible, which is OS FRN 14. If it's already above FRN 6 or 7 then there is something else you/we are missing here, like you can add a Float operand to an SCP instruction, or even integer, but you're getting the WARNING message mentioned in my older post above? If you can successfully add the SCP instruction then you should be able to ignore the warning.

I'm all for "mitigating maths", but if there is a predefined instruction available I would be trying to apply K.I.S.S.

Regards,
George
 
The error message when I verify the controller is: SCP Floating Point Operands are only valid for Micrologix 1500 LRP/LSP Series C FRN 7 or Micrologix 1200 Series C FRN 6 or higher processors.
So this controller is old and this block SCP is not able to use (CPT is not able either).
 
Last edited:
You didn't say what the actual firmware of your controller is. Check it.

Even if you have the proper firmware you will still get the warning. At least
I do. And just ignore it and it will work. Try it.
 
You didn't say what the actual firmware of your controller is. Check it.

Even if you have the proper firmware you will still get the warning. At least
I do. And just ignore it and it will work. Try it.


Yep, just like this. This works just fine.
This one is pretty old as well. Maybe was replaced around 15 years ago.

SCP1.jpg
 
Last edited:
A warning to the wise...

mccecim said:
The error message when I verify the controller is: SCP Floating Point Operands are only valid for Micrologix 1500 LRP/LSP Series C FRN 7 or Micrologix 1200 Series C FRN 6 or higher processors...

To clarify once more...

It is not an "error message". It is a WARNING message. There is a difference.

This message is simply warning you that the detected combination of the Float data type with an SCP instruction is only supported for these two controllers if the are at minimum running the FRN mentioned. At the point in time when you "Verify Project", the offline program you are developing does not know exactly which FRN the actual controller will be running. So it forewarns you to remind you to check that the controller is indeed at the supported level for this combination. If it is, you can ignore the warning.

From my other post I linked...

Geospark said:
...The reason RSLogix 500 always displays this WARNING for Series C controllers, is because you are compiling an offline project file, that uses Floating Point Operands in SCP instructions. It is merely forewarning you as it doesn't know the OS FRN of the controller you will be downloading the project to. The fact that it lets you verify and download, does not guarantee that all will be well. If the controller is not at FRN 7 or above, but is at FRN 6, you may run into problems at some stage...

As mentioned, this warning will always appear for projects with these controllers selected as Series C because the software will never know which FRN is intended to be used. If you really wanted to get rid of it, in RSLogix 500 you can disable warning messages during verification by going to...

Tools>Options...>System Preferences>Verification

...and uncheck Show Warnings

However, this disables all warning messages for all projects going forward. Personally, I would not advise doing this.

mccecim said:
...So this controller is old and this block SCP is not able to use (CPT is not able either).

Again, what is the OS Series and OS FRN for your controller? Telling us this will verify for us and you that what we are saying is the case here. If this controller truly is "old" i.e. pre FRN 7, then no, you will not be able to use the Float data type with the SCP instruction until you flash the controller to OS FRN 7 or higher.

If you do need it...

The firmware flash is free, and available to your controller because we know it is a Series C. We know this because if it was Series A or B then you would not get this warning message...

padees said:
This is an LRP series C. I changed it to a series B and got all kinds of fun warning stuff.

...you would get an ERROR message because the Float data type is and was never available for Series A or B hardware. It was introduced for Series C at certain FRN, as per the warning message.

A meander...

The reason this is necessary (the warning message) is because they chose not to list the MicroLogix controllers under "Processor Type" with their FRN or range of FRN, similar to most SLC controllers. They just list them according to their Series. An offline "MicroLogix 1500 LRP Series C" project, for instance, has no reference to which FRN it may be intended for. So they have to allow you develop the project including all Series C features. And because some of these features will not work with some FRN, they must forewarn you, in case your hardware is not at the supported level.

A warning to the wise...

Once you are wise to the fact that your controller is, or is not at the required FRN here, you will then know how best to proceed - ignore or flash. But continuing to assume that the very presence of this warning message means you cannot use this combination, would not be wise.

Regards,
George
 

Similar Topics

Please help me... Is there any possible way to use AB IR4-1762 module for analog input scaling....?
Replies
1
Views
1,175
Hello I m using Unity Pro XL. I want to scale my analog inputs. I configured the Analog Input Module as 0-4 mA and 0-10 V . What is the way...
Replies
2
Views
2,986
I'm going to be using a Micrologix 1200 to scale an 4-20mA analog input from a weighing scale and want to output this to an 4-20mA analog signal...
Replies
12
Views
11,397
Hello, I am using an IF2OF2 analog IO module in conjunction with a Micrologix 1100. I have both analog inputs set up for voltage mode with raw...
Replies
11
Views
5,053
I need some help on a program I inherited. I don't usually fool around with analog inputs so I am very confused. I have a SLC 5/04 with a pressure...
Replies
11
Views
16,548
Back
Top Bottom