preventing the input of a wrong number from a Siemens numeric pad

Lamboom

Lifetime Supporting Member
Join Date
Mar 2014
Location
Fallbrook, Ca
Posts
350
So you have an object on an HMI that will become a number inputted from a numeric pad, which is automatically launched on the HMI, when you touch that object.

Aperson could accidentally select a "wrong" number .. which will cause a "fault" or worse.. :)

There is a list of about 20 correct numbers (from 1 to 255), and only one of those will produce the desired result.

After a number is selected, a "GO" button is pushed on the HMI, and if the selected number matches one of the 20 acceptable numbers, The intent of the 'Go" button is permitted... if not, a "Not Correct" error will be indicated.

Is there a comparator function block in Siemens ladder logic, where it looks at a numeric value, and checks it against a list of values, then outputs a "1" if it finds a match in the list?

Regards, Michael

PS: I guess another Title for this might be "Managing the output of a numeric pad"
 
Not sure about Siemens, but on AB's you can write to a written integer, compare it with a variety of compares, and if acceptable then write it to the Setpoint integer and latch an Acceptable Bit or start an Accepted TOF timer. The next line check if the Setpoint equals the Written and if not move the Setpoint to the Written integer and set a NotCorrect bit or start a NotCorrect TOF timer to display on the HMI.

I am guessing Siemens must have similar commands.
 
Could you use a drop-down list on the HMI (called "Symbolic I/O Field" in WinCC flexible)? Then you can have the 20 values displayed as a text list, and the tag value of each entry in the text list can be the same as the displayed value. This prevents any other entry other than what is in the text list.
 
Thanks Aabeck .. I'll look into it... :)

And Sigmadelta .. thanks also.. not sure what you are suggesting.. (kinda new at this).. There is too much time between my programming operations.. so, I tend to forget a lot.. Not working all the time. . :) What you are saying sounds real good .. I will research that also... :)

Regards, Michael
 
Last edited:
Using the text list thing is probably the easiest if there isn't too many options.

If there are a lot, I would go with a CASE function in SCL, list all the number then the ELSE would give an error.
 
Lamboom, it's not so bad...

Go to Tools and drag the object "Symbolic I/O Field" on to your screen.
Select the tag you want to send the value to (i.e. the one you want the operator to select)
Create a new text list.
Edit the text list to contain something like the following example (first is the text, second is the value of the tag)
0 0
1 1
10 10
20 20
etc.

Now the operator will see a drop-down list only containing the values 0, 1, 10, 20. And he can only select one of these values. The value written to the tag is defined by the value in the text list. The text is just for showing the operator.

Optionally, the text could be any text (like "0 - NO SELECTION", "1 - SLOWEST SPEED", "10 - SOMETHING" etc. Also you could set the value to 0 (or any other value) when the operator enters the screen, if you wish.
 
Thanks Diameter57 .. There may be a lot.. even more than 20.. They need to be listed on paper .. each one has a number.. it's that number that must be entered. There are other numbers that could be entered (by mistake) but.. those mistakes must not be entered .. Only a number from that list will work correctly. There could be as 60!

SigmaDelta .. That would work..'cept the list could end up too long to be listed on the HMI screen (it's only a 6inch screen) This has to be all about the numbers that get punched in from the Numeric Pad (Siemens .. which is quite poorley designed.. hard to see unless you are directly in front, and the numbers are very small)
..Obviously, I'll have to create a list of "correct" numbers in the program .. somewhere... :)

By the way.. A selected number will point to a line in a Driver's Control Table ..one of 255 lines .. which contain command instructions, but only some can be selected first .. starting a sequence which would progress using several "lines" ... I'm trying to prevent accessing any line other than a "start" line.

Regards, Michael
 
Last edited:
If you give us more information on what kinda of numbers they are, maybe we can suggest a better solution.

Another idea is to have all these numbers in an array, something like this:

Subnet[0]=10
Subnet[1]=15
Subnet[2]=25
...

