Posted in

By

11 of 18Updated 2026-11-1762 min read中文版

With the two built-in RS-485 communication ports and the serial expansion module of the M-series CPU Unit users can connect and integrate with smart peripherals that have the same serial hardware communication interface through communication.

The FUN151 (CLINK) communication connection convenience command can specify the working mode of the communication port. There are 5 working modes, including Mode 0, 1, 2, 3, 4, and 5.

The following table shows the description of the command mode.

Item

Type

Transmission Rate

Data Length

Transmission Code

Error Detection Method

Command Processing Speed

FUN151

(CLINK)

FATEK M1 Communication Protocol

(MD0)

4.8Kbps

~

921.6Kbps

8 bits

Binary Code

Based on Protocols

Scanning Time

User-Defined Communication Protocol

(MD1、2、4、5)

7/8 bits

FATEK High-Speed CPU Link

(MD3)

38.4kbps

~

921.6Kbps

FUN150(Modbus) communication connection command can specify the communication port to communicate with the Modbus Communication Protocols.

The following table is the description of the command mode:

Item

Type

Transmission Rate

Data Length

Transmission Code

Error Detection Method

Command Processing Speed

FUN150

(MODBUS)

Modbus RTU/ASCII

4.8Kbps

~

921.6Kbps

8 bits

Binary Code

Modbus CRC

Scanning Time

10-1 Function of Serial Communication Port

M-Series CPU Unit comprises two RS485 software interfaces, Port 1 and Port 2. If it is not enough, you can install another communication module (CM) to expand the communication port interface to fourteen at most. (PORT1~PORT4 and HCM ports). Communication module (CM) has two interfaces of RS232 or RS485 to choose from. UperLogic software have communication drivers that conform to the "FATEK M1 Communication Protocols". If the hardware interface and communication parameters are consistent, Communication port can be connected by connecting to the communication port of the "standard interface". If there is no communication driver that conforms to this protocol, in addition to writing commands conforming to the " FATEK M1 Communication Protocols" format to communicate with the PLC, you can also use the most commonly used Modbus RTU/ASCII Protocols in the industry to communicate with the PLC. Port 1 and Port 2 are also defaulted as FATEK standard communication interface in the factory setting or system initialization of PLC. In order to meet the wide application and demand of communication connection, Port 1 and Port 2 not only provide FATEK standard communication interface. It also provides support for powerful communication convenience commands, allowing users to write the required application communication programs through the Ladder program, which can easily achieve the purpose of system integration and decentralized monitoring.

Additional Port3 and Port4 are only supported on the MQ series.

For details, please refer to the descriptions in the following chapters.

In M SERIES PLC, its software comprises two types of software interfaces. Listed below are the types of software interfaces that can be set through the respective port:

Type Option

Software
interface

Communication port

Remark

Port1

Port2

Port3

Port3

Standard Interface

○

○

Fatek M1 Slave

Modbus RTU/ASCII Slave

Plugged-in Interface

○

○

Fatek M1 Slave

Modbus RTU/ASCII Slave

* MQ only

Ladder Function Interface

○

○

○

○

The Port will be controlled by

Ladder program.

*Only Port 2 supports High-Speed CPU Link

  • Standard Interface:

Port1–Port2 can be set as this type of interface. In such interface, the Port is controlled by the standard communication drive program (using FATEK’s M SERIES PLC communication protocol or Modbus RTU/ASCII communication protocol) installed in the M SERIES PLC and it is termed as the “standard interface”. To communicate with the “standard interface”, the online operation will be allowed after meeting FATEK’s M-SERIES PLC communication protocol or Modbus RTU/ASCII communication protocol.

  • Plugged-in Interface:

Only MQ-series PLC supports plugged-in interfaces, up to 2 ports, port 3 and port 4. The description of the function of this kind of interfaces is the same as standard interfaces.

  • Ladder Function Interface:

Such type of interface can be selected by Port1–Port4. When operating on such type of interface, such Port will be controlled by Ladder commands (e.g., FUN94, FUN150 and FUN151). Through the Ladder program, the user will be allowed to control such Port.

Provided below is the description of function and application when these two communication ports of M SERIES PLC are operating under the aforesaid two types of interfaces.

10-1-1 Communication Port1~Port4

Functional specification

  • Port 1 and Port 2 : RS485 interfaces with functional specification complying with EIA-RS485.
  • Port 3 and Port 4 : RS232/485 interfaces with functional specification complying with RS-232 and EIA-RS485 respectively.

Basic usage

There are 2 types of software interface are selectable as follows:

➀ Standard interface:

Connectable to peripherals with RS485 interface, such as computer, UperLogic , HMI, SCADA, etc.

➁ Ladder diagram Program controlled interface:

User can control Port1~Port4 through the ladder diagram instructions; FUN151 (CLINK) command takes control of Port1~Port4 to establish connection with FATEK CPU Link or peripherals with RS485 interfaces; FUN150 (MBUS) command can turn Port1~Port4 into a master of Modbus RTU/ASCII communication protocol for connecting Slaves with this communication protocol.

Extended usage

  • Under Standard interface, act as the Slave for multi-drop FATEK RS485.
  • Under Ladder diagram program-controlled interface types, Port1~Port4 has the following functions:

➀ Use MD0 mode of FUN151 (CLINK) instruction to act as the master for FATEK CPU Link network.

➁ Use MD1 mode of FUN151 (CLINK) instruction to actively connect to intelligent peripherals equipped with this communication interface, such as other brands’ PLC, servo driver, temperature controller, inverter, message display, etc.

➂ Use FUN150 (MBUS) instruction to act as the Master for Modbus RTU/ASCII communication protocol to connect to peripherals with this communication protocol.

10-1-2 Description of Communication Functions

For the computer equipment to be able to communicate, hardware interface and organization software interface (i.e., communication protocol) communication parameters must be consistent between the sender and receiver. The same is true for PLC. After meeting the above three basic elements, PLC can communicate with PLC or other peripherals. These three aspects are described here.

Matching between hardware interface and mechanism

In order to meet the different needs of various peripheral devices, M-Series PLC can expand S232, RS485 communication interfaces are available. When using, please confirm whether the interface is consistent? If different communication interfaces are connected together, it may cause permanent damage to the hardware. Please also confirm whether the connected signal is correct? For example: TxD must be connected to RxD, RTS will be connected to CTS, RS232, RS485 are explained as follows:

Port 1 ~ Port 4 & HCM Ports

If you purchase a communication module (CM), you can expand one to twelve communication port interfaces, and the maximum number of communication port interfaces can be expanded to 14 (Port1 ~ Port2+ HCM ports), except for MQ-series PLC(Port1 ~ Port4).

Port1 ~ Port4 are defaulted to the "FATEK communication interface" in the factory setting or when the PLC system is initialized. For HCM ports, users need to select the mode by themselves, and they must go to the device view to configure the settings. In order to meet the wide application of communication connections According to the requirements, Port1 ~ Port4 not only provide FATEK standard communication interface, but also provide convenient communication commands with powerful functions, so that users can write the required application communication programs through Ladder commands, which can easily achieve system integration and decentralization. Purpose of monitoring.

Communication port interface of the communication module (CM) has two options: RS232+RS485 or RS485+RS485

  • RS232 Communication interface

Each communication module (CM) provides one or two sets of RS232 communication interface (9 Pin D-sub female connector). For application, users can purchase a standard 9 Pin RS232 cable from a computer store, or use the following Make 9 Pin RS232 cable by yourself.

Signal

Port

Connector

TXD

RXD

RTS

CTS

SG

DTR

DSR

9Pin
D-sub

MALE

3

2

7

8

5

4

6

FEMALE

(HCM25 Module)

2

3

8

7

5

6

4

M-Series PLC is not used.

9P D-sub female > 9P D-sub male RS232 communication cable :

If you make RS232 cables by yourself and the definition of each pin is not clear, use a multimeter for measurement to determine TXD and RXD.

9 Pin connector: The pin 5 is SG;
Measure the pin 2 (red probe) and the pin 5 (black probe) with a multimeter. If it is approximately -9V, it means that the pin 2 is the transmission pin; If it is approximately 0V, it means that the pin 2 is the receiving pin.

Measure the pin 3 (red probe) and the pin 5 (black probe) by a multimeter. If it is approximately -9V, it means that the pin 3 is the transmission pin; If it is approximately 0V, it means that the pin 3 is the receiving pin.

• RS485 Communication interface

Each communication board (or module) provides one or two standard RS485 4-pin European plug-able terminal block. The pin assignment of connector(s) is show below.

Built-in RS485

CM module RS485

Selection and Setting of Communication Protocols

Setting Steps:

  • Select Communication Configuration:

Click "Communication Configuration " of "System Configuration" in "Project Management" on the left side of the software interface, as shown in the figure below, and then click "Serial Port Settings".

At this time, you can select the Modbus or FATEK communication protocol in the "Communication Configuration " in the "Advanced Settings" below, as shown in the figure below.

After the setting is completed, download it to the PLC.

  • Set protocol via special register:

R35355:High byte = 56H, the planned communication port is Modbus RTU / Modbus ASCII communication protocol interface.

= other values, don’t have the function above.

(FATAK communication protocol as default)

Low byte = Port1~4, FATEK / Modbus RTU / Modbus ASCII, the specified format of the communication protocol is as follows:

High byte Low byte

56H

b7

b6

b5

b4

b3

b2

b1

b0

Bits

Value

Description

b1b0

0 or 1

Port1/Port3 works FATEK communication protocol

