---
title: "system.mes.spc.controllimit.isValueWithinLimitsByDefName(defName, locationPath, attributeName, limitName, value, [productCode], [sampleTimeTaken])"
id: "system-mes-spc-controllimit-isvaluewithinlimitsbydefname-defname-locationpath-attributename-limitna"
project: "MES User Manual"
url: "https://docs.sepasoft.com/articles/user-manual/system-mes-spc-controllimit-isvaluewithinlimitsbydefname-defname-locationpath-attributename-limitna"
updated: 2026-07-31T14:58:37Z
---

# system\.mes\.spc\.controllimit\.isValueWithinLimitsByDefName\(defName, locationPath, attributeName, limitName, value, \[productCode\], \[sampleTimeTaken\]\)

**Sepasoft MES Module Suite**

### system.mes.spc.controllimit.isValueWithinLimitsByDefName(defName, locationPath, attributeName, limitName, value, [productCode], [sampleTimeTaken])

This function accepts [keyword arguments.](https://docs.inductiveautomation.com/display/DOC79/User-Defined-Functions#UserDefinedFunctions-KeywordArguments)

Tests a measurement value to determine if it is within control limits.

Syntax

system.mes.spc.controllimit.isValueWithinLimitsByDefName(**defName, locationPath, attributeName, limitName, value, [productCode], [sampleTimeTaken]**)

* Parameters

String **defName** - The sample definition name that contains the limit values used in the test.

String **locationPath** - The path of the location that the limit values are begin used to test the measurement value.

String **attributeName** - The name of the attribute that the limit values are used for the test.

String **limitName** - The name of the limits to test. Multiple limit names can be specified by separating them with commas.

Double **value** - The measurement value to test.

String **productCode** - The product code that the limit values used in the test. Uses a blank string to specify the default product code if nothing is passed in. This only applies if the Save Control Limits by Product Code option is selected.

Date **sampleTimeTaken** - The time the sample was taken at. The current datetime is used if nothing is passed in.

* Returns

List&lt;ControlLimitResult&gt; - A Java List containing ControlLimitResult objects

* Scope

All
 #### Is Measurement Value within Control Limits

| ![Warning](/resources/Storage/user-manual/user-manual/Warning.png) | Stable Version: 3.81.5 and later<br><br>Release Candidate: 3.81.4 RC6 and later |
| --- | --- |


```python
locationPath = 'New Enterprise\California\Quality\Location A'
defUUID = 'dde09f41-0d73-4212-afcc-957571915930'
defName = 'Def 1'
attributeName = 'Temperature'
limits = 'XBar UCL,XBar LCL' #If '' then evaluate all limits for the default chart
productCode = ''
value = 100.5
result = system.mes.spc.controllimit.isValueWithinLimitsByDefUUID(defUUID, locationPath, attributeName, limits, productCode, value)
#Where result = List<ControlLimitResult> : [{XBar UCL, Upper, 134.0, True}, {XBar LCL, Lower, 85.0, True}]
print result
result = system.quality.spc.controllimit.isValueWithinLimitsByDefName(defName, locationPath, attributeName, limits, productCode, value)
print result[0].getLimitName()
print result[0].getLimitType()
print result[0].getLimitValue()
print result[0].getResult()
```


**Sepasoft MES Module Suite**