Moving Median in Ladder code

hanziou

Member
Join Date
May 2005
Posts
111
Do anyone have a simple way to calculate a "moving median" value? Or am I stuck maintaining a FIFO array, sorting that and then picking from the sorted array.

Can anyone suggest an efficient sort routine?

I work with DirectSoft4 and am starting in RSLogix5k (Ladder editing only).

( I am looking for a filter for spikes in analog data. We are also looking at greater signal conditioning, but we still seem to need a 'software' filter.)
 
This is the way I always do:


F10:0 = your analog input
F10:1 = averaged value

Use CPT instruction

F10:1 = (F10:0 + (F10:1 * 100)/101)

In this example you average on 100 scans.
Simple and easy

Ragrads

Antoine.
 

Similar Topics

I'm a Siemens person, and this is one of my first AB programs. The customer wants everything programmed in Ladder. I have a lot of data (3...
Replies
14
Views
217
Hello, I have a compact Logix plc and I have been task with configuring alarms into our SCADA when an Analog signal stops moving. The analog...
Replies
6
Views
241
Hello, i am a beginner with a Siemens Logo 8 PLC. I would determine the direction of an object if it passes a whole cycle of 2 input sensors. See...
Replies
2
Views
183
Can an AOP be removed from Logix? I seem to have some version weirdness from an E&H AOP and I need to see if reinstalling the AOP will correct it.
Replies
5
Views
973
I'm making a meal of this, my brain's not in gear. Also, I'm new to S7 TIA/WinCC so excuse my ignorance... See redacted pic. Pressing F7 (SAVE...
Replies
10
Views
3,219
Back
Top Bottom