Attention
These docs are a bit ambitious. The steps described are accurate but IronPLC cannot yet run programs.
P0004¶
- Code
P0004
- Message
Subrange declaration minimum value is not less than the maximum
This error occurs when a subrange declaration has a minimum value that is not strictly less than the maximum value.
Example¶
The following code will generate error P0004:
TYPE
InvalidRange : INT(10..-10); (* Error: minimum (10) >= maximum (-10) *)
END_TYPE
The subrange declaration has a minimum value of 10 and maximum value of -10, but the minimum must be strictly less than the maximum.
To fix this error, ensure the minimum value is less than the maximum value:
TYPE
ValidRange : INT(-10..10); (* Correct: minimum (-10) < maximum (10) *)
END_TYPE