The following is a snapshot of what your array will look like in the controller tag database: Image by Brandon Cooper Conclusion: Depending on what you are trying to accomplish, you may only need a sample every ten seconds, or you may need a sample every fifty milliseconds
#RSLOGIX 500 PROGRAMMING EXAMPLES CODE#
Increase or decrease the timer preset to have faster or slower sampling: In this example I've adjusted the TIMER_LAB.PRESET to five hundred milliseconds, which results in the code sampling and store the signal value twice a second.Make the array larger: Instead of only 16 stored data points as in this example, your array could be 50 points or more.(- ed.) NOTES: Adjustments for sampling options: This value is typically set initially to 0. Position – The offset into the selected array which the instruction is accessing. In some situations you may only want or need to Average a part of the array, but it's more common to Average all of the stored variables. Length – The length of the array to AVERAGE. The AVG instruction needs to have its own dedicated CONTROL tag. Consider this a “MOV” block inside the AVG instruction.Ĭontrol – This will be a CONTROL data type similar to the one used in the FFL and FFU instructions, but can not be the same tag as the FFL and FFU instructions. This parameter allows users with multi-dimensional arrays to select the dimension in the array to use (- ed.)ĭestination – Where to place the Result of the Average Instruction. To Vary – The array's Dimension to use (0, 1, 2) With the FFL and FFU covered, the next step is to use the AVG instruction to average the values we've collected and stored in our array, and below I'll detail the AVE's parameters:Īrray – The Array which hold the values you wish to calculate an Average ofĭem. I chose a tag called “Trash” because I don’t need the variable once it has been unloaded.Ĭontrol – This can be any tag name and select “CONTROL” as the data type.Īs noted above, the corresponding “FFL” instruction must use the same tag in its “Control” parameter so that they operate simultaneously. In this example I'm using the same ACCArray with a DINT data type used above.ĭestination – The variable that is being “Unloaded” from the array will be moved to this destination. Position – Position to Load the Array FFU (FIFO Unload) Instruction Parameters:įIFO – The Array in which to Unload the variable. This is usually the same length as the Tag Array used in the FIFO parameter. Note that the corresponding “FFU” (FIFO Unload) instruction must use the same tag in its “Control” parameter so that they operate simultaneously. In this example I'm using ACCArray with a DINT data typeĬontrol – This can be any tag name with “CONTROL” as the data type.
![rslogix 500 programming examples rslogix 500 programming examples](https://i.ytimg.com/vi/V8TxYQ8mUpc/maxresdefault.jpg)
Generally, this would be a process variable like a weight scale, pH, or temperature.įIFO – The Array in which to store the signal or variable.
![rslogix 500 programming examples rslogix 500 programming examples](https://i.ytimg.com/vi/kHKrcvguUOY/maxresdefault.jpg)
Source – The signal or variable that you want to store in the array.
![rslogix 500 programming examples rslogix 500 programming examples](https://itfasr348.weebly.com/uploads/1/2/3/7/123757719/449931649.png)
We can accomplish this by using a Timer to trigger FFL and FFU instructions, and below I cover each of their parameters: Image by Brandon Cooper The first step is of the process is to record samples of your value or analog signal (level, temperature, pressure, etc) over a given amount of time. In today's article I'll walk you through setting the parameters of these instructions to do just that. These instructions are commonly used to store multiple records at a given sample rate, which then can be averaged. Time Base: The number of times of "Seconds", a Time Base 1.In a previous article regarding ControlLogix processor faults, I mentioned one of the ways a processor can be faulted was by causing an array to go out of bounds when using an FFL and FFU instruction.Timer: Number and Adress of Timer, the Block configuration is in the side and is called TIMER T4.TON T4:0 The Main block of Timer On Delay "TON" here we configure:.B3:0 Binary In others PLCs you may find as "FLAGS" - "M", are Contacts in a PLC that create better logic in the programmation.
![rslogix 500 programming examples rslogix 500 programming examples](https://bin95.com/indirectaddressing.gif)
I0.0 Start - I0.1 Stop Start and Stop as Digital Inputs, used in all control process.