Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new FBType GEN_PULSE_DIST for Distance based Impulse Generator. #644

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<FBType Name="GEN_PULSE_DIST" Comment="Distance based Impulse Generator">
<Identification Standard="61499-1" Description="Copyright (c) 2025 HR Agrartechnik GmbH &#10; &#10;This program and the accompanying materials are made &#10;available under the terms of the Eclipse Public License 2.0 &#10;which is available at https://www.eclipse.org/legal/epl-2.0/ &#10; &#10;SPDX-License-Identifier: EPL-2.0&#10;&#10;Distance based Impulse Generator&#10;&#10;START with a HIGH Pulse. " >
</Identification>
<VersionInfo Organization="HR Agrartechnik GmbH" Version="1.0" Author="Franz Höpfinger" Date="2024-10-18" Remarks="initial Version">
</VersionInfo>
<VersionInfo Organization="HR Agrartechnik GmbH" Version="1.1" Author="Franz Höpfinger" Date="2024-10-18" Remarks="added Offset">
</VersionInfo>
<CompilerInfo packageName="signalprocessing::distance">
</CompilerInfo>
<InterfaceList>
<EventInputs>
<Event Name="REQ" Type="Event" Comment="Normal Execution Request">
<With Var="DIST_IN"/>
<With Var="DIST_OFF"/>
<With Var="DIST_HIGH"/>
<With Var="DIST_LOW"/>
</Event>
</EventInputs>
<EventOutputs>
<Event Name="CNF" Type="Event" Comment="Execution Confirmation">
<With Var="Q"/>
</Event>
</EventOutputs>
<InputVars>
<VarDeclaration Name="DIST_IN" Type="UDINT" Comment="Travelled Distance"/>
<VarDeclaration Name="DIST_OFF" Type="UDINT" Comment="Distance Offset"/>
<VarDeclaration Name="DIST_HIGH" Type="UDINT" Comment="Distance for Output HIGH"/>
<VarDeclaration Name="DIST_LOW" Type="UDINT" Comment="Distance for Output LOW"/>
</InputVars>
<OutputVars>
<VarDeclaration Name="Q" Type="BOOL" Comment="Output"/>
</OutputVars>
</InterfaceList>
<SimpleFB>
<InternalVars>
<VarDeclaration Name="DIST_REMAINDER" Type="UDINT" Comment=""/>
</InternalVars>
<Algorithm Name="REQ" Comment="">
<ST><![CDATA[ALGORITHM REQ

DIST_REMAINDER := (DIST_IN + DIST_OFF) MOD (DIST_HIGH + DIST_LOW);

IF (DIST_REMAINDER >= DIST_HIGH) THEN
Q := TRUE;
ELSE
Q := FALSE;
END_IF;

END_ALGORITHM

]]></ST>
</Algorithm>
</SimpleFB>
</FBType>
Loading