SetProgramControlled

Set communication mode to “Program controlled”

This instruction sets the communication mode to “Program controlled”

Parameters

Input

Port (INT)

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

Remarks

  • When the power is turned on, the communication mode selected in the system registers is set.

  • It is not possible to change to Modbus RTU mode or PLC Link mode during RUN mode.

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
		bEnableProgramControlled: BOOL:=FALSE;
		iPort: INT:=0;
	END_VAR

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 4 ;
        NETWORK_BODY
B(B_F,E_SetProgramControlled!,,17,0,28,4,,?DEN?DPort?AENO);
B(B_VARIN,,iPort,15,2,17,4,);
B(B_CONTACT,,bEnableProgramControlled,6,1,8,3,R);
L(8,2,17,2);
L(1,2,6,2);
L(1,0,1,4);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

IF DF(bEnableProgramControlled) then
    SetProgramControlled(Port := iPort);
END_IF;

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