RickL Posted February 23, 2023 Report Posted February 23, 2023 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.
MVP 2023 Flex727 Posted February 23, 2023 MVP 2023 Report Posted February 23, 2023 Use a Positive Transition contact instead of Direct contact for MB 11, 12, & 13.
RickL Posted February 23, 2023 Author Report Posted February 23, 2023 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.
RickL Posted February 23, 2023 Author Report Posted February 23, 2023 ................. 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.
RickL Posted March 1, 2023 Author Report Posted March 1, 2023 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 Joe Tauser Posted March 1, 2023 MVP 2023 Report Posted March 1, 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. Instead of three bits, you use an MI to hold the pump information. In this case, MI 18 is used. MI 18 = 0 => Hand MI 18 = 1 => Off MI 18 = 2 => Auto 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.
RickL Posted March 1, 2023 Author Report Posted March 1, 2023 Thank-you for your good help! ...... I'll try that out now! : )
RickL Posted March 1, 2023 Author Report Posted March 1, 2023 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?
MVP 2023 Flex727 Posted March 1, 2023 MVP 2023 Report Posted March 1, 2023 8 hours ago, Joe Tauser said: Assign a separate touch property bit to the "HAND", "OFF", and "AUTO" texts.
RickL Posted March 1, 2023 Author Report Posted March 1, 2023 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 Flex727 Posted March 1, 2023 MVP 2023 Report Posted March 1, 2023 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.
RickL Posted March 1, 2023 Author Report Posted March 1, 2023 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 Flex727 Posted March 1, 2023 MVP 2023 Report Posted March 1, 2023 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:
RickL Posted March 1, 2023 Author Report Posted March 1, 2023 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 Flex727 Posted March 1, 2023 MVP 2023 Report Posted March 1, 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):
RickL Posted March 1, 2023 Author Report Posted March 1, 2023 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)
RickL Posted March 1, 2023 Author Report Posted March 1, 2023 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!
RickL Posted March 2, 2023 Author Report Posted March 2, 2023 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): ...... 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)
RickL Posted March 2, 2023 Author Report Posted March 2, 2023 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! : )
MVP 2023 Flex727 Posted March 2, 2023 MVP 2023 Report Posted March 2, 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).
RickL Posted March 3, 2023 Author Report Posted March 3, 2023 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 Ausman Posted March 3, 2023 MVP 2023 Report Posted March 3, 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now