Jump to content


Photo
- - - - -

MicroLogix 1 Button Latch Unlatch


  • Please log in to reply
35 replies to this topic

#1 mhowasso

mhowasso

    Sparky

  • MrPLC Member
  • PipPipPip
  • 287 posts
  • Gender:Male
  • Location:Owasso, Oklahoma
  • Country:United States
    United States

Posted 26 January 2012 - 05:30 PM

Hi All,

See attached program file.
I have a little problem with a MicroLogix 1500 (RSLogix 500).
I am Latching B3:5/8 by pressing input B9:0/8
I am Unlatching B3:5/8 by pressing input B3:5/10

It works very well using the two seperate inputs.
What I want to be able to do is press B9:0/8 to Latch B3:5/8.
And then press the same B9:0/8 again to Unlatch B3:5/8.

I have tried several things to try and do this but it either will not allow the latch
to work or the latch will work but it will not unlatch.

Any advice or edits would be appreciated.

Thanks

Attached Files

  • Attached File  TEST.RSS   36.5KB   171 downloads


#2 b_carlton

b_carlton

    User

  • MrPLC Member
  • PipPipPipPipPip
  • 964 posts
  • Gender:Male
  • Location:Yakima, Washington
  • Country:United States
    United States

Posted 26 January 2012 - 05:44 PM

Try this - its just a little more complicated than the standard flip-flop by the requirement of the Latch/Unlatch.

Attached Files


An output is a PLC's way of getting its inputs to change.

#3 mhowasso

mhowasso

    Sparky

  • MrPLC Member
  • PipPipPip
  • 287 posts
  • Gender:Male
  • Location:Owasso, Oklahoma
  • Country:United States
    United States

Posted 26 January 2012 - 05:47 PM

Thanks
I will check this out..!!! :-)

#4 mhowasso

mhowasso

    Sparky

  • MrPLC Member
  • PipPipPip
  • 287 posts
  • Gender:Male
  • Location:Owasso, Oklahoma
  • Country:United States
    United States

Posted 26 January 2012 - 05:54 PM

Mr. Carlton,

Is it safe to assume that in rung 0 that output B3:3/5 should be a Latched output..???

Thanks

#5 b_carlton

b_carlton

    User

  • MrPLC Member
  • PipPipPipPipPip
  • 964 posts
  • Gender:Male
  • Location:Yakima, Washington
  • Country:United States
    United States

Posted 26 January 2012 - 06:03 PM

No, it is not safe to assume this. There are times when an Unlatch can be used without a matching Latch. I use it to conditionally turn off the state of a bit for all code which follows.
An output is a PLC's way of getting its inputs to change.

#6 mhowasso

mhowasso

    Sparky

  • MrPLC Member
  • PipPipPip
  • 287 posts
  • Gender:Male
  • Location:Owasso, Oklahoma
  • Country:United States
    United States

Posted 26 January 2012 - 06:13 PM

Im glad I asked then. I have not seen this done before.

Thanks

#7 slcman

slcman

    Sparky

  • MrPLC Member
  • PipPipPip
  • 331 posts
  • Gender:Male
  • Country:Canada
    Canada

Posted 26 January 2012 - 07:18 PM

For do that, I use ote coil. First create a one shot with B9:0/8, for example B9:0/9. Then type this:
Bst xic B3:0/9 xio B3:5/8 nxb xio B3:0/9 xic B3:5/8 bnd ote B3:5/8
------------------------------------------------------------------------------------------------------------------------------------------------------------
SLCMAN

#8 b_carlton

b_carlton

    User

  • MrPLC Member
  • PipPipPipPipPip
  • 964 posts
  • Gender:Male
  • Location:Yakima, Washington
  • Country:United States
    United States

Posted 26 January 2012 - 10:44 PM

But he mentioned he wanted a latch. An OTE will not last through a power cycle. With a latch/unlatch the state on power down will still be there on power up.

It is possible he mentioned Latch/Unlatch in the generic sense but I took him at his word.

Edited by b_carlton, 26 January 2012 - 10:45 PM.

An output is a PLC's way of getting its inputs to change.

#9 mhowasso

mhowasso

    Sparky

  • MrPLC Member
  • PipPipPip
  • 287 posts
  • Gender:Male
  • Location:Owasso, Oklahoma
  • Country:United States
    United States

Posted 27 January 2012 - 09:59 AM

Yes, I need the output to Latch.

Mr. Carlton, I did what you showed and it did not work.

