COM_SET_PROT

../_images/8bb2d657e38a9e670a33139000eba54e1

With the Function Block COM_SET_PROT, the serial interfaces of the CPU can actively be set on a predefined protocol or changed between several protocols from the user program.

The block COM_SET_PROT can be used for different functions:

  • Switching between two different protocols, for example ASCII/MODBUS
  • Switching the interface parameters of a protocol, for example changing the baudrate
  • Re-initialization of an interface protocol (for example, if an interface “hangs up”)
  • Switching between “Online access” and ASCII/MODBUS/SysLibCom depending on the current PLC mode, for example STOP=Online access, RUN=MODBUS (or ASCII, SysLibCom). In this case, the parameter “Enable login” does not have to be activated and the interface can use other interface parameters than required for “Online access” (see the following program example).

With the setting “COMx ““ Multi[SLOT]” in the configuration, several protocols can be predefined per COM. Using the Function Block COM_SET_PROT, the user can switch between these protocols from the user program. The rising edge (FALSE->TRUE) at the input EN activates the protocol which was selected over the inputs COM and IDX.

If the Function Block is used with a serial interface on which only one protocol was defined, the interface is initialized newly and the protocol started again.

Other applications of the Function Block can be e.g. a change of the baud rate or also a RESET defined of a protocol.

Available as of PLC runtime system: V2.0
Included in library: SysInt_AC500_V10.lib
Type Program