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

added WORDS_TO_DWORD.fct under assembling directory in utils typelib #242

Merged
48 changes: 48 additions & 0 deletions data/typelibrary/utils-1.0.0/typelib/assembling/WORDS_TO_DWORD.fct
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<Function Name="WORDS_TO_DWORD" Comment="">
<Identification Standard="61499-1" Description="Copyright (c) 2024 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" >
</Identification>
<VersionInfo Version="1.0" Author="franz" Date="2024-02-22">
</VersionInfo>
<CompilerInfo>
</CompilerInfo>
<InterfaceList>
<EventInputs>
<Event Name="REQ" Type="Event" Comment="">
<With Var="IN_00"/>
<With Var="IN_01"/>
</Event>
</EventInputs>
<EventOutputs>
<Event Name="CNF" Type="Event" Comment="">
<With Var="OUT"/>
</Event>
</EventOutputs>
<InputVars>
<VarDeclaration Name="IN_00" Type="WORD" Comment="WORD 00"/>
<VarDeclaration Name="IN_01" Type="WORD" Comment="WORD 01"/>
</InputVars>
<OutputVars>
<VarDeclaration Name="OUT" Type="DWORD" Comment="DWORD Output"/>
</OutputVars>
</InterfaceList>
<FunctionBody>
<ST><![CDATA[FUNCTION WORDS_TO_DWORD

VAR_INPUT
IN_00 : WORD; // WORD 00
IN_01 : WORD; // WORD 01
END_VAR

VAR_OUTPUT
OUT : DWORD; // DWORD Output
END_VAR

(* this Function combines the 2 WORDS to a dword *)
OUT := SHL(WORD_TO_DWORD(IN_01), SHIFT_WORD_01)
MoritzO02 marked this conversation as resolved.
Show resolved Hide resolved
OR SHL(WORD_TO_DWORD(IN_00), SHIFT_WORD_00);

END_FUNCTION
]]></ST>
</FunctionBody>
</Function>
Loading