add instruction question.

Greetings Jose.

I'm going to assume that since most of your questions have been about AB's SLC platform that this one is also about the SLC platform.

You would not use the RES instruction after an ADD instruction. The RES instruction is for use on timers and counters. There may be times however when you want to adjust the PREset of a counter or timer using an ADD instruction and then RESet the counter or timer. In this case that is how you would reset the counter or timer.


That said, there may very well be times when you might need to reset other things in the PLC after and ADD instruction. You could use the CLR instruction to reset any one of the words addressed in the ADD instruction to zero (this will be applicaiton dependent and most of the time unnecessary).

After an ADD it may be necessary to reset certain minor error bits. These bits are the overflow trap S:5/0, the overflow bit S:0/1. These bits indicate that the result of your ADD is greater than or less than what can be accurately represented in a 16 bit word. If this is a possibility you should check the bits right after you ADD and respond to the overflow with appropriate logic. And you need to clear the bits with an OTU insruction before an END statement is scanned or the processor will fault.

Thats a shotgun answer. A little more information on what you are trying to do will be helpful for getting a more precise answer.
 
Another shoot gun answer

If you are doing some addition and then need to clear the total, you can use the MOV instruction to move a zero to the register used in the ADD instruction.
 

Similar Topics

Okay I have an Add-on instruction used in 3 different ladders one of the tags (only in the add on's scope) is looking at an analog input card...
Replies
0
Views
2,517
I am new to AOIs, and do not have a processor handy to test my program. I have a couple of simple questions, which I have not been able to find an...
Replies
10
Views
10,169
Hi All, If I create a bool tag in the AOI local scope, will it still be latched on the next scan? Will it be latched during brief removal of...
Replies
5
Views
3,627
hey good afternoon ! I have a simple question, I need to import an Add on instruction to a controller that is in operation and cannot stop. Is it...
Replies
6
Views
301
please can someone help me how do i add status bits to the add on instruction in studio 5000 thank you
Replies
2
Views
1,481
Back
Top Bottom