Siemens S7/TIA v18: Restricting range of user input (reals)...

Mas01

Member
Join Date
Oct 2020
Location
Leicester, England
Posts
1,109
Hi,

I'm not sure how to do this...

Basically, I want to restrict the user input values for this tag to be in the range 20.001 to 25.0.

I *think* I need to use this High/Low Limit Violation property. Is that right?

Any help would be appreciated.

Happy to expand on any of the above.

Thanks in advance.

Upper and Lower Limits.png
 
Last edited:
The high and low limits set in the tag properties will make the input dialog limit the data entry to these values.
The color animation will only trigger if the tag value is outside the limits for some other reasons, for example the tag value was changed by the PLC program, or by some external access (OPC server or like that).

edit: Try it with simulation. It will be obvious.
 
The high and low limits set in the tag properties will make the input dialog limit the data entry to these values.
The color animation will only trigger if the tag value is outside the limits for some other reasons, for example the tag value was changed by the PLC program, or by some external access (OPC server or like that).

edit: Try it with simulation. It will be obvious.

Thanks @JesperMP, but I don't see anything in the tag properties here where the upper/lower limits can be set.

Am I looking in the right place?

Tag properties.png
 
Yep that's a weird one, however, seen something like this before, on some the popup data entry does not write the value to the actual variable so just shows an error, others where the edit is not a popup but the screen variable it just warns you out of limits & does not enter it into the variable (write it to the PLC.
 
OK Thanks everyone, I think I've got it sorted.
I created a couple of tags and gave them initial values and made them RETAINED.

Now when an out-of-range value is entered a message window pops-up for a couple of seconds then disappears and returns to the input field again.

lo and hi end values.png
 
This is a 'feature' by WinCC. You can only specify integer constants.
So in your case it would be 20 and 25.
Not sure if you link to HMI tags, then the limit function will work with the floating point value or the rounded to integer value.

edit: I see you figured it out.
Did you notice if it is the floating point value that is the limit, or the the rounded integer value ?
 
This is a 'feature' by WinCC. You can only specify integer constants.
So in your case it would be 20 and 25.
Not sure if you link to HMI tags, then the limit function will work with the floating point value or the rounded to integer value.

edit: I see you figured it out.
Did you notice if it is the floating point value that is the limit, or the the rounded integer value ?

I set the limits to be "20.001" (lower) and "25.0" (upper).

If the entered value is outside of this range, the attached error message appears for 2sec (the values show in it are correct, floating-point) before returning to the input field for the user to enter an in-range value.

This solution is adequate for me, so thanks all, for your help.

IMG_20231113_125151.jpg
 
Last edited:
FYI, not sure if it's been mentioned, because those system alarms only appear for 2 sec, the usual best practice is to have a permanent alarm screen somewhere that shows the alarm buffer (all alarm classes, or at least System alarms) instead of the active alarms.


Ends up being kinda like the Diagnostic buffer in the PLC to see what the HMI thinks is going on. Things like "tag out of range" aren't usually a huge deal (although "why isn't this tag doing what i told it" is still super annoying), but it can be really helpful for troubleshooting communication errors and the like.
 
This is a 'feature' by WinCC. You can only specify integer constants.
So in your case it would be 20 and 25.
Not sure if you link to HMI tags, then the limit function will work with the floating point value or the rounded to integer value.

edit: I see you figured it out.
Did you notice if it is the floating point value that is the limit, or the the rounded integer value ?

Wait what? At least in V16 i can use real as a constant for range.
And tested also with plc linked tag.

Tiaportal_real.png
Tiaportal_real2.png
 
I think Mas01 uses V17, so I don't know why he get the pink errors in post #8.


He started in 17, made the jump to 18 a while back.


I love that I know this, but I can't remember where i left my bag of cough drops this morning....
 

Similar Topics

Context: PLC= S7-1212C, HMI=KTP1200 Basic. Hi again, When the "REPORT" button is pressed (on a different screen), it takes the operator to the...
Replies
7
Views
667
Context: PLC= S7-1212C, HMI=KTP1200 Basic. Hi, The operator has reported that, from time-to-time, when he presses the "Generate Report" button...
Replies
5
Views
465
General Question: The PLC and HMI that I've been working on (a laser measurement system) is soon to be transported to the site where it will be...
Replies
2
Views
701
Can someone help me with this? I'm no good at SCL - virtually everything I've done so far has been ladder logic. The return value from the...
Replies
13
Views
1,109
Hi, Am I being daft (again)? I want to increment a tag (Integer) by 1 each time a button on the HMI is pressed. Before the button press, the...
Replies
22
Views
2,362
Back
Top Bottom