Fixed cycle time library namespace issues

This commit is contained in:
2026-02-19 12:02:55 +01:00
parent 64ed5cad37
commit d5a5d1b1e8
7 changed files with 29 additions and 17 deletions

View File

@@ -136,7 +136,7 @@
</System> </System>
<Plc> <Plc>
<Project GUID="{4E62D9E7-436C-457D-8DC4-82D2FEF91C96}" Name="BasicComponents" PrjFilePath="BasicComponents\BasicComponents.plcproj" TmcFilePath="BasicComponents\BasicComponents.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e" CopyTmcToTarget="true" CopyTpyToTarget="false" SymbolicMapping="true"> <Project GUID="{4E62D9E7-436C-457D-8DC4-82D2FEF91C96}" Name="BasicComponents" PrjFilePath="BasicComponents\BasicComponents.plcproj" TmcFilePath="BasicComponents\BasicComponents.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e" CopyTmcToTarget="true" CopyTpyToTarget="false" SymbolicMapping="true">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcHash="{994AF725-57BD-C8F2-A11E-43E32EDE2B55}" TmcPath="BasicComponents\BasicComponents.tmc"> <Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcHash="{63E07965-E818-C034-FD63-DBA12806D3FA}" TmcPath="BasicComponents\BasicComponents.tmc">
<Name>BasicComponents Instance</Name> <Name>BasicComponents Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID> <CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="2" AreaNo="1"> <Vars VarGrpType="2" AreaNo="1">

Binary file not shown.

View File

@@ -21,7 +21,7 @@
<GlobalVersionStructureIncluded>false</GlobalVersionStructureIncluded> <GlobalVersionStructureIncluded>false</GlobalVersionStructureIncluded>
<Company>Heisig GmbH</Company> <Company>Heisig GmbH</Company>
<Title>BaseComponents</Title> <Title>BaseComponents</Title>
<ProjectVersion>1.3.2</ProjectVersion> <ProjectVersion>1.3.3</ProjectVersion>
<DefaultNamespace>BC</DefaultNamespace> <DefaultNamespace>BC</DefaultNamespace>
<Author>M.Heisig</Author> <Author>M.Heisig</Author>
<Description>Basic components fb's (Valves, AI, AO, Motors, etc.)</Description> <Description>Basic components fb's (Valves, AI, AO, Motors, etc.)</Description>
@@ -112,6 +112,9 @@
<Compile Include="POUs\Components\Utilities\FC_HashFNV1a_32Bit.TcPOU"> <Compile Include="POUs\Components\Utilities\FC_HashFNV1a_32Bit.TcPOU">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="POUs\Components\Utilities\F_GetTaskCycleTime.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="POUs\Components\Valves\FB_Valve.TcPOU"> <Compile Include="POUs\Components\Valves\FB_Valve.TcPOU">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
@@ -2692,7 +2695,7 @@
<Type n="String">System.String</Type> <Type n="String">System.String</Type>
<Type n="UInt32">System.UInt32</Type> <Type n="UInt32">System.UInt32</Type>
</TypeList> </TypeList>
</XmlArchive> </XmlArchive>
</PlcProjectOptions> </PlcProjectOptions>
</ProjectExtensions> </ProjectExtensions>
</Project> </Project>

View File

@@ -33,7 +33,7 @@ END_VAR
_xFirstCycle := FALSE; _xFirstCycle := FALSE;
// Get current task time // Get current task time
_rT := LREAL_TO_REAL(UDINT_TO_LREAL(_TaskInfo[GETCURTASKINDEXEX()].CycleTime) * 1E-7); _rT := F_GetTaskCycleTime();
END_IF END_IF

View File

@@ -39,7 +39,7 @@ END_VAR
_xFirstCycle := FALSE; _xFirstCycle := FALSE;
// Get current task time // Get current task time
_rT := LREAL_TO_REAL(UDINT_TO_LREAL(_TaskInfo[GETCURTASKINDEXEX()].CycleTime) * 1E-7); _rT := F_GetTaskCycleTime();
_rPVLast := rPV; _rPVLast := rPV;
END_IF END_IF

View File

@@ -27,7 +27,7 @@ END_VAR]]></Declaration>
_xFirstCycle := FALSE; _xFirstCycle := FALSE;
// Get cycle time // Get cycle time
_rT := LREAL_TO_REAL(UDINT_TO_LREAL(_TaskInfo[GETCURTASKINDEXEX()].CycleTime) * 1E-7); _rT := F_GetTaskCycleTime();
END_IF END_IF
// If not enabled output equals input // If not enabled output equals input

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1">
<POU Name="F_GetTaskCycleTime" Id="{f260011a-790c-4820-8d51-924daa2b9f5a}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION F_GetTaskCycleTime : REAL]]></Declaration>
<Implementation>
<ST><![CDATA[F_GetTaskCycleTime := LREAL_TO_REAL(UDINT_TO_LREAL(TwinCAT_SystemInfoVarList._TaskInfo[GETCURTASKINDEXEX()].CycleTime) * 1E-7);]]></ST>
</Implementation>
</POU>
</TcPlcObject>