Byte combination
This FP instruction unifies the number of bytes specified at n_Bytes of the data starting at s_Start if the trigger EN is TRUE. The result is stored in d.
Input
Input value
Number of bytes to be unified, range: 0–65535
For n_Bytes=0, the instruction is not executed
Unused portions of the memory area are filled with zeros.
Output
Result
if the area specified using the index modifier exceeds the limit.
if the value at n_Bytes is out of range
if the area specified using the index modifier exceeds the limit.
if the value at n_Bytes is out of range
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR
bStart: BOOL:=FALSE;
dwSourceData: DWORD:=0;
dwResult: DWORD:=0;
END_VAR
When the variable bStart is set to TRUE, the function is carried out.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 6 ;
NETWORK_BODY
B(B_F,FP_UNIFY_BYTES!,,14,1,23,6,,?DEN?Ds_Start?Dn_Bytes?AENO?Cd);
B(B_VARIN,,dwSourceData,12,3,14,5,);
B(B_VARIN,,3,12,4,14,6,);
B(B_VAROUT,,dwResult,23,3,25,5,);
B(B_CONTACT,,bStart,5,2,7,4,);
L(1,3,5,3);
L(7,3,14,3);
L(1,0,1,6);
END_NETWORK_BODY
END_NET_WORK
END_BODY
IF (bStart) then
FP_UNIFY_BYTES(s_Start := dwSourceData,
n_Bytes := 4,
d => dwResult);
END_IF;