2(b1:1, b0:0)

Port1/Port3 works Modbus RTU communication protocol

3(b1:1, b0:1)

Port1/Port3 works Modbus ASCII communication protocol

b3b2

0 or 1

Port2/Port4 works FATEK communication protocol

2(b3:1, b2:0)

Port2/Port4 works Modbus RTU communication protocol

3(b3:1, b2:1)

Port2/Port4 works Modbus ASCII communication protocol

※ It is allowed to designate multiple ports as the Modbus RTU communication protocol interface, as long as the corresponding bit is set to 1.

Setting example:

R35355=5602H, specify Port1 as Modbus RTU communication protocol interface

R35355=5608H, specify Port2 as Modbus RTU communication protocol interface

R35801=5602H, specify Port3 as Modbus RTU communication protocol interface

R35801=5608H, specify Port4 as Modbus RTU communication protocol interface

R35355=560AH, designate Port1 and Port2 as Modbus RTU communication protocol interface

R35801=560AH, designate Port3 and Port4 as Modbus RTU communication protocol interface

※ If the communication port of the PLC is to be used as a Modbus RTU / Modbus ASCII slave station, it can be used by planning a Modbus RTU / Modbus ASCII communication protocol interface according to the above method, and the Modbus address configuration must meet the application requirements.

※ Please refer to Chapter 10-4-2 for the conversion principles of Modbus and FATEK data addresses.

Port 1~Port 4 work as the master station of Modbus RTU/ASCII communication protocol

※ If PLC communication port is a Master station of Modbus RTU/Modbus ASCII, please follow FUN150 (M-BUS) instruction (refer to below diagram). Please refer to Chapter 10-4 for further details of FUN150 (M-BUS) instruction.

Settings for Communication Parameters

The factory default or system initial values ​​of the communication parameters of Port 1~Port 4 are as follows:

Baud Rate

9600 bps

Data length

8 Bits

Parity Check

Even

Stop Bit

1 Bit

Default communication parameters

Port

Register Setup

Default Value

Default

Baud Rate

Other Default Parameters

Port 1

R35352

5661H

9600 bps

8-bit Data、 Even、1-bit Stop

Port 2

R35353

5661H

9600 bps

8-bit Data、 Even、1-bit Stop

Port 3

R35798

5661H

9600 bps

8-bit Data、 Even、1-bit Stop

Port 4

R35799

5661H

9600 bps

8-bit Data、 Even、1-bit Stop

※ When a port is set to Modbus RTU communication protocol, data bit is always 8-bit.

※ Port 1~Port 4 also provide Baud Rate settings for user-defined (4800 bps~1152000 bps).

Setup of Port 1~Port 4 communication parameters

Port communication parameters can be found by Project->Communication Configuration->Serial Port.

Without station number checking for HMI or SCADA connecting

While PLC communicating with UperLogic, it recognizes the FATEK M1 communication protocol.

While PLC communicating with Man Machine Interface (MMI) or Supervising software (SCADA), it recognizes the FATEK binary communication protocol.

Low byte of R35354 = 1, Port 1 without station number checking while FATEK’s external communication protocol.

High byte of R35354 = 1, Port 2 without station number checking while FATEK’s external communication protocol.

Low byte of R35800 = 1, Port 3 without station number checking while FATEK’s external communication protocol.

High byte of R35800 = 1, Port 4 without station number checking while FATEK’s external communication protocol.

Transmission delay time setting

While the communication port being used as the master of FATEK CPU LINK (FUN151) or Modbus RTU (FUN150) network, it allows the user to set the transmission delay time to slow down the expiration of message frame.

High byte of R35357: Port 1 transmission delay time setting (Unit in 10mS)

High byte of R35358: Port 2 transmission delay time setting (Unit in 10mS)

High byte of R35803: Port 3 transmission delay time setting (Unit in 10mS)

High byte of R35804: Port 4 transmission delay time setting (Unit in 10mS)

Receive time-out span setting

When the communication port of the PLC uses FUN150 (M-BUS) or FUN151 (CLINK) as the master of the Modbus or Fatek communication network. After sending a command, it must complete the transmission of all response messages within the set time. When the time is up, if the receiving party does not respond or the response is not completed, it is determined that the communication transaction command has failed.

Low byte of R35357: Port 1 receive time-out span setting (Unit in 10mS).

Low byte of R35358: Port 2 receive time-out span setting (Unit in 10mS).

Low byte of R35803: Port 3 receive time-out span setting (Unit in 10mS).

Low byte of R35804: Port 4 receive time-out span setting (Unit in 10mS).

New message detection time interval setting

While the communication port being used as the master or slave of Modbus RTU communication protocol, the system will give the default time interval to identify each packet of receiving message.

Without station number checking for FATEK’s internal communication protocol

While PLC communicating with UperLogic, it recognizes the FATEK’s internal communication protocol, the quick way to communicate with the PLC is to key in 255 as the station number for UperLogic to connect with the unsure station number of target.

Related internal relay

Communication

Port

Port ready

Indication relay

Indication relay to complete the last command

Port1

M9135

M9136

Port2

M9138

M9139

Port3

M9149

M9150

Port4

M9152

M9153

10-1-3 Description and Application of Software Interface Types

As described in Section 10.1, the built-in communication port has 3 types of software interfaces, Port1~Port2 are both Standard Interface and Ladder Function Interface. Port3~Port4 are both Plugged-in Interface and Ladder Function Interface. The interface type is based on PLC’s CPU of user’s program setting (when user used communication-controlled instruction FUN150 and FUN151, it will automatically set to “Ladder Diagram Program Controlled Interface”).

Standard/Plugged-in Interface

Standard and plugged-in interface differs in that plugged-in ones are not inherently built in, and only MQ-series PLC supports this kind of interface. The interface is controlled by PLC CPU, and the communication transaction of the ports is controlled by FATEK “Standard Communication Driver” or “Modbus Communication Driver”. All accesses to the port must be executed in the format of “FATEK-PLC Protocol” or “Modbus Communication Driver”. UperLogic software package, and many HMI and SCADA have communication drivers conforming to “FATEK-PLC Protocol”, so linkage is built immediate when the “standard interface” port is connected and the hardware interface and communication parameters are consistent. When no such conforming communication driver is available, additional commands that conform to the format of “FATEK-PLC Protocol” or “Modbus Communication Driver” must be written for PLC communication.

Ladder Function Interface

This type of interface can be set up for Port1~Port4. The ladder program that are used to control the ports are FUN150 (M-BUS) and FUN151 (CLINK).

FUN150 (M-BUS) controls Port 1~Port 4 and uses them as masters on the Modbus network. The ports can connect to Modbus peripherals (slaves) easily. Refer to the “Convenient instruction for Modbus RTU Master” below for more information.

FUN151 (CLINK) controls Port 1~Port 4and uses them for resource sharing among PLCs or connection to intelligent peripherals. FUN151 provides three operation modes. Refer to the “FATEK Binary Master/Slave Protocols” below for more information.

10-2 FATEK Binary Communication Protocol

FUN151 (CLINK) Usage Step

D:\patrick\說明書翻譯_功能篇\圖\圖片5.png

  • Station number can be any one from 1 to 254, but cannot be repeated
  • Please refer to the section Communication parameter setting instructions.
  • MD3 is only for Port2.

10-2-1 Description and examples of instruction

This chapter will explain the usage of the MD0 working modes of the FUN151 (CLINK) command with practical application examples.

FUN151(CLINK):MD0 Communication Connection Facilitation Command

FUN151

CLINK

FUN151(CLINK):MD0 Communication Connection Facilitation Command (which makes PLC act as the master station in FATEK communication protocol through PORT 1~4)

FUN151

CLINK

Symbol

Pt : Assign the port, 1~4

MD: 0, master station of CPU LINK (Using FATEK communication protocol).

SR: Starting register of communication table

WR: Starting register for instruction operation. It controls 8 registers; the other programs can not repeat in using.

Range

Operand

HR

ROR

DR

K

R0

∣

R34767

R43224

∣

R47319

D0

∣

D7999

Pt

1-4

MD

0

SR

○

○

○

WR

○

○*

○

FUN151

CLINK

FUN151(CLINK):MD0 Communication Connection Facilitation Command (which makes PLC act as the master station in FATEK communication protocol through PORT 1~4)

FUN151

CLINK

Description

  1. FUN151 (CLINK): MD 0 mode provides data sharing between FATEK PLC and PLC
  2. The master PLC may connect with 254 slave stations through the RS485 interface.
  3. Only the master PLC needs to use FUN151 instruction, the slave doesn’t need.
  4. It employs the program coding method or table filling method to plan for the data flow controls; i.e. from which one of the slave station to get which type of data and save them to the master PLC, or from the master PLC to write which type of data to the assigned slave station. It needs only 7 registries to make definition; every 7 registers define one packet of data transaction.
  5. When execution control 〝EN〞 changes from 0→1 and both inputs “PAU” and “ABT” are 0, and if the port hasn’t been controlled by other communication instructions, detecting that M9135/M9138/M9149/M9152=1, this instruction will control the port immediately and set the M9135/M9138/M9149/M9152 to be 0 (which means it is being occupied), then going on a packet of data transaction immediately. If the port has been controlled (M9135/M9138/M9149/M9152= 0), then this instruction will enter into the standby status until the controlling communication instruction completes its transaction or pause/abort its operation to release the control right ( M9135/M9138/M9149/M9152=1), and then this instruction will become enactive, set M9135/M9138/M9149/M9152 to be 0, and going on the data transaction immediately.
  6. While in transaction processing, if operation control “PAU” becomes 1, this instruction will release the control right (M9135/M9138/M9149/M9152 = 1) after this transaction. Next time, when this instruction takes over the transmission right again, it will restart from the next packet of data transaction.
  7. While in transaction processing, if operation control “ABT” becomes 1, this instruction will abort this transaction immediately and release the control right (M9135/M9138/M9149/M9152 = 1). Next time, when this instruction takes over the transmission right again, it will restart from the first packet of data transaction.
  8. While it is in the data transaction, the output indication “ACT” will be ON.
  9. When a data transaction is completed, if there is an error, the output indication "DN" and "ERR" will be ON at the same time.
  10. If there is no error occurred when it finishes a packet of data transaction, the output indication “DN” will be ON.
  11. If "EN" is ON, the communication will continue.

