peterservo

MrPLC Member
  • Content count

    4
  • Joined

  • Last visited

Community Reputation

1 Neutral

About peterservo

  • Rank
    Hi, I am New!

Profile Information

  • Country United States
  1. WonderWare Intouch and DASABCIP

    Wow.. I too have spent the better part of a day reading through WW manuals and came up in the same boat as the original poster! Having heard nothing but good things about WW, this is my first use of it. Thanks much for the "cut to the chase" answer. Works like a charm!
  2. Yes, after thinking about this again, I have now gotten it to the point where, if the number of active probes is odd, I pick out the middle element of the sorted array. If it's even, I add the 2 "middle" elements of the array and divide by 2 to get the Median. I am still struggling on how to remove un-active probes correctly though. As i mentioned, the SRT seems to treat the array as a FIFO. I am going to try using FFU/FFL to populate the array to see if that helps. Thanks for your help.
  3. Thanks for the reply, but unless I'm mistaken, the Length parameter of the SRT instruction won't allow anything but an Immediate value (no variables or expressions).
  4. Hello, I have searched this, and other online resources, for a way to do what I am attempting to do, but I have yet to find the solution to my problem. To begin, I am using a CompactLogix platform with Logix5000 software. I have a machine on which an operator can enable or disable the output of a probe using a toggle button on a Panelview. There are a total of 30 probes. If the operator enables a probe, I load it's analog value into an array. I will call the array "array_1" for sake of example. Array_1 has 30 elements and is formatted for the REAL datatype. For example, if the operator enables probe #1, I use a MOV instruction to put it's output into array_1[0]. If Probe 12 is enabled, it's value goes into array_1[11] etc... If a probe is disabled, I use a MOV instruction to move 0.0 into it's array placeholder. In another portion of the program, I use a NEQ instruction to scan each of the elements of array_1 for a non-zero value. If a given element is not equal to zero (it's enabled), then I use another MOV instruction to move that array_1 element into another array( "temp") and I increment a manual counter using an ADD instruction. I use an EQU instruction to scan the array_1 array for zero values. If a probe has been disabled, I use a MOV instruction to move 0.0 into my temp array, and I decrement my counter using a SUB instruction. The purpose of my counter is so that I can keep track of how many active probes there are. I use the value of this counter ("active_probes") as a pointer in my "temp" array. For example, if a probe is enabled, I move it's value into temp[active_probes] and now my active_probes counter=1. If another is activated, I store it into temp[active_probes], which is now equal to 2. This all works well. My problem is in coming up with a Median value for the temp array. In order to determine Median, I need to sort the temp array in ascending order. I have tried using the SRT, and it does work, but it acts like a FIFO. That is, I can't put a zero value into an inactive probe array and thereby disable it. If I have 2 probes active, the use of SRT puts my first active probe into element 29, then the next will shift 29 to 28 etc.. My temp array then contains 0.0 in elements 0-27, then my active probe readings (in ascending order). Sorry for being long winded, but if anyone has a better (working) way of finding the Median value, I would very much appreciate it.