Delaying an input without changing duration in Studio 5000

CapinWinky

Member
Join Date
Aug 2011
Location
Virginia
Posts
566
I'm trying to take an input signal (boolean, not analog), delay it for a configurable amount of time, then output it via an AOI using as little computing power and memory as possible. The output must look just like the input, just delayed (catch all rising and falling edges and get the duration right).

I'm thinking about recording the On/Off wallclock time in a ring buffer, which will use a lot less memory than just recording the value every scan, but since I'm not terribly familiar with AB, I thought there might be some special way to do this that is easier.
 
Simples - use a bit-shift register that is clocked at a fixed timebase (use a periodic task), feed your input into the bit array, and feed out at any position (time delay) you want, depending on the configuration of your periodic task. No need to use timers, or the processors clock....
 
can't rely on cycle time, I'm making an AOI. I ended up using a pair of one shots to record the wallclock time at rising edge plus the delay for turning on in one buffer and turning off in another. If the time in my current ring buffer position is equal to or greater than the current time, I turn on/off and advance the ring buffer read index.

It's working pretty well and if you use the CurrentTime it is pretty light on computing resources. The only issue I've been having is trying to save memory by using a DINT instead of LINT to record the time. I decided it wasn't worth it and used the LINT.
 

Similar Topics

Hello, I am written a POU controlled by task that runs every 30 seconds. What I want is that task should be delayed by 15 sec before its first...
Replies
3
Views
1,418
Hello there, newbie here. Fresh to PLC's, starting with some ladder logic, about to buy your books 📚 And as all newbies starting with a...
Replies
34
Views
11,721
Does anyone know if there is a way to delay a ML1500 from going into run mode throu programming. Thomas
Replies
8
Views
2,127
Hi, I have a ControlLogix system with 1756-IF16 analogue inputs. I can't scale the inputs at the card as there is a requirement to facilitate...
Replies
2
Views
77
I'm having trouble calming down 2 Tempo Sonics. I'm using Studio 5000 CompactLogix my Raw value is jumping around from 8575.0 to 8755.0 at a...
Replies
30
Views
1,068
Back
Top Bottom