Scale instruction

Join Date
Sep 2006
Location
SE Michigan/NW Ohio
Posts
158
Greetings.
ok, I'm trying to install a bar graph on a PV600 reading values from a Micrologix1500.
AHA!!! just go to :http://www.plctalk.net/qanda/showthread.php?t=15069&page=1&pp=15&highlight=scale
And you will easily be able to figure this out. Nope.

Excellent info though. I've gotten pretty far with it I think. And I'm almost over the hump.
However my problem has a bit of a twist to it.
I have an analog input from an LDT that reads in a very limited range. 10000 to 7000 counts (backwards). My problem is that I have 12 machines using the same equipment and they all have different values between 7000 and 10,000. The resolution I'm looking for is +/- 20. So an LDT reading 8000 at center would have a low limit of 7980 and a high of 8020, the one next to it reads 9000 nominal with a Low and High of 8980 and 9020
I want to capture the 7980 to 8020 area with the entirity of the bar graph.
So far my logic looks like this:
Data table
Input I:1.0
Low LDT reading (X1) =F58:31
High LDT reading (X2)=F58:30
Y1=0
Y2=100
M/rate= N99:0
Ouput to PV= N99:1


-------------Sub--------------------------
|SourceA: F58:30 |
|SourceB: F58:31 |
|Dest: F58:55 |
|---------------------|
| |
|-------DIV-----------|
|SourceA: 100 |
|SourceB: F58:55 |
|Dest F58:56 |
|---------------------|
| |
|-------MUL-----------|
|SourceA: F58:56 |
|SourceB: 10,000 |
|Dest N99:0 |
|---------------------|
| |
|------SCL------------|
|SourceA: I:1.0 |
|rate(/10000): N99:0 |
|Offset 0 |
|Dest N99:1 |
|---------------------|
| math |
| error reset |
| S:5/0 |
|-------( / )---------|

The problem I'm seeing revolves around, I believe, the floating point to integer coversion value.
the SCP instruction isn't available in the 1500 although I think this should work just fine.
I'm getting incorrect values in my N99:1.
I'm looking to scale between 0 and 100
Where am I going wrong?
 
Last edited:
The SCP instruction is available in the ML1500 under the advanced math tab


SCP1.jpg
 
Thanks for the reply. I did try the SCP last night and it gave an error saying not supported on versions of 1500 RevC4.5 or lower or something to that effect.
Hmm. I'll give it a try. Still, I wonder why my simple SCL doesn't work.
 
Post your .rss file or give us the numbers that are in the floating points and integer files
 
Thanks Mickey. Ok found the problem. I was trying to use Floating points instead of integers and SCP doesn't take floaters in a 1500.
This is what I changed to.
MOV F58;30 n99;2
MOV f58:31 n99;3
SCP I:1.0 N99;2 n99;3 0 100 n99;1
at last run the values are:
f58:30= 10010.41
f58:31= 9894.794
I:1.0 = 11844 (value at rest is off the charts as it should be) I'm looking to hit I;1.0 at around 9952 for a median value at weld position.

If you cut and paste those lines into an instruction on RSL500 you should see the code.

I can't upload anything from our fabulous computer system here at work. In fact, our computer system is so secure it takes me 15 minutes just to boot up and go online with a PLC. Sure we may lose millions a year in downtime while waiting to get connected and booted up when problems occur but at least no on will be playing pac-man.
 
Last edited:
If I read your original post correct, you would have the following numbers in the system.

F58:30 = 8020
F58:31 = 7980
F58:55 = 40
F58:56 = 2.5
N99:0 = 25000

If we plug these numbers into the formula used by the SCL function {(input value x rate) + offset} we get the following.

(I:1.0 x 25000/10000) + 0

If we see an input of 8000, then we would get 20000 in the output of the SCL. For your application, you will want to subtract F58:31 (Low LDT) from I:1.0 and use this number as the source for the SCL funtion. For the same input of 8000, we would now get 50. I think that this is what you are looking for.
 
Wow, Your exactley correct JP. I had the F58 31 and 30 backwards producing a scaled negative number so I swapped and plugged them in as stated. I produced an almost valid signal that unfortunatley doesn't work because I had a zero offset. My graph operates in reverse, decending instead of ascending but thats ok. The problem I now see is that my graph bottoms out(tops out?) at the 10000 max value. I believe you are correct in that by shifting my input value I'll lower my counts allowing me to hit dead nuts in the center on full compression.
So lets change it up a bit.
SUB i;1.0 n99;3 n99;0
MOV F58;31 n99;2
MOV f58:30 n99;3
SCP n99;0 N99;2 n99;3 0 100 n99;1
at last run the values are:
f58:30= 10010.41
f58:31= 9894.794
I'll try that out after a spot of lunch.
thanks again.
-scott
 

Similar Topics

Hello, I have a micrologix 1400 and am using a scale instruction to control my analog output. This is working fine but now I need to reverse the...
Replies
3
Views
1,417
the scale occasionally stops working and displays the message "no response from modbus" on the control screen . tunaylar - load line2
Replies
2
Views
143
Hi! I'm wondering if PLCs are used for small-scale production. I've got four machines doing different things with textiles, and I'm exploring the...
Replies
16
Views
1,354
I am having an issue writing a carriage return to my scale, I can manually push the print button the the scale and then read the buffer. The scale...
Replies
4
Views
1,125
Good afternoon. 1794-ie12 module available, channel set to 4...20 mA. According to the table from the manual, we get from 0 at 4mA to 30840 at...
Replies
5
Views
2,272
Back
Top Bottom