And they can select a number from 0-59 which is the "index" of the array, after they select that, the number say 15 is displayed in a output field next to it.

Another option is to have 4 arrow keys that increase the index number of the array by 1 or 10 or decrease the index number of the array by 1 or 10. This is easy to do instead of setbit/resetbit you can select increase tag by number on the events menu if I recall correctly.

Like I said, it would help if you give us more information as to what numbers and what they are for. If there is a mathematical function that describes the relation between the numbers, it may be even easier.
 
Last edited:
OK.. The numbers are 1 thru 255. Normally, you would have a program select a particular number, based on what was needed from your machine. That number would call a line in a driver's control table.. and a sequence would start and run. Not all motor or actuator drivers have control tables .. but, I'm using one that does. And, I'm letting an operator select the CT line that will start a sequence. There would be a catalog of "events" desired.. and each would have a number. The operator inputs the number (using the Numeric Pad) and presses the "GO" button.

If a particular sequence starts at line 33 in the CT, it's real important that line 34 isn't entered. Sure, the person may select another "start" sequence by mistake... But that's another problem..:) Which isn't very serious.

It's like .. "pick a number between 1 and 255" ... and if you select 4,25.33,43,36, or 78... you win! ...

Methinks Aabeck may be onto the solution ... But, I must do it with a Siemens S7 1200 series PLC & Basic HMI ...& TIA V11 ...sniff!
 
Last edited:
I don't have Tia on this pc, so there may be typos in the code.

I would maybe set a bit (#CheckCTLine) to true on release of the 'Go' button.
Then if (#CheckCtLine = true) run a FB_CheckCTline with the following SCL code:


#staCTLinecorrect := false;
CASE #stanCTLine OF
4: #staCTLinecorrent := true;
33: #staCTLinecorrent := true;
36: #staCTLinecorrent := true;
43: #staCTLinecorrent := true;
78: #staCTLinecorrent := true;
ELSE
#staCTLinecorrent := false;
END_CASE;
#CheckCTLine := false;

IF (#CheckCTLine = true) THEN
//Do stuff
;
ELSE
//Generate error message
;
END_IF;



If you need this kind of thing often, make a seperate datablock for each actuator drive and have an array with the values, then use a for loop to go through the array. That way your code is reuseable.

You could also make the Go button only visible if (#staCTLinecorrent = true) but make sure you also check if the bit is true when the button is clicked, even if the button is invisible, you can still click on it.
 
Last edited:
I forgot to mention something you probably already know though,..
In the list of HMI tags (not the PLC tags) you can right click on the titles of the columns and ask to display minimum and maximum.

There you can enter for example 0 for minimum and 255 for maximum, that way they can't enter something out of range.
 
Thanks Diameter157 ... Actually, I didn't know that .. :)

I've been working hard to master the Red Lion G3 HMI.. Wow!.. what a wonderful machine. It will replace the older Siemens automation system. It will work directly with a Delta RMC Motion Controller .. Which will run all the moves "on the fly" .. communicating with a simpler Velocity/Force Driver ... won't even need a PLC! .. Happy Days
 

Similar Topics

Hi there, I have created a ladder that simulates a traffic light system with a pedestrain request button. My sequence is as follows: A "reset"...
Replies
5
Views
1,908
Hi guys, Not an automation issue I am facing. I have a Factorytalkview se ver 10 installed on an HMI running win7. When I activate desklock, my...
Replies
2
Views
1,726
I am doing a system where I have to control a heater on a mold. I will use a PID lood with a PWM output to a SSR to control the heater. The...
Replies
15
Views
4,323
I went on a service call yesterday for a Micrologix 1500. An output wasn't activating and they wanted to know what was hanging it up. It was a...
Replies
10
Views
2,785
Hello, I have an ML1100. I am using the MSG instruction to send email alarms. I do not have an ACK facility (no HMI, and not using the...
Replies
24
Views
4,271
Back
Top Bottom