Store Peak value of the fluctuating Analog Input

fahd.naeem1

Member
Join Date
Mar 2017
Location
Lahore
Posts
8
I am currently working on a project Motor test bench for PLC Control.. I am trying to measure current using Hall effect sensor.
As I want to store the peak value of the current but the register value keeps on changing.
I have tried to use greater than commands to get the maximum peak value but the code became very very long as value fluctuates between 2k and 4k.
Any solution?

P.S: I am using a FATEK PLC FBS-20MC and using AI Card FBS-2A4TC.
 
It shouldn't be a lot of code.
If Current_Value > Peak_Value MOVE Current_Value TO Peak_Value

That's it.
To reset the Peak_Value, just MOVE 0 to Peak_Value

One, two lines at most in just about any processor.
 
No I am getting peak value from analog input(hall effect sensor)

I feel like Abbott and Costello's "Who's on First".....

You're confusing terminology....You're using Peak Value where we are using Current Value. Let's change it...You have Peak Value (Analog Input) and you want the Highest Value.

So just as rdrast stated,

"If Peak_Value > Highest_Value MOVE Peak_Value TO Highest_Value"
 
Peak Value (Analog Input) changes every time..
I want to make a program that stores that peak value in a register.

P.S: Analog Input value keeps on fluctuating between some values
 
I'm expect the OP's native language is not English. To most of us. "peak value" means the highest value recorded over some time interval. If your definition of "peak value' differs, please advise.
In RDRast's sample code, "Current_Value" is the name given to the analog input channel and "Peak_Value" is the name given to the variable that will hold the maximum observed value. To capture the peak value, at the beginning of the interval over which you want to monitor, move a value of zero to the variable, "Peak_Value". Over the monitoring interval, in any PLC scan where the value in "Current_Value" exceeds the value in "Peak_Value", the value in "Current_Value" will be copied to "Peak_Value. If necessary, create a Boolean tag that is true during the monitoring period and use its true state as a permissive for the MOV instruction.
 
As post #11 indicates, maybe there is something getting lost in translation. Now I can read the question as how to buffer a stream of data after some triggering event. It would take a lot of code if there was a rung with a MOV instruction for each value to be saved.
If this is the case, a single rung using array indexing or indirect addressing with a sample counter would be a better approach for saving multiple, successive values from a data stream such as from an Analog Input.
Is this what is needed: Saving all values from the analog input during some time period, not just the largest value?
 
I am sorry English is not my native language.
Yes that is the case here Mispeld..
I had to use many rungs with a MOV instruction.
 
Fahd

So you need to save the analog values to an array correct? You also need to save the highest value of that array seperately?
How many array values do you want to save and at what rate do you want to save them? What criteria if any do you want to evaluate to determine if you should save a value?

If you just save the value to an array every scan, the array will fill up very quickly.
 

Similar Topics

I'm running into a problem when trying to use the RSLinx Backup Restore Utility where it throws an error when it tries to restore a backup. The...
Replies
6
Views
575
Hi y'all I have a KTP400 connected to a s7-1200. Now i have on my screen the encoder value which comes from my SEW movitrac. under there I have...
Replies
2
Views
387
This was asked in another forum and taken down due to being a 'backdoor', but this has useful info that might be useful to someone in a pinch. I'm...
Replies
6
Views
610
Hello all, I'm using a 5069-L330ER in a project and I need to essentially capture some data that will be shown as a trend on a screen. The data...
Replies
9
Views
966
Hi all, I am working with an IO link sensor (measuring current across motor)and need to read in and store the sensor values for 5 seconds, then...
Replies
13
Views
1,215
Back
Top Bottom