Data transfer via communication ports
718
Part III FP Instructions
SetCommunication
Mode
Switch communication mode between 'Program controlled' and
'MEWTOCOL-COM'
This instruction also exists as a P instruction (for FP2/2SH, FP3/5, FP10/10SH PLC types), which
is only executed at the rising edge of the EN trigger. Select [Insert P instruction] from the
"Instructions" pane if you require a P instruction. To facilitate reuse, the instruction then appears
under "Recently used" in the pop-up menu. Press <Ctrl>+<Shift>+<v> within the programming
area to open the list of recently used elements.
PLC types see see page 1330
Variable Data type Function
Port INT Specifies the CPU or MCU port number
bSetProgramControlled
Sets the communication mode:
TRUE: Program controlled mode
FALSE: MEWTOCOL-COM Slave [Computer Link] mode
Setting the MCU's COM Ports in PROG Mode via DIP Switches (FP2/2SH)
Use the DIP switches that are located at the back of the unit to set the operation mode and communication
speed.
Description
Sets the communication mode to the mode indicated by the value applied at
bSetProgramControlled. If this value is TRUE then the communication mode is set to Program
controlled mode (see page 712), if it is FALSE it is set to "MEWTOCOL-COM (see page 712) Slave
[Computer Link
]".
Data types
Example
In this example the function has been programmed in ladder diagram (LD) and structured text
(ST).The same POU header is used for all programming languages.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
LD
ST
SetCommunicationMode(Port := SYS_COM1_PORT,
bSetProgramControlled := bSetMode);