The leader in industrial automation and control solutions

Serial Protocol Communication Program

The Serial Protocol program allows users to define and configure the communication frame of the serial communication module manually.

Register Serial Protocol Program

Serial Protocol New Program in MapleLogic

Step 1: To create a new serial protocol program, in the Project Windowright-click Program and left-click New Program.

Serial Protocol New Program Selection in MapleLogic

Step 2: Left-click Serial Protocol and left-click OK.

Write Program

  • The following example demonstrates writing a program to read five WORDs from %MW100 of another branded PLC and store them in five WORDs starting from D100 of a Maple Systems PLC.
  • The communication uses Channel #1 (RS-232).

Program Configuration

Serial Protocol Program Configuration in MapleLogic
ItemDescirption
BaseModule Mounted Base
SlotModule Mounted Slot
CHSerial Communication Channel
Result: MStarting M Data Register

Frame Configuration

Serial Protocol Frame Configuration in MapleLogic
ItemDescription
Frame NameName of the frame
TX/RXTX: Transmit the frame
RX: Receive the frame
PeriodThe interval between sending/receiving the frame
Rx Frame After TxSpecifies the frame that corresponds to the response
AddDefines and adds a new segment
EditEdits and existing segment
DeleteDelete the existing segment
Move UpMoves the selected segment up
Mode DownMoves the selected segment down
  • To reposition a frame, type CTRL + X to remote it, navigate to the desired position and type CTRL + V.

Frame Set Up

Serial Protocol Frame Set Up in MapleLogic
  • To add a new frame, left-click Add.

Segment Configuration – Receiving Frame

  • RX frame of the continuous read command for the direct variable.
  • The receiving frame defines the frame contents to interpret from the response frame for the continuous read requesting frame of the other PLC’s direct variable.
  • This will set the header for the protocol.
Serial Protocol Header in MapleLogic
  • Set the Segment type to Fixed LengthLength to 1, and the Binary to 06.
    • The header for the ACK response from is ACK (O6H).

Station Number

  • The station number sets the area for the protocol.
  • Enter the station number of the other PLC.
    • In this example, the station number is 01H (1).
Serial Protocol Station Number in MapleLogic
  • Set the Segment type to Fixed Length, Length to 1, and the Binary to 01.

Command & Command Type

  • Continuous read command for the direct variable + command type rSB (r + SB).
Serial Protocol Command & Command Type in MapleLogic
  • Set the Segment type to Fixed LengthLength to 3, and the ASCII to rSB.

Number of Blocks & Data

  • The number of blocks is 1.
  • The number of data is 10.
    • (= 5 WORDs ×2, 0AH) → (01 + 0A)
Serial Protocol Number of Blocks & Data in MapleLogic
  • Set the Segment type to Fixed LengthLength to 4, and the ASCII to 010A.

Data

  • 5 WORDs will be received from the Glofa PLC starting at D100 (MapleLogic).
  • To display 5 WORDs as an ASCII code: 20 bytes = (5 WORDs × 4 characters)
Serial Protocol Data in MapleLogic
  • Set the Segment type to Memory LinkLength to 20Address to D00100, and the Convert to (from) to HEX.

Tail

  • The tail of the ACK frame is ETX (03H).
Serial Protocol Tail in MapleLogic
  • Set the Segment type to Fixed LengthLength to 1, and the Binary to 03.

BCC

  • BCC is the ASCII-converted value of the lowest 1 byte from the ASCII value that adds from the header to the tail.
Serial Protocol BCC in MapleLogic
  • Set the Segment type to Error Check(BCC)Length to 2Segment Range to 0 ~ 5, and the Convert to (from) to HEX.

Result

Serial Protocol Result in MapleLogic
  • This is the result of the receiving frame.

Segment Configuration – Transmitting Frame

  • The transmitting frame for the continuous read command of the direct variable.
    • This defines the request frame of the continuous read command for the direct variable.

Header

  • The header of the request frame is ENQ (05H).
Serial Protocol Header Segment Setup in MapleLogic
  • Set the Segment type to Fixed LengthLength to 1, and the Binary to 05.

Station Number

Serial Protocol Station Number Segment Setup in MapleLogic
  • Set the Segment type to Fixed LengthLength to 2, and the ASCII to 01.

Command & Command Type

Serial Protocol Command & Command Type Segment Setup in MapleLogic
  • Set the Segment type to Fixed LengthLength to 3, and the ASCII to rSB.

Variable Length, Name, and Data

  • The variable length is 6 bytes (06H).
  • The direct variable is %MW100%.
  • The number of WORDs is 5 (05H).
Serial Protocol Variable Length Name & Data in MapleLogic
  • Set the Segment type to Fixed LengthLength to 10, and the ASCII to 06%MW10005.

Tail

  • The tail of the ACK frame is EOT (04H).
Serial Protocol Tail Segment Setup in MapleLogic
  • Set the Segment type to Fixed LengthLength to 1, and the Binary to 04.

BCC

  • BCC is the ASCII-converted value of the lowest 1 byte from the ASCII value that adds from the header to the tail.
Serial Protocol BCC Segment Setup in MapleLogic
  • Set the Segment type to Error Check(BCC)Length to 2Segment Range to 0 ~ 4, and the Convert to (from) to HEX.

Result

Serial Protocol Result Frame Setup in MapleLogic
  • This is the result of the transmitting frame.

Frames

Serial Protocol Frames in MapleLogic
  • The receiving and transmitting frames will be displayed in the special program.