storing highest and lowest values

dbh6

Lifetime Supporting Member
Join Date
Jan 2013
Location
Central, NJ
Posts
552
PLC is a SLC 5/04

I can one write logic to see how high or how low a value got?

Example their is a 0-10v scaled signal coming into my analog input
card the signal is fluctuating way to fast for me to use the values in my code. I know that you can use a first order filter to filter the value but that is not what im trying to do. Im trying to write logic to see how high the value reached or how low that value reached, that way I can incorporate deadbands from the high and low values that I get to control other parts of my logic
 
Use a timer, when timer ticks first time saves incoming value to a known place A, next time timer ticks compare incoming value to value saved in A, if incoming value is less than value in A do nothing if greater than A then moved that value to A. This way A contains the max value. Do the same but opposite for min value, in this case use a new register call it B.
 
The easiest way I think would be to do a simple compare then move.

For instance:

Les (Your Value), (Tag 1) ------ Mov (Your Value), (Tag 1)

So everytime the value you are looking as gets lower than tag 1 it stores it in that tag. You might want to set up some limits so you dont go faulting the processor though.
 
Setup two registers. One, labled 'Highest' will be preset with the LOWEST possible value (zero maybe?). The other, labled 'Lowest', will be preset with the highest possible value.

On each pass through the program:

If Current < Lowest then set Lowest = Current
If Current > Highest then set Highest = Current

When finished your test period you will ahve your answers.
 

Similar Topics

HI all, I have a backup from a Series 7000 Cognex camera. I am trying to restore and see the vision tools used in the job. Can I restore those...
Replies
0
Views
68
Hello, I have an int variable that updates the value every second. I want to store the 100 values in an array. Array should keep storing the...
Replies
7
Views
1,000
Hi I have a vision camera that I’m getting the string data P908765 from the vision on an advance trigger .which im using a S -move. Then I put...
Replies
1
Views
374
Hello You guys helped me with a similar issue some time back on storing totalized values to different tags each month. I have a similar issue...
Replies
19
Views
1,493
Is there any easy way to store a password for an email address that is changeable on the HMI that is not easily deciphered. aka, don't write it to...
Replies
0
Views
381
Back
Top Bottom