Delete space after //comment in all POU in Test directory
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.0">
|
||||
<POU Name="FB_tcUNIT_common" Id="{0f757d3d-99b7-46eb-bdc6-03aa126689f4}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[// tcUNIT Common function block: Contains helper methods for tcUNIT.
|
||||
<Declaration><![CDATA[//tcUNIT Common function block: Contains helper methods for tcUNIT.
|
||||
FUNCTION_BLOCK FB_tcUNIT_common
|
||||
|
||||
VAR
|
||||
@@ -11,18 +11,18 @@ END_VAR]]></Declaration>
|
||||
<ST><![CDATA[]]></ST>
|
||||
</Implementation>
|
||||
<Method Name="mEnableAxis" Id="{12e91532-7139-4c17-998e-4c670b584b9d}">
|
||||
<Declaration><![CDATA[METHOD mEnableAxis : BOOL
|
||||
<Declaration><![CDATA[METHOD mEnableAxis: BOOL
|
||||
VAR_INPUT
|
||||
iAxisIndex: UINT; // The idex of the axis to action the method on.
|
||||
iAxisIndex: UINT; //The idex of the axis to action the method on.
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[GVL.astAxes[iAxisIndex].stControl.bEnable := TRUE;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="mExecute" Id="{010bd927-5568-40db-a7c5-fcfe995a5cb1}">
|
||||
<Declaration><![CDATA[METHOD mExecute : BOOL
|
||||
<Declaration><![CDATA[METHOD mExecute: BOOL
|
||||
VAR_INPUT
|
||||
iAxisIndex: UINT; // The idex of the axis to action the method on.
|
||||
iAxisIndex: UINT; //The idex of the axis to action the method on.
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[GVL.astAxes[iAxisIndex].stControl.bExecute := TRUE;]]></ST>
|
||||
@@ -32,10 +32,10 @@ END_VAR]]></Declaration>
|
||||
<Declaration><![CDATA[METHOD mPrepareDefaultMove
|
||||
|
||||
VAR_INPUT
|
||||
iAxisIndex: UINT; // The idex of the axis to action the method on.
|
||||
iAxisIndex: UINT; //The idex of the axis to action the method on.
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[// Prepare an axis so it is ready to action a move using target defaults when executed.
|
||||
<ST><![CDATA[//Prepare an axis so it is ready to action a move using target defaults when executed.
|
||||
|
||||
GVL.astAxes[iAxisIndex].stControl.bEnable := TRUE;
|
||||
GVL.astAxes[iAxisIndex].stControl.eCommand := E_MotionFunctions.eMoveAbsolute;
|
||||
@@ -54,15 +54,15 @@ GVL.astAxes[iAxisIndex].stConfig.fPosition := tcUNIT_GVL.fDEFAULT_POSITION;]]></
|
||||
<Declaration><![CDATA[METHOD mPrepareMove
|
||||
|
||||
VAR_INPUT
|
||||
iAxisIndex: UINT; // The idex of the axis to action the method on.
|
||||
iAxisIndex: UINT; //The idex of the axis to action the method on.
|
||||
fTargetVelocity: LREAL;
|
||||
fTargetAcceleration: LREAL;
|
||||
fTargetDeceleration: LREAL;
|
||||
fTargetPosition: LREAL;
|
||||
eMotionStrategy: E_MotionFunctions; // The desired MotionFunctions motion strategy.
|
||||
eMotionStrategy: E_MotionFunctions; //The desired MotionFunctions motion strategy.
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[// Prepare the axis so it is ready to action a move when executed for a given motion strategy.
|
||||
<ST><![CDATA[//Prepare the axis so it is ready to action a move when executed for a given motion strategy.
|
||||
|
||||
GVL.astAxes[iAxisIndex].stControl.bEnable := FALSE;
|
||||
GVL.astAxes[iAxisIndex].stControl.eCommand := eMotionStrategy;
|
||||
@@ -80,7 +80,7 @@ GVL.astAxes[iAxisIndex].stConfig.fPosition := fTargetPosition;]]></ST>
|
||||
<Declaration><![CDATA[METHOD mSetAxisDefaults
|
||||
|
||||
VAR_INPUT
|
||||
iAxisIndex: UINT; // The idex of the axis to action the method on.
|
||||
iAxisIndex: UINT; //The idex of the axis to action the method on.
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[// Set PLC default values for the axis. Note: Status values can take multiple cycles to updated. This is not an instant reset.
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.0">
|
||||
<GVL Name="tcUNIT_GVL" Id="{4b23d6c9-6a88-40b7-9bf4-d55c4dfd4246}">
|
||||
<Declaration><![CDATA[// tcUNIT_GVL: Global variables used in tcUNIT tests.
|
||||
<Declaration><![CDATA[//tcUNIT_GVL: Global variables used in tcUNIT tests.
|
||||
{attribute 'qualified_only'}
|
||||
VAR_GLOBAL CONSTANT
|
||||
// Constants for axis defaults.
|
||||
//Constants for axis defaults.
|
||||
fDEFAULT_VELOCITY: LREAL := 0.0;
|
||||
fDEFAULT_ACCELERATION: LREAL := 0.0;
|
||||
fDEFAULT_DECCELERATION: LREAL := 0.0;
|
||||
fDEFAULT_POSITION: LREAL := 0.0;
|
||||
|
||||
fDEFAULT_TARGET_VELOCITY: LREAL := 1.0;
|
||||
fDEFAULT_TARGET_ACCELERATION: LREAL := 0.5;
|
||||
fDEFAULT_TARGET_DECCELERATION: LREAL := 0.5;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.0">
|
||||
<POU Name="FB_Axis_TEST" Id="{3bfca2b4-3b3f-48f2-9900-9d4cd3404e9e}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[// Test suite for the FB_Axis POU
|
||||
<Declaration><![CDATA[//Test suite for the FB_Axis POU
|
||||
{attribute 'call_after_init'}
|
||||
FUNCTION_BLOCK FB_Axis_TEST EXTENDS tcUnit.FB_TestSuite
|
||||
VAR
|
||||
fbCommon: FB_tcUNIT_common;
|
||||
iTargetAxis: UINT := 1; // The <index> of the axis within GVL.aAxes[<index>] to test against.
|
||||
iTargetAxis: UINT := 1; //The <index> of the axis within GVL.astAxes[<index>] to test against.
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[// Declare methods defined in the FB_Axis_TEST POU to be included (executed) in the test suite
|
||||
<ST><![CDATA[//Declare methods defined in the FB_Axis_TEST POU to be included (executed) in the test suite
|
||||
SetAxisControl_Enabled();
|
||||
CheckAxisStatus_Moving();
|
||||
SetAxisConfig_Acceleration();
|
||||
@@ -59,9 +59,9 @@ END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[TEST('test_GIVEN_new_axis_position_set_WHEN_executed_THEN_axis_moves_to_new_position');
|
||||
|
||||
// Since the axis has state; a test might begin the position at some location set by
|
||||
// a previous test. Therefore if we execute a move we should just check it's moved
|
||||
// from the initial location not some initial default.
|
||||
//Since the axis has state; a test might begin the position at some location set by
|
||||
//a previous test. Therefore if we execute a move we should just check it's moved
|
||||
//from the initial location not some initial default.
|
||||
|
||||
InitialValue := GVL.astAxes[iTargetAxis].stConfig.fPosition;
|
||||
ExpectedResult := InitialValue + 10;
|
||||
@@ -92,7 +92,7 @@ END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[TEST('test_GIVEN_new_axis_acceleration_set_WHEN_executed_THEN_new_axis_acceleration_set');
|
||||
|
||||
// example of direct GVL axis reference for assert.
|
||||
//example of direct GVL axis reference for assert.
|
||||
|
||||
ExpectedResult := tcUNIT_gvl.fDEFAULT_TARGET_ACCELERATION;
|
||||
fbCommon.mPrepareDefaultMove(iTargetAxis);
|
||||
@@ -118,7 +118,7 @@ END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[TEST('test_GIVEN_prepare_default_move_WHEN_move_prepared_THEN_axis_enabled');
|
||||
|
||||
// example of test that requires multiple cycles to complete. Due to stateful behaviour of the axis structure.
|
||||
//example of test that requires multiple cycles to complete. Due to stateful behaviour of the axis structure.
|
||||
|
||||
ExpectedResult := TRUE;
|
||||
GVL.astAxes[iTargetAxis].stControl.bEnable := ExpectedResult;
|
||||
@@ -148,7 +148,7 @@ END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[TEST('test_GIVEN_new_axis_velocity_set_WHEN_executed_THEN_new_axis_velocity_set');
|
||||
|
||||
// Example of using a tcUNIT assert for a specific type (in this case LREAL).
|
||||
//Example of using a tcUNIT assert for a specific type (in this case LREAL).
|
||||
|
||||
InitialValue := GVL.astAxes[iTargetAxis].stConfig.fVelocity;
|
||||
ExpectedResult := InitialValue + 0.5;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.0">
|
||||
<POU Name="tcUNIT_STD_LIB_RUN" Id="{5e8cc903-e536-40be-a096-d6b305fbb618}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[// tcUNIT Standard Library tests: Add program to PLC task in order to run tcUNIT tests against the declared POU test suites
|
||||
<Declaration><![CDATA[//tcUNIT Standard Library tests: Add program to PLC task in order to run tcUNIT tests against the declared POU test suites
|
||||
PROGRAM tcUNIT_STD_LIB_RUN
|
||||
VAR
|
||||
// Declare standard library POU tests to be run
|
||||
//Declare standard library POU tests to be run
|
||||
fbAxisTest: FB_Axis_TEST;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
|
||||
Reference in New Issue
Block a user