I would just like the one button B9:0/8 to Lock and Unlock my Axis.

B9:0/8 is the present "Lock PB".

B3:5/8 is the Output that Locks Z Axis

B3:4/7 is a "Message" bit I use on screen.

B3:3/5 is a flasher bit for the flashing the message.

B3:5/10 is the present "Unlock PB"

Thanks in advance for all your help.

Edited by mhowasso, 27 January 2012 - 10:04 AM.


#10 mhowasso

mhowasso

    Sparky

  • MrPLC Member
  • PipPipPip
  • 287 posts
  • Gender:Male
  • Location:Owasso, Oklahoma
  • Country:United States
    United States

Posted 27 January 2012 - 10:04 AM

Yes, I need the output to Latch.

Mr. Carlton, I did what you showed and it did not work.

I would just like the one button B9:0/8 to Lock and Unlock my Axis.

B9:0/8 is the present "Lock PB".

B3:5/8 is the Output that Locks Z Axis

B3:4/7 is a "Message" bit I use on screen.

B3:3/5 is a flasher bit for the flashing the message.

B3:5/10 is the present "Unlock PB"

Thanks in advance for all your help.

Attached Files



#11 mhowasso

mhowasso

    Sparky

  • MrPLC Member
  • PipPipPip
  • 287 posts
  • Gender:Male
  • Location:Owasso, Oklahoma
  • Country:United States
    United States

Posted 27 January 2012 - 10:11 AM

I also did what SLCMAN said to do and that did not work.

#12 b_carlton

b_carlton

    User

  • MrPLC Member
  • PipPipPipPipPip
  • 964 posts
  • Gender:Male
  • Location:Yakima, Washington
  • Country:United States
    United States

Posted 27 January 2012 - 10:16 AM

I cannot view or edit your program until Monday. Just replace the bits that you were using for something else with bits that are currently free. I used them, since they were unlabeled, in my post. I didn't want to make assumptions about other bits in your program. If they were used for something important other than in this latch/.unlatch function I couldn't tell.
An output is a PLC's way of getting its inputs to change.

#13 slcman

slcman

    Sparky

  • MrPLC Member
  • PipPipPip
  • 331 posts
  • Gender:Male
  • Country:Canada
    Canada

Posted 28 January 2012 - 10:59 AM

I also did what SLCMAN said to do and that did not work.


Because I forgot to use b9:0/8 for unlock axis. Here is something should work in LAD4, LAD3 is your original logic. I use b9:100/x for bit I added to your logic.

Attached Thumbnails

  • Capture.JPG

Attached Files


------------------------------------------------------------------------------------------------------------------------------------------------------------
SLCMAN

#14 b_carlton

b_carlton

    User

  • MrPLC Member
  • PipPipPipPipPip
  • 964 posts
  • Gender:Male
  • Location:Yakima, Washington
  • Country:United States
    United States

Posted 28 January 2012 - 11:05 AM

SLCMAN - what is the purpose of the NC of the pushbutton in the toggle rung? I believe that it will prevent the toggle from taking place.
An output is a PLC's way of getting its inputs to change.

#15 slcman

slcman

    Sparky

  • MrPLC Member
  • PipPipPip
  • 331 posts
  • Gender:Male
  • Country:Canada
    Canada

Posted 28 January 2012 - 11:14 AM

SLCMAN - what is the purpose of the NC of the pushbutton in the toggle rung? I believe that it will prevent the toggle from taking place.



When B3:5/8 if off, XIC B3:100/1 XIO B3:5/8 set B3:5/8
XIO B3:100/1 and XIC b3:5/8 maintain B3:5/8 ON until B3:100/1 was set again.

So NC pushbutton is used as reset function of this flip-flop
------------------------------------------------------------------------------------------------------------------------------------------------------------
SLCMAN

#16 mhowasso

mhowasso

    Sparky

  • MrPLC Member
  • PipPipPip
  • 287 posts
  • Gender:Male
  • Location:Owasso, Oklahoma
  • Country:United States
    United States

Posted 29 January 2012 - 09:29 AM

SLCMAN,

Im sorry but I can not get your version to work.

I have attached a file basically showing the two ways that have been discussed.

The first one is in in LAD3 and the one you show is in LAD4.

The first one works as described, but the second one does not work. (Maybe its something Im doing wrong)

Maybe you could modify LAD 4 so it does work. It might just be a simple edit.

If not, thats OK also.

Anyway,

Thanks for all the advice.

Attached Files



#17 slcman

