![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
![]() ![]() Join Date: Jan 2020
Location: Sanaa
Posts: 12
|
![]()
Hi guys,
I am using CCW with AB Micro-Controller. The user can select 2 pumps out of 4 to be running. However, the user shall not be able to select more than 2 pumps and an error message should appear if the user tries to select the 3rd pump telling him "Not more than 2 pumps to run, deselect one of the pumps if you require to select another pump". Please help me to do this as I don't know how to restrict the selection in the HMI, or shall it be done via PLC program? Best Regards Last edited by ahaanwar2; February 23rd, 2021 at 06:04 AM. Reason: Typo |
![]() |
![]() |
#2 |
Lifetime Supporting Member
|
Is this homework?
One way to accomplish this is to assign a value to each selection, say 1, then add the selections, if total =2, then allow no more.
__________________
Certified Siemens Functional Safety Professional, ID: SFSP17010238 https://azr.com/ |
![]() |
![]() |
#3 |
Lifetime Supporting Member
|
Create six buttons:
Is this homework or workwork? |
![]() |
![]() |
#4 | |
Member
![]() ![]() Join Date: Jan 2020
Location: Sanaa
Posts: 12
|
Quote:
Thanks for your response. This is not a homework. I am trying to teach my self on programming PLC and I am trying to replicate a project I have seen but I don't have the PLC program . So, what you are saying is doing the program in the logic. Isn't there any easier way or a function in the HMI creation tool? |
|
![]() |
![]() |
#5 | |
Member
![]() ![]() Join Date: Jan 2020
Location: Sanaa
Posts: 12
|
Quote:
Thanks for your answer. Actually, I thought of your way of doing it. However, what if the user want to run only 1 pump? I don't want to fill up the screen with a list of Selection buttons. |
|
![]() |
![]() |
#6 |
Member
|
My personal preference is to do all the work in the PLC. Have the HMI trigger momentary pushbuttons and show On/Off values for bits.
Have the PLC monitor each PB and if 2 pumps are already on it will not turn on a third pump, and have it turn on a timer for 20 seconds that when timing sets a visibility bit that the HMI uses for the warning popup. The most elegant quote to apply is from someone on this forum (I'm thinking GeniusInTraining): A HMI should be a window into the PLC I have a customer that has a hoist controlled line of plating tanks they wwant changes made in the PLC, the the CLX PLC is basically a dumb terminal that only does what the HMI tells it to do. All the recipes, timing, setpoints, hoist moves, etc are controlled by a proprietary, self made HMI the OEM won't think of making any changes to, that if the PLC ran things I could make in a couple hours. |
![]() |
![]() |
#7 |
Member
![]() ![]() Join Date: Dec 2006
Location: Montgomery, Alabama
Posts: 769
|
Create a word, each select button will add 1 to this word. If the value is greater than or equal to two you can't select any more. You can clear the word in the beginning of the scan.
|
![]() |
![]() |
#8 | |
Lifetime Supporting Member
|
Quote:
Ten buttons on a 4x4 grid 62%+ filled: Code:
[1 alone] [1 & 2] [2 alone] [1 & 3] [2 & 3] [3 alone] [1 & 4] [2 & 4] [3 & 4] [4 alone] Perhaps the HMI provides a drop-down list selection widget; that would not clutter the screen. In the PLC, @KenM and others already provided one solution: count the bits; four rungs of essentially identical code plus one compare. Another solution: if each pump button represents one bit in an integer, there are only five invalid values to check (three with three bits as 1s and one with four bits as 1s); it's clumsy but easy to code and understand; also it is codable as five NEQs ANDed on a single rung, instead of five EQUs ORed on five branches. Also, there could be a boolean array INVALID_COMBINATIONS with 16 values: 0s for the valid combinations; 1s for the invalid combinations; the HMI assigns 1s or 0s to the bits of an index, the PLC uses one instruction [XIC INVALID_COMBINATIONS[index]]* to determine whether 3 or more bits are 1 in the index, and the error message on the HMI is driven by the result. If you are teaching yourself PLCs, you would ideally try all of the above, and test each. * this is RSLogix5C/Logix5k lingo, may not be work in CCW, but the idea is the same. Last edited by drbitboy; February 23rd, 2021 at 07:11 AM. |
|
![]() |
![]() |
#9 | |
Member
![]() ![]() Join Date: Jan 2020
Location: Sanaa
Posts: 12
|
Quote:
Regards |
|
![]() |
![]() |
#10 | |
Member
![]() ![]() Join Date: Jan 2020
Location: Sanaa
Posts: 12
|
Quote:
Regards |
|
![]() |
![]() |
#11 |
Member
![]() ![]() Join Date: Nov 2016
Location: Fields of corn
Posts: 1,773
|
From what you're saying, your logic has to keep track of a selected pump as the reason for this to exist is to allow group control of the pumps (start, stop, etc...).
So why not add up all the pumps that are selected and then not allow any selection command to latch if the value is higher than 1? To make the HMI development easier, you can create a bit in your software that indicates that the maximum number of pumps has been selected and then use that bit to disable the HMI button that allows them to be enabled. It's also the faster way to, in the future, allow 1, 3 or 4 pumps to be enabled without changing your program other than that one compare instruction. |
![]() |
![]() |
#12 |
Lifetime Supporting Member + Moderator
|
Brute force method
|
![]() |
![]() |
#13 | |
Member
![]() ![]() Join Date: May 2013
Location: Northern Snowball
Posts: 246
|
Quote:
In general it is better to put your limits in the PLC. Be that number of pumps running, speeds, dosing levels, etc. You can replicate them in the HMI but only for messaging purposes so you can flag your operator when they try to enter it outside the limit they are allowed to access. This will also allow graduated ranges. Operators have the narrowest to do their job within established parameters. Supervisors have a wider range to adjust for unexpected issues. Maint can have full band within the safety limits purely for testing needs. |
|
![]() |
![]() |
#14 | |
Member
|
Quote:
First if somehow the operator found a way to turn on 3 or 4 pumps the OTE would be off, don't underestimate the level of idiots that HR can hire to run your machine. Second, half the bits to check. |
|
![]() |
![]() |
#15 |
Lifetime Supporting Member
|
I know you are using CCW, but the principles are the same. KISS. Main(OB1) not shown, but it only calls the pumps' handler FB.
HMI
pump_hmi.png Static array with validity of sixteen possible hmi_pattern values e.g.
patterns.png Handler for all four pumps
pumps.png Pump Function
one_pump.png Last edited by drbitboy; February 23rd, 2021 at 01:56 PM. |
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hide a user in tp 700 hmi tia v 14 | ron7 | LIVE PLC Questions And Answers | 3 | December 19th, 2018 03:38 AM |
HMI user authentication with LDAP via laptop | Evirua | LIVE PLC Questions And Answers | 2 | September 21st, 2018 11:18 AM |
Automation direct HMI EA7-T12C shows No user program. | hinddhindsa | LIVE PLC Questions And Answers | 2 | February 3rd, 2016 11:45 PM |
User rights HMI PV800 Allen-Bradley | akathomas | LIVE PLC Questions And Answers | 10 | November 6th, 2015 04:32 AM |
Troubleshooting Siemens HMI w/Step 7, & WinCC/Redlion HMI question | AutomationTechBrian | LIVE PLC Questions And Answers | 5 | June 22nd, 2014 01:06 PM |