FUN151

CLINK

FUN151(CLINK):MD0 Communication Connection Facilitation Command (which makes PLC act as the master station in FATEK communication protocol through PORT 1~4)

FUN151

CLINK

Description

Port Interface Signal

List of relays and registers used by communication ports:

Communication Port

Interface Signal

Port 1

Port 2

Port 3

Port 4

1. Port occupation indication

M91355

M9138

M9149

M9152

2. Port command complete indication

M9136

M9139

M9150

M9153

3. Port communication parameter register

etting register

R35352

R35353

R35798

R35799

4. Transmit Delay and Receive Anomaly Detection Register

R35357

R35358

R35803 

R35804

  1. Port occupation indication: the signal is generated by CPU, ON signal means the Port can accept new orders to send data. OFF means the Port is being occupied and cannot accept new commands to transmit data.
  2. Port command completion indication: This signal is generated by the CPU. When the last transaction of the communication program is completed, it is ON for one scan time (continuous transmission). When the last transaction of the communication program is completed, ON (discontinuous transmission).
  3. Port communication parameter setting register: (10-1-2 Description of Communication Functions).
  4. Transmission delay and reception abnormality detection register:
    Low Byte: Define the error detection time-out time of CLINK command, the unit is 0.01 second. The CLINK command uses the Time-out time to judge whether the communication object is online correctly; when the master station sends a read or write command to the slave station, if the slave station does not respond within this time, it means that the communication Time-out is abnormal. When multiple devices are connected, adjust this value appropriately (more than one scan time of the slave station with the longest scan time), so that if more than one slave station is not powered on (time-out will occur), there will be a connection PLC communication does not significantly affect scan time.
    High Byte: Define the transmission delay time between one transaction and one transaction of CLINK instruction, the unit is 0.01 second. If there is only one-to-one connection, this value can be set to 0 to shorten communication transaction time and improve communication efficiency. When multiple devices are connected, if the master station needs to delay the sending of communication commands to improve the communication quality, this value can be set.

FUN151

CLINK

FUN151(CLINK):MD0 Communication Connection Facilitation Command (which makes PLC act as the master station in FATEK communication protocol through PORT 1~4)

FUN151

CLINK

Example

Use Port 2 to execute communication command program

When M1 = ON, the master station will continue to read the slave station data through Port 2, or write data to the slave station

Editing Communication Table with UperLogic

Click the “Link Table” Item which in project windows: Project name

Table Edit

Link Table 🡪

Click right button and select “New Link Table”.

FUN151

CLINK

FUN151(CLINK):MD0 Communication Connection Facilitation Command (which makes PLC act as the master station in FATEK communication protocol through PORT 1~4)

FUN151

CLINK

D:\patrick\說明書翻譯_功能篇\圖\fun151_3.png

Figure 57 Table of communication command

FUN151

CLINK

FUN151(CLINK):MD0 Communication Connection Facilitation Command (which makes PLC act as the master station in FATEK communication protocol through PORT 1~4)

FUN151

CLINK

D:\patrick\說明書翻譯_功能篇\圖\FUN151_4.PNG

Figure 58 Table of Normal Link

  • Table Type: MD0 must be selected “Normal Link Table”.
  • Table Name: For modification or debug, you can give a convenient name.
  • Table Starting Address: Enter the address which is the starting register of communication table to store the data exchange list.

※ To make it easy to edit, read, and maintain the communication program, we have extended following related instructions under FUN150 and FUN151. The use method is taking focus on FUN150 or FUN151, and press the hotkey “Z”. When “Table Edit” windows appear, then you can edit the communication table.

FUN151

CLINK

FUN151(CLINK):MD0 Communication Connection Facilitation Command (which makes PLC act as the master station in FATEK communication protocol through PORT 1~4)

FUN151

CLINK

D:\patrick\說明書翻譯_功能篇\圖\fun151_5.PNG

Figure 59 Table of Normal Link_Communicatoin Command Setting

  • Command: read is the master read data back from the slave, write is write data from the master to the slave.
  • Slave Station: The station number of the slave station to be transmitted.
  • Master data: read is the location where the data is read from the slave station and stored, and write is where the data is written from the master station to the slave station.
  • Slave data: read is the position that the slave station wants to send back to the master station, and write is the position of writing data from the master station to the slave station.
  • Data Length: The length to be sent, the range is 1 ~ 64.

FUN151

CLINK

FUN151(CLINK):MD0 Communication Connection Facilitation Command (which makes PLC act as the master station in FATEK communication protocol through PORT 1~4)

FUN151

CLINK

Explanation for MD0 Operand SR

SR:Starting register for communication program of CLINK instruction。

SR+0

Total transactions

  • Low Byte is valid; one transaction takes 7 registers to describe, which means 7 registers define a packet of data transaction.

SR+1

Slave station No. which is about

to transact with

  • Low Byte is valid, 0 to 254 (if it is 0: it means that the master PLC sends a broadcast to all slave PLCs, and the slave PLC does not respond).

SR+2

Command code

  • Low Byte is valid; =1, means reading data from slave PLC; =2, means writing data to slave PLC.

SR+3

Data length of this transaction

  • Low Byte is valid; the range is 1~64.

SR+4

Data type of Master PLC

  • Low Byte is valid, and its range is 0 to 13; it defines the data type of master PLC (see next page).

SR+5

Starting reference of Master PLC

  • Word is valid; it defines the starting address of data (master).

SR+6

Data type of slave PLC

  • Low Byte is valid, and its range is 0 to 13; it defines the datatype of slave PLC (see next page).

SR+7

Starting reference of Slave PLC

  • Word is valid; it defines the starting address of data (slave).

FUN151

CLINK

FUN151(CLINK):MD0 Communication Connection Facilitation Command (which makes PLC act as the master station in FATEK communication protocol through PORT 1~4)

FUN151

CLINK

SR+8

Slave station No. which is about

to transact with

SR+9

Command Code

SR+10

Data length of this transaction

SR+11

Data type of Master PLC

Description of the 2nd packet of transaction.

SR+12

Starting reference of Master PLC

SR+13

Data type of slave PLC

SR+14

Starting reference of Slave PLC

FUN151

CLINK

FUN151(CLINK):MD0 Communication Connection Facilitation Command (which makes PLC act as the master station in FATEK communication protocol through PORT 1~4)

FUN151

CLINK

Master/Slave data type, code and reference number

Data code

Data type

Reference number

0

X (discrete input)

0~1023

1

Y (discrete output)

0~1023

2

M (internal relay M)

0~9119

3

S (step relay S)

0~3103

4

T (timer contact)

0~1023

5

C (counter contact)

0~1023

6

WX (word of discrete input ,16 bits)

0~1008, it must be the multiple of 16.

7

WY (word of discrete output ,16 bits)

0~1008, it must be the multiple of 16.

8

WM (word of internal relay,16 bits)

0~9104, it must be the multiple of 16.

9

WS (word of step relay,16 bits)

0~3088, it must be the multiple of 16.

10

TR (timer register)

0~1023

11

CR (counter register)

0~1023

12

R (data register)

0~34767

13

D (data register)

0~7999

Note: The data type for master and slave must be consistent. i.e., if the master station is any value between 0 to 5, the slave station must also be any value between 0 to 5; if the master station is any value between 6 to 13, the slave station must also be any value between 6 to 13.

FUN151

CLINK

FUN151(CLINK):MD0 Communication Connection Facilitation Command (which makes PLC act as the master station in FATEK communication protocol through PORT 1~4)

FUN151

CLINK

FUN151: Explanation for the Operand WR of MD0

High Byte Low Byte

WR+0

Result code

Transaction

No.

  • Transaction No.: the operating transaction

(starting from 0)

  • Result code indicates the transaction result; 0= normal,

other value = abnormal.

WR+1

Station No.

Command

code

  • Command = 0H, reading system status from slave PLC.

= 1H, writing system status from slave PLC.

  • Station No.: the slave station number which is in transaction.

WR+2

For internal operation

WR+3

For internal operation

WR+4

For internal operation

WR+5

For internal operation

WR+6

For internal operation

WR+7

For internal operation

Result code: 0, this transaction is successful.

2, data length error (data length is 0 or greater than 64 in one transaction).

3, command code error (command code is greater than 2).

4, data type error (data type is greater than 13, please refer to data type code).

5, reference number error (please refer to reference number).

6, inconsistence in data type (e.g., master station is 0~5 while slave is 6~13).

A, no response from slave station (Time-out error).

B, communication error (received error data).

FUN151

CLINK

FUN151(CLINK):MD0 Communication Connection Facilitation Command (which makes PLC act as the master station in FATEK communication protocol through PORT 1~4)

FUN151

