Technical FAQs

Ask a Question

BMXNOM0200H Dynamic Protocol Switching

Title
BMXNOM0200H Dynamic Protocol Switching
 
Issue
BMXNOM0200H Dynamic Protocol Switching
 
Product Line
M340 M580 BMXNOM0200
 
Environment
Unity Pro
 
Cause
N/A
 
Resolution
This describes how to change the protocol used by a CPU serial communication using the WRITE_CMD(IODDT_VAR1) command. This command can be used to switch between the following three protocols:
  • Modbus Slave
  • Modbus Master
  • Character Mode
NOTE: IODDT_VAR1 variable must be a T_COM_MB_BMX type. 
 
Changing Protocol: The Principle
NOTE: In order for changes to be made from one protocol to another, the processor must initially be configured to Modbus Slave mode.
You must create first an IODDT variable linked to the processor’s serial channel, then set to 1 the bit of word IODDT_VAR1.CONTROL (%MWr.m.c.24) that corresponds to the change of protocol desired:
  • TO_MODBUS_MASTER (Bit 12): Current protocol is changed to Modbus Master.
  • TO_MODBUS_SLAVE (Bit 13): Current protocol is changed to Modbus Slave.
  • TO_CHAR_MODE (Bit 14): Current protocol is changed to Character Mode.
NOTE: IODDT_VAR1.CONTROL (%MWr.m.c.24) is part of the IODDT variable IODDT_VAR1.
Afterwards, apply the WRITE_CMD instruction to the IODDT variable linked to the processor’s serial channel.
The diagram below shows the protocol changes to be made according to the bits of the IODDT_VAR1.CONTROL (%MWr.m.c.24) word set to 1:

Uses
Three protocol changes are used:
  • Transfer to Modbus Master: The protocol change is a two-stage process:
    • Transfer from the Modbus Slave configuration to the Modbus Master configuration
    • Return to the initial Modbus Slave configuration
The aim of Modbus Master configuration is to send information about an event to another PLC. When a change is made from Modbus Slave configuration to Modbus Master configuration, transmission, signal and physical line parameters remain the same. Only the values of the following parameters specific to Modbus Master configuration are changed:
  • The Delay Between Frames is set to its default value, which depends on transmission speed.
  • Answer delay is set to 3,000 ms
  • Number of retries set to 3
  • Transfer to Character Mode: This protocol change is a two-stage process:
    • Transfer from Modbus Slave configuration to Character Mode configuration
    • Return to the initial Modbus Slave configuration.
The aim of Character Mode configuration is to communicate with a private protocol (a modem, for instance). When a change is made from Modbus Slave configuration to Character Mode configuration, transmission, signal and physical line parameters remain the same. Only the message end parameter specific to Character Mode is set to stop on silence with a timeout of 1000 ms.
  • Transfer to the Character Mode and Modbus Master protocols: This protocol change is a three-stage process:
    • Transfer from Modbus Slave configuration to Character Mode configuration.
    • Transfer from Character Mode configuration to Modbus Master configuration.
    • Return to the initial Modbus Slave configuration.
The aim of Character Mode configuration is to communicate with a private protocol (a modem, for instance). Once the exchange has finished, the user switches to the Modbus Master configuration in order to send information about an event to another PLC. Once the message has been sent, the user returns to the initial Modbus Slave configuration.
NOTE: All three cases, the default configuration remains Modbus Slave. 
 
Cold and Warm Starts
Changes in protocol are not affected by the %S0 and %S1 bits (the bits set to 1 during a cold and warm start respectively). However, a cold or warm start of the PLC will configure the serial port to its default values or to values programmed into the application.
 
 
Was this helpful?
What can we do to improve the information ?