Jump to content

Three button exclusive latch?


Recommended Posts

Hello!   :  )

For the  "Manual ON - Pump 1 AUTO - Manual OFF" buttons   ......  my ladder code works fine "setting" only my last choice button when pressed and resetting the two other buttons. 

Can the buttons in the display be coded to change from the momentary depressed state to a  toggle "pressed visual state down?"

..... so, the last button pressed would be displayed as "Pressed" in the display.

 

 

 

Link to comment
Share on other sites

48 minutes ago, Flex727 said:

Use a Positive Transition contact instead of Direct contact for MB 11, 12, & 13.

After making your suggested changes ..... that still doesn't work!   :  (

acting same as before.

I'm  hoping I can make the last button pressed remain  in the "pressed" style after taking my finger off this button.

Link to comment
Share on other sites

Hi!

 

In the pic of my code clip above,

How do I re-code this:           --|  |-------(S)------(R) -------(R)-------

To this:                                            --|  |-------(1)------(0)--------(0)-------

 

This code is the result of pressing one of the 3 top buttons in the HMI pic'd above.

Pressing one button .... reset the other two.

 

Link to comment
Share on other sites

  • MVP 2023

You may want to re-think your approach and use a List of Images display object to display a three-position selector switch.  Using a data type that is only capable of two states to display three states of an object is a royal pain in the butt, as you're discovering.

image.png.1bebcfac6ce80daf25319b039593a8f6.png

Instead of three bits, you use an MI to hold the pump information.  In this case, MI 18 is used.

MI 18  = 0 => Hand

image.png.d3cace87050077a211305c621f032341.png

MI 18 = 1 => Off

image.png.d7e690e19dadc23953970f4bfd483060.png

MI 18 = 2 => Auto

image.png.f9d33345c822baa86794d6c3fd8f1b25.png

 

If you drop the List of Images object, you'll find these images installed with your Visilogic installation under /ImagesC/EMF/3D buttons.

Assign a separate touch property bit to the "HAND", "OFF", and "AUTO" texts.  In your code, use that touch property to store the appropriate value to the MI.  You can use Equal blocks in place of contacts in your logic to do what's needed.  Or you could use an Equal block to set coils based on the MI's value and reference those addresses as contacts in the rest of your code.

I realize this is a bit more complex than what you've tried so far, but it gives you a lot more control and you're not guessing how the bits will behave.  Plus an animated switch looks a lot cooler than three buttons.

Joe T.

 

Link to comment
Share on other sites

It looks like this "list of images" push button is a rotation type of control ie: press once = 0 , press again = 1, press again = 2

This would represent my "off-on-auto" pump control.

What i don't like about this set-up is that I can't with one press go to my desired selection. With this button I have to rotate around to my selection.

 .......... Is that correct?

Link to comment
Share on other sites

7 minutes ago, Flex727 said:

Yes, I think that's what he meant.

Ohkeydoke!   :  )

Thank-you!

 

The graphics of the suggested picture button is really poor (jagged edges, sketch like drawing, etc).  I prefer to use the realistic buttons as in my HMI pic above.  The "set/reset" ladder rung lines gives me a perfect functional "look and feel" to the display.

I just need to add to the end of each bank of "manual off-auto-manual on" a resettable flag bit (1 or 0)  so I can run these bits through the logic blocks (ie:AND) to give this controller the ability to rotate the lead pump each pump cycle and know the status of each pump (on-auto-off) and the number of pumps required to be turned on depending on the reported water level in the storage tank. 

Link to comment
Share on other sites

This I already did! ...... including an additional set and resets to make the buttons look locked down by changing the colors of the buttons (green =on, yellow=auto, red=off) when selected.

but all of these are of the MB type.  I need at the end of each of these ladder rungs a resettable flag (1 or 0) of type MI so i can use the logic blocks (AND, NAND,etc) .... the logic blocks require type MI inputs.

 

(I would post my current ladder code for you to see .... but i exceeded my file allotment)  :  (

Note:

These buttons are not controlling any pump output (on-off) to the external pump motor contactors.  The HMI buttons  are  offering thier status of any availability pump (on-auto-off).

Later logic blocks will ultimately instruct when an I/0 command to turn on a pump.

 

 

 

Link to comment
Share on other sites

  • MVP 2023
8 minutes ago, RickL said:

including an additional set and resets to make the buttons look locked down

Why did you need additional set and resets? The button, when set as Toggle type, will look pressed when the bit is on and you can change the text and color as desired.

Regarding the MIs, I can't imagine why you need to use logic function blocks with bits, but it's simple enough to do the following (do this with each button):

image.png.fcc9d3a4a8c4b6312b2264b4cf13fb9f.png

Link to comment
Share on other sites

Perfect!  ........ by using "Store" fb   I simply added this to the end of my ladder wrung for each button. 

ie:  lets say for the auto button,  store #1  at a new MI location , then add another two "store" fb blocks on the same wrung to reset to "0" the other buttons (on-off)

Link to comment
Share on other sites

2 hours ago, RickL said:

Perfect!  ........ by using "Store" fb   I simply added this to the end of my ladder wrung for each button. 

ie:  lets say for the auto button,  store #1  at a new MI location , then add another two "store" fb blocks on the same wrung to reset to "0" the other buttons (on-off)

.................. This worked out perfect!     every button (On-AUTO-Off) now sets an MI type variable output of a logical "1" when pressed while resetting the other two associated buttons back to a logical "0".

Now I can proceed with  logical FB's to  code my determination of lead/lag rotation of these four pumps and the number of pumps required by the water tank level.

Thank-you guys for your good help!  

Link to comment
Share on other sites

5 hours ago, Flex727 said:

Why did you need additional set and resets? The button, when set as Toggle type, will look pressed when the bit is on and you can change the text and color as desired.

Regarding the MIs, I can't imagine why you need to use logic function blocks with bits, but it's simple enough to do the following (do this with each button):

image.png.fcc9d3a4a8c4b6312b2264b4cf13fb9f.png

...... by the way, How are you posting your code here like above?  (I tried copy from my ladder, by will not past to this forum)

Link to comment
Share on other sites

  • MVP 2023
9 hours ago, RickL said:

Screen capture!   I got now!  :  )

Yes, screen capture (alt-PrintScreen button), paste into Paint, crop, copy, paste into the forum. Quick and easy.

From your post above, note that the Reset Numeric block is equivalent to Store 0 and takes up less space (see where I used it in the post above yours).

Link to comment
Share on other sites

Thank-you!

That Reset Numeric will do nicely indeed!

I'm going back and cleaning up my code as I pick up on more and more.   :  )

Not knowing the up load file limitations , I wiped out my max allocation in two posts!  ...... because I sent it as a pic from my cell phone!

.... I'm learning now!   :   )

I truly appreciate all the help in here!

Link to comment
Share on other sites

  • MVP 2023
11 hours ago, RickL said:

I wiped out my max allocation in two posts!

For now go back to all your uploaded pics, delete, resize  & repost.   That should get you under the limit again.  Limit changes are not available to the volunteer mods.....who are the people who have helped you so far.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...