You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# IOLink - A TwinCAT library for demonstrating TcUnit
2
2
3
3
This library project is used primarily for the demonstration purposes of the
4
-
[TwinCAT unit testing framework **TcUnit**](https://github.com/tcunit/TcUnit).
4
+
[TwinCAT unit testing framework **TcUnit**](https://github.com/TcUnit/TcUnit).
5
5
6
6
It implements certain parts of the IO-Link functionality.
7
-
IO-Link is a serial communication protocol for end devices such as various types
8
-
of sensors (temperature, pressure, etc) and actuators.
9
-
The functionality implemented in this library is related to the "diagnosis" part
10
-
of IO-Link, which in EtherCAT masters is implemented using the diagnosis history
11
-
object defined in the ETG1020 specification.
7
+
IO-Link is a serial communication protocol for end devices such as various types of sensors (temperature, pressure, etc) and actuators.
8
+
The functionality implemented in this library is related to the "diagnosis" part of IO-Link, which in EtherCAT masters is implemented using the diagnosis history object defined in the ETG1020 specification.
12
9
13
-
This library is explained in full detail in seven chapters on the website for the
Copy file name to clipboardExpand all lines: RunTestsInSequenceExampleProjects/MixedSequentialAndParallelTests/MixedSequentialAndParallelTests/MixedSequentialAndParallelTests.tsproj
Copy file name to clipboardExpand all lines: RunTestsInSequenceExampleProjects/MixedSequentialAndParallelTests/MixedSequentialAndParallelTests/MixedSequentialAndParallelTests/GVLs/GVL.TcGVL
Copy file name to clipboardExpand all lines: RunTestsInSequenceExampleProjects/MixedSequentialAndParallelTests/MixedSequentialAndParallelTests/MixedSequentialAndParallelTests/MixedSequentialAndParallelTests.plcproj
Copy file name to clipboardExpand all lines: RunTestsInSequenceExampleProjects/MixedSequentialAndParallelTests/MixedSequentialAndParallelTests/MixedSequentialAndParallelTests/POUs/FB_StateMachineFunctionBlock.TcPOU
Copy file name to clipboardExpand all lines: RunTestsInSequenceExampleProjects/MixedSequentialAndParallelTests/MixedSequentialAndParallelTests/MixedSequentialAndParallelTests/POUs/FB_TimedFunctionBlock.TcPOU
+1-1
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ VAR_OUTPUT
10
10
nValue : INT;
11
11
END_VAR
12
12
VAR
13
-
fbTimer : Tc2_Standard.TON := (PT := T#5S);
13
+
fbTimer : TON := (PT := T#5S);
14
14
END_VAR]]></Declaration>
15
15
<Implementation>
16
16
<ST><![CDATA[fbTimer(IN := bExecute); // Start timer on high trigger, reset timer on low
Copy file name to clipboardExpand all lines: RunTestsInSequenceExampleProjects/MixedSequentialAndParallelTests/MixedSequentialAndParallelTests/MixedSequentialAndParallelTests/Test/FB_StateMachineAndTimedFunctionBlock_Test.TcPOU
+10-10
Original file line number
Diff line number
Diff line change
@@ -17,15 +17,15 @@ TestVariant20(); // This test will fail]]></ST>
17
17
VAR_INST
18
18
// Function block under test
19
19
fbTimedFunctionBlock : FB_TimedFunctionBlock;
20
-
fbTon : Tc2_Standard.TON := (PT := T#10S); // The maximum time we will run the test
20
+
fbTon : TON := (PT := T#10S); // The maximum time we will run the test
21
21
END_VAR
22
22
VAR CONSTANT
23
23
EXPECTED_RESULT : INT := 100;
24
24
END_VAR]]></Declaration>
25
25
<Implementation>
26
26
<ST><![CDATA[(* Make sure to only run test logic if it's time for this test to execute *)
27
27
IF TEST_ORDERED('TestLongTime') THEN
28
-
GVL.timedfb_testLongTime := GVL.timedfb_testLongTime + 1; // Only for testing the framework. Ignore this.
28
+
GVL.nTimedFunctionBlockTestLongTime := GVL.nTimedFunctionBlockTestLongTime + 1; // Only for testing the framework. Ignore this.
29
29
fbTon(IN := TRUE); // Maximum time we will run the test
30
30
fbTimedFunctionBlock(bExecute := TRUE);
31
31
(* Check if we get a timeout or if we get the result we want *)
@@ -45,7 +45,7 @@ END_IF]]></ST>
45
45
VAR_INST
46
46
// Function block under test
47
47
fbTimedFunctionBlock : FB_TimedFunctionBlock;
48
-
fbTon : Tc2_Standard.TON := (PT := T#2S); // The maximum time we will run the test
48
+
fbTon : TON := (PT := T#2S); // The maximum time we will run the test
49
49
END_VAR
50
50
VAR CONSTANT
51
51
EXPECTED_RESULT : INT := 100;
@@ -54,7 +54,7 @@ END_VAR]]></Declaration>
54
54
<ST>< on the TcUnit FAQ.
20
-
**Note that version 1.2** (or later) of TcUnit is required to run test suites and tests in a sequence.
21
+
For more information see the [following FAQ](https://tcunit.org/#/faq?id=_7-is-it-possible-to-run-test-suites-andor-tests-in-a-sequence) on the TcUnit FAQ.
22
+
**Note that version 1.2** (or later) of TcUnit is required to run test suites and tests in a sequence.
Copy file name to clipboardExpand all lines: RunTestsInSequenceExampleProjects/SequentialTestSuitesAndTests/SequentialTestSuitesAndTests/SequentialTestSuitesAndTests.tsproj
Copy file name to clipboardExpand all lines: RunTestsInSequenceExampleProjects/SequentialTestSuitesAndTests/SequentialTestSuitesAndTests/SequentialTestSuitesAndTests/GVLs/GVL.TcGVL
0 commit comments