CX3G FX3GC PLC Programming Manual - V21.81
CX3G FX3GC PLC Programming Manual - V21.81
COOLMAY
CX3G/FX3GC PLC
Programming manual
(Difference comparing with Mitsubishi FX3G)
Content
1. Overview......................................................................................................................................................... 1
1.1 COOLMAY CX3G PLC has the following advantages:................................................................... 1
1.2 Models of CX3G PLC...........................................................................................................................3
1.3 Models of FX3GC PLC........................................................................................................................ 4
2. Soft element.................................................................................................................................................... 5
2.1 Soft element table..................................................................................................................................5
3. Special relay and register................................................................................................................................ 7
3.1 Special relay number and content......................................................................................................... 7
3.2 Special register number and content................................................................................................... 11
4. Function Instructions..................................................................................................................................... 15
4.1 List of basic logic instructions............................................................................................................ 15
4.2 Applied instructions【Sequence is according to instruct variety】................................................... 15
5. Application of analog.................................................................................................................................... 23
5.1 Analog input........................................................................................................................................ 23
5.1.1 Analog input (temperature)...................................................................................................... 23
5.1.2 Analog input reading 1 (for software version 26210 and 26220)......................................... 25
5.1.3 Analog input reading 2 (for software version 26220)........................................................... 26
5.1.4 Analog input reading 3 (for software version 26230 and above)..........................................27
5.1.5 Analog input sampling............................................................................................................. 28
5.1.6 Analog input program example:...............................................................................................28
5.2 Analog output...................................................................................................................................... 29
5.3 PID Instruction.................................................................................................................................... 30
5.3.1 Outline...................................................................................................................................... 30
5.3.2 PID instruction format and parameter description................................................................... 30
5.3.3 Function and action description............................................................................................... 30
5.3.4 Notice....................................................................................................................................... 33
5.3.5 Example....................................................................................................................................33
6. Application of high speed counter................................................................................................................ 35
6.1 Assignment table of built-in high speed counter.................................................................................35
6.2 Related device.................................................................................................................................. 36
7. Application of high speed pulse.................................................................................................................... 37
7.1 high speed pulse output....................................................................................................................... 37
7.2 Circular interpolation.......................................................................................................................... 37
7.2.1 Normal interpolation function.................................................................................................. 37
7.2.2 Continuous interpolation function............................................................................................40
7.3 Pulse width modulation (PWM)..........................................................................................................42
7.3.1 Outline...................................................................................................................................... 42
7.3.2 PWM instruction format and parameter description................................................................ 42
7.3.3 Function and action description............................................................................................... 42
7.3.4 Program Example..................................................................................................................... 43
7.3.5 Special Note............................................................................................................................. 43
7.4 Hand wheel pulse function.................................................................................................................. 44
8. Coolmay CX3G PLC Communication Instructions...................................................................................... 47
I
CX3G/FX3GC PLC Programming manual
8.1 MODBUS instruction interpretation and communication address..................................................... 47
8.1.1 RD3A/WR3A command function and action description:...................................................... 47
8.1.2 ADPRW command function and action description:............................................................... 48
8.1.3 Bit device Communication address number............................................................................ 48
8.1.4 Word device Communication address number........................................................................ 49
8.1.5 ADPRW Command function parameter.................................................................................. 49
8.2 Serial port 1: RS232( PLC programming port)................................................................................... 50
8.3 Serial port 2: RS485(A B)/RS232....................................................................................................... 50
8.3.1 Mitsubishi programming port protocol.................................................................................... 52
8.3.2 Free port protocol function and example................................................................................. 52
8.3.3 Modbus RTU Protocol............................................................................................................. 53
8.3.4 MODBUS RTU ADPRW command....................................................................................... 56
8.3.5 Modbus ASCII Protocol........................................................................................................... 57
8.4 Serial port 3:RS485(A1 B1)................................................................................................................ 59
8.4.1 Mitsubishi programming protocol............................................................................................61
8.4.2 Free port protocol function.......................................................................................................61
8.4.3 Modbus RTU protocol RD3A/WR3A command..................................................................... 62
8.4.4 MODBUS RTU ADPRW Command.......................................................................................64
8.4.5 Modbus ASCII Function.......................................................................................................... 65
8.5 CAN communication port................................................................................................................... 67
8.5.1 Free port protocol function.......................................................................................................69
8.5.2 Modbus RTU Function RD3A/WR3A command.................................................................... 70
8.5.3 Modbus RTU Function ADPRW command............................................................................ 72
8.6 Network communication..................................................................................................................... 73
8.6.1 Modbus UDP function RD3A/WR3A command..................................................................... 75
8.7 Network N:N communication............................................................................................................. 76
8.7.1 Related device content............................................................................................................. 76
8.7.2 Program setting and description............................................................................................... 78
Appendix Version Change Record............................................................................................................80
II
CX3G/FX3GC PLC Programming manual
1. Overview
1.1 COOLMAY CX3G PLC has the following advantages:
◆Powerful, compatible with FX3G/FX3U/FX3S PLC, high processing speed.(supports
Ladder diagram and SFC language, does not support structured programming/labels).
◆Upper computer programming software compatible with Works 2/GX Developer8.86
◆Military level 32 bit CPU adopted, which is faster and more adapted to industrial environment of
high electromagnetic interference.
◆Special encryption, prevent illegal reading thoroughly. 8-bit encryption, 12345678 as
password can thoroughly prevent reading of ladder logic program.
◆Clock supported, rechargeable battery adopted.
◆With two PLC programming ports. CX3G PLC has one MiniB USB port with faster
downloading speed; one Rs232 programming port with 8 mouse hole sockets.FX3GC PLC has one
MiniB USB port with faster downloading speed; one Rs422 programming port with 8 mouse hole
sockets.
◆Support Mitsubishi programming port protocol/Modbus protocol/Rs protocol/BD board
protocol,easily achieve PLC communication with plc and other devices.
CX3G-16M/24M/32M/48M PLC is with 2 com ports. Default is with 2 RS485, or customized as 1
RS485+1 RS232, or 1RS485+ 1 CAN port, or 1RS232 + 1 CAN port.
CX3G-34M/64M/80M PLC is with 3 com ports. Default is with 2 RS485,or customized as 1
RS485+1 RS232,CAN port is optional for connecting HMI,VFD and other equipment.
For FX3GC-30M, 1 Rs485 can be added;
For FX3GC-16M, com ports/ analog can be added, at most 2 Rs485+1 CAN port+6AD4DA can be
added; or 1 Rs485+1 CAN port+8AD4DA can be added; or 1 RS485 +8AD6DA can be added, or 2
RS485 +1 CAN port can be added.
◆High speed counter, regular as single phase 6 channels 60KHz or AB(Z) phase 2 channels
60KHz+ AB phase 1 channel 10KHz.
◆High speed pulse, regular as 8 channels Y0-Y3 in 100KHz,Y4-Y7 in 10KHz.(Among them
CX3G-16M high-speed pulse gauge 8 way 10KHz);
Note: High speed counter+High speed pulse should be less 480KHz.
◆Support multiple types analog individually or mixed ones for analog output and input.
Precision of AD/DA is 12bit.Temperature/current/voltage for input. current/voltage for output.
For CX3G PLC, at most 16DI/8DO. For FX3GC-16M, com ports/ analog can be added, at most 2
Rs485+1 CAN port+6AD/4DA can be added; or 1 Rs485+1 CAN port+8AD/4DA can be added; or
1 RS485+8AD/6DA can be added or 2 RS485+ 1 CAN port can be added.
◆Up to 40DI/40DO for CX3G PLC, up to 16DI/16DO for FX3GC PLC. Relay/transistor or
mixed relay and transistor for output.
1
CX3G/FX3GC PLC Programming manual
◆Convenient for wiring. CX3G adopts 5.00mm pluggable terminals. FX3GC adopts 3.5mm
pluggable terminals.
◆Easy installation. DIN-Rail (35mm width) installation and fixed hole installation.
◆Flexible, can be customized accordingly.
2
CX3G/FX3GC PLC Programming manual
Image
65*90*36m
Dimension 130*90*36mm 200*90*36mm 290*90*36mm
m
Cutout size 57*99mm 122*99mm 192*99mm 282*99mm
Installation Fixed hole installation and DIN-Rail (35mm )
3
CX3G/FX3GC PLC Programming manual
Image
Dimension 90*60*32mm
Installation Fixed hole installation and DIN-Rail (35mm)
Digital I/O Up to 8DI/8DO Up to 16DI/14DO Up to 16DI/16DO
Detailed info. refer to:CX3G FX3GC PLC Programming Manual FX3GC User Manual
Support interruption、linear and arc interpolated、PID and modify parameters automatically; with capacity of 32K step
program, 32K holding register while power off.
Extension module can add at most 2 RS485,1 CAN port,6AD4DA,
Or 1 RS485,1 CAN port,8AD4DA,
Or 1RS485,8AD8DA,
Or 2 RS485,1 CAN port.
4
CX3G/FX3GC PLC Programming manual
2. Soft element
2.1 Soft element table
Name Contents
I/O relay
Input relay X000~X047 40points Soft element number is octal
Output relay Y000~Y047 40points Total 80points for I/O
Auxiliary relay
General M0~M383 384 points
EEPROM hold M384~M1535 1152 points
General*1 M1536~M7679*2 6144 points
Special*3 M8000~M8511 512 points
Status
Initial state (EEPROM hold) S0~S9 10 points
EEPROM hold S10~S899 890 points
Signal Alert (EEPROM hold) S900~S999 100 points
General*1 S1000~S4095 3096 points
Timer (ON delay timer)
200
100ms T0~T191 0.1~3,276.7s
points
10ms T200~T245 46 points 0.01~327.67s
1ms accumulative (EEPROM hold) T246~T249 4 points 0.001~32.767s
100ms accumulative
T250~T255 6 points 0.1~3,276.7s
(EEPROM hold)
1ms T256~T319 64 points 0.001~32.767s
Counter
General up counter (16bit) C0~C15 16 points 0~32,767 counter
EEPROM hold up counter 184
C16~C199 0~32,767counter
(16 bit) points
General bi-direction (32 bit) C200~C219 20 points -2,147,483,648~+2,147,483,647 counter
High-speed counter
Single-phase single counter input
C235~C245
Bi-direction (32 bit) (EEPROM -2,147,483,648~+2,147,483,647 Counter Software
hold) counter
Single-phase double counter input Single phase:at most 6 channel, 60kHz
C246~C250
Bi-direction (32 bit) (EEPROM Double phase:1 times frequency:at most 2-3
hold) channels,60KHz; M8198 is 4 times frequency sign of
Double –phase double counter C251/C252.
input C251~C255 4 times frequency:at most 2 channels,
Bi-direction (32 bit)(EEPROM 24kHz,M8199 is 4 times frequency sign of C253/C255.
hold)
5
CX3G/FX3GC PLC Programming manual
Name Contents
Data register(32 bit when using in pair)
General(16bit) D0~D127 128 points
EEPROM hold (16 bit) D128~D7999 7872 points
Special (16 bit) D8000~D8511 512 points
Index (16 bit) V0~V7,Z0~Z7 16 points
Extended register·extended file register
R0~R22999 23000points Maintain when power off not supported
Extended register(16 bit)
R23000~R23999 1000points for system internal
Pointer
256 points
P0~P255 CJ instruct、CALL
JUMP、CALL branch 1281 points(26232 and
P0~P1280 instruct
above)
Input interrupt I0□□~I5□□ 6points
Timer interrupt I6□□~I8□□ 3points
Counter interrupt I010~I060 6points
Nest
Master control N0~N7 8points MC instruct
Constant
16 bit -32,768~+32,767
Decimal (K)
32 bit -2,147,483,648~+2,147,483,647
16 bit 0000~FFFF
Hexadecimal (H)
32 bit 00000000~FFFFFFFF
Real number(E)*3 -1.0×2128~-1.0×2-126,0,1.0×2-126~1.0×2128
32 bit
Can be in the form of a decimal point and index
*1: The 10ms timer will be affected by the scan cycle. If the scan period is 12ms, the timer becomes 12ms and is executed once.
6
CX3G/FX3GC PLC Programming manual
7
CX3G/FX3GC PLC Programming manual
9
CX3G/FX3GC PLC Programming manual
11
CX3G/FX3GC PLC Programming manual
D8050 DA0 analog output value D8349 1st pulse deceleration time
D8051 DA1 analog output value D8350 Low
2nd position pulse amount
D8052 DA2 analog output value D8351 High
Y1 deviation speed
D8053 DA3 analog output value D8352
Initial value:0
D8054 DA4 analog output value D8353 Low
2nd pulse maximum speed
D8055 DA5 analog output value D8354 High
Y1 crawling speed
D8056 DA6 analog output value D8355
Initial value: 1000
D8057 DA7 analog output value D8356 Y1 Origin return speed Low
D8058 When DA is current,Bit setting Refer to 5.2 D8357 Initial value:50000 High
D8059 Constant scan time D8358 2nd pulse acceleration time
D8074 X0 Rising edge ring counter value Low D8359 2 nd
pulse deceleration time
D8075 [1/6μs unit] High D8360 3 rd
position pulse amount Low
12
CX3G/FX3GC PLC Programming manual
13
CX3G/FX3GC PLC Programming manual
14
CX3G/FX3GC PLC Programming manual
4. Function Instructions
4.1 List of basic logic instructions
Mnemon
Name Features Available devices
ic
LD take Normally open contact logic operation starts X,Y,M,S,D□.b,T,C
LDI Negate Normally closed contact logic operation starts X,Y,M,S,D□.b,T,C
LDP Take the rising edge of the pulse Start of operation to detect rising edge X,Y,M,S,D□.b,T,C
LDF Take the falling edge of the pulse Start of operation to detect falling edge X,Y,M,S,D□.b,T,C
AND versus Series of normally open contacts X,Y,M,S,D□.b,T,C
ANI With reverse Series of normally closed contacts X,Y,M,S,D□.b,T,C
ANDP With pulse rising edge Detect rising edge series connection X,Y,M,S,D□.b,T,C
ANDF With the falling edge of the pulse Series connection detection of falling edges X,Y,M,S,D□.b,T,C
OR Or pulse rising edge Normally open contacts in parallel X,Y,M,S,D□.b,T,C
ORI Or reverse Normally closed contacts in parallel X,Y,M,S,D□.b,T,C
ORP Or pulse rising edge Parallel connection detecting rising edge X,Y,M,S,D□.b,T,C
ORF Or pulse falling edge Parallel connection to detect falling edge X,Y,M,S,D□.b,T,C
ANB Block with Series connection of circuit blocks -
ORB Block or Parallel connection of circuit blocks -
MPS Push stack Push onto the stack -
MRD Read stack Read stack -
MPP Unstack Pop the stack -
INV Negate Inversion of operation result -
MEP M.E.P Conduction on rising edge -
MEF M..EF Conduction on falling edge -
OUT Output Coil drive Y,M,S,D□.b,T,C
SET Position Movement retention Y,M,S,D□.b
Y,M,S,D□.b,T,C,
RST Reset Clear action keeps, register cleared
D,R,V,Z
PLS pulse Differential output on rising edge Y,M
PLF Falling edge pulse Differential output on falling edge Y,M
Connection circle command for common
MC Master Y,M
series point
MCR Master reset Instruction to eliminate common series point -
NOP No operation No action -
End of the program and
END End -
I/O and return to the beginning
15
CX3G/FX3GC PLC Programming manual
3. Comparison instructions
Mnemonic FNC No. Function Support
LD= 224 Contact compare LD (S1)=(S2) ★
LD> 225 Contact compare LD (S1)>(S2) ★
LD< 226 Contact compare LD (S1)<(S2) ★
LD<> 228 Contact compare LD (S1)≠(S2) ★
LD<= 229 Contact compare LD (S1)≦(S2) ★
LD>= 230 Contact compare LD (S1)≧(S2) ★
AND= 232 Contact compare AND (S1)=(S2) ★
AND> 233 Contact compare AND (S1)>(S2) ★
AND< 234 Contact compare AND (S1)<(S2) ★
AND<> 236 Contact compare AND (S1)≠(S2) ★
AND<= 237 Contact compare AND (S1)≦(S2) ★
AND>= 238 Contact compare AND (S1)≧(S2) ★
OR= 240 Contact compare OR (S1)=(S2) ★
OR> 241 Contact compare OR (S1)>(S2) ★
OR< 242 Contact compare OR (S1)<(S2) ★
OR<> 244 Contact compare OR (S1)≠(S2) ★
OR<= 245 Contact compare OR (S1)≦(S2) ★
OR>= 246 Contact compare OR (S1)≧(S2) ★
CMP 10 Compare ★
ZCP 11 Zone Compare ★
ECMP 110 Floating Point Compare ★
EZCP 111 Floating Point Zone Compare ★
HSCS 53 High speed counter set ★
HSCR 54 High speed counter reset ★
HSZ 55 High Speed Counter Zone Compare ★
HSCT 280 High speed counter table compare ★
BKCMP= 194 Block compare (S1)=(S2) ★
BKCMP> 195 Block compare (S1)>(S2) ★
BKCMP< 196 Block compare (S1)<(S2) ★
BKCMP<> 197 Block compare (S1)≠(S2) ★
BKCMP<= 198 Block compare (S1)≦(S2) ★
BKCMP>= 199 Block compare (S1)≧(S2) ★
17
CX3G/FX3GC PLC Programming manual
7. Rotate instructions
Mnemonic FNC No. Function Support
ROR 30 Rotation Right ★
ROL 31 Rotation Left ★
RCR 32 Rotation right With Carry ★
RCL 33 Rotation Left with Carry ★
18
CX3G/FX3GC PLC Programming manual
8. Shift instructions
Mnemonic FNC No. Function Support
SFTR 34 Bit Shift Right ★
SFTL 35 Bit Shift Left ★
SFR 213 Bit Shift Right with Carry ★
SFL 214 Bit Shift Left with Carry ★
WSFR 36 Word Shift Right ★
WSFL 37 Word Shift left ★
SFWR 38 Shift Write [FIFO/FILO Control] ★
SFRD 39 Shift Read [FIFO Control] ★
POP 212 Shift Last Data Read [FILO Control] ★
19
CX3G/FX3GC PLC Programming manual
22
CX3G/FX3GC PLC Programming manual
5. Application of analog
This section refers to the software version query, the version number is stored in the special
register D8001, if necessary, please query the value of D8001.
The transmitter which is integrated inside PLC is one of the above table or mixed ones, it is up
to customers’s need when ordering.
5.1.2 Analog input reading 1 (for software version 26210 and 26220)
Support FROM instruction or register directly read. Such as: FROM K0 K0 D400 K16, read
out 16 analog input, 0-10V.
The K-type thermocouple registers read values are shown in the following table:
NO Register Value
AD0 R23680
AD1 R23681
AD2 R23682
AD3 R23683
AD4 (Environment R23684
temperature)
AD5 R23685
AD6 R23686
AD7 R23687
AD8 R23688
AD9 R23689
AD10 R23690
AD11 R23691
AD12 R23692
AD13 R23693
AD14 R23694
AD15 R23695
When 4-20mA type, Registers read less than 3.8mA, the value is 32760, that is break value.
26
CX3G/FX3GC PLC Programming manual
5.1.4 Analog input reading 3 (for software version 26230 and above)
Support FROM instructions or register read directly. Such as: FROM K0 K0 D400 K16 read
16 analog input, 0~10V.
The analog input of current, voltage, PT type and thermocouple type directly reads the register:
D[8030]~D[8045]. Constant scan time changed to D8059, started by M8039 (version 26232 and
higher).
NO Register Value
AD0 D8030
AD1 D8031
AD2 D8032
AD3 D8033
AD4 D8034
(Environment temperature)
AD5 D8035
AD6 D8036
AD7 D8037
AD8 D8038
AD9 D8039
AD10 D8040
AD11 D8041
AD12 D8042
AD13 D8043
AD14 D8044
AD15 D8045
When the analog input has a thermocouple type, it can only do up to 15 channels, of which
AD4 is the ambient temperature of the thermocouple. 16 channels are possible without the
thermocouple type.
The value of the thermistor NTC is read in the 16th registers starting at R23660.
NO. Register value
AD0 R23660
AD1 R23661
AD2 R23662
AD3 R23663
AD4 R23664
(Environment temperature)
AD5 R23665
AD6 R23666
AD7 R23667
AD8 R23668
AD9 R23669
27
CX3G/FX3GC PLC Programming manual
AD10 R23670
AD11 R23671
AD12 R23672
AD13 R23673
AD14 R23674
AD15 R23675
R23960 starts with a zero correction value and default is 0 (Namely, size correction).
The 16 registers starting from R23620 are 0~10V or 0~20mA corresponding values, that is,
real-time sampled values.
Connect the signal terminal of the temperature sensor to the AD0 input of the PLC and the
other end to the GND of the analog input port.
When the PLC is running, the value of the data register D8030 corresponding to AD0 will be
transmitted to D0, the value of D0 will be put into D10 after floating point operation,
and then the floating point number division operation will be performed on D10, and then
operation result will be put into D20, the result D20 is the actual Temperature value.
In the ladder diagram, you can also directly divide the value of D8030.
Note: When the input is 0-10V analog, the actual analog value = register reading / 400;
When the input is temperature, the actual temperature value = register reading/10;
When the input is 0-20mA analog, the actual analog value = register reading / 200;
When the input is 4-20 mA analog, the actual analog value = register reading / 250 + 4.
The analog correction is corrected for the size. The following figure is an example of correcting
the AD0 temperature after acquisition:
28
CX3G/FX3GC PLC Programming manual
If the current temperature is 37.9℃,the actual test is 47.9 ° C, the error is 10 ° C, you need to
modify the size correction register, show as below:
In the above figure, when M0 is closed, the value -100 is transmitted to the correction register
R23960, and now you can see that the value of the actual measured temperature D20 is close to the
actual temperature which is 37.9 °C.
For example:
At this point, use a multimeter to check the voltage of the DA0 terminal, that is, the
multimeter's red pen is connected to the DA0 terminal, and the black pen is connected to the GND
terminal. The multimeter is displaying 5V voltage value.
Parameter Description:
Word software
Operand Type Content Data Type
component
Save data register number of the
S1. BIN16 bit D,R
target value (SV)
Save data register number of the
S2. BIN16 bit D,R
measured value (PV)
Save the data register number of the
S3. BIN16 bit D,R
parameter
Save data register number of the
D. BIN16 bit D,R
output register (MV)
30
CX3G/FX3GC PLC Programming manual
Setting item
Occupied
Setting item Content
points
Target Set target value (SV)
S1. 1 point
value(SV) PID instruction does not change the setting contents
Measured
S2. The input value of the PID operation 1 point
value(PV)
Auto-tuning: step response method
a) ACT setting:when bit1,bit2,bit5 are all not "0",occupy 25points Soft 25 points
S3. Parameter Component starting from the Initial Soft Component specified in S3.
b) ACT setting:when bit1,bit2,bit5 are all "0",occupy 20points Soft 20 points
Component starting from the Initial Soft Component specified in S3.
Auto-tuning: step response method
Output value Set the step output value on the user side before the instruction is driven.
D. 1 point
(MV) During the auto-tuning process, the MV output cannot be changed on the
side of the PID instruction.
31
CX3G/FX3GC PLC Programming manual
32
CX3G/FX3GC PLC Programming manual
overflow;
1: Output change amount
(increase side) overflow.
0: The output change amount
(reduction side) does not
bit3 overflow;
1: Output change amount
(reduction side) overflow.
*1: When S3+1 action setting (ACT) bit1=1, bit2=1 or bit5=1, S3+20~24 is occupied.
5.3.4 Notice
When using multiple instructions: It can be executed multiple times at the same time (the
number of loops is not limited), but note that the S3 and D devices used in the operation cannot be
repeated.
Occupied points of parameter S3. : Step response method
1) ACT setting:when bit1,bit2,bit5 are all not "0",occupy 25points Soft Component starting from
the Initial Soft Component specified in S3.
2) ACT setting:when bit1,bit2,bit5 are all "0",occupy 20points Soft Component starting from the
Initial Soft Component specified in S3.
Step response mode: The self-tuning mode in the PID instruction has only a step response
mode, and the step value is S0+22, which is the upper limit value.
When specifying the soft component in the power failure holding area:If D. is specified in
the program to hold the data register in the power failure, needs to clear the specified register at the
time of program start-up.
Action flag:(version number is viewed in D8001)
version below 26232,bit 0=0 of S3+1 is positive action,bit0=0 is reverse action;;
version in and after 26232,bit 0=0 of S3+1 is a positive action, and bit0=1 is a
reverse action;
When heating, is reverse action.
5.3.5 Example
33
CX3G/FX3GC PLC Programming manual
34
CX3G/FX3GC PLC Programming manual
35
CX3G/FX3GC PLC Programming manual
2.For monitoring the up/down counting direction of Single phase double counter and AB
phase double counter
Counter Designated Up Down
Type
number device counting counting
C246 M8246
Single phase C247 M8247
double counter C248 M8248
input C249 M8249
C250 M8250
OFF ON
C251 M8251
AB phase C252 M8252
double counter C253 M8253
input C254 M8254
C255 M8255
36
CX3G/FX3GC PLC Programming manual
Pulse point
Function Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7
Description
Pulse operation M8340 M8350 M8360 M8370 M8151 M8152 M8153 M8154
monitoring
Position pulse D8340 D8350 D8360 D8370 D8140 D8142 D8144 D8160
(32bit) D8341 D8351 D8361 D8371 D8141 D8143 D8145 D8161
accelerate / D8348 D8358 D8368 D8378 D8148 D8148 D8148 D8148
decelerate time D8349 D8359 D8369 D8379
Pulse stop bit M8349 M8359 M8369 M8379 M8450 M8451 M8452 M8453
D8343 D8353 D8363 D8373 D8146 D8146 D8146 D8146
Maximum speed
D8344 D8354 D8364 D8374 D8147 D8147 D8147 D8147
The direction and coordinates of the center and radius interpolation are as shown in the following
table: (26234 version has no interpolation function)
26233 version and above 26235 version and above
Clockwise M8348 = 0 Clockwise M8435 = 0
Anticlockwise M8348 = 1 Anticlockwise M8435 = 1
Relative coordinate M8344 = 0 Relative coordinate M8434 = 0
Absolute coordinate M8344 = 1 Absolute coordinate M8434 = 1
D8340 shows the current address of X axis,D8350 shows the current address of Y axis。
In CoolMay 3G PLC,interpolation motion still adopts DPLSR for pulse output.
38
CX3G/FX3GC PLC Programming manual
In the Center interpolation: D100 speed, D102 is the X-axis target address, D104 is the Y-axis
target address, and D106 is the center X address. D108 is the center Y address. Y0 and Y1
respectively pulse the X-axis and Y-axis.
Note 1: The current address of X and Y must be on the same circle as the destination address.
Note 2: When the current address coincides with the target address, it indicates that the motion track
is a full circle.
In the radius interpolation: D100 speed, D102 is the X-axis target address, D104 is the Y-axis target
address, and D106 is the radius length. Y0 and Y1 respectively pulse the X-axis and Y-axis.(The
example below is clockwise, i.e. M8435=0)
39
CX3G/FX3GC PLC Programming manual
pulse output.
In continuous interpolation mode, M8432~M8435 are determined by the 5th parameter (ie S.+10).
The function description of each bit of the 32-bit register S2.+8 is as follows:
32bit
b31~b28 b27~b24 b23~b20 b19~b16 b15~b12 b11~b8 b7~b4 b3~b0
position
Continuous interpolation
Position Interpolation Interpolation
Function execution and stop
mode direction mode
Flag position
When S2.+8 is used, it is expressed in hexadecimal. The bit values of each group are as below:
=1:linear mode interpolation
b3~b0 =2:center mode interpolation
=3: radius mode interpolation
=0: clockwise rotation
b7~b4 =1: counterclockwise rotation
= any other value: linear mode
=1:relative position
b11~b8
=2:absolute position
=00000:continuous interpolation execution
b31~b12
=AAAAA:continuous interpolation stop
PS: When using linear mode interpolation, b7~b4 is ignored and can be set to any value from 2~F.
S1. and S2. may be set discontinuous. For example, S1.=D100, S2.=D120.
S2. Must be consecutive with the next four 32-bit registers. For example, it must be set to D102,
D104, D106, D108, D110.
40
CX3G/FX3GC PLC Programming manual
Program as below :
41
CX3G/FX3GC PLC Programming manual
Parameter description:
Operand
Content Data type Word software component Range
type
Notes.
Value of the pulse width S1. and the period S2. should be set: S1.≦S2.。
When instruction input is OFF, Output from D. is also OFF.
Do not operate the setting switch of the pulse output mode during pulse emission.
42
CX3G/FX3GC PLC Programming manual
In this example, the data range of D10 is changed from 0 to 50, and the average output of Y0 is
0 to 100%. If D10 data >50, it will be wrong.
R >> P
t = R(KΩ)* C(µF) = 470ms >>T0
Compared to the pulse period T0,the time constant τ of the filter is a very large value.
4) Whether the customized PWM coexists with other analog. (If the product is separately
equipped with analog, the analog output terminals DA0~DA3 are a group, and DA4~DA7 are a
group. When custom PWM of 3G series products, Only when the output frequency is 21KHz,it can
be used with other analog group. ).
control the motor rotation, and the handwheel can rotate one pulse, and the motor also rotates the
corresponding one. Number of pulses.
Special sign
M8228: Turn ON to enable the hand wheel function (the original C228 function is not used for
now)
Instruction format and parameter description when using the hand wheel.
Instruction format
Parameter Description:
Operand
content type of data Word software
type
S1. Set the numerator of the input to output ratio BIN16 digits K,D
S2. Set the denominator of the input to output ratio BIN16 digits K,D
pulse:Y0-Y5
Y10-Y15
PS: When setting S1. and S2., S1. must be an integer multiple of S2. If it is 1:1, it means that the
hand wheel rotates one pulse and the motor rotates one pulse; if it is an integer multiple of n, it
means that the hand wheel rotates one pulse and the motor rotates n pulses;
45
CX3G/FX3GC PLC Programming manual
This program is 1:1 pulse output, that is, how many the hand wheel rotates, then how many pulse
Y0 will output.
46
CX3G/FX3GC PLC Programming manual
ADPRW :
S. indicates the station number of the slave device to be read and written, the range is 0-247;
S1. indicates the function code (that is, the functions NO 01-06, 15, and 16 );
S2. The function parameter corresponding to each function code (the operand indicates the
MODBUS start address when the function is 01);
S3. The function parameters corresponding to each function code (the operand indicates the number
of access points when the function is 01, and the parameter is fixed to 0 when the 05 function is
used);
D. indicates the starting position of the data storage device.
49
CX3G/FX3GC PLC Programming manual
M8196: the activation flag of using programming port protocol and other protocol (Main version
26232 and higher, modified to “not hold when power failure”).
M8125: the activation flag of using MODBUS and the original Mitsubishi function.
M8122: RS sending flag (this bit needs to be set 1 when using the RS instruction, and it will
automatically reset after sending).
M8123: RS receiving completion flag ( need to reset manually).
M8124: RS command data is being received.
M8161: 8-bit/16-bit mode flag of RS instruction (used in 26230 and above versions, fixed 8-bit
mode in 26210/26220 version)
M8128: RD3A / WR3A receive the correct flag.
M8129:RD3A/WR3A communication over-time flag. (when communication is over-time, flag is
ON)
M8029: Communication completion flag (communication completion flag when using ADPRW
instruction, needs to be reset by hand).
51
CX3G/FX3GC PLC Programming manual
D8120: The detailed communication parameter settings of saving Modbus RTU protocol are seen as
below.
D8121: Save the host or slave station number. (It must be set as max. K255 as master)
D8126: When using the serial port 2 in the ADPRW instruction, set D8126 to 0. (26232 or lower
version)
D8126: Interval period. Default as 10 times. (26232 or higher version uses this register.)
D8129: RD3A and WR3A timeout period. (The unit is milliseconds, it is recommended to set: when
the communication rate setting is greater than or equal to 9600, D8129 is set to 10~20; when the
communication rate setting is less than 9600, D8129 is set to 20~50;)
D8397: When using the serial port 2 in the ADPRW instruction, set D8397 to 0. (26232 and higher
version)
Support RS, WR3A, RD3A, ADPRW instructions. Can be set in the parameter zone,
corresponding to serial port 2. The parameter zone settings are only valid for this channel. It is
invalid for serial port 3.
For Mitsubishi Freeport Protocol, RS instruction is supported, the D8120 only needs to set the value
of the lower 8 bits.
b7 b6 b5 b4 b3 b2 b1 b0
52
CX3G/FX3GC PLC Programming manual
Demo program:
Use the serial port tool by serial port 2 to monitor the data obtained is
[2017:11:01:10:49:16][receive]31 32 33
53
CX3G/FX3GC PLC Programming manual
Stop bit
b3 0:1 bit
1:2 bit
Baud rate (b7 b6 b5 b4)
0100:600bps
0101:1200bps
b4 0110:2400bps
b5 0111:4800bps
b6 1000:9600bps
b7 1001:19200bps
1010:38400bps
1011:57600bps
1100:115200bps
b8
b9
Set 0
b10
b11
b12 RTU/ASCII Mode Selection 0:RTU 1:ASCII
b13 Set 1
b14 Set 1
b15 Set 1
Master program:
54
CX3G/FX3GC PLC Programming manual
Program explanation:
D300 saves the numbers of registers read, which means that 10 data is read.
D299 must be set to 0.
This program represents that 10 data of the registers D100-D109 in the PLC with the slave station 1
are read and stored in the registers D301-D310 of the master station PLC.
55
CX3G/FX3GC PLC Programming manual
Master program:
Program explanation:
This program represents that 1 data of the register D301 in the master PLC is written to the PLC in
Slave 1, and is stored in the register D100 of the slave PLC.
Use the serial port tool to monitor the results:
[2017:10:31:16:47:22][receive]01 06 00 64 00 6F 88 39
[2017:10:31:16:47:22][receive]01 06 00 64 00 6F 88 39
56
CX3G/FX3GC PLC Programming manual
Slave program:
Use the serial port tool to monitor serial port 2 for below data:
[2017:11:01:17:48:54][receive]01 03 00 00 00 06 C5 C8
[2017:11:01:17:48:54][receive]01 03 0C 00 0C 00 17 00 22 00 38 00 4E 00 63 C4 29
57
CX3G/FX3GC PLC Programming manual
Slave program:
Data of the Master D300~D303 before and after the program execution is showed as below.
58
CX3G/FX3GC PLC Programming manual
60
CX3G/FX3GC PLC Programming manual
Program example:
61
CX3G/FX3GC PLC Programming manual
Use the serial port tool to monitor serial port 3 for data:[2017:11:01:11:49:16][receive]31 32 33
Last parameter of RS2 instruction =1: Serial port 3;
=2: CAN.
Master program:
62
CX3G/FX3GC PLC Programming manual
Use the serial port tool to monitor serial port 3 for below data:
[2017:11:01:09:00:11][receive]01 03 00 64 00 0A 84 12
[2017:11:01:09:00:11][receive]01 03 14 00 42 00 4D 00 58 00 58 00 63 00 37 00 2C 00 21 00 16
00 0B 9F C7
Master program
63
CX3G/FX3GC PLC Programming manual
Use the serial port tool to monitor serial port 3 for below data:
[2017:11:01:09:25:20][receive]01 10 00 64 00 08 10 00 0B 00 16 00 21 00 2C 00 37 00 42 00 4D
00 58 D1 6C
[2017:11:01:09:25:20][receive]01 10 00 64 00 08 10 00 0B 00 16 00 21 00 2C 00 37 00 42 00 4D
00 58 D1 6C
Master program
64
CX3G/FX3GC PLC Programming manual
Slave program
Use the serial port tool to monitor serial port 3 for below data:
[2017:11:01:17:38:34][receive]01 04 00 00 00 06 70 08
[2017:11:01:17:38:34][receive]01 04 0C 00 15 00 20 00 2B 00 41 00 57 00 00 5F A7
Master program:
Slave program:
Data of the Slave D100~D109 before and after the program execution is showed as below
66
CX3G/FX3GC PLC Programming manual
67
CX3G/FX3GC PLC Programming manual
26232 version)
D8397: When using the ADPRW instruction, set the D8397 to 2 when using CAN. (versions
26232 and above)
D8426: Interval period. Default as 12 times.
D8429: Time-out period.(The unit is milliseconds, it is recommended to set: when the
communication rate setting is greater than or equal to 9600, D8429 is set to 10~20; when the
communication rate setting is less than 9600, D8429 is set to 20~50; when using RD3A and WR3A,
the master timeout setting is about that of the slave The timeout time is about 6);
D8434: Slave station number.
D8440: Save the local ID number (slave station number).
D8442: When multiplexed, save the slave ID number (the slave what data is read).
D8421 Parameter set
Select protocol
b0 0: Other communication protocol
1: MODBUS protocol
Master/Slave setting
b4 0: MODBUS Master
1: MODBUS Slave
b5~b7 Unavailable, Set 0
Program example:
69
CX3G/FX3GC PLC Programming manual
Master Program:
70
CX3G/FX3GC PLC Programming manual
Slave Program:
Monitoring the Master station program, the master station 16 data of D301-D316 change between
300-200 at a rate of minus 1 per second.
WR3A Program Example ( refer to 8.1.1):
Master Program:
71
CX3G/FX3GC PLC Programming manual
Slave Program:
Monitoring the Slave station program, the slave station 16 data of D100-D115 change between
200-400 at a rate of plus 1 per second.
Master Program:
72
CX3G/FX3GC PLC Programming manual
Slave Program:
CAN port of the the PLC communicates with the CAN port of the slave PLC, and reads from the 4
bits M0~M3 of the slave PLC to the D0 of the master PLC.
74
CX3G/FX3GC PLC Programming manual
Slave Program:
75
CX3G/FX3GC PLC Programming manual
3. Link device
It is a device for sending and receiving information between programmable controllers. The device
number and the number of points used differ depending on the station number set in the
corresponding station number setting and the mode set in the refresh range setting.
1) Mode 0 (D8178=0):
Word
device (4 D10~ D20~ D30~ D40~ D50~ D60~ D70~
D0~D3
points D13 D23 D33 D43 D53 D63 D73
each)
76
CX3G/FX3GC PLC Programming manual
2) Mode 1 (D8178=1):
Bit device
M1000~ M1064~ M1128~ M1192~ M1256~ M1320~ M1384~ M1448~
(32 points
M1031 M1095 M1159 M1223 M1287 M1351 M1415 M1479
each)
Word
device (4 D10~ D20~ D30~ D40~ D50~ D60~ D70~
D0~D3
points D13 D23 D33 D43 D53 D63 D73
each)
3) Mode 2 (D8178=2):
Bit device
M1000~ M1064~ M1128~ M1192~ M1256~ M1320~ M1384~ M1448~
(64 points
M1063 M1127 M1191 M1255 M1319 M1383 M1447 M1511
each)
Word
device (8 D10~ D20~ D30~ D40~ D50~ D60~ D70~
D0~D7
points D17 D27 D37 D47 D57 D67 D77
each)
Station Station Station Station Station Station
Station No Station 8 Station 9
10 11 12 13 14 15
77
CX3G/FX3GC PLC Programming manual
Bit device
M1512~ M1576~ M1640~ M1704~ M1768~ M1832~ M1896~ M1960~
(64 points
M1575 M1639 M1703 M1767 M1831 M1895 M1959 M2023
each)
Word
device (8 D80~ D90~ D100~ D110~ D120~ D130~ D140~ D150~
points D87 D97 D107 D117 D127 D137 D147 D157
each)
1. Serial port 2
Master program:
Slave program:
2. Serial port 3
Such as serial port 2, only need the master and slave program to set D8394=3
78
CX3G/FX3GC PLC Programming manual
3. CAN port
Master program:
Slave program:
79
CX3G/FX3GC PLC Programming manual
80