Jump to content

Recommended Posts

Posted

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.

 

 

 

Posted
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.

Posted

.................  I got working now!  :  )

Yes .... for the positive transit type!

And changed button type to the "toggle type"  and then added two button resets to turn off the other buttons.

Posted

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.

 

  • MVP 2023
Posted

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.

 

Posted

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?

Posted
3 hours ago, Flex727 said:

 

Do you mean that you "touch" the text above the button (off-on-auto) to make a selection directly and NOT the picture button?

  • MVP 2023
Posted
27 minutes ago, RickL said:

Do you mean that you "touch" the text above the button (off-on-auto) to make a selection directly and NOT the picture button?

Yes, I think that's what he meant.

Posted
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. 

  • MVP 2023
Posted

To use buttons, as in your original post, is simple. Take your original logic, change the first contact to a positive transition, and change each button to be a Toggle button. It will look like this:

image.png.dd60e9eb18afa342ffdd5eab977f2398.png

Posted

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.

 

 

 

  • MVP 2023
Posted
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

Posted

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)

Posted
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!  

Posted
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)

Posted
4 hours ago, RickL said:

...... 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)

Screen capture!   I got now!  :  )

image.png

  • MVP 2023
Posted
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).

Posted

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!

  • MVP 2023
Posted
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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.