Is it possible to store Previous status of a Tag?

Ish_Yad

Member
Join Date
Jun 2016
Location
Wuppertal
Posts
9
Hello All,

I need to know if it is possible to retrieve the previous status of a tag and store that in a new tag.

Eg: Switch ON -> Motor ON
Switch OFF -> Motor OFF
/*Here ´Motor´ and ´Switch´ are the Tag_names*/
Is it possible to store the previous status of ´Motor´ in a temporary Tag ´Motor_Old´ and use it for another sequence in the program? If yes, how can I do so?? Is it done By making ´Motor_Old´ as the Alias Tag for ´Motor´???

To make it more clear, something like a Memory from where I can retrieve the previous status of tag ´Motor´!

Regards,
Yad
 
Last edited:
Just before executing the Motor command do:

Motor -> Motor_Old

And use the contents of Motor_Old for one scan. Why only one scan? Because the value in Motor_Old will be overwritten on the next scan.

Motor_Old would be its own tag, not an alias to 'Motor'
 
Hello Mr. Carlton,

Thanks for the quick reply, but I am unable to understand. Can you brief it a little more?
What do you mean by, Motor -> Motor_Old ??
How can I program for using the content of Motor_Old for One Scan?? I´m using FBD language.
Sorry for too many questions, Im a beginner in PLC programming
 
If it's a binary bit then the previous state would be the opposite of the present state. [On=Off; Off=On]

If you are talking about an integer or real value then you can write that value to another integer/real number just before you change it, then you can go back to it if you want.
 
Dear Mr. Carlton,

Sorry to reopen the thread after a month.
Do you mean to say the following, i.e When Motor ON , Motor_Old also ON; then execute the Motor_Old Tag just for One Scan, totally understandable! But, How do I execute the Motor_Old tag just for 'One scan' using FBD or Lader Logic Programming?
Any Suggestions?

Thanks in Advance,
Yad
 
What plc are you using?
Most plc logic has "1 shot" logic functions....Like a coil with a "transition" contact, that energizes for one scan only on "coil on" or "coil off" or a "OS" bit (one shot) in AB logic command in the rung.

You may be able to do this without a 1 shot. IF I understood why you want to trap previous state of motor tag....Is this the motor "state" on switch off or "command" to motor on switch off?
Your logic request seems seems slightly odd. You will always trap motor_old as "1" if it the switch was on...because it appears you are only trapping "start command" to motor.
 
Last edited:
Hi Nathan,
I am using 1756 L63 AB PLC. I tried using 1 shot rise instruction but I still havnt got the required output. I want to attach the program but unable to do so.
 
Ish_Yad, as Nathan said, your request seems odd, if you tell us what the total end result of the program is we may be able to help you better.

It doesn't make sense to store the previous value of a binary tag in a seperate variable.

Are you trying to count how many times the motor is turned on and off?
Are you trying to make a toggle button, so when you press the button it will turn on if it was off and visa versa?
 
No, it's not possible, only current values can be stored, once stored previous values can be recalled though.
👨🏻‍🏫
 

Similar Topics

I am using the RecipePlus Selector and RecipePlus Table. I find that if I Restore a recipe, the values appear in the Recipe column of the Recipe...
Replies
1
Views
2,115
Now that my program to save the maximum values of my analog inputs is actually working, we come to the next problem - how to access the data for...
Replies
15
Views
9,285
Hello All, I need the ability to remotely reboot a Red Lion CR3000 HMI. Due to some graphics issues when the database is updated the HMI must be...
Replies
4
Views
218
Hello The plant is running and there is no shutdown nowadays therefore I can add 1734- AENTR and its card while PLC is in Run? I do not wanna...
Replies
8
Views
344
Folks, I have a client with an old ABB Advant / MOD300 system (v14.4). Around y2k I installed the ABB Industrial IT MOD300 OPC Server 1.1/2...
Replies
1
Views
178
Back
Top Bottom