FP_MEWNET_W_SET_PARAMETERS

Set MEWNET-W parameters

This FP instruction sets the MEWNET-W parameters for the MEWNET-W unit in the slot specified by s1_Slot.

Input

s1_Slot (ANY16)

Slot number of expansion unit

s2_dutMewnetWParameters (FP_MEWNET_W_PARAMETERS_DUT)

Parameters to be set in the MEWNET-W unit

Output

d_Result (ANY16)

Starting address of the memory area in the master unit that stores the processing result (1 word)

Content of the processing result d_Result

  1.  (1) Bit 15: Process-in-progress flag

    FALSE: Process is completed

    TRUE: Process is in progress

  2.  (2) Bit 14: Execution result flag

    FALSE: Normal completion

    TRUE: Abnormal completion

  3.  (3) Lower byte: Execution result code
    • 0: Normal completion
    • 1: The specified communication port is invalid
    • 2: Setting error
    • 3: Mode change error
    • 4: The specified communication port is occupied
    • 5: Inconsistency of parameters to be changed (at the start/end of the setting process, parameters specified by operands are inconsistent)
    • 7: Unit number setting on the front panel of the multi-wire link unit (when the rotary switch is not set to 0)

Remarks

  • 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.

Example

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
		bEnable: BOOL:=FALSE;
		iSlot: INT:=0;
		dutMewnetWParameters: FP_MEWNET_W_PARAMETERS_DUT;
		wResult: WORD:=0;
	END_VAR

LD body

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_W_SET_PARAMETERS!,,15,2,32,7,,?DEN?Ds1_Slot?Ds2_dutMewnetWParameter?AENO?Cd_Result);
B(B_VARIN,,iSlot,13,4,15,6,);
B(B_VAROUT,,wResult,33,4,35,6,);
B(B_VARIN,,dutMewnetWParameters,13,5,15,7,);
L(1,0,1,7);
L(1,4,4,4);
L(6,4,15,4);
L(32,5,33,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

If (bEnable) Then
    FP_MEWNET_W_SET_PARAMETERS(s1_Slot := iSlot,
                               s2_dutMewnetWParameter := dutMewnetWParameters,
                               d_Result => wResult);
End_if;

Modified on: 2022-03-02Feedback on this pagePanasonic hotline