VAR_INPUT
// Input Parameters
myBit0_0 :BOOL;
myBit0_1 :BOOL;
myBit0_2 :BOOL;
myBit0_3 :BOOL;
myBit0_4 :BOOL;
myBit0_5 :BOOL;
myBit0_6 :BOOL;
myBit0_7 :BOOL;
//
myBit1_0 :BOOL;
myBit1_1 :BOOL;
myBit1_2 :BOOL;
myBit1_3 :BOOL;
myBit1_4 :BOOL;
myBit1_5 :BOOL;
myBit1_6 :BOOL;
myBit1_7 :BOOL;
END_VAR
VAR_OUTPUT
// Output Parameters
QWord :WORD;
END_VAR
VAR
MY_WORD : WORD :=16#0;
[B]BIT AT MY_WORD : STRUCT [/B]
[B]Bit0_0 :BOOL:=false;[/B]
[B]Bit0_1 :BOOL:=false;[/B]
[B]Bit0_2 :BOOL:=false;[/B]
[B]Bit0_3 :BOOL:=false;[/B]
[B]Bit0_4 :BOOL:=false;[/B]
[B]Bit0_5 :BOOL:=false;[/B]
[B]Bit0_6 :BOOL:=false;[/B]
[B]Bit0_7 :BOOL:=false; [/B]
[B]// [/B]
[B]Bit1_0 :BOOL:=false;[/B]
[B]Bit1_1 :BOOL:=false;[/B]
[B]Bit1_2 :BOOL:=false;[/B]
[B]Bit1_3 :BOOL:=false;[/B]
[B]Bit1_4 :BOOL:=false;[/B]
[B]Bit1_5 :BOOL:=false;[/B]
[B]Bit1_6 :BOOL:=false;[/B]
[B]Bit1_7 :BOOL:=false; [/B]
[B]END_STRUCT;[/B]
END_VAR
//SWAP ISLEMI LAZIM DEGILSE KULLANMAYIN ASAGISINI
BIT.Bit0_0 := myBit1_0;
BIT.Bit0_1 := myBit1_1;
BIT.Bit0_2 := myBit1_2;
BIT.Bit0_3 := myBit1_3;
BIT.Bit0_4 := myBit1_4;
BIT.Bit0_5 := myBit1_5;
BIT.Bit0_6 := myBit1_6;
BIT.Bit0_7 := myBit1_7;
//
BIT.Bit1_0 := myBit0_0;
BIT.Bit1_1 := myBit0_1;
BIT.Bit1_2 := myBit0_2;
BIT.Bit1_3 := myBit0_3;
BIT.Bit1_4 := myBit0_4;
BIT.Bit1_5 := myBit0_5;
BIT.Bit1_6 := myBit0_6;
BIT.Bit1_7 := myBit0_7;
//
QWord := MY_WORD;
END_FUNCTION_BLOCK