FP_COM_GET_PARAMETER

Get communication parameters from CPU/SCU/MCU port

This FP instruction reads the parameters of the communication port specified by s_Port of the CPU unit and stores the result in the DUT d1_dutParameter.

Parameters

Input

s_Port (WORD, INT, UINT)

Specifies the communication ports depending on the PLC type:

  • COM port e.g. SYS_COM0_PORT

  • MCU/SCU e.g. 16#xx01 (xx = slot number) in COM01

Output

d1_dutParameter (FP_COM_PARAMETER_DUT)

CPU/SCU/MCU parameters to be read

d2_dutPLCLinkParameter (FP_COM_PLCLINK_PARAMETER_DUT)

Starting address of parameters to be stored

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 the area specified using the index modifier exceeds the limit.

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
		bStart: BOOL:=FALSE;
		DUT_PLCLINK_PARAMETER: FP_COM_PLCLINK_PARAMETER_DUT;
		DUT_PARAMETER: FP_COM_PARAMETER_DUT;
	END_VAR

POU body

When the variable bStart changes from FALSE to TRUE, the function is carried out.

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 7 ;
        NETWORK_BODY
B(B_VAROUT,,DUT_PLCLINK_PARAMETER,21,4,23,6,);
B(B_VAROUT,,DUT_PARAMETER,21,3,23,5,);
B(B_VARIN,,0,6,3,8,5,);
B(B_CONTACT,,bStart,3,2,5,4,R);
B(B_F,FP_COM_GET_PARAMETER!,,8,1,21,6,,?DEN?Ds_Port?AENO?Cd1_dutParameter?Cd2_dutPlcLinkParameter);
L(1,3,3,3);
L(5,3,8,3);
L(1,0,1,7);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

IF DF(bStart) then
    FP_COM_GET_PARAMETER(s_Port := 0,
                         d1_dutScuParameter => DUT_PARAMETER,
                         d2_dutScuPlcLinkParameter => DUT_PLCLINK_PARAMETER);
END_IF;

Modified on: 2022-01-18Feedback on this pagePanasonic hotline