
Range Check
Section 6 Program Code Issues
104
3BSE042835-600
Example of range test on AEConfig:
(* Parameter range test *)
ParError := false;
IF AEConfig < 0 or AEConfig > 4 THEN
AEConfigInt := 1;
ParError := true;
ELSE
AEConfigInt := AEConfig;
END_IF;
After this, the variable
AEConfigInt
is used in the code and graphics since the input
parameter AEConfig can not be modified.
When an input parameter is used in the code, the range check shall be made there. If
the parameter is used in an internal FB, the range check shall be made there as well.
In the main object the ParError should be calculated as the sum error of the ParError
of the block itself (if any) and the ParError(s) of the sub function block(s).
Example:
Test of
AEConfigInt
,
InteractionPar.AEFilterTime
and
InteractionPar.AEHysteresis
have been tested as described above.
AEClass is tested in the function block Level6Alg.
Level6Alg(AEFilterTime := InteractionPar.AEFilterTime,
AEClass := AEClass,
AEHysteresis := InteractionPar.AEHysteresis,
AEConfig := AEConfigInt);
ParError := ParError or Level6Alg.ParError;
This principle may be used in all levels of function block calls.
Summary of Contents for AC 800M
Page 2: ......
Page 3: ...AC 800M Library Object Style Guide System Version 6 0...
Page 12: ...Related Documentation About This User Manual 12 3BSE042835 600...
Page 18: ...Naming Convention Section 1 Libraries 18 3BSE042835 600...
Page 108: ...SIL Mark Restrictions Section 6 Program Code Issues 108 3BSE042835 600...
Page 116: ...Standard Library Parameters Appendix A Names and Abbreviations 116 3BSE042835 600...
Page 119: ......