F_iecMoveStreamToStream
![F_iecMoveStreamToStream 1:](Images/gif/984921611__en-US__Web.gif)
This function copies data bytes from the source variable to the target variable and then deletes the copied data bytes from the source variable. The memory content of the source variable is reduced, the content of the target variable is increased.
Syntax
FUNCTION F_iecMoveStreamToStream : UDINT
VAR_INPUT
cbCopy : UDINT;
END_VAR
VAR_IN_OUT
target : ST_IEC870_5_101Stream;
source : ST_IEC870_5_101Stream;
END_VAR
Inputs
cbCopy: Number of data bytes to be copied from the source variable to the target variable.
Sample in ST
PROGRAM P_iecMoveStreamToStream
VAR
target : ST_IEC870_5_101Stream := ( length := 2, data := [16#AA, 16#BB] );
source : ST_IEC870_5_101Stream := ( length := 8, data := [1,2,3,4,5,6,7,8] );
cbReturn : UDINT;
bMove : BOOL := TRUE;
END_VAR
IF bMove THEN
bMove := FALSE;
cbReturn := F_iecMoveStreamToStream( source.length, target, source );
END_IF
Content of the target variable after program start:
length | data | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
10 | 16#AA | 16#BB | 16#01 | 16#02 | 16#03 | 16#04 | 16#05 | 16#06 | 16#07 | 16#08 | ... | IEC870_MAX_ASDU_DATA_BYTE |
content of the source variable after the program start:
length | data | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 16#01 | 16#02 | 16#03 | 16#04 | 16#05 | 16#06 | 16#07 | 16#08 | 16#00 | 16#00 | ... | IEC870_MAX_ASDU_DATA_BYTE |
Requirements
Development environment |
Target system type |
PLC libraries to be linked (category group) |
---|---|---|
TwinCAT v3.1.4012.0 |
PC oder CX (x86, x64, ARM) |
Tc2_IEC60870_5_10x (Communication->IEC60870) |