Testcase (FB)ΒΆ
FUNCTION_BLOCK Testcase EXTENDS Testcase_Base IMPLEMENTS IBaseIecUnitTest
Base class for a simple test case.
To implement a testcase:
Extend your test from this function block
Add
{attribute 'test'}to the FB, so that it is identified as a testOptionally add any of the following attributes as desired
{attribute 'testcategory':='<add categories here>'}{attribute 'testcasename':='<new name>'}to use a testcasename other then the FB name{attribute 'testcasetimeout':='<timeout in ms>'}to alter the default timeout for this test
Add a call to
SUPER^()to your implementation of the FB.Overwrite method
Execute()to implement your testOptionally overwrite any of the following methods as desired
- InOut:
Scope
Name
Type
Comment
Inherited from
Input
xExecuteBOOLRising edge: Action startsFalling edge: Resets outputsIf a falling edge occurs before the function block has completed its action, the outputs operate in the usual manner and are only reset if either the action is completed or in the event of an error. In this case, the corresponding output values (xDone,xError,iError) are present at the outputs for exactly one cycle.ETrigA
xAbortBOOLTRUE: Action is stopped immediately and all outputs are reset to their initial values.ETrigA
Output
xDoneBOOLTRUE: Action successfully completedETrigA
xBusyBOOLTRUE: Function block activeETrigA
xErrorBOOLTRUE: Error occurred, function block aborts actionFALSE: No errorETrigA
xAbortedBOOLTRUE: Action aborted by userETrigA
xFinishedBOOLTestcase_Base
sInfoWSTRING(Constants.WSTRING_LENGTH)additional information (e.g. an error text)
Methods:
Structure: