RSLogix/Studio 5000 Capture/Track Previous Value

ohnedich6

Member
Join Date
Jun 2014
Location
Midlands SC
Posts
67
Good day all,

PLC: RSLogix/Studio 5000 using Ladder Logic

I've been toying around with the idea of capturing the previous value of a tag inside of my PLC, but I cannot seem to get started with the best way of coding this. I was hoping I could get some help with this.

I would like the tag Previous_Tag to be able to capture the value regardless whether the number increases or decreases. Also, the value may change in an inconsistent manner/pattern at times (I.E. 1 ->4, 4->11).

Thank you for your help.

-Nathan
 
Pretty Basic 101....

Initial Previous Tag to Current Tag on startup (MOV Current Tag Previous Tag)

Then standard logic

If Current Tag <> Previous Tag, MOV Current Tag Previous Tag
 
If you have the following parameters:
TAG
THIS_TAG
PREVIOUS_TAG
Compare TAG to THIS_TAG if not equal then using a one shot Move THIS_TAG to PREVIOUS_TAG and TAG to THIS_TAG

Hope this helps.
Regards,
 
Is the Tag you want to look at a input value? If so are you buffering your I/O?

Remember that the 5000 family of controllers update their inputs Asynchronous to the controller scan. So the controller could update a input value before you get to your MOV Logic and you may not actually capture the true previous state.
 
Is the Tag you want to look at a input value? If so are you buffering your I/O?

Remember that the 5000 family of controllers update their inputs Asynchronous to the controller scan. So the controller could update a input value before you get to your MOV Logic and you may not actually capture the true previous state.

Bullzi,

Its a memory tag which will eventually be used inside of an AOI.

-Nathan
 
robertmee,

I use the NEQ and MOV to determine if a transmitter's reading has frozen, but for this logic it is performing so fast that by the time I can look at the PREVIOUS_TAG it is already equal to the TAG & THIS_TAG.

gclshortt,

Thanks for the suggestion, but all of the values end up being equal to TAG almost instantly.

-Nathan
 
All,

Scratch the second part of my previous post with regards to gclshortt. I had a destructive rung of logic that I did not notice *face palm*. Once I deleted that it worked beautifully.

Thanks very much for you help.

-Nathan
 

Similar Topics

So, I have a little dillemma I am trying to work through but I feel there is probably a better way. I've always liked the idea of using a VM in...
Replies
5
Views
2,055
I have a micrologix 1100 that I am trying to read three data points from it on my safety plc using studio 5000. Any tips or guidance is appreciated.
Replies
4
Views
849
Dear Sir, We have Windows 10 Dell laptop with RSlogix Studio 5000 installed in it. Now we have purchased a ex-proof laptop with Windows 10 and...
Replies
2
Views
2,621
How can I achieve the same functionality in Studio 5000? Image 001.png for the old RSLogix500 program Image 002.png for conversion to Studio...
Replies
6
Views
2,527
Hello all, I am working on a project on a CompactLogix L16ER-BB1B plc, and I was given a program that is on version 20.019, while my plc is on...
Replies
3
Views
1,848
Back
Top Bottom