Forums.MrPLC.com: OTE command in RXLogix 500 - Forums.MrPLC.com

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

OTE command in RXLogix 500 new bie question of OTE Rate Topic: -----

#1
User is offline   mikey431 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 78
  • Joined: 11-September 05
I just start to learn PLC programming and ladder logic is pretty new to me. Here is my question.
If a bit that is energized by OTE command under true input condition, does it still retain the value when the input condition is no longer true ? if it does indeed retain it value, does it retain value when the program terminates assuming the input conditions will never true again?
If it does not, is there any way we can do implementing the idea of a output bit will retain its value until the input condition is true again and change that outout bit? Hope this makes sense.
Im using Rslogix 500.
Thank y'all.
0

#2
User is offline   OkiePC 

  • Boat Rocker/Trouble Breaker
  • PipPipPipPipPip
  • Group: MrPLC Member
  • Posts: 934
  • Joined: 25-April 05
  • Gender:Male
  • Location:Oklahoma
  • Interests:Kids, Outdoors, Animals, Sports, Science, Math, Music, Puzzles, Video Games, Food, Watersports, Paintball, Jeeps, Pit Bulldogs, Chevy, OU Football, Hiking, Piddling, more ...
  • Country:United States
    United States
Think of an OTE instruction as a relay coil. When energized (true input logic), it writes a one to the address. When de-energized (false input logic) it writes a 0 to the address. If you want to retain the value of a bit address, you can use OTL and OTU to write 1 or 0 to the same address. OTL (output latch) will write a one to the address when true, and do nothing when false. OTU (output unlatch) will write a zero to the address when scanned true and do nothing when false. Addresses that are only updated by OTL and OTU instructions will retain their state even after power is cycled to the allen-bradley PLC.

This post has been edited by OkiePC: 13 September 2005 - 10:19 AM

0

#3
User is offline   TConnolly 

  • Guru
  • PipPipPipPipPip
  • Group: MrPLC Member
  • Posts: 934
  • Joined: 06-May 05
  • Gender:Male
  • Location:Salt Lake City
  • Country:United States
    United States
The OTE insturuction turns on the bit when the rung is true, it turns it off when the rung is false.

The next question is a bit more complicated.
If the program terminates, the bit will remain set in memory - because the program is not running or doing anyting to reset it. If you put the processor in program mode and observed the state of the bit, it will remain in what ever state it was in when the program ended..

However, as soon as you put the processor back in run mode, it will perform a pre-scan and it will reset the bit on the OTE instruction. Then on subsequent program scans it will again set/clear the bit according to the rung condition.

To turn a bit on and have it remain on even if the rung goes false or even when the program terminates and restarts, use the OTL (latch) instruction. When you use the OTL intstruction, you also use an OTU (unlatch) instruction to clear the bit when the rung conditions are true.

There is also a first scan bit (Bit S:1/15 in a SLC/MicroLogix) that is true for only the first scan of a program. You can use this bit to reset any unwanted latched bits.

In some PLCs latch and unlatch instructions must be programmed to certian addresses in order to be retentive through a power off-power on cycle. In the AB PLC this is not the case, but you should be aware of it for when you do encounter other PLCs.

Expand and zoon the attached image to see an example with explanations.

Attached thumbnail(s)

  • Attached Image: oteotlotu.JPG

This post has been edited by Alaric: 13 September 2005 - 10:46 AM


0

#4
User is offline   Spedley 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 147
  • Joined: 16-December 04
  • Location:Warwickshire, England
  • Country:United Kingdom
    United Kingdom
If you are familiar with 'normal' programming it may be easier to think of ladder logic that way.

for example with OTE:
XIC SW1 XIC SW2 OTE M1

is actually:
if (SW1 and SW2)=1 then
  M1=1
else
  M1=0
endif


and another with OTL:
XIC SW1 XIC SW2 OTL M1

is actually:
if (SW1 and SW2)=1 then
  M1=1
endif


and another with OTU:
XIC SW1 XIC SW2 OTU M1

is actually:
if (SW1 and SW2)=1 then
  M1=0
endif


The whole program runs from start to finish with each scan which is somewhat different to 'normal' programming but as you can see if the above bits of code don't get run (i.e a subroutine that isn't called) then the they don't change.

There is nothing special about Ladder Logic, it's just often easier to understand than 10 lines of 'if', 'and', 'or' etc. It is just a normal computer with a normal program.
0

#5
User is offline   mikey431 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 78
  • Joined: 11-September 05
I do have 'normal' programming background and to me ladder logic programming is similiar but not the same.Thank you all. I love this forum already !!!
0

#6
User is offline   mikey431 

  • Sparky
  • PipPipPip
  • Group: MrPLC Member
  • Posts: 78
  • Joined: 11-September 05

Alaric, on Sep 13 2005, 10:23 AM, said:

The OTE insturuction turns on the bit when the rung is true, it turns it off when the rung is false.

The next question is a bit more complicated.
If the program terminates, the bit will remain set in memory - because the program is not running or doing anyting to reset it.  If you put the processor in program mode and observed the state of the bit, it will remain in what ever state it was in when the program ended..