CLINK

  • For easier programming and troubleshooting, the UperLogic provides the table editing environment to edit the communication table of FUN151 instruction; Key in the complete FUN151 instruction first and then move the cursor to the position of it, depressing the "Z" key, now comes the table editing environment. The user can create the new communication table or display the existed table under this friendly user interface operation.

Communication Table for Normal Link (MD0)

Command

Slave

Master Data

Slave Data

Length

Read (=1)

Write (=2)

Describing the station number of slave PLC which is about to transact with.

Station number=0, The master PLC broadcasts the data to all slave PLCs and slave PLCs will not reply.

Station number=N, it means the station number of the slave PLC which is about to transact with the master PLC

N=1~ 254

Describing the data type & reference number of this packet of transaction for the master PLC.

X0~X1023

Y0~Y1023

M0~M9119

S0~S3103

T0~T1023

C0~C1023

WX0~WX1008

WY0~WY1008

WM0~WM9104

WS0~WS3088

TR0~TR1023

CR0~CR1023

R0~R34767

D0~D7999

Describing the data type & reference number of this packet of transaction for the slave PLC.

X0~X1023

Y0~Y1023

M0~M9119

S0~S3103

T0~T1023

C0~C1023

WX0~WX1008

WY0~WY1008

WM0~WM9104

WS0~WS3088

TR0~TR1023

CR0~CR1023

R0~R34767

D0~D7999

Data length of this transaction.

1~64

10-3 User-Defined Communication Protocols

The functions of MD1 and MD4 are both connected to intelligent peripheral devices with a counterpart communication interface, so that PLC can be used as data transmission (automatic transmission) through Port 1 and 4. The difference is that the transmission data of MD1 will only occupy one Low Byte in a Word, while the transmission data of MD4 will occupy the High Byte and Low Byte in a Word.

The functions of MD2 and MD5 are ready to receive at any time. The message sent by the intelligent peripheral equipment of the RS485 communication interface makes the PLC receive data through these ports (passive reception). The difference is that the received data of MD2 will only occupy one Low Byte in a Word, and the received data of MD5 will occupy the High Byte and Low Byte in a Word.

10-3-1 Instruction description and examples

This chapter will explain the usage of the working modes (MD1, MD4, MD2, MD5) of FUN151 (CLINK) command with examples of actual applications.

FUN151(CLINK):MD1、MD4 Communication Connection Convenience Command

FUN151

CLINK

FUN151(CLINK):MD1、MD4 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Symbol

Pt:Assign communication port, 1~4.

MD:1 & 4;Connect with intelligent peripheral devices with serial communication interfaces.

SR:Communication transmission table start register.

(Look at the example description).

WR:Instruction operation start register (see example description), a total of 8 registers are occupied, and other programs cannot be reused.

Range

Operand

HR

ROR

DR

K

R0

∣

R34767

R43224

∣

R47319

D0

∣

D7999

Pt

1~4

MD

1、4

SR

○

○

○

WR

○

○*

○

MD1 and MD4 are used to connect with intelligent peripheral devices with RS-485 communication interface, so that PLC can be used as data transmission (automatic transmission) through Port 1~Port 4. The difference is that the transmission data of MD1 will only occupy one Low Byte in a Word, and the transmission data of MD4 will occupy the High Byte and Low Byte in a Word, please refer to the description of the follow-up SR for details.

FUN151

CLINK

FUN151(CLINK):MD1、MD4 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Function Description

  1. FUN151 (CLINK): MD1 and MD4 modes are mainly provided for FATEK PLC to actively connect with intelligent peripheral devices using serial communication interfaces.
  2. One master PLC can connect with multiple peripheral devices with the same protocol.
  3. The communication format is written by the UperLogic program and must be consistent with the communication peripheral to be connected in order to successfully connect.
  4. When the execution control "EN" changes from 0 to 1 and both the suspend operation "PAU" and the abort operation "ABT" are 0, if the specified communication port is not occupied by other communication commands, detecting M9135/M9138/M9149/M9152=1, then this command will control the communication port immediately, and set M9135/M9138/M9149/M9152 to 0 (indicating occupation), and then immediately carry out data transmission transactions. If the specified communication port is already occupied (M9135/M9138/M9149/M9152 = 0), this command enters the waiting state until the occupied communication command is sent or the operation is suspended/abandoned, and after the control is released (M9135/M9138/M9149/M9152 = 1), This instruction immediately leaves the waiting state, sets M9135/M9138/M9149/M9152 to 0, and immediately carries out the transmission transaction
  5. When the transmission transaction is in progress, if the suspension operation "PAU" becomes 1, this instruction will suspend the operation and release the control right after the transaction data transmission is completed at that time (M9135/M9138/M9149/M9152 =1).
  6. During the transfer transaction, if abandon operation then "ABT" becomes 1, this instruction will immediately stop the transfer and release the control right (M9135/M9138/M9149/M9152 =1).
  7. When the data transaction is being transmitted, the output indication "ACT" is ON.
  8. When a data transaction has been transmitted (completed or transmitted and then received), if an error occurs, the output indication "DN" and "ERR" will be ON at the same time.
  9. When a data transaction has been transmitted (completed or transmitted and then received), if no error occurs, the output indication "DN" will be ON.

FUN151

CLINK

FUN151(CLINK):MD1、MD4 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Function Description

Port Interface Signal

List of relays and registers used by communication ports:

Communication Port

Interface Signal

Port 1

Port 2

Port 3

Port 4

1. Port occupation indication

M91355

M9138

M9149

M9152

2. Port command complete indication

M9136

M9139

M9150

M9153

3. Port communication parameter register

etting register

R35352

R35353

R35798

R35799

4. Transmit Delay and Receive Anomaly Detection Register

R35357

R35358

R35803 

R35804

  1. Port Occupation Indication: This signal is generated by the CPU.
    ON represents the Port accepts new commands to transmit data.
    OFF means that the Port is being occupied and cannot accept new commands to transmit data.
  2. Port Command Completion Indication: This signal is generated by the CPU.
    ON, complete a data transaction.
  3. Port Communication Parameter Setting Register :(Refer to 10-1-2 Description of Communication Functions)
  4. Transmit Delay and Receive Anomaly Detection Register:
    Low Byte: Define the abnormal detection Time-out time when the CLINK command specifies the use of Port, and the unit is 0.01 second. The CLINK command uses the Time-out time to judge whether the communication object is online or not; when the CLINK is MD1 and is set to the "transmit and then receive" mode, if the PLC sends a communication transaction to the peripheral, but the communication object cannot respond within this time, then a Time-out error occurs. When CLINK is MD1 and set to "transmit only" mode, this value is meaningless.

High Byte: For MD1, it is recommended to set it to 0.

FUN151

CLINK

FUN151(CLINK):MD1、MD4 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Example

Using Port 2 to actively connect with smart peripherals using non-standard communication protocols

Example description: Actively and continuously send 02H (‘STX’), 4FH (‘ O’), 4BH (‘K’), 03H (‘ETX’) through PLC Port 2 to intelligent peripheral devices with RS485 communication interface.

Example N000:

Program Description:

  1. Data Transfer Mode: Set only outgoing messages, no response message mode from the other party (R10=0).
  2. Set the start code (02H) and end code (03H).
    (The start code is High Byte and the end code is Low Byte)

FUN151

CLINK

FUN151(CLINK):MD1、MD4 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Program Example N001:

Program Description:

Package transmission data:

  1. Set the transmission data length(R12=N)

Fill in the data to be sent:

  1. Fill in the data 1(R13= 02H ‘ STX ‘)
  2. Fill in the data 2(R14= 4FH ‘ O ‘)
  3. Fill in the data 3(R15= 4BH ‘ K ‘)
  4. Fill in the data 4(R16= 03H ‘ ETX ‘)

FUN151

CLINK

FUN151(CLINK):MD1、MD4 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Program Example N002:

Program Description:

  1. When M1=ON, PLC will send data through Port2 in MD1 mode.

FUN151

CLINK

FUN151(CLINK):MD1、MD4 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

FUN 151: Explanation of MD1 operand SR

SR: The initial register for the data transfer form.

SR+0

Transfer only / transfer then receive

  • Low Byte is valid,

= 00H, only send message, the other side has no response message.

= 01H, send a message, and then wait for the

response message from the other side.

(Do receive if no communication error)

= 81H, send messages, then wait for the

response message from the other side.

(Receive with or without communication error)

SR+1

Receive start / end code

  • High Byte: Describe the start code of the response message when receiving.
  • Low Byte: Describe the end code of the response message when receiving.

SR+2

Transfer data length

  • The length of the data to be transmitted; the maximum is 1024.

SR+3

MD1: Data 1

MD4: Data 2 and 1

  • MD1: Low Byte is valid;
  • MD4: High Byte and Low Byte are valid.

SR+4

MD1: Data2

MD4: Data 4 and 3

  • MD1: Low Byte is valid;
  • MD4: High Byte and Low Byte are valid.

SR+5

MD1: Data 3

MD4: Data 6 and 5

  • MD1: Low Byte is valid;
  • MD4: High Byte and Low Byte are valid.

…

MD1: Data N

MD4: Data N and N-1

FUN151

CLINK

