0% found this document useful (0 votes)
8 views3 pages

LIM Test Cases Studio5000

The document outlines various test cases for the LIM instruction in Studio 5000, focusing on different data type combinations and edge cases. Each test case includes objectives, steps to execute, and expected results, ensuring the LIM instruction behaves correctly under various scenarios. Key areas tested include mixed data types, signed vs. unsigned integers, floating-point precision, and handling extreme values.

Uploaded by

sunny gaikwad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

LIM Test Cases Studio5000

The document outlines various test cases for the LIM instruction in Studio 5000, focusing on different data type combinations and edge cases. Each test case includes objectives, steps to execute, and expected results, ensuring the LIM instruction behaves correctly under various scenarios. Key areas tested include mixed data types, signed vs. unsigned integers, floating-point precision, and handling extreme values.

Uploaded by

sunny gaikwad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

LIM (Limit) Instruction Test Cases - Studio 5000

Test Case 1: Same Data Type for All Variables


Objective: Verify the LIM instruction when all three variables use the same integer data type.

Steps:
1. Open Studio 5000 Logix Designer.
2. Create a new rung.
3. Add a LIM instruction with all variables as DINT.
4. Assign test values.
5. Execute and observe output.

Expected Results:
- The LIM instruction should return True if LL <= TV <= UL.
- Otherwise, it should return False.

Test Case 2: Mixed Integer Types


Objective: Verify how LIM handles different integer types (SINT, INT, DINT, LINT).

Steps:
1. Set LL as SINT, TV as INT, and UL as DINT.
2. Execute logic and monitor LIM output.

Expected Results:
- The instruction should correctly compare across integer types without errors.

Test Case 3: Signed vs. Unsigned Integer Types


Objective: Check behavior when mixing signed and unsigned integers.

Steps:
1. Assign negative SINT value as LL.
2. Assign positive UINT value as TV.
3. Set UL as DINT.
4. Execute and observe output.

Expected Results:
- LIM should handle signed-to-unsigned comparisons correctly.

Test Case 4: Integer and Floating-Point Mixing


Objective: Test behavior when mixing integer and floating-point values.

Steps:
1. Assign LL as DINT (integer), TV as REAL (floating-point), and UL as DINT.
2. Execute logic and monitor output.

Expected Results:
- LIM should automatically convert integers to floating-point for comparison.
Test Case 5: Floating-Point Precision and Rounding
Objective: Verify how LIM handles floating-point precision issues.

Steps:
1. Assign floating-point values with very small differences.
2. Execute logic and check if rounding is handled correctly.

Expected Results:
- LIM should not incorrectly round values in floating-point calculations.

Test Case 6: Edge Cases for Maximum & Minimum Values


Objective: Test LIM with min and max possible values for different data types.

Steps:
1. Assign extreme values for DINT, UDINT, and REAL.
2. Observe if LIM correctly evaluates boundary values.

Expected Results:
- The LIM instruction should handle extreme values without errors.

Test Case 7: Unsigned Integer with Floating-Point


Objective: Verify behavior when mixing UDINT, ULINT with REAL, LREAL.

Steps:
1. Assign LL as UDINT, TV as REAL, and UL as UDINT.
2. Observe if LIM correctly compares mixed types.

Expected Results:
- LIM should handle automatic type conversion correctly.

Test Case 8: Negative Floating-Point Values


Objective: Ensure LIM correctly handles negative floating-point numbers.

Steps:
1. Use negative REAL values in LL, TV, and UL.
2. Monitor if LIM correctly evaluates negatives.

Expected Results:
- LIM should not mistakenly round negative numbers toward zero.

Test Case 9: Swapped Limit Values (LL > UL)


Objective: Check behavior when Lower Limit is greater than Upper Limit.

Steps:
1. Assign LL > UL.
2. Assign a Test Value in between.
3. Check if LIM evaluates correctly.

Expected Results:
- If LL > UL, LIM should return True when TV is outside the inverted range.

Test Case 10: Handling Large Numbers and Overflow


Objective: Test LIM with maximum values to check for overflow.

Steps:
1. Assign extreme values for LINT and ULINT.
2. Assign mid-range TV.
3. Observe if LIM handles large values correctly.

Expected Results:
- No overflow or incorrect evaluations should occur.

Test Case 11: Precision with LREAL


Objective: Check floating-point precision errors when using LREAL values.

Steps:
1. Assign LREAL values with extremely small differences.
2. Monitor if LIM rounds values incorrectly.

Expected Results:
- LIM should correctly compare values without precision errors.

Test Case 12: Combination of Integer and Float with Swapped Limits
Objective: Test when LL is floating-point and UL is integer.

Steps:
1. Assign LL as REAL, TV as DINT, UL as DINT.
2. Monitor whether LIM correctly converts values.

Expected Results:
- No data loss or incorrect conversions should occur.

You might also like