slcman

    Sparky

  • MrPLC Member
  • PipPipPip
  • 331 posts
  • Gender:Male
  • Country:Canada
    Canada

Posted 29 January 2012 - 10:24 AM

Your start / stop PB must be used only in the OSR rung. the XIO in the red circle (see picture) is used as reset master, you can put there interlock, estop and so on. I put the logic in emulator, toggle input for simulate and I did a movies. Look in attachement, you'll see everthing work. The only thing I change is I:0/1 for B3:100/0 for the bit in the red circle.



Wish I help

Attached Thumbnails

  • Capture.JPG

Attached Files


------------------------------------------------------------------------------------------------------------------------------------------------------------
SLCMAN

#18 mhowasso

mhowasso

    Sparky

  • MrPLC Member
  • PipPipPip
  • 287 posts
  • Gender:Male
  • Location:Owasso, Oklahoma
  • Country:United States
    United States

Posted 29 January 2012 - 10:37 AM

Hi SLCMAN,

YES....This time it worked. :-2

Thanks so much for the quick reply..!!

Edited by mhowasso, 29 January 2012 - 10:37 AM.


#19 b_carlton

b_carlton

    User

  • MrPLC Member
  • PipPipPipPipPip
  • 964 posts
  • Gender:Male
  • Location:Yakima, Washington
  • Country:United States
    United States

Posted 29 January 2012 - 11:11 AM

SLCMAN - I had assumed your program section in post #13 wouldn't work as shown. I see you have changed it in your avi. Good work.It still doesn't use Latch/Unlatch so the output will be turned off by a power cycle. But maybe that's ok.

Edited by b_carlton, 29 January 2012 - 11:12 AM.

An output is a PLC's way of getting its inputs to change.

#20 slcman

slcman

    Sparky

  • MrPLC Member
  • PipPipPip
  • 331 posts
  • Gender:Male
  • Country:Canada
    Canada

Posted 29 January 2012 - 11:25 AM

SLCMAN - I had assumed your program section in post #13 wouldn't work as shown. I see you have changed it in your avi. Good work.It still doesn't use Latch/Unlatch so the output will be turned off by a power cycle. But maybe that's ok.



You're right I did a mistake in post #13....I would like to type B3:5/10 instead of B9:0/8 for keep the unlatch PB in the HMI.

The logic didn't use latch/unlatch but binary file are retentive so the logic will keep the same state between power cycle. I didn't understand why you say program will lost B3:1/1 state after a power cycle.
------------------------------------------------------------------------------------------------------------------------------------------------------------
SLCMAN

#21 b_carlton

b_carlton

    User

  • MrPLC Member
  • PipPipPipPipPip
  • 964 posts
  • Gender:Male
  • Location:Yakima, Washington
  • Country:United States
    United States

Posted 29 January 2012 - 01:26 PM

No - B3:1/1, because it is the target of an OTE, WILL be reset after a power cycle regardless of its state on power down. If it were the target of a Latch it would not. Try it on a actual system if you don't believe me. It is part of the 'pre-scan' function to go through all the rungs and apply their results to any outputs as if the rung had been evaluated as false. An OTE will be turned off. An OTL will not be affected.

Edited by b_carlton, 29 January 2012 - 02:38 PM.

An output is a PLC's way of getting its inputs to change.

#22 slcman

slcman

    Sparky

  • MrPLC Member
  • PipPipPip
  • 331 posts
  • Gender:Male
  • Country:Canada
    Canada

Posted 29 January 2012 - 05:01 PM

No - B3:1/1, because it is the target of an OTE, WILL be reset after a power cycle regardless of its state on power down. If it were the target of a Latch it would not. Try it on a actual system if you don't believe me. It is part of the 'pre-scan' function to go through all the rungs and apply their results to any outputs as if the rung had been evaluated as false. An OTE will be turned off. An OTL will not be affected.



Again you're right. I tought B3:1/1 will be ON until ote instruction will be scanned. I often use bit as config data or HMI (bit without coil instruction) and in that case, bit state is retain on power cycle. I never have to deal with this logic and power cycle, I can say I learn something today.


regards
------------------------------------------------------------------------------------------------------------------------------------------------------------
SLCMAN

#23 Shiner

Shiner

    Sparky

  • MrPLC Member
  • PipPipPip
  • 286 posts
  • Gender:Male
  • Location:Houston
  • Country:United States
    United States

Posted 30 January 2012 - 08:22 AM

Would this work for toggling based on a single input?

Attached Files



#24 mhowasso

