Obsolete Test POU Implementations
Important
The CBM.ETrigA
and TM.Testcase_Base
test POU implementations are still supported by version 5.0.0.0, but in future versions they might not be supported anymore.
If you have test cases with old implementation and want to adapt them to the new implementation, then you need to consider the following points:
Use
TM.Testcase
(Implementing a single test POU) instead.Derive a new POU from
TM.Testcase
and transfer the logic of the methods of the existing POU (toCBM.ETrigA
). For this purpose, use the wizard to create a newTM.Testcase
. Enable all options so that all possible sample content is generated (template, comments, methods, etc.). In this way, you can easily see the differences. Larger parts of your existing test implementation can remain the same if you pay attention to the following conventions ofTM.Testcase
as opposed to the methods ofCBM.ETrigA
:The
prvCyclicAction()
,prvStart
(),prvAbort(
), andprvResetOutputs()
methods do not have to be overloaded in theTM.Testcase
scheme. As a result, they cannot simply be copied from theCBM.ETrigA
-based test POU to theTM.Testcase
-based POU. Instead, only the contents of these methods may be copied and customized into the equivalents of the newTM.Testcase
-based test POU, as explained below:Instead of the
prvCyclicAction()
method,Execute()
is implemented:The
SUPER
call is omitted.SUPER^.prvCyclicAction()
must no longer be called and instead also notSUPER^.Execute()
.The
VAR_OUTPUT xDone
output must no longer be set directly. To signal the successful end of the test, theExecute()
method has to return the valueTRUE
.Directly setting the error outputs
VAR_OUTPUT xError
andiErrorCode
is still possible, but should be replaced by corresponding Assert Functions. We reserve the right to change the error outputs in future releases and plan to use the assert functions as a migration path.The
sInfo
output now has the typeWSTRING
and must no longer be declared explicitly: The string length ofsInfo
is now defined by the library parameterCONSTANTS.WSTRING_LENGTH
. ThesInfo
output may still be written directly. However, when using assert functions, it can be mutually overwritten.
Instead of the
prvAbort()
method,Abort()
is implemented:The
SUPER
call is omitted.SUPER^.prvAbort()
must no longer be called and instead also notSUPER^.Abort()
.The
xAbortInProgress
variable no longer exists. Instead, theAbort()
method has to returnTRUE
when the abort has ended.Attention: This has the inverted semantics to
xAbortInProgress
.
Instead of the
prvStart()
method,Setup()
is implemented:The
SUPER
call is omitted.SUPER^.prvStart()
must no longer be called and instead also notSUPER^.Setup()
.The
Setup()
method still does not have to return a value (it is ignored).
Instead of the
prvResetOutputs()
method,TearDown()
is implemented:The
SUPER
call is omitted.SUPER^.prvResetOutputs()
must no longer be called and instead also notSUPER^.TearDown()
.The
TearDown()
method still does not have to return a value (it is ignored).
Use
TM.Testcase
instead.The
TM.Testcase_Base
was popularly used in the past to be able to define ansInfo
output with more than 255 characters. TheTM.Testcase
had only one definedsInfo
output with 255 characters. Now you can set the length of thesInfo
output using the library parameterCONSTANTS.WSTRING_LENGTH
.Derive directly from TM.Testcase instead of
TM.Testcase_Base
. However, you need to consider some points:Remove the custom
sInfo
output.Change the access to the
sInfo
ofTM.Testcase
toWSTRING
(instead ofSTRING
) if the customsInfo
output was a STRING.Define the library parameter
CONSTANTS.WSTRING_LENGTH
of theTest Manager IEC Unit Test, 5.0.0.0
library (or newer) to the maximum required length.
Test POUs, which have been fully implemented without a base and therefore comply exclusively with the interface convention, could also become incompatible in the future. It is always recommended to derive from TM.Testcase
.