sa3-plc function instruction manual - sseec.com.cn · sa3-plc function instruction manual . ... 3.1...
TRANSCRIPT
SA3-PLC Function
Instruction Manual
CONTENTS
1. PLC Function Application .......................................................................................................................... 1
1.1 PLC Introduction ................................................................................................................................ 1
1.2 The note of using the PLC function .................................................................................................... 1
1.3 System Configuration ......................................................................................................................... 2
1.3.1 Editing Tools ............................................................................................................................... 2
1.3.2 System Configuration ................................................................................................................. 2
1.3.3 Program Download ..................................................................................................................... 2
1.3.4 Operation Panel Description ...................................................................................................... 3
1.4 Parameter Description ........................................................................................................................ 4
1.4.1 Parameter Description ............................................................................................................... 4
1.4.2 Communication configuration for Program downloads ............................................................. 5
1.4.3 PLC implementation ................................................................................................................... 5
1.4.4 Erase PLC internal storage ......................................................................................................... 5
1.5. PLC configuration .............................................................................................................................. 6
1.5.1 PLC specifications ....................................................................................................................... 6
1.5.2 I/O device map........................................................................................................................... 7
1.5.3 Device function specification ..................................................................................................... 9
1.5.4 Special auxiliary relay function specification ........................................................................... 11
1.5.5 Special data register function specification ............................................................................. 13
1.5.6 Analog input and output .......................................................................................................... 14
1.5.7 Pulse train input ....................................................................................................................... 15
2. Commands Description .......................................................................................................................... 14
2.1 Basic Commands ............................................................................................................................... 14
2.2 Application commands ..................................................................................................................... 22
3. Communication application specification .............................................................................................. 30
3.1 Modbus communication protocol ..................................................................................................... 30
3.2 PLC communication protocol ............................................................................................................ 32
Appendix .................................................................................................................................................... 33
PLC Function Application
1
1. PLC Function Application
1.1 PLC Introduction
The PLC function built-in SA3 provides a simple function of the programmable controller, It provide the Ladder
diagram editing tools SL - Ladder Developer, 21 basic instructions and 12 application instructions.
1.2 The note of using the PLC function
When download PLC programs, please keep the communication frame format is consistent with SL-Ladder
Developer and the inverter.
SA3 provides two communication ports to download the PLC program. Two communication channels are
different but identical to support RS485 communications.
The definition of communication port pins: 1, 2, 3, 6: Reserved; 4: DB; 5:DA; 7: +5V; 8: GND. The figure
shown as follows :
8 1
18
81
Pin number:1,2,3,6:Reserved
4:DB
5:DA
7:+5V
8:GND
PU PORT COM1 PORT
Download the PLC program make sure SA3 built-in PLC in the STOP state. Otherwise the program will
download fail.
The input and output terminals which used in the PLC program are occupied after the function of PLC is
selected(10-55(P.780)≠0).
When PLC controlled inverter run, other sources command fails.
If PLC given target frequency, the other reference source of target frequency fails.
When PLC given target line speed, other target Line speed source fails.
PLC given feedback line speed, other sources of feedback speed become invalid.
When PLC given tension, other sources of tension fails.
PLC Function Application
2
1.3 System Configuration
1.3.1 Editing Tools
SL-Ladder Developer in Windows XP/win7/win8/win10 system is dedicated editing software of PLC,
Support the ladder diagram and instruction list two kinds of language program design.
1.3.2 System Configuration
The inverter and the personal computer are connected via USB communication or RS-485 communication.
The following figure shows the system configuration for use of the PLC function.
or
Inverter
RS-232C<=>RS-485Converter
Serial Port USB Interface
USB<=>RS-485Converter
Inverter
1.3.3 Program Download
Use "SL - Ladder Developer" software write PLC program
399
After the hardware connection,the inverter is powered on, then modify the parameters (Please refer to
Section1.4.1) to set the communication address formats and protocols which the program download used.
When parameter set to complete, inverter needs power off, then power on make the setting effective.
PLC Function Application
3
After writing PLC program, press the F4 key to complete PLC program compilation. Select the
"Online->Transfer Setup" in the pop-up dialog box, set the communication format for host computer and
the set of inverter, then click on "Download" and the PLC program will be downloaded to the inverter. After
the download is complete, PLC program in the inverter has been updated; the original PLC program has
been cleared.
1.3.4 Operation Panel Description
PLC runs, the operation panel will displayed as the follow figure:
PLC Function Light
OUTPUT FRE
PLC runs, LCD
displayed "PLC"
PLC state
Display PLC state
PU301(LED) PU301C(LCD)
ON “PLC” PLC runs
OFF --- PLC stop
PLC Function Application
4
1.4 Parameter Description
1.4.1 Parameter Description
P Number Group Name Setting Range Content
P.32 07-02 Serial communication Baud rate for COM1 0~5
(Note 1) 1: 9600bps 2: 19200bps
P.812 07-27 Serial communication Baud rate for PU
P.33 07-00 Communication protocol selection for COM1
0~2 0: Modbus Protocol 1: Shihlin Protocol 2: PLC Communication Protocol P.810 07-25
Communication protocol selection for PU
P.36 07-01 COM1 station
0~254 The station number which support MODBUS Protocol is from 1 to 254 for Embedded PLC P.811 07-26 PU station
P.48 07-03 COM1 data length
0,1 0: 8bit
1: 7 bit P.813 07-28 PU data length
P.49 07-04 COM1 stop bit length
0,1 0: 1bit
1: 2bit P.814 07-29 PU stop bit length
P.50 07-05 COM1 Parity check
0~2
0: No parity verification
1: Odd
2: Even P.815 07-30 PU Parity check
P.154 07-07
COM1 Modbus format
0~5
0: 1、7、N、2 (Modbus, ASCII)
1: 1、7、E、1 (Modbus, ASCII)
2: 1、7、O、1 (Modbus, ASCII)
3: 1、8、N、2 (Modbus, RTU)
4: 1、8、E、1 (Modbus, RTU)
5: 1、8、O、1 (Modbus, RTU)
P.817 07-32 PU Modbus format
P.780 10-55 PLC action choice 0~2
0: The PLC function is invalid
1: PLC function effectively, PLC RUN
command is from external terminal
input signal or 10-55(P. 781).
2: PLC function effectively, PLC RUN
command is from external terminal
input signal.
P.781 10-56 PLC control RUN/STOP 0,1 0: No effect
1: If 10-55(P.780) = 1, PLC will run.
P.782 10-57 Erase PLC program 0,1
0: Invalid
1: Erase the PLC program. After the
success of the erasure,
10-57(P.782) =0
PLC Function Application
5
1.4.2 Communication configuration for Program downloads
07-00(P.33)set to 2 Select communication protocols for PLC. 07-02(P.32)set the baud rate to 9600bps
or 19200bps. Other communication parameters Shared with Shihlin Protocol. Default setting of PLC
communication protocol is 1, 7, E, 1 for SL-Ladder Developer. When download PLC programs, please keep
the communication frame format is consistent with SL-Ladder Developer and the inverter.
Note: SL - Ladder Developer support only 9600bps or 19200bps.
1.4.3 PLC implementation
The effective RUN signal of SA3 built-in PLC associated with the 10-55(P.780)setting. If 10-55(P.780)
=1, PLC RUN command is from external terminal input signal which function is PLC_ON_STOP or 10-55(P.
781) set to 1.If 10-55(P.780)=2, PLC RUN command is from external terminal input signal which function
is PLC_ON_STOP. The external input terminals M0, M1, M2, and STF, STR, M3, M4, M5, RES, HDI and
external expansion board EB308R or EB362R which function is PLC_ON_STOP. It means that the
corresponding parameter value is 60, then the terminal can control the RUN signal of PLC .
PLC State:10-55(P.780) = 1
10-56(P.781) PLC_ON_STOP PLC State
0 0 STOP
1 0 RUN
0 1 RUN
1 1 RUN
PLC State:10-55(P.780) = 2
PLC_ON_STOP PLC State
0 STOP
1 RUN
When the output terminal and the input terminal are used in PLC program (P.780 = 1 OR 2), they cannot
be used in other places. Such as a PLC program using X0 and Y0, then the terminal will as the PLC program
command to action, the setting of 03-03(P.80) and 03-10(P.40) are disabled.
Note: 1. When using the PLC function to ensure the terminal which is set to PLC RUN/STOP command is
not used by PLC program. Otherwise the Terminal will lose the ability to control the RUN
command of PLC.
2. When PLC function is programmed with FREQ or RUN command, another FREQ or RUN
command source is invalid.
1.4.4 Erase PLC internal storage
Erase PLC program
When 10-57(P.782) is set to 1, the PLC program will be erased. After the success of the erasure,
10-57(P.782) value will return to zero. If failed to erasure, 10-57(P.782) does not revert to the value 0. PLC
should be in the STOP state, otherwise erase will fail.
Erase the Power off keep area
Special m relay M8032 ON, the content of power off keep area will be cleared.
PLC Function Application
6
1.5. PLC configuration
1.5.1 PLC specifications
Item SA3 PLC function specifications
Control method Repeated operation
I/O control mode Refresh input and output
Programming language Relay symbolic language (ladder) Function block
No. of instructions
Basic instructions 21
Application instructions 12
Processing speed
Basic instructions Several of us
Application instructions Dozens of us
Program capacity 0 to 399 steps can be set
Number of analog I/O points 3 input points built-in (Terminals 2, 3 and 4) 2 output points (AM1 and AM2)
High-speed pulse input function HDI High-speed input count
I/O configuration
Input(X) 22 input points(X0~X25, Octonary number system)
Output(Y) 20 output points(Y0~Y23, Octonary number system)
Auxiliary relay (M)
General 160 points,M0~M159
Power off keep 80 points,M160~M239
Special 64 points,M8000~M8079
Timer(T) 100ms 8 points,T0~T7, Measurement Range:0~6553.5s
Counter(C) Up-counter 8 points,C0~C7,counter range:0~65535
Data register(D)
General 32 points,D0~D31
Power off keep 16 points,D32~D47
Parameter 1300 points,D1000~D2299
Special 64 points,D8000~D8161
constant(K) 0~65535
PLC Function Application
7
1.5.2 I/O device map
Input(X),output(Y)
PLC receiving external switch signal through input port, they have innumerable normally open contacts
and normally closed contacts which can be used infinitely, but the input port can't use the program to drive.
The address code is according to octal code.
PLC input:
X Num 1 2 3
X0 M0
X1 M1
X2 M2
X3 STF
X4 STR
X5 RES
X6 M3
X7 M4
X10 M5
X11 HDI
X12 M10
X13 M11
X14 M12
X15 M13
X16 M14
X17 M15
X20 M10
X21 M11
X22 M12
X23 M13
X24 M14
X25 M15
1. The external input terminals of SA3.
2. External expansion board EB362R in the control panel in slot three.
3. External expansion board EB362R in the control panel in slot two.
Note: If HDI as input terminals, the value of 03-09(P.550) cannot be 41, 54 or 57, otherwise the HDI will not be normal.
PLC Function Application
8
PLC transmitting external switch signal through output port, they have innumerable normally open
contacts and normally closed contacts which can be used infinitely. The address code is according to octal
code.
PLC output:
Y Num 1 2 3 4 5
Y0 SO1-SE
Y1 SO2-SE
Y2 A1B1C1
Y3 A2B2C2
Y4 ABC10 ABC10
Y5 ABC11 ABC11
Y6 ABC12
Y7 ABC13
Y10 ABC14
Y11 ABC15
Y12 ABC16
Y13 ABC17
Y14 ABC10 ABC10
Y15 ABC11 ABC11
Y16 ABC12
Y17 ABC13
Y20 ABC14
Y21 ABC15
Y22 ABC16
Y23 ABC17
1. The external output terminals of SA3.
2. External expansion board EB308R in the control panel in slot three.
3. External expansion board EB308R in the control panel in slot two.
4. External expansion board EB362R in the control panel in slot three.
5. External expansion board EB362R in the control panel in slot two.
PLC Function Application
9
1.5.3 Device function specification
Auxiliary relay (M)
There are many auxiliary relays in PLC, they can be divided into general, power off keep and special three
categories, the address code of auxiliary relay is according to decimal code. Specific configurations are as
follows:
General 160 points,M0~M159
Power off keep 80 points,M160~M239
Special 64 points,M8000~M8079
General auxiliary relay
The function of general purpose auxiliary relay is similar to intermediate relay in electric control circuit,
the general purpose auxiliary relay can be used as intermediate storage and signal transformation.
Auxiliary relay can be driven by the contact of soft components within the PLC. Auxiliary relays have a
myriad of normally open contacts and normally closed contacts can be unlimited used, but can't drive
external loads directly.
Power off keep auxiliary relay
Power off when the PLC running, the state of power off keep auxiliary relay will be saved in EEPROM of
inverter before inverter thoroughly losing electricity. Then power on, power off keep auxiliary relay which
maintain the state will continue to be used.
Special auxiliary relay
Special auxiliary relay is an internal relay whose application is already determined in the PLC function.
Therefore, undefined special auxiliary relay do not use. Please refer to Section1.5.4 for detailed.
Timer (T)
The timer is equal to time relay in the electrical control circuit, it can be applied in the program to delay
control. The address code of timer is according to decimal code. The PLC function has only one timer,
Timing for timing upwards. Regular period is 100ms; measurement range is from 0 to 6553.5s. There are
eight points that is T0 to T7 which address code is according to decimal code.
Outside of own number memory, timer also have a set value register and a current value register. The
program timing setting is stored to the current value register, timing register records at the current value of
these registers are hexadecimal storage. Real time is the set value multiply by time unit. When the count
value is equal to the set value, the timer output contact action. Timer can use the decimal constants (k) as
the setting value, can also use the data register (d) indirect setting.
Counter (C)
Counter is used to count. There is only one 16-bit increased counter in built-in PLC; measurement range is
from 0 to 65535. There are eight points that is C0 to C7. The current value register and the set value
register are the 16-bit binary registers; the set value range is from 0 to 65535.
PLC Function Application
10
RST C0
X10
C0
X11
C0
Y0
K10
01
23
45
67
89 10
X10
X11
C0
current value
C0,Y0
As indicated in Figure, X11 ON->OFF, C0 current value increases by 1 at a time, and when the count
reached K10, C0-contact action, Y0 output. Then X1 triggering again, C0 also won't accumulate and kept
in the K10.When the power supply is OK, the current value register of the counter with memory, so before
the counter start counting you should reset the current value register with RST instruction.
Data register
Data register is divided into general data register and special data register.
General data register
Once written data in the general data register, as long as no longer write other data, the general data
register is not changed. If PLC run command OFF or power off, the data will be cleared. The data register
which used to Power off keep can maintain its data.
Special data register
Special data register is an internal relay whose application is already determined in the PLC function.
Please refer to Section1.5.5 for detailed
1.5.4 Special auxiliary relay function specification
Special auxiliary relay is an internal relay whose application is already determined in the PLC function.
Therefore, undefined special auxiliary relay do not use. Specific content as follows:
Number Name Description R/W
M8000 RUN monitoring This contact is On when running R
M8001 RUN monitoring This contact is Off when running R
M8002 Initial pulse Normally open contact (Pulse width=scan period.) R
M8003 Initial pulse Normally closed contact (Pulse width=scan period.) R
M8011 10ms clock pulse 5ms on/5ms off R
M8012 100ms clock pulse 50ms on/50ms off R
M8013 1s clock pulse 0.5s on/0.5s off R
M8014 1min clock pulse 30s on/30s off R
PLC Function Application
11
Number Name Description R/W
M8020 Zero
[Setting condition]: Addition and subtraction result is 0. [Clearing condition]: (1) The next addition and subtraction result is not zero. (2) PLC program or communication.
R/W
M8023 Zero divisor
[Setting condition]: Divisor is 0. [Clearing condition]: PLC program or communication.
R/W
M8030 Parameter values are saved to EEPROM selection
0: Saved 1: No saved
R/W
M8032 Clear power off keep area Clear the data of the power off keep area R/W
M8034 All the output can be disabled Y outputs are disabled R/W
M8035 Special operations end 0: Allow the special operations or in special operations 1: End (Note 1)
R/W
M8036 Set operation mode enable
0: Do not modify the inverter operation mode 1: allow to modify the inverter operation mode
(After modify will be automatically reset) R/W
M8038 Failure to restore all parameters to default values
[Setting condition]: Failure [Clearing condition]: (1) Success (2) PLC program or communication.
R/W
M8041 State control (STF) The inverter runs forward R/W
M8042 State control (STR) The inverter runs reverse R/W
M8043 State control (RL) Multi-speed low speed R/W
M8044 State control (RM) Multi-speed medium speed R/W
M8045 State control (RH) Multi-speed high speed R/W
M8046 State control (RT) The inverter second function R/W
M8047 State control (MRS) The instantaneous stopping of the inverter output. R/W
M8048 Character control After setting condition the state control of the inverter by D8040.
R/W
M8049 Analog output After setting condition, two analog outputs can output. (Note 3)
R/W
M8058 Analog input After setting condition, start monitoring the analog input.
R/W
M8050 State monitoring (RUN) Inverter running
M8051 State monitoring (STF) Forward rotation
M8052 State monitoring (STR) Reverse rotation
M8053 State monitoring (SU) Reaching the output frequency
M8054 State monitoring (OL) Overload detection
PLC Function Application
12
Number Name Description R/W
M8055 State monitoring (END) Restore all parameters to default values completion
M8056 State monitoring (FU) Output frequency detection
M8057 State monitoring (ALARM) Alarm detection
M8059 The custom state output Monitor selected by the output of D8059.
M8060 High-speed pulse count start After setting condition high-speed pulse count R/W
M8061 Clear High-speed count After setting condition high-speed pulse clear R/W
M8065 Over-voltage 0: No over-voltage 1: Over-voltage between Terminal P and Terminal N
R
M8066 Low-voltage 0: No low-voltage 1: Low-voltage between Terminal P and Terminal N
R
M8067 PLC operation monitoring 0: PLC stop 1: PLC running
R
M8068 Inverter reset 0: No reset 1: Reset (Note 2)
R
M8069 Tuning state 0: No tuning 1: During tuning
R
M8070 Power off flag 0: Power on 1: Power off
R
Note: 1. M8035 must be 0, special operations can start. Special operations operate D8153. M8035 can be
cleared by communications, PLC program and PLC STOP.
2. If the value of M8068 is 1, the inverter will be reset. At this time, the user should get ready for the
operation.
3. The data of D8059 and D8060 is not cleared when M8049 Cleared.
1.5.5 Special data register function specification
The application of special data registers is already determined in the PLC function. Specific content as follows:
Number Name Description R/W
D8001 PLC firmware version --- R
D8002 Program capacity --- R
D8003 The current program capacity The current program step R
D8010 Present scan time Unit: 0.1ms R
D8011 Minimum scan time Unit: 0.1ms R
D8012 Maximum scan time Unit: 0.1ms R
D8013 Monitor the external terminals which used by PLC program(X0~X7, X10~X17)
Monitor the external terminals which used by PLC program (The external terminals used by the PLC cannot have other functions). The data is according to the high to low arrangement (with left higher than the right), it is corresponds to the soft device number from big to small.
R
D8014 Monitor the external terminals which used by PLC program(X20~X23)
R
D8015 Monitor the external terminals which used by PLC program(Y0~Y7, Y10~Y17)
R
D8016 Monitor the external terminals which used by PLC program(Y20~Y23)
R
PLC Function Application
13
Number Name Description R/W
D8040
The inverter control word b8~b15: Reserve. b7: Inverter emergency stop (MRS) b6: The second function (RT) b5: High speed (RH) b4: Medium speed (RM) b3: Low speed (RL) b2: Reverse rotation (STR) b1: Forward rotation (STF) b0: Reserve.
Corresponding the control word of M8041~M8047.
R/W
D8041 Target frequency Unit: 0.01Hz R/W
D8045 Analog output AM1-5 (0%~100.00%) Set the percentage of AM1-5 output. The unit is 0.1%
R/W
D8046 Analog output AM2-5(0%~100.00%) Set the percentage of AM2-5 output. The unit is 0.1%
R/W
D8050
Inverter status monitoring b15: During tuning b14: During inverter resetting b13~b11: Reserve b10: PLC operating b9: Inverter low-voltage b8: Inverter over-voltage b7: Abnormality occurred b6: Frequency test b5: Restore all parameters to default
values completion b4: Overloaded b3: Reached the frequency b2: During reverse rotation b1: During forward rotation b0: During rotation
R
D8051 Output frequency Unit: 0.01Hz R
D8052 Output current Unit: 0.01A R
D8053 Output voltage Unit: 0.01V R
D8054 Error codes E1, E2 R
D8055 Error codes E3, E4 R
D8056 Analog input 2-5 (-100%~100%) Set the percentage of 2-5 input. The unit is 0.1%
R
D8057 Analog input 4-5 (0%~100%) Set the percentage of 4-5 input. The unit is 0.1%
R
D8058 Analog input 3-5 (0%~100%) Set the percentage of 3-5 input. The unit is 0.1%
R
D8059 User-defined the Monitor status type The function is same to output external terminals, please refer to 03-10 (P.40)
R/W
D8060 Current value of high-speed counter(L) Low 16 bits R
D8061 Current value of high-speed counter(H) High 16 bits (Note 1) R
PLC Function Application
14
Number Name Description R/W
D1000~
D2299
Corresponds to the value of the parameters( P.0~P.1299 )
They only operate on parameters, the serial number of D which minus 1000 is the number of parameters. M8030 to decide whether to parameter save when power off. (Note 2,3)
R/W
D8128 Inverter operation mode set
P.79 = 0 0: PU mode 1: External mode 2: JOG mode P.79 = 1 0: PU mode 1: Invalid 2: JOG mode P.79 = 3 0: CU mode (00-19(P.35) = 0); External
mode (00-19 P.35) = 1). 1: External mode 2: Communication JOG mode
R/W
D8129 Line speed feedback write-in Unit: 0.1 m/min R/W
D8130 Line speed target value write-in Unit: 0.1 m/min R/W
D8131 Tension reference write-in Unit: 1N R/W
D8132
Torque reference write-in (H0000~H2710: 0~100.00% HD8F0~HFFFF: -100.00%~0)
Unit: 0.01% R/W
D8135
2-5 terminal input voltage (H0000~H03E8: 0~10.00V HFF9C~HFFFF: -10.00~0V)
Unit: 0.01V R
D8136 4-5 terminal input current/voltage Unit: 0.01mA/V R
D8137 3-5 terminal input current/voltage Unit: 0.01mA/V R
D8138 AM1-5 terminal output voltage/current Unit: 0.01mA/V R
D8139 AM2-5 terminal output voltage/current Unit: 0.01mA/V R
D8140 DC bus voltage Unit: 1V R
D8141 The electronic thermal accumulation rate of inverter
Unit: 0.01% R
D8142 Inverter output power Unit: 0.01KW R
D8143 The temperature rising accumulation rate of inverter
Unit: 0.01% R
D8144 The NTC temperature accumulation of inverter
Unit: 0.01℃ R
D8145 The electronic thermal accumulation rate of motor
Unit: 0.01% R
D8146 Target pressure when PID control Unit: 0.01% R
D8147 Feedback pressure when PID control Unit: 0.01% R
D8148 Rotating speed fed back by PG Unit: 0.01Hz R
D8149 HDI terminal input frequency Unit: 0.01kHz R
PLC Function Application
15
Number Name Description R/W
D8151 Output torque of inverter Unit: 0.1% R
D8152 Output frequency Unit: 0.01Hz
D8153 Special operation
1: Alarm history clear (P.996) 2: Inverter reset (P.997) 3: P.998 4: P.999_1 5: P.999_2 6: P.999_3 Restoring some parameters to default values (3, 4, 5and 6). 7: Communication P.998 8: Communication P.999_1 9: Communication P.999_2 10: Communication P.999_3 Restoring all parameters to default values except the communication parameter(7, 8, 9 and 10) (Note 4)
R/W
D8154 The inverter operation mode monitor
H0000: Communication mode;
H0001: External mode;
H0002: JOG mode;
H0003: Combination mode 1;
H0004: Combination mode 2;
H0005: Combination mode 3;
H0006: Combination mode 4;
H0007: Combination mode 5;
H0008: PU mode;
00000000
b7 ~ b0b11 ~ b8Setting value
of 00-17
Setting value
of 00-18
b14 ~ b12b15
1 :
The second operation mode.
R
D8155 Line speed feedback read-out Unit: 0.1 m/min R
D8156 Line speed target value read-out Unit: 0.1 m/min R
D8157 Tension reference read-out Unit: 1N R
D8158 Torque reference read-out Unit: 0.01% R
Note: 1. If PLC program use M8060 and M8061, and also the PLC program is effective, HDI terminal can only
be used by PLC program.
2. The parameter values written by D1000 ~ D2299 whether or not to power off keep depends on the
value of M8030. M8030 = 0, power off keep; M8030 = 1, no power off keep. The values of
parameters D register will remain until power off or reset the inverter.
3. D1996 to D1999 is invalid.
4. D8153 readout value is 0.
PLC Function Application
16
1.5.6 Analog input and output
Analog output
If 02-04(P.54) = 13, the output controlled by PLC. M8049 ON, AM1-5 output.
The value of 02-45(P.64) can choose AM1-5 output signal type (the range of voltage or current). When the
user needs to select the output type of terminal AM1, please turn the toggle switch SW3 to the
corresponding type at first.
D8045 can set the percentage of AM1-5 output. (Unit: 0.1%, Range: 0%~100%, Percentage corresponds
to the range set by 02-45(P.64)).
02-45(P.64) Range Percentage SW3
0 0~10V 0~100% Up
1 Reserve ---- ----
2 0~20mA 0~100% Down
3 4~20mA 0~100% Down
If 02-05(P.537) = 13, the output controlled by PLC. M8049 ON, AM1-2 output.
The value of 02-48(P.538) can choose AM2-5 output signal type (the range of voltage or current). When
the user needs to select the output type of terminal AM2, please turn the toggle switch SW4 to the
corresponding type at first.
D8046 can set the percentage of AM2-5 output. (Unit: 0.1%, Range: 0%~100%, Percentage corresponds
to the range set by 02-48(P.538)).
02-48(P.538) Range Percentage SW4
0 0~10V 0~100% Up
1 Reserve ---- ----
2 0~20mA 0~100% Down
3 4~20mA 0~100% Down
Analog input
If M8058 ON, M8058 will monitor the signal value of analog input terminals.
The value of 02-08(P.73) can choose 2-5 analog input signal range. (Unit: 0.1%, Range: -100%~100%,
Percentage set by 02-08(P.73)).
02-08(P.73) Range Percentage
0 0~5V 0~100%
1 0~10V 0~100%
2 0~-5V 0~-100%(Note)
3 0~-10V 0~-100%(Note)
4 -5~5V -100%~100%(Note)
5 -10~10V -100%~100%(Note)
The value of 02-29(P.531) can choose 3-5 analog input signal range and type. (Unit: 0.1%, Range:
0%~100%, Percentage set by 02-29(P.531)). When the user needs to monitor the input voltage of 3-5,
please turn the toggle switch SW1 to the corresponding type at first.
PLC Function Application
17
02-29(P.531) Range Percentage
0 4~20mA 0~100%
1 0~10V 0~100%
2 0~5V 0~100%
The value of 02-20(P.17) can choose 4-5 analog input signal range and type. (Unit: 0.1%, Range:
0%~100%, Percentage set by 02-20(P.17)). When the user needs to monitor the input voltage of 3-5,
please turn the toggle switch SW2 to the corresponding type at first.
02-20(P.17) Range Percentage
0 4~20mA 0~100%
1 0~10V 0~100%
2 0~5V 0~100%
Note: The percentage is a negative value when negative voltage of terminal 2-5. D register is 16-bit unsigned type, so if the percentage is negative, the value of D register is an absolute value. Such as: the percentage is -100.0%, the value of D8056 is 65536 – 1000 = 64536.
1.5.7 Pulse train input
M8060 is a start command of the built-in PLC high-speed pulse input count function.
M8061 can clear the high-speed pulse input count of built-in PLC
D8060 entered the low 16 bits of the built-in high-speed pulse input count.
D8061 entered the high 16 bits of the built-in high-speed pulse input count.
Count pulse by the HDI input port when 03-09(P.550) set to 54. HDI wiring connection is the same as the
common patterns. High-speed counter can identify the highest pulse frequency is 100 KHZ.
In the following figure, X0 closed and M8060 was setting, then the high-speed pulse input counting start.
D8060 and D8061 store the current count value. D8060 transmitting the low 16 bits value to D0, D8061
transmitting the low 16 bits value to D1.If X1 closed, D8060 and D8061 will be Clearing.
Note: Editing to M8060 or M8061, and 03-09P.550 set to 54 when the PLC program effective, the original function of HDI will be failure.
Commands
18
2. Commands Description
The PLC function built-in SA3 provides 21 basic instructions and 12 application instructions.
2.1 Basic Commands
The structure of ladder diagram and information:
Ladder Diagram
Explanation Command Device Number range
Normally open, contact a LD X、Y、M、T、C
X:0~25, Octal code
Y:0~23, Octal code
M:0~239, M8000~M8063
T:T0~T7
C:C0~C7
K:0~65535
Normally closed, contact b LDI X、Y、M、T、C
Serial normally open AND X、Y、M、T、C
Serial normally closed ANI X、Y、M、T、C
Parallel normally open OR X、Y、M、T、C
Parallel normally closed ORI X、Y、M、T、C
Rising-edge trigger switch LDP X、Y、M、T、C
Falling-edge trigger switch LDF X、Y、M、T、C
Rising-edge trigger in
serial ANDP X、Y、M、T、C
Falling-edge trigger in
serial ANDF X、Y、M、T、C
Rising-edge trigger in
parallel ORP X、Y、M、T、C
Falling-edge trigger in
parallel ORF X、Y、M、T、C
Block in serial ANB ---
Block in parallel ORB ---
Multiple output MPS、MRD、MPP ---
Output command of coil
drive OUT Y、M
PLC program end END ---
--- Coil through to keep SET Y、M
Coil through to remove RST Y、M
Commands
19
Explanation for the Command
Mnemonic Function
LD
The LD command is used on the A contact that has its start from the left BUS or the A contact that
is the start of a contact circuit. Function of the command is to save present contents, and at the
same time, save the acquired contact status into the accumulative register.
Operand X Y M T C D
OK OK OK OK OK NO
Example:
Ladder diagram: Command code:
LD X0
OUT Y0
Mnemonic Function
LDI
The LDI command is used on the B contact that has its start from the left BUS or the B contact
that is the start of a contact circuit. Function of the command is to save present contents, and at
the same time, save the acquired contact status into the accumulative register.
Operand X Y M T C D
OK OK OK OK OK NO
Example:
Ladder diagram: Command code:
LDI X0
OUT Y0
Mnemonic Function
AND
The AND command is used in the series connection of A contact. The function of the command is
to readout the status of present specific series connection contacts first, and then to perform the
“AND” calculation with the logic calculation result before the contacts, thereafter, saving the result
into the accumulative register.
Operand X Y M T C D
OK OK OK OK OK NO
Example:
Ladder diagram: Command code:
LD X0
AND X1
OUT Y0
Y0
X0
X0 X1
Y0
Y0
X0
Commands
20
Mnemonic Function
ANI
The ANI command is used in the series connection of B contact. The function of the command is
to readout the status of present specific series connection contacts first, and then to perform the
“AND” calculation with the logic calculation result before the contacts, thereafter, saving the result
into the accumulative register.
Operand X Y M T C D
OK OK OK OK OK NO
Example:
Ladder diagram: Command code:
LD X0
ANI X1
OUT Y0
Mnemonic Function
OR
The OR commands is used in the parallel connection of A contact. The function of the command is
to readout the status of present specific series connection contacts, and then to perform the “OR”
calculations with the logic calculation result before the contacts, thereafter, saving the result into
the accumulative register.
Operand X Y M T C D
OK OK OK OK OK NO
Example:
Ladder diagram: Command code:
LD X0
OR X1
OUT Y0
Mnemonic Function
ORI
The ORI command is used in the parallel connection of B contact. The function of the command is
to readout the status of present specific series connection contacts, and then to perform the “OR”
calculations with the logic calculation result before the contacts, thereafter, saving the result into
the accumulative register.
Operand X Y M T C D
OK OK OK OK OK NO
Example:
Ladder diagram: Command code:
LD X0
ORI X1
OUT Y0
X0
Y0
X1
Y0
X0
X1
Y0
X0
X1
Commands
21
Mnemonic Function
LDP
Usage of the LDP command is the same as the LD command, but the motion is different. It is used
to reserve present contents and at the same time, saving the detection status of the acquired
contact rising-edge into the accumulative register.
Operand X Y M T C D
OK OK OK OK OK NO
Example:
Ladder diagram: Command code:
LDP X0
OUT Y0
Mnemonic Function
LDF
Usage of the LDF command is the same as the LD command, but the motion is different. It is used
to reserve present contents and at the same time, saving the detection status of the acquired
contact falling-edge into the accumulative register.
Operand X Y M T C D
OK OK OK OK OK NO
Example:
Ladder diagram: Command code:
LDF X0
OUT Y0
Mnemonic Function
ANDP ANDP command is used in the series connection of the contacts’ rising-edge detection.
Operand X Y M T C D
OK OK OK OK OK NO
Example:
Ladder diagram: Command code:
LD X0
ANDP X1
OUT Y0
X0
Y0
X0
Y0
X1
Y0
X0
Commands
22
Mnemonic Function
ANDF ANDF command is used in the series connection of the contacts’ falling-edge detection.
Operand X Y M T C D
OK OK OK OK OK NO
Example:
Ladder diagram: Command code:
LD X0
ANDF X1
OUT Y0
Mnemonic Function
ORP The ORP commands are used in the parallel connection of the contact’s rising-edge detection.
Operand X Y M T C D
OK OK OK OK OK NO
Example:
Ladder diagram: Command code:
LD X0
ORP X1
OUT Y0
Mnemonic Function
ORF The ORP commands are used in the parallel connection of the contact’s falling-edge detection.
Operand X Y M T C D
OK OK OK OK OK NO
Example:
Ladder diagram: Command code:
LD X0
ORP X1
OUT Y0
Mnemonic Function
ANB To perform the “ANB” calculation between the previous reserved logic results and contents of the
accumulative register.
Operand ---
X1
Y0
X0
X0
Y0
X1
X0
Y0
X1
Commands
23
Example:
Ladder diagram: Command code:
LD X0
OR X1
LD X2
OR X3
ANB
OUT Y0
Mnemonic Function
ORB ORB is to perform the “OR” calculation between the previous reserved logic results and contents
of the accumulative register.
Operand ---
Example:
Ladder diagram: Command code:
LD X0
AND X1
LD X2
AND X3
ORB
OUT Y0
Mnemonic Function
MPS To save contents of the accumulative register into the operation result. (the result operation
pointer pluses 1)
MRD Reading content of the operation result to the accumulative register. (the pointer of operation
result doesn’t move)
MPP Reading content of the operation result to the accumulative register. (the stack pointer will
decrease 1)
Operand ---
Y0
X0
X1
X2
X3
ANB
Y0
X0
X2
X1
X3 ORB
Communication application specification
24
Example:
Ladder diagram: Command code:
LD X10
MPS
AND X11
OUT Y0
MRD
AND X12
OUT Y1
MPP
AND X13
OUT Y2
Mnemonic Function
OUT Output the logic calculation result before the OUT command to specific device.
Operand X Y M T C D
NO OK OK OK OK NO
Example:
Ladder diagram: Command code:
LD X0
OUT Y0
Mnemonic Function
SET
When the SET command is driven, its specific device is set to be “ON,” which will keep “ON”
whether the SET command is still driven. You can use the RST command to set the device to
“OFF”.
Operand X Y M T C D
NO OK OK NO NO NO
Example:
Ladder diagram: Command code:
LD X0
SET M0
X10
Y0
X12
Y1
X13
Y2
MPS
MRD
MPP
X11
X0
Y0
X0
SET M0
Commands
25
Mnemonic Function
RST Clear the contacts or the registers
Operand X Y M T C D
NO OK OK OK OK OK
Example:
Ladder diagram: Command code:
LD X0
RST Y0
Mnemonic Function
END Program End
Operand ---
Example:
Ladder diagram: Command code:
END
X0
RST Y0
END
Communication application specification
26
2.2 Application commands
Description of the application commands.
Classification FNC NO. (Decimal) Mnemonic Codes Function Following number of parameters
Transmission
comparison
10 CMP Compare 3
11 ZCP Zone compare 4
12 MOV Data Move 2
15 BMOV Block move 3
Four
Fundamental
operations of
arithmetic
20 ADD Perform the addition of BIN
data 3
21 SUB Perform the addition of BIN
data 3
22 MUL Perform the multiplication
of BIN data 3
23 DIV Perform the division of BIN
data 3
24 INC Perform the addition of 1 1
25 DEC Perform the subtraction of
1 1
Rotation and
displacement
30 ROR Rotate to the right 2
31 ROL Rotate to the left 2
FNC 10 CMP S2A 16-bit
instructions
Two output data
comparison drive coilDS1
X Y M K T C D
S1 O O O O
S2 O O O O
D O O
Flag: Nothing
Explanation:
1. S 1: value comparison 1, S 2: value comparison 2, D: result comparison
2. The contents in S 1 and S 2 are compared and result is stored in D.
3. The two comparison values are compared algebraically and the two values are signed binary values. When
b15 = 1 in 16-bit instruction, the comparison will regard the value as negative binary values.
Example:
1. Designate device M0, and automatically occupies M0, M1, and M2.
2. When X0 = on, CMP instruction will be executed. When X0 = off, CMP instruction will not be executed and
remain the status before X10 = off.
Commands
27
X0
CMP C0K10 M0
M0
M1
M2
If K10 > C0, M0 = ON
If K10 = C0, M1 = ON
If K10 < C0, M2 = ON
FNC 11 ZCP S2 Zone compare DS1 SA 16-bit
instructions
X Y M K T C D
S1 O O O O
S2 O O O O
S O O O O
D O O
Flag: Nothing
Explanation:
1. S1: Lower bound of zone comparison, S2: Upper bound of zone comparison, S: Comparison value,
D: Comparison result
2. S is compared with its S1, S 2 and the result is stored in D.
Example:
1. Designate device M0, and operand D automatically occupies M0, M1 and M2.
2. When X0 = on, ZCP instruction will be executed. When X0 = off, ZCP instruction will not be executed and
remain the status before X0 = off.
X0
ZCP K120K10 C0
M0
M1
M2
If K10 > C0, M0 = ON
If K10 <= C0<=K120,
M1 = ON
If C0>K120, M2 = ON
M0
Communication application specification
28
X Y M K T C D
S O O O O
D O O O
Flag: Nothing
Explanation:
1. S: Source of data, D: Destination of data
2. When this instruction is executed, the content of S will be moved directly to D. When this instruction is not
executed, the content of D remains unchanged.
Example:
When X0 = off, the content in D10 will remain unchanged. If X0 = on, the value K10 will be moved to D10 data
register.
FNC 15 BMOV Block moveDS NA 16-bit
instructions
X Y M K T C D
S O O O
D O O O
N O O
Flag: Nothing
Explanation:
1. S: Start of source devices, D: Start of destination devices, n: Number of data to be moved
2. The contents in n registers starting from the device designated by S will be moved to n registers starting from
the device designated by D. If n exceeds the actual number of available source devices, only the devices that
fall within the valid range will be used.
Example:
When X0 = on, the contents in registers D0 ~ D5 will be moved to the 6registers D10 ~ D15.
X0
MOV K10 D0
X0
BMOV D0 D10 K6
D0
D1
D2
D3
D4
D5
D10
D11
D12
D13
D14
D15
FNC 12 MOV Moving the data DSA 16-bit
instructions
Commands
29
FNC 20 ADD BIN addition S2S1 DA 16-bit
instructions
X Y M K T C D
S1 O O O O
S2 O O O O
D O O O
Flag: M8020 0: Addition and subtraction result is not 0.
1: Addition and subtraction result is 0.
Explanation:
1. S1: Summand, S2: Addend, D: Sum
2. This instruction adds S1 and S2 in BIN format and store the result in D.
3. The result is zero, M8020 is set. The result is not zero, M8020 is cleared.
Example:
When X0 = on, the content in D0 will plus the content in D10 and the sum will be stored in D20.
FNC 21 SUB SubtractionS2S1 DA 16-bit
instructions
X Y M K T C D
S1 O O O O
S2 O O O O
D O O O
Flag: M8020 0: Addition and subtraction result is not 0.
1: Addition and subtraction result is 0.
Explanation:
1. S1: Minuend, S2: Subtrahend, D: Remainder
2. This instruction subtracts S1 and S2 in BIN format and stores the result in D. Participating in operation
numbers are positive integers, so ask for S1>= S2.
3. The result is zero, M8020 is set. The result is not zero, M8020 is cleared.
Example:
When X0 = on, the content in D0 will minus the content in D10 and the remainder will be stored in D20. If the
difference is zero, the M8020 will be set to 1.
X0
ADD D0 D10 D20
X0
SUB D0 D10 D20
Communication application specification
30
FNC 22 MUL BIN multiplication S2S1 DA 16-bit
instructions
X Y M K T C D
S1 O O O O
S2 O O O O
D O O O
Flag: Nothing
Explanation:
1. S1: Multiplicand, S2: Multiplication, D: Product
2. This instruction multiplies S1 by S2 in BIN format and stores the result in D. Be careful with the
positive/negative signs of S1, S2 and D when doing 16-bit operations.
Example:
When X0 = on, the content in D0 will multiplied by the content in D10 and the remainder will be stored in D20.
The 16-bit D0 is multiplied by the 16-bit D10 and brings forth a 32-bit product.
FNC 23 DIV BIN division S2S1 DA 16-bit
instructions
X Y M K T C D
S1 O O O O
S2 O O O O
D O O O
Flag::M8023 0:The divisor is not 0.
1:The divisor is 0.
Explanation:
1. S1: Dividend, S2: Divisor, D: Quotient
2. This instruction divides S1 and S2 in BIN format and stores the result in D. Be careful with the
positive/negative signs of S1, S2 and D when doing 16-bit operations, Only quotient stored in D. The divisor
is not 0, M8023 will be set to 1.
Example:
When X0 = on, D0 will be divided by D10; the quotient will be stored in D20.
X0
MUL D0 D10 D20
X0
DIV D0 D10 D20
Commands
31
FNC 24 INCIncrement:
BIN plus 1 D
A 16-bit
instructions
X Y M K T C D
D O O O
Flag: Nothing
Explanation:
1. D: Destination device.
2. If the instruction is not a pulse execution one, the content in the designated device D will plus “1” in every
scan period.
3. This instruction adopts pulse execution instructions.
4. INC instruction has only one operand, and does not affect the zero flag.
5. Operation data as an unsigned 16-bit binary number.
Example:
When X0 goes from Off to On, the content in D0 minuses 1 automatically.
FNC 24 DECDecrement:
BIN minus 1 D
A 16-bit
instructions
X Y M K T C D
D O O O
Flag: Nothing
Explanation:
1. D: Destination device.
2. If the command is not a pulse execution type, the content in the designated device D will minus “1” in every
scan period.
3. This instruction adopts pulse execution instructions.
4. DEC instruction has only one operand, and does not affect the zero flag.
5. Operation data as an unsigned 16-bit binary number.
Example:
When X0 goes from Off to On, the content in D0 minuses 1 automatically.
FNC 30 RORRotate to
the right D N
A 16-bit
instructions
X0
INC D0
X0
DEC D0
Communication application specification
32
X Y M K T C D
D O O O
N O
Flag: Nothing
Explanation:
1. D: Device to be rotated, N: Number of bits to be rotated in 1 rotation
2. This instruction rotates the device content designated by D to the right for N bits.
3. Operation data as an unsigned 16-bit binary number.
4. This instruction adopts pulse execution instructions. A move cannot be more than 15 bit.
Example:
When X0 goes from Off to On, the 16-bit (4 bits as a group) in D10 will rotate to the right.
X0
ROR D0 K4
1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
Rotate to the right
1 1110000 0 0 0 0 0 0 0 0
After one rotation to the right
Communication application specification
33
FNC 31 ROLRotate to
the left D N
A 16-bit
instructions
X Y M K T C D
D O O O
N O
Flag: Nothing
Explanation:
1. D: Device to be rotated, N: Number of bits to be rotated in 1 rotation
2. This instruction rotates the device content designated by D to the left for N bits.
3. Operation data as an unsigned 16-bit binary number.
4. This instruction adopts pulse execution instructions. A move cannot be more than 15 bit.
Example:
When X0 goes from Off to On, the 16-bit (4 bits as a group) in D10 will rotate to the left.
X0
ROL D0 K4
1 1110 0 0 0 0 0 0 00000
Rotate to the left
1 1110000 0 0 0 0 0 0 0 0
After one rotation to the left
Communication application specification
34
3. Communication application specification
3.1 Modbus communication protocol
Embedded PLC supports Modbus RTU and ASCII communications protocols to read and write the soft
devices.
A soft device Modbus addresses are divided into groups and bit address. To the operation of the group
address is 16 bits of soft devices to read and write at the same time. Read and write at most 416 addresses
at a time. Word soft devices have group address only, read and write at most 20 at a time. If parameter D
need write must ensure that the inverter is in communication mode.
PLC soft device Modbus contact address:
Soft device Group address Bit address
X 0x2000~0x2001 0x3000~0x3015
Y 0x2002~0x2003 0x3020~0x3033
M 0x2004~0x2012 0x3040~0x312F
T(位) 0x2013 0x3130~0x3137
C(位) 0x2014 0x3140~0x3147
Special M 0x2015~2019 0x3150~0x319F
T set value 0x2034~0x2043
---
C set value 0x2044~0x2053
T current value 0x2054~0x2063
C current value 0x2064~0x2073
D 0x2074~0x20A3
Special D 0x20A4~0x2145
---
Special D 0x000~0x0513
Communication application specification
35
Communication with PLC available order code
Code Function Operating mode suitable object
0x01 The coil state read Bit manipulation, Read single / Read multiple Y,M,T,C
0x02 The input state read Bit manipulation, Read single / Read multiple X,Y,M,T,C
0x03 Read single data Word manipulation, Read single / Read multiple
X, Y, M, T, C, D, T current value, T set value, C current value, C set value.
0x05 Force single coil Bit manipulation, Write single Y,M ,T,C
0x06 Write single information Word manipulation, Write single
Y, M, T, C, D, T current value, T set value, C current value, C set value.
0x10 Write more information Word manipulation, Write multiple
Y, M, T, C, D, T current value, T set value, C current value, C set value.
Communication example:
Example 1: Read the state OF M16 ~ M33.
Bit manipulation:
Enquire:01 01 30 50 00 12 B3 16
Reply:01 01 03 BC ED 03 F0 FB
Response data parsing:0xBC is corresponding to the state of M23 ~ M16. M18, M19, M20, M21 and M23 are
1; M16, M17 and M22 are 0.
0xED is corresponding to the state of M31~M24. M24, M26, M27, M29, M30 and M31
are 1, M25 and M28 is 0.
0x03 is corresponding to the state of M33~M32. M33 and M32 less than one byte, so
the excess is 0.M33, M32 with a status of 1.
Word manipulation:
Enquire:01 03 20 05 00 02 DF CA
Reply:01 03 04 ED BC A5 67 34 01
Response data parsing:0XEDBC is corresponding to the state of M31~M16.
M18,M19,M20,M21,M23,M24,M26,M27,M29,M30 and M31 are 1,M16, M17, M22,
M25 and M28 are 0.
0XA567 is corresponding to the state of M47~M32. Here we only care about M33,
M32, and other can no matter.
The use of the command code 0x02 is the same as 0x01, just the range is different.
Communication application specification
36
Example 2: Forced M100 ON
Command:01 05 30 A4 FF 00 C2 D9
Reply: 01 05 30 A4 FF 00 C2 D9
Forced M100 OFF
Command:01 05 30 A4 00 00 83 29
Reply: 01 05 30 A4 00 00 83 29
Analysis: Write value 0xff00 means operations command a soft device state to ON. Write a value of 0x0000,
which commands the operation for the soft device state to OFF.
Example 3: Read the value of D20
Enquire:01 03 20 88 00 01 0F E0
Reply:01 03 02 17 70 B6 50
Example 4: Read the value of D0~D10
Enquire:01 03 20 74 00 0B 4F D7
Reply:01 03 16 00 19 01 E8 00 10 17 70 13 88 07 DA 00 00 10 00 12 00 21 03 FF FF 06 AA
Example 5: Write 3000 to D20
Command:01 06 20 88 0B B8 05 62
Reply:01 06 20 88 0B B8 05 62
Example 6: Write to D2~D6
Command:01 10 20 76 00 05 0A 13 88 07 D0 17 70 10 68 0A 28 F0 AF
Reply:01 10 20 76 00 05 EA 10
3.2 PLC communication protocol
If P. 33 set to 2, it means choose the PLC communication protocol, P.48 ~ P.50 set communication format, P.
32 choose communication baud rate. PLC protocol is a special agreement with PLC program download or
the embedded PLC and shilin HMI communication. Shihlin HMI EC200 currently supports this protocol.
Use with HMI can realize the I/O monitoring, internal soft device monitoring and monitoring of PLC program
running
Appendix
37
Appendix
SA3 built-in PLC can be used with the Shihlin HMI to read PLC ladder diagram and instruction list, modify the
instruction sheet and monitor PLC operation. As shown in the figure below, the serial ports pin definition is for
RS232, RS422 and RS485 of Shilin HMI.