AB Compactlogix programming

vova_m

Member
Join Date
Apr 2023
Location
Atlanta
Posts
2
Hi All,
Does anyone knows what is that piece of logic could be used for?
(working on the conversion of this logic to function blocks diagram)
Thanks!

1.png 2.png
 
does anyone know what it is used for? probably not.

does anyone know what it does? of course. It samples the value of 16-bit signed integer N12:14 once an hour (or some other period) over up to 20 hours (periods). Perhaps those values are used for a trend, or for recent history, or for an average.

TL;DR

The typical operation (Rungs 0002-0005) is that once every [N26:22] seconds (repeating timer on Rung 0002),

  • It loads (Rung 0004) the value of N12:14 onto the top of a FIFO array, which can hold up to 20 elements
  • If that FIFO has already had 20 elements loaded onto it, then it unloads (Rung 0003) the value at the bottom (N26:1) into N26:21. I suspect N26:21 has no significance, but the FFU command needs a destination.
  • It calculates (Rung 0005) the amount of time, in seconds, represented by the number of sampled elements in the FIFO, assuming all samples were acquired using the same sampling period in N26:22/T4:5.PRE, and puts the result in N26:23. With the value of N6:22 shown (3600) and the number of elements in the FIFO (R6:1.POS = 20), this calculation would yield 72000s, which causes a minor fault by overflowing the capacity of 16-bit signed integer N26:23, so the maximum possible value of 32767 is placed in N26:23 instead, and the Overflow Trap bit (S:5/0) is reset to a value of 0 so the minor fault (overflow) does not get promoted to a major fault at the end of the scan cycle, which would cause the PLC program to halt. Note that the 32767 result implies that the Math Overflow Selection status bit S:2/14 is 0 (cf. here).
The atypical operation, Rung 0001, occurs when N26:22, the sampling period changes. In that case

  • the timer has the new period stored in its preset,
  • the timer is effectively reset,
  • a value of 0 is loaded onto the FIFO array,
  • and a value is removed if the FIFO is already full.
We have not addressed when this subroutine executes:

  • is it called during the continuous scan cycle?
  • is it called from an STI Function?
  • is is called unconditionally?
Welcome to the forum!
 
Last edited:

Similar Topics

Hello. Was just curious, if it is possible to load an image from an SD card on to a Compactlogix PLC that came straight out of the box brand new...
Replies
4
Views
551
Hello Gents, I am currently using AB CompactLogix Processor L36 ERM (Mid Range Controller) in an application. One of the device on the network is...
Replies
4
Views
5,532
We just replaced a SLC5/05 processor with a CompactLogix and are wondering if there is a way to create a "data file" in the compact logix that can...
Replies
3
Views
2,471
I am trying to run an adaptation of a lathe, it's more like a winder, with a compactlogix. I have the motion axis moves working the way I want...
Replies
2
Views
2,759
I am trying to connect to a 1769-L18-ERM-BB1B CompactLogix motion controller. I will be attaching a panelview plus 600 and 2 kinetix drives with...
Replies
31
Views
9,438
Back
Top Bottom