Coolmay: MX2N Series PLC Programming Manual
Coolmay: MX2N Series PLC Programming Manual
Coolmay: MX2N Series PLC Programming Manual
Content
1 Summary................................................................................................................................1
1.1 COOLMAY MX2N PLC main advantage................................................................... 1
1.2 Type & Specification.................................................................................................... 2
2 Component Range..................................................................................................................3
3 Supported instruction.............................................................................................................3
3.1 Basic Logic instructions................................................................................................3
3.2 Step command instructions...........................................................................................3
3.3 Function instruction table( Compared with Mitsubishi PLC)...................................... 5
3.4 Special relay & register function.................................................................................. 8
3.4.1 Special relay function table................................................................................8
3.4.2 Special register function table............................................................................9
4 Analog Usage.......................................................................................................................12
4.1 Analog input type....................................................................................................... 12
4.1.1 Analog input reading....................................................................................... 12
4.2 Analog output type..................................................................................................... 12
4.2.1 Analog output reading..................................................................................... 12
5 Random number instructions...............................................................................................13
6 High speed counter application........................................................................................... 14
6.1 Inside high speed counter input distribution table...................................................... 14
6.2 High speed count input instructions........................................................................... 14
7 Pulse capture function application.......................................................................................16
8 High speed pulse output application....................................................................................16
9 Optional COM Port instructions.......................................................................................... 17
9.1 Function instructions.................................................................................................. 17
9.2 Modbus-RTU Protocol special registers & relays...................................................... 17
9.3 D8120 Parameter and Function setting.......................................................................18
9.4 Modbus-RTU Master station instructions.................................................................. 19
9.5 Modbus-RTU Protocol slave station element address................................................20
9.6 RS Protocol special registers & relays instructions.................................................... 23
9.7 CAN communication protocol instruction..................................................................23
9.7.1 Function description........................................................................................ 23
9.7.2 Register and relay description......................................................................... 23
9.7.3 Description of register can’t be communicated............................................... 24
9.7.4 CAN communication speed and distance........................................................ 24
9.7.5 Master-Slave shared register table...................................................................25
9.7.6 Setting example of communication program...................................................26
9.7.7 Test program description................................................................................. 27
10 Fault detection................................................................................................................... 28
I
Coolmay MX2N series PLC programming manual
1 Summary
1.1 COOLMAY MX2N PLC main advantage
◆ Could use GX Developer 8.52E and GX Works2 software to program ,read,
download,verify, diagnose,monitor and process sequence.
◆ Could customize 4 channels AD and 2 channels DA,in 12bit precision,use
RD3A to read AD data and WRA3 to output DA data (can set upper and lower limit
ranges.)
◆ Support optional one RS485 or RS232 COM Port,support Programming port
protocol and MODBUS-RTU master-slave protocol.It can be switched in the
program through D8120,support communication through RS485 networking and
inverter etc.
◆ Support RTC function,when password is 12345678,the programming
software can't modify clock data.
◆ High Speed counter input conventional 6 channels single-phase counting (X0-X5)
or 2 channels AB phase counting (X0-X1/X3-X4)10KHz, it can be customized 6
channels single-phase counting at most (4 channels 60KHz,2channels 60KHz).
◆ High speed pulse output conventional 4 channels 20KHz Y0/Y1/Y2/Y3, it can
be customized 4 channels Y0/Y1 200KHz,Y2/Y3 100KHz.
◆ Support Watch dogs function-compatible with Mitsubishi FX2N.
◆ Support external interrupt function-compatible with the original,support
pulse capture function,support 6 channels X0-X5.
◆ Support super password: When password is 12345678,the program can't read
except the device data. When password is changed,the program will be cleaned.
You can also open the PLC program to disable the read mode on setup software
(Once open, no matter what the password is,the program can't be read.)
◆ Support Power-down data protection (All power-down is Kept by
FLASH,data will be checked when power-on.)
◆ Check the downloaded ladder program
◆ When the program run in the PLC,it will check the program instructions and
the components range,corresponding problem will be reported when being
detected.
◆ Run light flashes when switch turns to "RUN", run light goes out when to "STOP".
◆ During running. If check slight fault,the ERR light flashes. If serious fault,
ERR light is on always.
◆ Support constant scan mode: D8039-Constant scan time,M8039-Constant
scan mode.
◆ Support CAN networking communication function. Support 32 slaves at
most,master-slaves share 32 registers at most,communication baud rate could be set.
◆ Optional High speed pulse output function, PWM support the highest
frequency 900KHz,duty ratio is 0-100%.
1
Coolmay MX2N series PLC programming manual
Image
Dimension 125*90*36mm
Cutout size 117*99mm
Installatio
Fixed hole installation and DIN-RAIL (35mm
n
Digital I/O 12DI/12DO
I/O level NPN,COM
Output MT(MOS) : 500mA at most/ MR (Relay): 5A at most
type Input:NPN, public side isolation,S/S to 24V positive
Normally 6 single phase counting (X0-X5) or 2 AB phase counting(X0-X1/X3-X4)10KHz
High speed
counter At most 6 single counting can be customized (4 *60KHz,2 *10KHz) or 2 AB phase counting( 2
60KHz)
High speed Normally 4 channels 20KHz,Y0-Y3
pulse Can special customize 4channels:2 channels 200KHz (Y0/Y1)+ 2 channels 100KHz (Y2/Y3)
AI: 0-5V/0-10V/0-20mA/NTC10K/NTC50K/
AO:0-10V/0-5V/0-20mA or mixed
Analog I/O
4AD/2DA(additional:can optional 1 channel weighing function/load cell)
AD Notice: 1 channel NTC10K or NTC50K occupy two AD points,2channels at most
Optional voltage and current could be done 4 channels at most.
Default 1 RS232
Com port Optional 1 RS485/RS232(default is Mitsubishi programming port protocol when Power-on )
Optional CAN (only for internal networking, and can’t coexist with weighing modules)
Software Compatible with MITSUBISHI GX8.52 and WORKS 2
Detailed info. refer to:<Coolmay MX2N Series PLC Programming Manual>
<Coolmay MX2N Series PLC User Manual>
Regular Models:MX2N-24MR/MT(MOS)/MRT(-4AD2DA-485/232)
2
Coolmay MX2N series PLC programming manual
2 Component Range
Input X X0~X47 40 points Out put Y Y0~Y47 40 points
Ministrant M0~M383 384 M8000~M8255 255 points
M384~M1535 1052 points (keep)
relay M points (general) (special)
State relay S0~S9 10 points
S10~S999 990 points (keep)
S (State keep)
T0~T199 200 T200~T254 T246~T249
T250~T255 6points 100ms
Timer T points 46 points 4points 1ms
accumulation
100ms 10ms accumulation
16 Bits counter 32 Bits counter
C0~C15 16 C16~C199 C200~C219 20 C220~C234 C235~C255
Counter C
points 184 points 15points 20points
(general) points (keep) (general) (keep) (HS keep)
D8196~D8 V0~V7
D0~D127 128 D128~D7999 D8000~D8195 255 Z0~Z7
R D.V.Z points 7872 196 points 59points 16points
(general) points (keep) (special,keep)
(special) (index)
Nested N0~N7 8 points P0~P127 128 points IO 口口~I5 口口 6 points
Pointer (master) (jump,subroutine) (External interrupt)
32bits-
K(10 digits) 16 bits-32768~32767
Constant 2147483648~2147483647
H(16 digits 16 bits O~FFFF 32 bits 0~FFFFFFFF
3 Supported instruction
3
Coolmay MX2N series PLC programming manual
4
Coolmay MX2N series PLC programming manual
5
Coolmay MX2N series PLC programming manual
43 SUM ON digits ★
44 BON ON digits determination ★
45 MEAN Average value ★
46 ANS Signal alarm set ★
47 ANR Signal alarm reset ★
48 SQR BIN extraction of a root ★
49 FLT BIN Integer→floating conversion ★
50 REF Input and output refresh ★
51 REFF Input refresh (with filter settings
High-speed processing
al
★
162 TADD Clock data addition ★
163 TSUB Clock data subtraction ★
166 TRD Clock data readout ★
167 TWR Clock data write ★
169 HOUR Calculagraph ★
170 GRY Gray code transformation ★
equipment
Peripheral
Note :
**1--When analog input and output is selected ,read and wrote data is used;
**2--Optional RS485/RS232 is used for MODBUS-RTU master function,to read/write slave
data.
MX2N-43HB does not support the optional RS485/RS232 communication port.
MX2N-70HB supports to add 1 RS485 communication port but can’t coexist with the built-in
232 port.
Remarks :
1)Support 32-bit instructions,and adding P instructions;
2)When unsupported instruction is used,6056 fault will be detected;
3)“★”indicates the function instructions supported by MX2N series HMI PLC All in one;
4)Instruction details refer to《FX series PLC Programming manual》
8
Coolmay MX2N series PLC programming manual
9
Coolmay MX2N series PLC programming manual
10
Coolmay MX2N series PLC programming manual
11
Coolmay MX2N series PLC programming manual
4 Analog Usage
4.1 Analog input type
Register Accuracy
Input signal type Range Resolution
reading value total range
Thermistor -19.9~109.9℃ -199~1099 0.1℃ 1%
NTC10K
Thermistor -40~199.9℃ -400~1999 0.1℃ 1%
NTC50K
Voltage analog 0~10V/0-5V 0~4000 2.5mV 1%
Current analog 0~20mA 0~4000 5uA 1%
is 0.
5 Random number instructions
1) Random number related register: Start convert relay-M8005
Random number save register-D8005 (low) D8006 (high)
2) If you need to generate the random number, just need to set M8005 ON in the
program. When the random number is generated and be saved to D8005 D8006,
M8005 will be set OFF automatically.
3) Therefore, M8005 is set from OFF to ON, then start the random number
conversion. And M8005 turn from ON to OFF, then the conversion is completed.
4) Example
LDP M0 M0 non-edge pulse
SET M8005 SET M8005
LDF M8005 M8005 ‘s Lower edge -Conversion completed
DMOV D8005 D0 Extract random numbers to D0 D1
13
Coolmay MX2N series PLC programming manual
14
Coolmay MX2N series PLC programming manual
For example: If you use an AB phase encoder, it is 1024 pulse inputs in one turn. If not set
the frequency multiplier, then adjust the counter count 1024 (the original FX1N does not
support frequency multiplier, but the FX3U can set 4 times frequency), If you set 2 times the
frequency, then turn the counter to count 2048; if you set 4 times, then turn the counter to
count 4096.
Usage instruction:
** Other usage are consistent with the original FX1N, refer to FX programming manual;
15
Coolmay MX2N series PLC programming manual
** If high-speed input function is not selected, Then SPD, external interrupt, and C235~C255
high-speed counter cannot be used normally.
7 Pulse capture function application
1) Supports the pulse capture function of X0-X5, corresponding to: X0-M8170, X1-
M8171,
X2-M8172, X3-M8173, X4-M8174, X5-M8175.
2) Using the pulse capture function, you need to use the EI instruction first. The
example is as follows:
2) Regarding the positioning command with direction output: after driving, the
direction output delay is 20ms before outputting the pulse;
16
Coolmay MX2N series PLC programming manual
Slave:
17
Coolmay MX2N series PLC programming manual
0011:300bps
0100:600bps
0101:1200bps
0110:2400bps
0111:4800bps
b7b6b5b4 Baud rate
1000:9600bps
1001:19200bps
1010:38400bps
1011:57600bps
1100:115200bps
b8 Forbidden Set 0
b9 Forbidden Set 0
000:Mitsubishi Programming port protocol
Protocol 001:RS Protocol
b12 b11 b10
selection 010:MODBUS-RTU Slave protocol
011:MODBUS-RTU Master protocol
b13 Forbidden Set 0
b14 Forbidden Set 0
18
Coolmay MX2N series PLC programming manual
* Write the data of D0 to the register with the 1st slave in address 0
M1--The lower 8 bits indicate the slave address ,the high 8 bits indicate the sent
instruction; Such as: H601-command 06 (read register instruction), slave address 01;
if the high 8 bit is 0, the command defaults is 06;
M2--slave component address; (Slave address of MX2N series PLC refers to slave
element address table);
If the address is set to 0, it means that data is written to all slaves;
D -- the master station data register, which holds the data to be written to
the slave; N -- write data length;
19
Coolmay MX2N series PLC programming manual
Special Note:
1. FROM and TO can be used many times in the program. When multiple instructions
are executed at the same time, the system will communicate in turns. If the
communication is overtime, M8129 turns ON and reports 6306 fault and exits this
communication, and records this overtime station number in the D8122 register,execute
the next communication instructions;
2. The FROM/TO instruction cannot be used with the RS instruction in the program at
the same time, reporting 6609 failure;
3. The maximum data length of the FROM/TO instruction: bit (1~64), register (1~64);
4. The communication parameters of the master station and the slave station must be set
same to communicate, such as data length, parity, stop bit, and rate;
5. When using the 05 command to set the slave station component, such as: TO H501
K4000 D0 K1—Set the M0 state of slave No. 1. If D0 is equal to 0, slave M0 is
OFF; when D0 is non-zero, slave M0 is ON;
6. When using the TO command, you can send instructions to all slaves, and only need
to set the slave address to 0.
For example, TO H600 K0 D0 K3: Write D0, D1, D2 of master station
to register addresses 0, 1, 2 of all slaves.
Bit Addres Bit Bit Bit Addres Bit Addre Bit Addr
component s component component component s component ss component ess
1000-
X0 0 X40 32 Y0 300 Y40 332 S0-S999
1999
20
Coolmay MX2N series PLC programming manual
2000-
X1 1 X41 33 Y1 301 Y41 333 T0-T255
2255
3000-
X2 2 X42 34 Y2 302 Y42 334 C0-C255
3255
M0-
4000-
X3 3 X43 35 Y3 303 Y43 335 M1535:
5535
FX1N
M0-
4000-
X4 4 X44 36 Y4 304 Y44 336 M3071:
7071
FX2N
Bit Addres
X6 6 X46 38 Y6 306 Y46 338
component s
8000-
X10 8 X50 40 Y10 308 Y50 340 T0-T255
8255
8300-
X11 9 X51 41 Y11 309 Y51 341 C0-C255
8555
21
Coolmay MX2N series PLC programming manual
22
Coolmay MX2N series PLC programming manual
Note:
Max data sent and received by RS Instruction is 140. (If over, report 6706)
Master
M8150-CAN allow work
M8149-Communication timeout flag(CAN occurs “does not communicate” or “timeout flag”.
After this flag is ON, it needs to be manually turned OFF in the program).
D8149-Communication timeout parameter (1=1ms,Default 50ms)
D8150-Master set(0=master)
D8151-Slave numbers(1~32,Default 8)
D8152-Shared register numbers(1~32,Default 8)
D8153-Communication baud rate(20K~1000K,Default 250K)
D8196-uncommunicated slave(1~16)
D8197-uncommunicated slave(17~32)
D8198-uncommunicated slave summary(1~16)
D8199-uncommunicated slave summary(17~32)
23
Coolmay MX2N series PLC programming manual
Slave
M8150-CAN allow work
M8149-Communication timeout flag(CAN occurs “does not communicate” or “timeout flag”.
After this flag is ON, it needs to be manually turned OFF in the program).
D8149-Communication timeout parameter (1=1ms,Default 60ms)
D8150-Slave address set(1~32)
D8152-Shared register numbers(1~32,Default 8)
D8153-Communication baud rate(20K~1000K,Default 250K)
D8196-uncommunicated slave(1~16)
D8197-uncommunicated slave(17~32)
D8198-uncommunicated slave summary(1~16)
D8199-uncommunicated slave summary(17~32)
D8200-Maximum time to communicate with the slave successfully(1=1ms)
Note:
1. Flag of D8196 D8197 can’t communicate with slave is 500ms automatic reset once.
2. Uncommunicated Slave summary of D8198 D8199,after power-on,can’t communicate with
slave summary.
3. CAN related register parameters, after setting,need to be powered off firstly to execute
according to the new data((if the parameters are set by the program, please turn off the
power after the PLC is running, and then send power again, then CAN will start or start with
new parameters);
4. Communication timeout setting of master and slave: The D8149 of the slave is
recommended to be larger 10ms than the master (if master is 50s, then slave is 60s).
Note:
1. When the corresponding bit of the above register is 1, it indicates that the address
corresponding to the bit is not communicated or the communication error occurs.
2. D8198 D8199 is,slave record that has not been communicated after the main board is
powered on,reset after power off;
24
Coolmay MX2N series PLC programming manual
10 D1320 D1351 #10 shared register 27 D1864 D1895 #27 shared register
11 D1352 D1383 #11 shared register 28 D1896 D1927 #28 shared register
12 D1384 D1415 #12 shared register 29 D1928 D1959 #29 shared register
13 D1416 D1447 #13 shared register 30 D1960 D1991 #30 shared register
14 D1448 D1479 #14 shared register 31 D1992 D2023 #31 shared register
15 D1480 D1511 #15 shared register 32 D2024 D2055 #32 shared register
25
Coolmay MX2N series PLC programming manual
26
Coolmay MX2N series PLC programming manual
Test:
After the communication between the three Plcs is normal, disconnect the communication
cable of the station #2, monitor the master and the D8196 of the station #1 (should be H0002-
indicates that the station #2 is not communicated), and monitor the D8196 of the station #2
(should be H0002- Indicates that itself can’t communicate with master)
27
Coolmay MX2N series PLC programming manual
10 Fault detection
Sorts Error Error contents Resolution
0000 No abnormality
Check the power failure
PLC hardware 6101 Power failure data error detection circuit, CPU internal
error FLASH is damaged
M8061(D8061) Increase D8000 setting value, or
Running stop 6105 Monitor action (Internal watchdog act)
check procedures
28
Coolmay MX2N series PLC programming manual
**When an error occurs, use the diagnostics on the PLC programming software GX
Developer and GX Works2 software menu to diagnose the PLC error code and program steps;
29
Coolmay MX2N series PLC programming manual
Note:
When the power is turned off, the ERR light is long on and the program is not allowed to be
downloaded.
**If you need to reset the ERR light, after troubleshooting:
1. Turn the RUN switch to STOP and pull it back to RUN;
2. After the main board is powered off, send power until ERR light is off.
30