FUN151(CLINK):MD1、MD4 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Note:

  1. When the transmission-only mode is selected, the start/end codes of reception are meaningless.
  2. When selecting the mode of sending and then receiving, before starting the transmission, you must first estimate the start code and end code of the response message from the other side and fill it in the receiving start/end code register (for example, SR+1=0203H, 02H represents the start code, 03H represents the end code), so as to ensure correct reception. The communication protocol with start/end code is easy to distinguish each message, and the communication program is simple and efficient.
  3. When the mode of sending and receiving is selected, if the response message has no start code, the high byte of the start/end code register is filled with 0; if the response message has no end code, the start/end code register fill the low byte with 0.
  4. When selecting the mode of sending and then receiving, and when the CPU completes the transmission and receives a response message, it will fill the received data into the receive register and set the receive length (the sum of WR+8 and the length of the subsequent register).

FUN151

CLINK

FUN151(CLINK):MD1、MD4 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

FUN151: Description of MD1 operand WR

High Byte Low Byte

WR+0

Result Code

0

  • The result code stores the operation result;

=0, normal; other values, abnormal.

WR+1

Internal operation use

  • Internal operation use; execute the CLINK command, the register that the CPU needs to use.

WR+2

Internal operation use

WR+3

Internal operation use

WR+4

Internal operation use

WR+5

Internal operation use

WR+6

Internal operation use

WR+7

Internal operation use

WR+8

The total number of data received

  • A total of several Byte data received (received data length register; the received start code and end code are included).

WR+9

MD1: Receive data 1

MD4: Receive data 2 and 1

  • MD1: The first Byte data received (start code if there is a

start code), High Byte=0.

  • MD4: The 1st and 2nd Byte data received.

˙

˙

˙

MD1: Receive data 2

MD4: Receive data 4 and 3

  • MD1: For the second Byte data received, High Byte=0.
  • MD4: The 3rd and 4th Byte data received.

˙

˙

MD1: Receive data 3

MD4: Receive data 6 and 5

  • MD1: For the second Byte data received, High Byte=0.
  • MD4: The received 5th and 6th Byte data.

…

MD1: Receive data N

MD4: Receive data N and

N-1

  • MD1: For the received Nth Byte data (end code if there is

one), High Byte=0.

  • MD4: The received N and N-1 Byte data.

FUN151

CLINK

FUN151(CLINK):MD1、MD4 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Result Code: 0, The transfer (transaction) was successful.

2, Data length error(The value is 0, or a transaction volume is greater than 1024).
A, No response from the other side.
B, Communication abnormality (wrong data received).

FUN151(CLINK):MD2、MD5 Communication Connection Convenience Command

FUN151

CLINK

FUN151(CLINK):MD2、MD5 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Symbol

Pt:Assign port, 1~4.

MD:2, 5; always be ready to receive messages from intelligent peripheral devices with serial communication interfaces.

SR:The initial register of the communication transmission table (refer to example description).

WR:Instruction operation start register (refer to example description), a total of 8 registers are occupied, and other programs cannot be reused.

Range

Operand

HR

ROR

DR

K

R0

∣

R34767

R43224

∣

R47319

D0

∣

D7999

Pt

1~2

MD

2、5

SR

○

○

○

WR

○

○*

○

The functions of MD2 and MD5 are ready to receive at any time. The message sent by the intelligent peripheral equipment of the serial communication interface makes the PLC receive data through Port 1~Port 4 (passive reception). The difference is that the received data of MD2 will only occupy the Low Byte part of a Word, and the received data of MD5 will occupy the High Byte and Low Byte of a Word, please refer to the description of the follow-up SR for details.

FUN151

CLINK

FUN151(CLINK):MD2、MD5 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Description

  1. FUN151 (CLINK): MD2 and MD5 modes, providing FATEK PLC to receive messages from peripherals with serial communication interfaces at any time.
  2. The communication format is written by the Ladder program, which must be consistent with the peripheral to be connected in order to successfully connect.
  3. When the execution control "EN" changes from 0 to 1 and both the suspend operation "PAU" and the abort operation "ABT" are 0, if the specified communication port is not occupied by other communication commands, detecting M9135/M9138/M9149/M9152=1 , then this command will control the communication port immediately, and set M9135/M9138/M9149/M9152 to 0 (means occupied). If the specified communication port is already occupied (M9135/M9138/M9149/M9152 = 0), this command enters the waiting state until the occupied communication command is transmitted or the operation is suspended/abandoned, and after the control is released (M9135/M9138/M9149/M9152 = 1), This instruction immediately leaves the waiting state, sets M9135/M9138/M9149/M9152 to 0, and enters the receiving state.
  4. When suspending operation "PAU" or abandoning operation "ABT" is 1, immediately abandon receiving (M9135/M9138/M9149/M9152 =1).
  5. When entering the receiving state, the output indicator "ACT" is ON.
  6. When a transaction is completed (received or received and then transmitted), if an error occurs, the output indication "DN" and "ERR" will be ON for one scan time at the same time.
  7. When a transaction is completed (received or received and then transmitted), if no error occurs, the output indication "DN" will be ON.

Port Interface Signal

List of relays and registers used by communication ports:

Communication Port

Interface Signal

Port 1

Port 2

Port 3

Port 4

1. Port occupation indication

M91355

M9138

M9149

M9152

2. Port command complete indication

M9136

M9139

M9150

M9153

3. Port communication parameter register

R35352

R35353

R35798

R35799

4. Transmit Delay and Receive Anomaly Detection Register

R35357

R35358

R35803

R35804

FUN151

CLINK

FUN151(CLINK):MD2、MD5 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

  1. Port Occupation Indication: This signal is generated by the CPU.
    ON represents the Port accepts new commands to transmit data.
    OFF means that the Port is being occupied and cannot accept new commands to transmit data.
  2. Port Command Completion Indication: This signal is generated by the CPU.
    ON, complete a data transaction.
  3. Port Communication Parameter Setting Register :(Refer to 10-1-2 Description of Communication Functions)
  4. Transmission error detection register:
    Low Byte: Define the abnormal detection Time-out time when the CLINK command specifies the use of Port, and the unit is 0.01 second. When the PLC receives a message and must respond (receive and then transmit mode), but the Ladder program cannot process and send the response message within this period of time, the CPU abandons the response and automatically returns to the receiving state. When FUN151: MD2 is set to receive only (following examples) mode, this value is meaningless.
    High Byte: Not used for MD2.

Note:

1:FUN151: MD2 and MD5 stay in the receiving state as long as they start receiving, unless the input signal of abandon receiving (ABT) is ON, they will leave the receiving state to stop receiving and wait for the next start of receiving control.

2: When the start/end code of reception is changed, it is necessary to control the ABT input signal ON, and then start the reception control "EN↑" from 0→1 to start receiving messages.

FUN151

CLINK

FUN151(CLINK):MD2、MD5 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Example

Use Port2 to return the data received by this PLC to the CPU Unit that sent the data

Program Example N000:

Program Description:

  1. Clear the received data length to 0.
  2. Clear the data transmission length to 0.
  3. (If you only receive but not transmit, you don’t need this program)
  4. Set the receiving method: set the receive and transmit mode.
  5. Set the start code (02H) and end code (03H) of the received message (R11=0, if there is no start code and end code, it can also be received normally).

(The start code is High Byte and the end code is Low Byte)

FUN151

CLINK

FUN151(CLINK):MD2、MD5 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Example

Use Port2 to return the data received by this PLC to the CPU Unit that sent the data

Program Example N001 ~ N002:

Program Description:

  1. When M1=ON, the PLC will receive the data sent by the other through Port2.
  2. When the transmission is complete, clear the data transmission length to 0.
  3. (If you only receive but not transmit, you don’t need this program)

FUN151

CLINK

FUN151(CLINK):MD2、MD5 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Example

Use Port2 to return the data received by this PLC to the CPU Unit that sent the data

Program Example N003 ~ N004:

Ladder Program Description:

  1. When the mode of receiving and sending is selected, use the comparison command to judge whether a new message has been received; if so, then M100=OFF, and process the received data.
  2. If the number received is 0, jump to Lable1 to execute the relevant program.

FUN151

CLINK

FUN151(CLINK):MD2、MD5 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Example

Use Port2 to return the data received by this PLC to the CPU Unit that sent the data

Ladder Program Example N005 ~ N007:

Program Description:

  1. When a new message has been received, copy all received data to the response register.
  • R108 is the length of received data.
  • After R109 is data received.
  • After R13 are response registers.
  1. After processing the received data, fill in the length of the received data as the length of the returned data to start the response transmission.
  2. Clear the received data length to 0.
  3. (Ready to receive new data)

FUN151

CLINK

FUN151(CLINK):MD2、MD5 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

FUN151: Description of MD2 operand SR

SR: The initial register of the data transmission form.

SR+0

Receive only / receive then transfer

• Low Byte is valid.

= 00H, only receive messages (receive only if there

is no communication error), and do not respond.

= 01H, receive the message (received only if there

is no communication error), and then send out

Respond to the message.

= 80H, only receive messages (whether there is a

communication error or not), and do not respond.

= 81H, receive messages (receive with or without

communication errors), and then send out

Respond to the message.

SR+1

Receive start / end code

• High Byte : Describe the start code of reception.

Low Byte : Describe the end code of receiving.

SR+2

Response data length

• The length of the data received and transmitted, the maximum is 1024; when the data length is not equal to zero, start to transmit.

SR+3

MD2: Data 1

MD5: Data 2 and 1

• MD2: Low Byte is valid;

MD5: High Byte and Low Byte are valid.

SR+4

MD2: Data2

MD5: Data 4 and 3

• MD2: Low Byte is valid;

MD5: High Byte and Low Byte are valid.

…

MD2: Data N

MD5: Data N and N-1

• MD2: Low Byte is valid;

