FP_MOVE_BITS

Move bit data

This FP instruction moves a bit data from the bit data area specified by s1_Start and s2_End to the bit data block starting from the bit data area specified by d_Start if the trigger EN is TRUE.

Parameters

Input

s1_Start (BOOL)

Starting address of the source bit data area

s2_End (BOOL)

Ending address of the source bit data area

Output

d_Start (BOOL)

Starting address of the destination bit data area

Remarks

  • The input and output variables have to be of the same data type.

  • The operands s1_Start and s2_End should be:

    • in the same memory area, e.g. DT, WR, FL, LD ...

    • s1_Start £ s2_End

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • if the area specified using the index modifier exceeds the limit.
sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • if s1_Start > s2_End

Related topics:

Example

Global variables

In the global variable list you define variables that can be accessed by all POUs in the project.

POU header

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;
			(*activates the function*)
	END_VAR
	VAR_EXTERNAL
		bStartAddress: BOOL:=FALSE;
		bEndAddress: BOOL:=FALSE;
		bTargetAddress: BOOL:=FALSE;
	END_VAR

POU body

When the variable bStart is set to TRUE, the function is carried out. It moves the bits X1–X8 to the target area YD–Y14.

LD body

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_MOVE_BITS!,,13,1,22,6,,?DEN?Ds1_Start?Ds2_End?AENO?Cd_Start);
B(B_CONTACT,,bStart,6,2,8,4,);
B(B_VARIN,,bStartAddress,11,3,13,5,);
B(B_VARIN,,bEndAddress,11,4,13,6,);
B(B_VAROUT,,bTargetAddress,22,3,24,5,);
L(1,3,6,3);
L(8,3,13,3);
L(1,0,1,6);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

If (bStart) then
    FP_MOVE_BITS(s1_Start := bStartAddress, s2_End := bEndAdress, d_Start => bTargetAddress);
End_if;

Modified on: 2019-08-23Feedback on this pagePanasonic hotline