However, as soon as you put the processor back in run mode, it will perform a pre-scan and it will reset the bit on the OTE instruction.  Then on subsequent program scans it will again set/clear the bit according to the rung condition.

To turn a bit on and have it remain on even if the rung goes false or even when the program terminates and restarts, use the OTL (latch) instruction.  When you use the OTL intstruction, you also use an OTU (unlatch) instruction to clear the bit when the rung conditions are true.

There is also a first scan bit  (Bit S:1/15 in a SLC/MicroLogix) that is true for only the first scan of a program.  You can use this bit to reset any unwanted latched bits.

In some PLCs latch and unlatch instructions must be programmed to certian addresses in order to be retentive through a power off-power on cycle.  In the AB PLC this is not the case, but you should be aware of it for when you do encounter other PLCs.

Expand and zoon the attached image to see an example with explanations.

in the attachment image, first example, did u use 2 buttons for stop and start or use 1 button for both? I'm confused because you said " As soon as the start button is pressed and the rung becomes false",if it is true then why we need the "pump stop button" XIO condition ?

In the last example , as far as i understand the "First Pass" should turn on the fan on first scan since that's whole purpose of using it ? Is there any tricky stuff here that I dont understand?
Thanks

0

#7
User is offline   TConnolly 

  • Guru
  • PipPipPipPipPip
  • Group: MrPLC Member
  • Posts: 934
  • Joined: 06-May 05
  • Gender:Male
  • Location:Salt Lake City
  • Country:United States
    United States
Sorry, that should read "As soon as the STOP button is pressed"
:grad: .

Think of a motor control circuit with momentary start/stop button. Pressing the start button energizes the relay. The relay closes, and one of the contacts on the relay is wired around the start button to hold the relay on after the button is released. The relay holds itself on through this contact until power flow to the coil is interrupted by pressing the stop button, which is wired to interrupt the power flow when pressed. This is standard control wiring on magnetic contactors - the advantage being that it will turn off when power is interrupted, and stay off, until it is intentionally restarted. The software mimics that function.


The last rung just shows another way you might do the rung before it. Both of those rungs turn the fan offl, the OTU instruction sets the bit to 0. For example, if you had a piece of equipment that you wanted to start back up automatically after a power failure, but only if it was running when power failed, such as a ventillation fan, then you would use the OTL and OTU instruction pair shown in the two rungs before the last rung. If however, you wanted it to not start after a power failure, but had programmed it whith OTL/OTU, then you have to put in the first pass on the OTU to turn the bit OFF on power up. - Ignore the comment on the next to the last rung. RSLogix puts in the same comment on all rungs with the same output address - since its on the last rung, its also on the next to the last rung (unless you change the comment default setting, which I did not do).

0

#8
User is offline   TConnolly 

  • Guru
  • PipPipPipPipPip
  • Group: MrPLC Member
  • Posts: 934
  • Joined: 06-May 05
  • Gender:Male
  • Location:Salt Lake City
  • Country:United States
    United States

mikey431, on Sep 13 2005, 09:55 AM, said:

is there any way we can do implementing the idea of a output bit will retain its value until the input condition is true again and change that outout bit? Hope this makes sense.

I think that what you are asking for here is the logic for what is called a flip-flop.

I have a reading lamp on my bedstand at home where if you touch the base the lamp turns on. Remove a hand, then touch the base again and it turns off. Inside the lamp is a chip that has a flip-flop on it, which is an arrangement of four logic gates cross connected in such a way that an input turns on the lamp. Remove the input, and the gates set themselves so that next time the input comes on, the lamp will go off.

Look at the attached image. The logic is arranged so that instead of looking at the state of the input, we look at the rising edge of the input to create a pulse called a one-shot. The one-shot (B255/2) is true for only a single scan of the PLC. To make it true again for another single scan, the input bit has to turn off, and then turn on again. The one shot will change the state of B255/3 in the next rung: if it iss off it will turn it on, or, if it is on it will turn it off.

I := NOT I

However, the AB PLC has a handy instruction that can be used for the same purpose. The instruction is the CTU counter instruction. The counter builds in a one-shot so that it only upcounts on false to true rung transtions. In binary numbers, the least significant bit of an even number is 0, while for an odd number it is a 1. So everytime we increment a number, the least significant bit changes state. So if I program the following two rungs:

XIC BUTTON CTU C5:0 0 0
XIC C5:0.ACC/0 OTE O:0/0

Then when I press the BUTTON the first time, the counter increments to 1, setting the least signifanct bit of the counter accumulator. This bit turns on the output. Now if I press the BUTTON again, the counter increments to 2, clearning the least significant bit of the counter accumulator, and turning off the output. We dont' need to concern ourselves with the actual value of the counter accumulator, or or even with counter roll over (thats the beaurty of 2s compliment binary numbers). Since we dont care what the state of the timer DN bit is, I programmed a PREset of 0.

If we want to make sure that when the PLC powers up, the output will always be off use the First pass bit to reset the counter.
XIC S:1/15 RES C5:0

Is that what you were asking?

Attached image(s)

  • Attached Image: post-1-1126887817.gif

This post has been edited by Alaric: 16 September 2005 - 11:52 AM


0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users