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.Testcaseand 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.Testcaseas opposed to the methods ofCBM.ETrigA:The
prvCyclicAction(),prvStart(),prvAbort(), andprvResetOutputs()methods do not have to be overloaded in theTM.Testcasescheme. 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
SUPERcall is omitted.SUPER^.prvCyclicAction()must no longer be called and instead also notSUPER^.Execute().The
VAR_OUTPUT xDoneoutput 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 xErrorandiErrorCodeis 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
sInfooutput now has the typeWSTRINGand must no longer be declared explicitly: The string length ofsInfois now defined by the library parameterCONSTANTS.WSTRING_LENGTH. ThesInfooutput may still be written directly. However, when using assert functions, it can be mutually overwritten.
Instead of the
prvAbort()method,Abort()is implemented:The
SUPERcall is omitted.SUPER^.prvAbort()must no longer be called and instead also notSUPER^.Abort().The
xAbortInProgressvariable no longer exists. Instead, theAbort()method has to returnTRUEwhen the abort has ended.Attention: This has the inverted semantics to
xAbortInProgress.
Instead of the
prvStart()method,Setup()is implemented:The
SUPERcall 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
SUPERcall 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.Testcaseinstead.The
TM.Testcase_Basewas popularly used in the past to be able to define ansInfooutput with more than 255 characters. TheTM.Testcasehad only one definedsInfooutput with 255 characters. Now you can set the length of thesInfooutput 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
sInfooutput.Change the access to the
sInfoofTM.TestcasetoWSTRING(instead ofSTRING) if the customsInfooutput was a STRING.Define the library parameter
CONSTANTS.WSTRING_LENGTHof theTest Manager IEC Unit Test, 5.0.0.0library (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.