mhowasso

    Sparky

  • MrPLC Member
  • PipPipPip
  • 287 posts
  • Gender:Male
  • Location:Owasso, Oklahoma
  • Country:United States
    United States

Posted 30 January 2012 - 12:25 PM

Shiner,

I tried this and it did not work. Dont really know all the reasons why not tho.

Looked good tho.. :no:

#25 mhowasso

mhowasso

    Sparky

  • MrPLC Member
  • PipPipPip
  • 287 posts
  • Gender:Male
  • Location:Owasso, Oklahoma
  • Country:United States
    United States

Posted 30 January 2012 - 12:31 PM

Mr. Carlton,

After all the replies, if you dont mind me asking, considering the power down/up issue and anything else,
just so Im clear, what is the "BEST" way of accomplishing this One Button Latch Unlatch issue.

I just want to use the best way from now on.

Thanks for everyones help.

#26 slcman

slcman

    Sparky

  • MrPLC Member
  • PipPipPip
  • 331 posts
  • Gender:Male
  • Country:Canada
    Canada

Posted 30 January 2012 - 09:02 PM

Shiner,

I tried this and it did not work. Dont really know all the reasons why not tho.

Looked good tho.. :no:



It's didn't work because if B3:0/0 is off, logic will set it [XIO B3:0/0 OTL B3:0/0] then the program reach the branch [XIC B3:0/0 OTU B3:0/0] and reset B3:0/0.


Double clic on the rung number to see how the program is scanned: XIC B3:0/1 ONS B3:0/2 BST XIO B3:0/0 OTL B3:0/0 NXB XIC B3:0/0 OTU B3:0/0 BND
------------------------------------------------------------------------------------------------------------------------------------------------------------
SLCMAN

#27 slcman

slcman

    Sparky

  • MrPLC Member
  • PipPipPip
  • 331 posts
  • Gender:Male
  • Country:Canada
    Canada

Posted 30 January 2012 - 09:30 PM

Mr. Carlton,

After all the replies, if you dont mind me asking, considering the power down/up issue and anything else,
just so Im clear, what is the "BEST" way of accomplishing this One Button Latch Unlatch issue.

I just want to use the best way from now on.

Thanks for everyones help.


ok I did my homework and now I can offer to you ver3 who contain latch/unlatch thru one pushbutton and value is retain thru power cycle. Mhowasso, note that previous version work but they lose status of memory bit on power cycle. This is mean if axis is lock, it will be unlock on power up. I'm sure sure one of those version will fit to your application. I did a mistake (who can say he never make one) about power up and I'm sorry for that. For me, the best way is a simple way, without too many unclear rung and also....with comment! I prefer ver2 if you don't care about power up, if retentive is needed use ver 3

Attached Files


------------------------------------------------------------------------------------------------------------------------------------------------------------
SLCMAN

#28 mhowasso

mhowasso

    Sparky

  • MrPLC Member
  • PipPipPip
  • 287 posts
  • Gender:Male
  • Location:Owasso, Oklahoma
  • Country:United States
    United States

Posted 31 January 2012 - 05:42 AM

Hi SLCMAN...

You are the MAN..!!!

Thanks so much for your replies.

I, like most, just want to learn and do things the best way the first time.

I also understand that sometimes there is not a BEST way, but many ways
that will work and get the job done.

Thanks again for your patience with me.

PS. Just curious, what is the fix for Shiner's program..???

Edited by mhowasso, 31 January 2012 - 05:43 AM.


#29 slcman

slcman

    Sparky

  • MrPLC Member
  • PipPipPip
  • 331 posts
  • Gender:Male
  • Country:Canada
    Canada

Posted 31 January 2012 - 08:35 PM

Hi SLCMAN...

You are the MAN..!!!

Thanks so much for your replies.

I, like most, just want to learn and do things the best way the first time.

I also understand that sometimes there is not a BEST way, but many ways
that will work and get the job done.

Thanks again for your patience with me.

PS. Just curious, what is the fix for Shiner's program..???



I already post a reply to this program. Look at post 26
------------------------------------------------------------------------------------------------------------------------------------------------------------
SLCMAN

#30 nehpets

nehpets

    Sparky

  • MrPLC Member
  • PipPipPip
  • 33 posts
  • Country:Wales
    Wales

Posted 01 February 2012 - 04:00 AM

Just another angle, the status of the counter is retained

Attached File  ONE BUTTON LATCH UNLATCH 3 version.RSS   59KB   117 downloads


Steve




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users