Set MEWNET-W2 station number
This FP instruction sets the MEWNET-W2 station number for the MEWNET-W2 unit in the slot number specified by s1_Slot.
Input
Slot number of expansion unit
Station number (setting range: 1–64)
The station number can be changed only when the rotary switch on the front panel of the unit is set to 0.
Output
Starting address of the memory area in the master unit that stores the processing result (1 word)
Content of the processing result d_Result
FALSE: Process is completed
TRUE: Process is in progress
FALSE: Normal completion
TRUE: Abnormal completion
Before you execute the instruction, make sure that the bit 15 (process in-progress flag) of the processing result storage area specified by dResult is FALSE.
The processing result is stored in the area specified by d_Result.If an error occurs, the execution result flag (bit 14) is turned to TRUE. The error code is stored in lower bytes of d_Result.
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;
iSlot: INT:=0;
wResult: WORD:=0;
iStationNumber: INT:=0;
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 := 7 ;
NETWORK_BODY
B(B_CONTACT,,bEnable,4,3,6,5,);
B(B_F,FP_MEWNET_W2_SET_STATION_NUMBER!,,15,2,34,7,,?DEN?Ds1_Slot?Ds2_StationNumber?AENO?Cd_Result);
B(B_VARIN,,iSlot,13,4,15,6,);
B(B_VAROUT,,wResult,34,4,36,6,);
B(B_VARIN,,iStationNumber,13,5,15,7,);
L(1,0,1,7);
L(1,4,4,4);
L(6,4,15,4);
END_NETWORK_BODY
END_NET_WORK
END_BODY
If (bEnable) Then
FP_MEWNET_W2_SET_STATION_NUMBER(s1_Slot := iSlot,
s2_StationNumber := iStationNumber,
d_Result => wResult);
End_if;