MD5: High Byte and Low Byte are valid.

FUN151

CLINK

FUN151(CLINK):MD2、MD5 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Note:

  1. When the receive-only mode is selected, after the CPU receives a complete message, it will fill the received data into the receiving register and set the receiving length (the sum of WR+8 and the length of the subsequent register), and immediately start receiving the next message.
  2. When the receive-then-transmit mode is selected, after the CPU receives a complete message, it fills the received data into the receiving register and sets the receiving length (the sum of WR+8 and the length of the subsequent register), and then begins to wait for the response. The transmission starts when the data length (SR+2) is not equal to zero (so choose this mode, when the response data has not yet filled the response register, the response data length must be controlled to be zero; wait for the response data to fill the response register, then the response data length can be set).
  3. Before starting to receive, the start code and end code of the received message must be filled into the receive start/end code register (for example, SR+1=0A0DH, 0AH represents the start code, 0DH represents the end code), only in this way can we ensure correct reception. The communication protocol with the start/end code can be easily used to distinguish each message, and the communication program is simple and efficient.
  4. If the received message has no start code, fill the high byte of the start/end code register with 0. If the received message has no end code, fill the low byte of the start/end code register with 0.

FUN151

CLINK

FUN151(CLINK):MD2、MD5 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

FUN151: Description of MD2 operator WR

High Byte Low Byte

WR+0

Result Code

0

• The result code stores the operation result; =0, normal; other values, abnormal.

WR+1

Internal operation use

• Internal operation use; Execute the CLINK command, the register that the CPU needs to use.

WR+2

Internal operation use

WR+3

Internal operation use

WR+4

Internal operation use

WR+5

Internal operation use

WR+6

Internal operation use

WR+7

Internal operation use

WR+8

The total number of data received

• A total of several Byte data received (received data length register; the received start code and end code are included).

WR+9

MD2: Receive data 1

MD5: Receive data 2 and 1

• MD2: The first Byte data received (start code if there is a start code), High Byte=0.

MD5: The 1st and 2nd Byte data received.

‧

‧

MD2: Receive data 2

MD5: Receive data 4 and 3

• MD2: For the second Byte data received, High Byte=0.

MD5: The 3rd and 4th Byte data received.

‧

‧

MD2: Receive data N

MD5: Receive data N and N-1

• MD1: For the received Nth Byte data (end code if there

is one), High Byte=0.

MD4: The received N and N-1 Byte data.

FUN151

CLINK

FUN151(CLINK):MD2、MD5 Communication Connection Convenience Command

( Use PLC as a data transmission unit via Port 1~Port 4 )

FUN151

CLINK

Note: When the CPU receives a complete message, it will fill the received data into the receiving register and set the receiving length, so before the Ladder program starts receiving, the receiving data length register (WR+8) can be cleared to Zero, as long as the received data length register is not zero, it means that a new message has been received; after the Ladder program reads the received data, it clears the received data length register to zero. As long as the received data length register is not zero, it means that a new message has been received, so that the receiving action can be easily processed.

Result Code:

0, the data transaction is successful.

2, The data length is wrong (the value is 0, or the transaction volume is greater than 1024).

A, Unable to respond to messages within the Time-out time (receive and transmit mode).

B, Abnormal communication (wrong data received).

10-4 Modbus RTU/ASCII Communication Protocols

Procedures for Usage

D:\patrick\說明書翻譯_功能篇\圖\圖片6.png

  • Station number can be set to any one between 1 to 254 without replication.
  • For communication parameters, please refer to the description of "Communication Related Setting".

10-4-1 Instruction description and examples

This section will instruction to explain FUN150 (Modbus) usages, with respective practical application program examples.

