Skip to content

Commit 3fbd8f3

Browse files
author
sripp
committed
suport SystemFunction CTU
1 parent b326022 commit 3fbd8f3

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System.Linq;
2+
using TiaCodegen.Commands.Functions.Base;
3+
using TiaCodegen.Enums;
4+
using TiaCodegen.Interfaces;
5+
6+
namespace TiaCodegen.Commands.Functions
7+
{
8+
public class CTUCall : SystemFunctionBlockCall
9+
{
10+
public CTUCall(string instanceName,
11+
IOperationOrSignal cu = null,
12+
IOperationOrSignal r = null,
13+
IOperationOrSignal pv = null,
14+
IOperationOrSignal q = null,
15+
IOperationOrSignal cv = null) : base("CTU", instanceName, null)
16+
{
17+
Interface["CU"] = new IOperationOrSignalDirectionWrapper(cu, Direction.Input);
18+
Interface["R"] = new IOperationOrSignalDirectionWrapper(r, Direction.Input);
19+
Interface["PV"] = new IOperationOrSignalDirectionWrapper(pv, Direction.Input);
20+
Interface["Q"] = new IOperationOrSignalDirectionWrapper(q, Direction.Output);
21+
Interface["CV"] = new IOperationOrSignalDirectionWrapper(cv, Direction.Output);
22+
23+
TemplateValueName = "value_type";
24+
TemplateValueType = "Type";
25+
TemplateValue = "Int";
26+
HasNoEn = true;
27+
28+
Children.AddRange(Interface.Values.Where(x => x.OperationOrSignal != null).Select(x => x.OperationOrSignal));
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)