Set a replacement register for FL addresses
This instruction sets a replacement register for FL addresses when the FP7 communicates with other FP-series controllers via MEWTOCOL.
This FP instruction sets a replacement DT/LD register in the FP7 CPU if an FL register is specified by the partner FP-series PLC for MEWTOCOL-COM or MEWTOCOL-DAT communication. The instruction can be used for an FP7 with built-in SCU, built-in ET-LAN, or connected serial communication unit and is compatible with FP2SH.
Input
Memory area for the register replacing the FL register. (SYS_MEMORY_AREA_DT or SYS_MEMORY_AREA_LD)
Start address offset for the replacement of FL0, e.g. 100123 for DT100123.
Set this instruction to be executed only one time after switching to “RUN mode”.
This instruction cannot be executed while the built-in Ethernet is being initialized. Before you execute the instruction, make sure that sys_bIsEthernetIPAddressAssigned is set to FALSE.
if the offset specified at nOffset exceeds the limit of the memory area
if the offset specified at nOffset exceeds the limit of the memory area
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
bEnable: BOOL:=FALSE;
diOffset: DINT:=123456;
END_VAR
When the variable bEnable is set to TRUE, the function is executed.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_CONTACT,,bEnable,5,1,7,3,);
B(B_F,FP_MEWTOCOL_SET_MAPPING_START_FL!,,19,0,39,5,,?DEN?HnArea?DnOffset?AENO);
B(B_VARIN,,SYS_MEMORY_AREA_DT,17,2,19,4,);
B(B_VARIN,,diOffset,17,3,19,5,);
L(1,0,1,5);
L(1,2,5,2);
L(7,2,19,2);
END_NETWORK_BODY
END_NET_WORK
END_BODY
if (bEnable) then
FP_MEWTOCOL_SET_MAPPING_START_FL(nArea := SYS_MEMORY_AREA_DT, nOffset := diOffset);
end_if;