Set communication mode
TRUE: “Program controlled”
FALSE: “MEWTOCOL-COM slave”/“MEWTOCOL-COM master/slave”
Input
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
Sets the communication mode:
TRUE: “Program controlled”
FALSE: “MEWTOCOL-COM slave”/“MEWTOCOL-COM master/slave”
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.
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
bSetMode: BOOL:=FALSE;
(*If TRUE, communication mode is set to 'Program controlled'*)
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 6 ;
NETWORK_BODY
B(B_VARIN,,SYS_COM1_PORT,9,3,11,5,);
B(B_VARIN,,bSetMode,9,4,11,6,);
B(B_F,SetCommunicationMode!,,11,2,24,6,,?DPort?DbSetProgramControlled);
L(1,0,1,6);
END_NETWORK_BODY
END_NET_WORK
END_BODY
SetCommunicationMode(Port := SYS_COM1_PORT,
bSetProgramControlled := bSetMode);