LIM Test Cases Studio5000
LIM Test Cases Studio5000
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.