Convenient Instruction for Modbus RTU/ASCII Master (makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

Symbol

D:\patrick\說明書翻譯_功能篇\圖\150.png

Pt:1~4, specify the communication port to work as the Modbus RTU master

SR:Starting register of communication program

WR:Starting register for instruction operation. It controls 8 registers; the other programs can not repeat in using.

Range

Operand

HR

ROR

DR

K

R0

∣

R34767

R43224

∣

R47319

D0

∣

D7999

Pt

1-2

SR

○

○

○

WR

○

○*

○

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

Description

  1. FUN150 (M-BUS) instruction makes PLC act as Modbus RTU/ASCII master through Port 1~Port 4, thus it is very easy to communicate with the intelligent peripheral with Modbus RTU/ASCII protocol.
  2. Only the master PLC needs to use M-BUS instruction.
  3. It employs the program coding method or table filling method to plan for the data flow controls; i.e., from which one of the slave stations to get which type of data and save them to the master PLC, or from the master PLC to write which type of data to the assigned slave station. It needs only seven registries to make definition; every seven registers define one packet of data transaction.
  4. When execution control〝EN〞changes from 0→1 and the input “ABT” is 0, and if Port 1~Port 4 hasn’t been controlled by other communication instructions, detecting M9135/M9138/M9149/M9152 = 1, this instruction will control the ports immediately and set the M9135/M9138/M9149/M9152 to be 0 (which means it is being occupied), then going on a packet of data transaction immediately. If the port has been controlled (M9135/M9138/M9149/M9152 = 0), then this instruction will enter into the standby status until the controlling communication instruction completes its transaction or pause/abort its operation to release the control right (M9135/M9138/M9149/M9152 =1), and then this instruction will become enactive, set M9135/M9138/M9149/M9152 to be 0, and going on the data transaction immediately.
  5. While in transaction processing, if operation control “ABT” becomes 1, this instruction will abort this transaction immediately and release the control right (M9135/M9138/M9149/M9152 = 1). Next time, when this instruction takes over the transmission right again, it will restart from the first packet of data transaction.
  6. While〝A/R〞=0,Modbus RTU protocol;〝A/R〞=1,Modbus ASCII protocol.
  7. While it is in the data transaction, the output indication “ACT” will be ON.

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

  1. If there is no error occurred when it finishes a packet of data transaction, the output indication “DN” will be ON.
  2. If "EN" is ON, it will continue to communicate.

Interface Signals

Dedicated Relays and Registers for corresponding port:

Communication Port

Interface Signal

Port 1

Port 2

Port 3

Port 4

1. Port occupation indication

M91355

M9138

M9149

M9152

2. Port command complete indication

M9136

M9139

M9150

M9153

3. Port communication parameter register

R35352

R35353

R35798

R35799

4. Transmit Delay and Receive Anomaly Detection Register

R35357

R35358

R35803

R35804

  • Port Ready Indicator:This signal is generated from CPU.

ON, it represents that port is free and ready.

OFF, it represents that port is busy, data transaction is going.

  • Port Communication Parameters: The register is for communication parameters setting of corresponding port. (Please refer to the chapter of communication parameters setting).

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

  1. TX Delay & RX Time-out Span:

The content of Low Byte defines the receive time-out span of M-BUS instruction. The M-BUS instruction employs receive time-out span to judge whether the slave station on line or not. When the master PLC sent out the read/write command to the slave station, the slave station didn’t reply within this period means that there is abnormal event in communication called Time-out. When there are multi-drop linking, properly adjust this value (greater than 1 scan time of the slave station with the longest scan time) to shorten the communication response time among the active linking stations if there are many slave stations power off (The time-out cases will happen).
The content of High Byte defines the transmission delay time between two packets of data transaction for M-BUS instruction. For point-to-point link, this value can be set as 0 to shorten the communication transaction time and promote the communication efficiency. In the case of linking multi-drop and if the scan time of master PLC is far longer than any slave station, this value can also be set to 0 to shorten the communication transaction time and promote the communication efficiency.

  1. Setting of RX Time-out Span: Please refer FUN151 MD0 for details.
  2. Edge Trigger Execution: Please refer FUN151 MD0 for details.

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

Example

Communicate with Modbus devices via Port 2

Description

  1. When execution control 〝EN〞changes from 0→1, and Port 2 is not occupied by other communication instruction (M9138 ON), M-BUS instruction will start the data transaction. according to the settings in the Modbus table, what kind of data should be read from which slave station and stored to the master station (PLC), or what kind of data should be written from the master station (PLC) to the slave station, and the data will be continuously transaction.

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

Editing Communication Table with UperLogic

Click the “Modbus Master” Item which in project windows: Modbus Master Table:

Project name

Table Edit

Modbus Master

🡪Click right button and select “Add Modbus Master Table”

D:\patrick\說明書翻譯_功能篇\圖\60.PNG

Figure 60 Adding Modbus Master Table

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

Figure 61 Editing Modbus Master Table

  • Table Type: It will be fixed to “Modbus Master Table”.
  • Table Name: For modify or debug, you can give a convenient name.
  • Table Starting Address: Enter the address which Starting register of communication Table

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

D:\patrick\說明書翻譯_功能篇\圖\62.PNG

  • Command: Read means that the master station reads the data from the Modbus slave station, and write means that the master station writes data to the Modbus slave station.
  • Slave station: The station number of the slave station to be transmitted.
  • Master data: read is the location where the data is read from the slave station and stored, and write is where the data is written from the master station to the slave station.
  • Slave data: read is the position that the slave station wants to send back to the master station, and write is the position of writing data from the master station to the slave station.
  • Length: The length to be sent.

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

Description of FUN150 operand SR

SR:Starting register for communication program of M-BUS instruction.

SR+0

SR+1

reserve

50h

• Low Byte valid; = 50H, it means valid M-BUS program

• Low Byte:Total number of transactions,one transaction needs 7 registers to describe.

reserve

Total

transactions

SR+2

Slave station No. Which is about to transact with

• Low Byte is valid, 0~247 (0 means that master PLC broadcasts the data to all slaves, the slaves do not reply).

SR+3

Command code

• Low Byte is valid;

=1, means "Read data from slave station"

=2, means "Write multiple data to slave station"

=3, means "Write single data to slavestation"

SR+4

Data length of this transaction

• Low Byte is valid; the range is 1~125 (Reg.)

or 1~255 (Discrete).

SR+5

Data type of Master PLC

• Low Byte is valid, and its range is 1~3 or 12~13; it defines the data type of master PLC (see next page).

SR+6

Starting reference of Master PLC

• Word is valid; it defines the starting address of data (master).

SR+7

Data type of slave station

• Low Byte is valid, and its range is 0 or 4; it defines the data type of slave station (see next page).

SR+8

Starting reference of Slave station

• Word is valid; it defines the starting address of data (slave).

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

Description of FUN150 operand SR

SR+9

Slave station No. which is about to transact with

Description of the 2_nd packet of transaction

SR+10

Command code

SR+11

Data length of this transaction

SR+12

Data type of Master PLC

SR+13

Starting reference of Master PLC

SR+14

Data type of slave station

SR+15

Starting reference of Slave station

•

•

•

SR+2+n×7

Reserved

• N is the total number of transactions.

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

  • Data code, type and reference number of Master station (FATEK PLC)

Data code

Data type

Reference number

1

Y(Output Relay)

0~1023

2

M(Internal M Relay)

0~29599

3

S(Step Relay)

0~3103

12

R(Data Register)

0~34767

13

D(Data register)

0~7999

  • Data code, type and reference number of Slave station (Modbus slave)

Data code

Data type

Reference number

0

Discrete Output

1~65535

4

Holding register

1~65535

1

Discrete Input

1~65535

3

Input Register

1~65535

Note: The master and slave data types must be the same, if the master station is Y/M/S, the slave station must be 0/1; If the master station is R/D, the slave station must be 3/4; and vice versa.

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

Description of FUN150 operand WR

High Byte Low Byte

WR+0

Result code

Transaction

No.

• Result code indicates the transaction result; 0 means "Normal", other value means "Abnormal"

• Transaction No. indicates which one is in processing (begins from 0).

WR+1

Station

number

Command

code

• Station number: the slave station No. which is in transaction.

Command code: Low Byte valid

=1 (read)

=2 (write)

=3 (write once)

WR+2

For internal working use

WR+3

For internal working use

WR+4

For internal working use

•

WR+5

For internal working use

WR+6

For internal working use

WR+7

For internal working use

Result code:

0, Transaction is successful.

2, Data length error (for length is 0 or over limit).

3, Command code error (Command code is 0 or greater than 3).

4, Data type error.

5, Reference number error.

6, Inconsistence in data type (e.g., master station is Y/M/S while slave is 4).

7, Port error (Not Port 1~4).

8, Invalid communication table.

A, No response from slave station (Time-out error).

B, Communication error (received error data or exception reply).

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

For easier programming and troubleshooting, the UperLogic provides the table editing environment to edit the communication table of FUN150 instruction; Key in the complete FUN150 instruction first and then move the cursor to the position of it, depressing the "Z" key, now comes the table editing environment. The user can create the new communication table or display the existed table under this friendly user interface operation.

M-BUS Communication Table

Command

Slave

Data of Master

Data of Slave

Length

Read (=1)

Write (=2)

Write single (=3)

The station number of slave which is about to transact with Station No.=0,

It means broadcasting, there will not any response from the slave

Station No.=N, means the station number of slave which is about to transact with;

N=1~247

The data type

of Master for

this transaction

Y0~Y1023

M0~M9119

S0~S3103

R0~R34767

D0~D7999

The data type of Slave for this transaction

000001~065535(read/write)

400001~465535(read/write)

100001~165535(read)

300001~365535(read)

Quantity of this

While Register,1~125

While Discrete,1~255

FUN150

M-BUS

Convenient Instruction for Modbus RTU/ASCII Master

(makes PLC as the Modbus RTU/ASCII master through Port 1~Port 4)

FUN150

M-BUS

※UperLogic provides the user friendly table edit for M-BUS Master:

Command Slave Data of Master Data of Slave Data length

Read 1~247 Y0~Y1023 ← 000001~065535 1~255

M0~M9119 ← 000001~065535 1~255

S0~S3103 ← 000001~065535 1~255

Y0~Y1023 ← 100001~165535 1~255

M0~M9119 ← 100001~165535 1~255

S0~S3103 ← 100001~165535 1~255

R0~R34767 ← 400001~465535 1~125

D0~D7999 ← 400001~465535 1~125

R0~R34767 ← 300001~365535 1~125

D0~D7999 ← 300001~365535 1~125

Write 0~247 Y0~Y1023 → 000001~065535 1~255

M0~M9119 → 000001~065535 1~255

S0~S3103 → 000001~065535 1~255

R0~R34767 → 400001~465535 1~125

D0~D7999 → 400001~465535 1~125

10-4-2 Address mapping between Modbus and FATEK

Modbus

Slave

Address mapping between Modbus and FATEK

(PLC works as the slave station of Modbus Communication Protocols

through Port 1~Port 4, and HCM ports)

Modbus

Slave

  • M-Series PLC can use FUN150 to be Modbus protocol Master, besides it also can be Modbus communication Slave by configuration ( Port 1~Port 4, and HCM ports , but Port0 fixed to FATEK communication protocol) then it can connect with the intelligent peripheral.
      • Set up the connection with the M PLC
      • Method 1: In the "PLC Setting" of the "PLC" tab of the UperLogic software, select the Port to be modified, such as "Port2 Parameter", as shown in the figure below.
        D:\patrick\說明書翻譯_功能篇\圖\擷取1.PNG
      • Click "Serial Configuration – Port2"
        D:\patrick\說明書翻譯_功能篇\圖\擷取2.PNG

Modbus

Slave

Address mapping between Modbus and FATEK

(PLC works as the slave station of Modbus Communication Protocols

through Port 1~Port 4, and HCM ports )

Modbus

Slave

      • Change the "Protocol" to "Modbus RTU (Slave)" or "Modbus ASCII (Slave)" and press OK.
        D:\patrick\說明書翻譯_功能篇\圖\擷取.PNG
      • setting is successful.
        D:\patrick\說明書翻譯_功能篇\圖\擷取1.PNG
      • Method 2: In the "PLC Setting" of the "PLC" tab of the UperLogic software, select "Communication Protocol", as shown in the figure below.
        D:\patrick\說明書翻譯_功能篇\圖\擷取1.PNG

Modbus

Slave

Address mapping between Modbus and FATEK

(PLC works as the slave station of Modbus Communication Protocols

through Port 1~Port 4, and HCM ports )

Modbus

Slave

      • Click "Protocol"
        D:\patrick\說明書翻譯_功能篇\圖\擷取.PNG
      • Change the "Protocol" to "Modbus RTU (Slave)" or "Modbus ASCII (Slave)" and press OK.
      • setting is successful.
        D:\patrick\說明書翻譯_功能篇\圖\擷取1.PNG

See below for Modbus and FATEK data address mapping rules:

Mapping Rule

Modbus

FATEK

5

Code

0XXXX

Discrete elements of Ynnnn、Xnnnn、Mnnnnn、Snnnn、Tnnnn、Cnnnn

4XXXX

Data Registers of Rnnnnn、Dnnnn、Tnnnn、Cnnnn

6

Code

00XXXX

Discrete elements of Ynnnn、Xnnnn、Mnnnnn、Snnnn、Tnnnn、Cnnnn

40XXXX

Data Registers of Rnnnn、Dnnnn、Tnnn、Cnnn

Modbus

Slave

Address mapping between Modbus and FATEK

(PLC works as the slave station of Modbus Communication Protocols

through Port 1~Port 4, and HCM ports )

Modbus

Slave

  • The range of Modbus slave address conversion can be planned by the designer through the software in "Communication Configuration".
  • In the UperLogic software "Project" tab, click "Communication Configuration"
  • "Modbus Device Allocation" as shown below.

D:\patrick\說明書翻譯_功能篇\圖\圖片1.png

Modbus

Slave

Address mapping between Modbus and FATEK

(PLC works as the slave station of Modbus Communication Protocols

through Port 1~Port 4, and HCM ports )

Modbus

Slave

        • Designer can adjust the range of PLC and Modbus to be converted, or the starting address, etc.
        • Table options are explained below.
        • Items: Including contact settings, such as I/O contacts (X / Y), internal relays (M), etc., and register settings, such as registers (R / D), etc.
        • Address: It refers to the address of the PLC. For example, input 0 in the internal relay [M], it means that M0 corresponds to the address specified by Modbus. As shown in the figure above, M0 corresponds to the address of Modbus 20001.
        • Modbus address: refers to the address of the corresponding Modbus.
        • Totals: It is the length of the total conversion starting from the starting address.
        • Usage: When the starting address and total number are set, the software will display the total converted addresses, so that the designer can know the usage status more clearly.
        • Default: After clicking, the setting value will return to the default state.
        • When the PLC communication port works in the Modbus slave communication mode, in addition to adjusting the range to be converted between PLC and Modbus, or the initial address, etc. through the table; you can also adjust the corresponding access method through the PLC register; it is not in the setting range for data access, PLC will respond with a communication error.

Register No.

Value

Description

R35484

CPU module’s MAC

R35485

R354886

M9162

= ON

New address mapping for Modbus slave communication protocol (Detailed as below)

= OFF

Existed address mapping for Modbus slave comm protocol

R35402

0 ~ 1023

  • Assign the starting address of Y output relay of FATEK
  • 0 ~ 1023: Means Y output relay Y0 ~ Y1023

R35403

0 ~ 65535

  • Assign the starting address of discrete output of Modbus
  • 0 ~ 65535: Means discrete output 000001 ~ 065536

R35404

1 ~ 1023

  • Assign the range of access both for Modbus contact output and Y output of FATEK.
  • 1 ~ 1023: Means access range between 1 ~ 1023 point
  • R35402 and R35403 are used to specify the access range of Modbus contact output corresponding to FATEK’s Y output relay. (M9162 must be ON for a pulse)

Modbus

Slave

Modbus Communication Protocols

Modbus

Slave

Register No.

Value

Description

R35405

0 ~ 1023

  • Assign the starting address of X input relay of FATEK.
  • 0 ~ 1023: Means X input relay X0 ~ X1023

R35406

0 ~ 65535

  • Assign the starting address of Modbus contact output (Coil)
  • 0 ~ 65535: Means contact output number 000001 ~ 065536

R35407

1 ~ 1023

  • Assign the range of access both for Modbus contact output and X input of FATEK.
  • 1 ~ 1023: Means access range between 1 ~ 1023 point
  • R35405 and R35406 are used to specify the access range of Modbus contact output corresponding to X input relay of FATEK. (M9162 must be ON for a pulse)

R35408

0 ~ 9119

  • Assign the starting address of M internal relay of FATEK
  • 0 ~ 9119: Means M internal relay M0 ~ M9119

R35409

0 ~ 65535

  • Assign the starting address of Modbus contact output (Coil)
  • 0 ~ 65535: Means contact output number 000001 ~ 065536

R35410

1 ~ 9119

  • Assign the range of access both for Modbus contact output and M internal relay of FATEK.
  • 1 ~ 9119: Means access range between 1 ~ 9119 point
  • R35408 and R35409 are used to specify the access range of Modbus contact output corresponding to M internal relay of FATEK. (M9162 must be ON for a pulse).

R35411

0 ~ 3103

  • Assign the starting address of stepper relay of FATEK.
  • 0 ~ 3103: Means stepper relay S0 ~ S3103

R35412

0 ~ 65535

  • Assign the starting address of Modbus contact output (Coil)
  • 0 ~ 65535: Means contact output number 000001 ~ 065536

R35413

1 ~ 9119

  • Assign the range of access both for Modbus contact output and Stepper relay of FATEK.
  • 1 ~ 3103: Means access range between 1 ~ 3103 point
  • R35411 and R35412 are used to specify the access range of Modbus contact output corresponding to M internal relay of FATEK. (M9162 must be ON for a pulse).

R35414

0 ~ 1023

  • Assign the starting address of Timer relay of FATEK.
  • 0 ~ 1023: Means Timer relay T0 ~ T1023

Modbus

Slave

Modbus Communication Protocols

Modbus

Slave

Register No.

Value

Description

R35415

0 ~ 65535

  • Assign the starting address of Modbus contact output (Coil)
  • 0 ~ 65535: Means contact output number 000001 ~ 065536

R35416

1 ~ 1023

  • Assign the range of access both for Modbus contact output and T Timer relay of FATEK.
  • 1 ~ 1023: Means access range between 1 ~ 1023 point
  • R35414 and R35415 are used to specify the access range of Modbus contact output corresponding to T Timer relay of FATEK. (M9162 must be ON for a pulse).

R35417

0 ~ 1023

  • Assign the starting address of C Counter relay of FATEK.
  • 0 ~ 1023: Means C Counter relay C0 ~ C1023

R35418

0 ~ 65535

  • Assign the starting address of Modbus contact output (Coil)
  • 0 ~ 65535: Means contact output number 000001 ~ 065536

R35419

1 ~ 1023

  • Assign the range of access both for Modbus contact output and C Counter relay of FATEK.
  • 1 ~ 1023: Means access range between 1 ~ 1023 point
  • R35417 and R35418 are used to specify the access range of Modbus contact output corresponding to C Counter relay of FATEK. (M9162 must be ON for a pulse).

R35420

0 ~ 34767

  • Assign the starting address of R registers of FATEK.
  • 0 ~ 34767: Means R registers R0 ~ R34767

R35421

0 ~ 65535

  • Assign the starting address of Modbus registers
  • 0 ~ 65535: Means Modbus registers number 400001~465536

R35422

1 ~ 34767

  • Assign the range of access both for Modbus contact output and R registers of FATEK.
  • 1 ~ 34767: Means access range between 1 ~ 34767 point
  • R35420 and R35421 are used to specify the access range of Modbus contact output corresponding to D registers of FATEK. (M9162 must be ON for a pulse).

R35423

0 ~ 7999

  • Assign the starting address of D registers of FATEK.
  • 0 ~ 7999: Means D registers D0 ~ D7999

R35424

0 ~ 65535

  • Assign the starting address of Modbus registers
  • 0 ~ 65535: Means Modbus registers number 400001~465536

Modbus

Slave

Modbus Communication Protocols

Modbus

Slave

Modbus

Slave

Modbus Communication Protocols

Modbus

Slave

Register No.

Value

Description

R35425

1 ~ 7999

  • Assign the range of access both for Modbus contact output and D registers of FATEK.
  • 1 ~ 7999: Means access range between 1 ~ 7999 point
  • R35423 and R35424 are used to specify the access range of Modbus contact output corresponding to D registers of FATEK. (M9162 must be ON for a pulse).

R35426

0 ~ 1023

  • Assign the starting address of T Timer registers of FATEK.
  • 0 ~ 1023: Means T Timer registers T0 ~ T1023

R35427

0 ~ 65535

  • Assign the starting address of Modbus registers
  • 0 ~ 65535: Means Modbus registers number 400001~465536

R35428

1 ~ 1023

  • Assign the range of access both for Modbus contact output and T Timer registers of FATEK.
  • 1 ~ 1023: Means access range between 1 ~ 1023 point
  • R35426 and R35427 are used to specify the access range of Modbus contact output corresponding to T Timer registers of FATEK. (M9162 must be ON for a pulse).

R35429

0 ~ 1023

  • Assign the starting address of C Counter relay of FATEK.
  • 0 ~ 1023: Means C Counter relay C0 ~ C1023

R35430

0 ~ 65535

  • Assign the starting address of Modbus registers
  • 0 ~ 65535: Means Modbus registers number 400001~465536

R35431

1 ~ 1023

  • Assign the range of access both for Modbus contact output and C Counter registers of FATEK.
  • 1 ~ 1023: Means access range between 1 ~ 1023 registers
  • R35429 and R35430 are used to specify the access range of Modbus registers corresponding to C Counter registers of FATEK. (M9162 must be ON for a pulse).

R35432

0 ~ 1023

  • Assign the starting address of C Counter relay (32 bit) of FATEK.
  • 1024 ~ 1279: Means C Counter relay (32 bit) C1024 ~ C1279

R35433

0 ~ 65535

  • Assign the starting address of Modbus registers
  • 0 ~ 65535: Means Modbus registers number 400001~465536

Modbus

Slave

Modbus Communication Protocols

Modbus

Slave

Register No.

Value

Description

R35434

1024 ~ 1279

  • Assign the range of access both for Modbus contact output and C Counter registers (32 bit) of FATEK.
  • 1~256: Means access range between 1 ~ 256 registers
  • R35432 and R35432 are used to specify the access range of Modbus registers correspond to C Counter registers (32-bit) of FATEK. (M9162 must be ON for a pulse).

For example, after the settings of R35402 ~ R35434 are completed, M9162 is turned ON for a pulse, which means that the corresponding access mode is adjusted through the PLC register method.

  • R35409=0, R35408=1000, R3971=100:
    Mapping 000001 ~ 000100(Modbus) > M1000~M1099(FATEK)
  • R35421=0,R35420=2000,R3980=200:
    Mapping 400001 ~ 400200(Modbus) > R2000~R2219(FATEK)。

M-Series PLC is designed with an Ethernet communication port. Such port provides a number of Ethernet functions for the user to combine with network-related equipment or applications, such as combining with IoT application.

Functional specifications

Meet the IEEE802.3 standard and provide 10/100 Base T interface.

Basic purpose

Provide the UperLogic for using FATEK on PC in order to realize communication with the Ethernet communication port of M-Series PLC through the Ethernet, including the project online uploading and downloading as well as PLC data online monitoring, etc.

It can also be connected with the Ethernet interface mounted FATEK communication drive program device or with the Modbus drive program related UperLogic, HMI and graphical control devices, etc.

Derivative purpose

In addition to the aforesaid functions, this product also provides the following functions and they will be described in the subsequent paragraphs.

  • NTP (Network Time Protocol) time synchronization. Through the appointed NTP server address, it allows the designed to run the time synchronization through the network.
  • MQTT publishing/subscription functions, allowing more efficient remote monitoring and data swapping through the IoT.
  • Modbus TCP master/slave communication protocol function. Through the Ethernet, the user may communicate with the device provided for supporting the Modbus protocol.

10-5 FATEK Binary communication Protocol

FATEK Binary Communication Protocol is an open protocol, with which any device is able to connect to M PLC accordingly. Both serial and Ethernet communication support this protocol.

Please refer to the Fatek Binary communication manual for details.

Was this page helpful?

Tip: press ← → to switch chapters, Ctrl+K to search