Programming Manual OptimusDrivePLC
Programming Manual OptimusDrivePLC
configuration.
PLC features
Ethernet + : Host PLC and remote modules support Ethernet
function.
High-speed pulse frequency measurement: Supports 16-channel
project" window, select PLC series. PLC MPU and others project
attribute .
Third step: write control program ,build one or many program block,
running correct then next step, otherwise return to third step modify
program .
At "CPU type " among pull listing select "CPU also MPU type".
V V1000~V2047 1048
M M1536~M2047 512
S S156~S255 100
T T96~T127 32
C C64~C127 64
At " project name " input new project name, the project name will be
relate to information.
If need password protect the new project, then at "password" and "verify
According to the need build one or more program block, choice oneself
well-informed program language (LD. FBD. IL), each block may be set
After complete the program, save program file, start simulator running,
[Example]
Below explain how to write the control program via the example,
the example control requirement: press X0 button start, delay 2 second
output Y0. press X1 button stop.
[Example program]
[Example program operation]
Create a new " Quick start example" main program block, open mode:A.
button "Main program block"." Create new program block " window as
follow.
Click tool bar button or press F9 shortcut key add a switch, input
switch component "X0//start" (behind "//" " start " is the comment of
"M0//self-lock"
Move cursor to the right side of X0 switch ,press F9 shortcut key series a
Move cursor right, input "TON" return, add one "TON" instruction,
continuous press enter, when input box at "Pt" item input set value 2 of
the timer.
Press F11 shortcut key add parallel output instruction "OUT", input
component "M0".
Press tool bar button or press Ctrl+L shortcut key add a new
network.
Press F9 shortcut key add a switch, input switch component "T0//delay
2S".
Press F11 shortcut key add output instruction "OUT", input component
"Y0//output".
save the program file, may be start the simulator executing, debug
channel signal type . quantities etc. ) or need add extend module etc.
Double click " Project manager " window directory tree "PLC hardware
Click open "Project manager" window directory tree " PLC ,select want
to add module , use mouse drag the module to right side hardware
configure list.
Click hardware configure list module ,under the list will display the
simulator under the condition of completely off line PLC simulate running
PLC program, use for check program executed whether correct, vastly
efficiency.
Click menu [Debug/Start simulator]or click tools bar button start the
If compile the program error, simulator can not running, user must modify
as follows:
Double click program "X0" switch force X0=ON, then M0=ON self lock,
may be control operation the PLC, such as: upload or download etc..
Click menu [PLC/PLC networking] or click tool bar button , open "PLC
online" window.
Click "Online" button (general condition, direct use default parameter ),
already online PLC will automatic add to the listing box, now click "exit "
PLC online and parameter setting refer to "Online control PLC" section
"PLC online".
after user modify the program no any error then can be downloaded.
"Download program".
indicator go on), may skip the step. Otherwise turn the PLC running
Overview
PLC have configurated many component in the system (also call: variable. address),as:X. Y.
M. AI. AQ. V etc..Components have Bit register and Word register,bit register occupy one bit
express boolean variables ,word register occupy one word (16 bits,2 bytes) express data
variables,they can be used again and again in program.In PLC use the soft component to
Data
1. Data type
16 bits,1 register
INT integer with sign ﹣32768~32767
component
32bits,2 register
REAL floating point ﹣3.402823e+38~3.402823e+38
components
BOOL X Y T C M SM LM S
INT constant AI AQ TV CV V LV SV P
DINT constant TV CV V LV SV
REAL constant V LV
CHAR constant V LV
3. Constant
16 bits constant in
0x2EF8. 0x9A12 0x0~0xFFFF
hexadecimal
32 bits constant in
0xA76DCFE9 0x0~0xFFFFFFFF
hexadecimal
1. The storage pattern in the register of 32 bits data :the data type of DINT. REAL are 32 bits
length,but one register occupy 16 bits length,so need 2 continuous address registers for
store 32 bits data.When store 32 bits data,according to fist low word. after high word
,e..g.:32 bits long integer data 0xA76DCFE9 store in V0V1 registers,then 0xCFE9 stored in
2. Register component can stored integer. long integer,if the operands in instructions is
register,then the component is 16 bits integer. 32 bits long integer or floating point,is
according the data type of the operand in the instruction.e.g.:"MOV -23, V10",the MOV is 16
bits integer move instruction,the register V10 is a 16 bits integer;"D.MOV 7891223, V10",the
D.MOV is 32 bits integer move instruction,the register V10 is a 32 bits long integer (occupy
V10V11);"FMOV -9.223, V10",the FMOV is floating point move instruction,the register V10 is
3. The operand of floating point instruction is floating point,the operand of other instruction is
integer(16 bits integer,32 bits long integer),data type converted with convert instruction.
Component overview
1. PLC bit component
X
External input X0~X1023 read
relay
10ms. 100ms. 1s
T Timer T0~T1023 read/write
default power-off preserve:T96~T127,32 point
AI
Analog input register AI0~AI255 read
AQ
Analog output register AQ0~AQ255 read/write
10ms. 100ms. 1s
TV Current value of timer
TV0~TV1023 read/write
default power-off preserve:TV96~TV127,32 point
SV0~SV1
SV System register all be read/some be
54 wrote
Indexed addressing
P P0~P29 special register use in indexed addressing
point read/write
Note:power-off preserve range of T(TV). C(CV). M. S. V in the table are default configure of the
Sign by X,e.g.:X0. X1. … X8. X10. X11. …. Identifiered from X0,In "PLC hardware configure" to
points Y ON-OFF (ON or OFF).One Y relay can be reuse of output in the program ,but
recommendation use only once, in order to improve the reliability and readability of the program.
Sign by Y,e.g.:Y0. Y1. … Y8. Y10. Y11. ….Identifiered from Y0,In "PLC hardware configure" to
Timer [T]
Timer T:each timer compose output relay T and current value TV.
Target = time base * set value.Time base of T0~T251. T256~T1023 can be set 10ms. 100ms.
In one program,each timer can be used only once,But the output relay T and current value TV
current value TV of the no power-off preserve timer will be reset when PLC STOP .The output
relay T and current value TV of the power-off preserve timer will be retain when PLC STOP.
Counter[C]
Counter C:each counter compose output relay C and current value CV.
In one program,each counter can be used only once,But the output relay C and current value
Counter can be devided 16 bits counter and 32 bits counter, among CV48~CV79 are 32 bits
Counter can be devided three type in accordance with the count mode:increase count CTU.
Counter can be devided power-off preserve and no power-off preserve :the output relay C
and current value CV of the no power-off preserve counter will be reset when PLC STOP .The
output relay C and current value CV of the power-off preserve counter will be retain when PLC
STOP.
Auxiliary relay[M]
Auxiliary relay M:Used for internal logic operation,we can use the combination of auxiliary
M can be devided power-off preserve and no power-off preserve :the state of no power-off
preserve M will be reset when PLC STOP .The state of power-off preserve M will be retain when
PLC STOP.
Step relay[S]
Step relay S:Used for step control instruction,each step relay stand for one step,can be used
the same as auxiliary relay if there is not step instruction in the program .
S can be devided power-off preserve and no power-off preserve :the state of no power-off
preserve S will be reset when PLC STOP .The state of power-off preserve S will be retain when
PLC STOP.
The function range of M:in the all program in the project,all of the scan cycle.
The function range of LM:in local area (program block. sub program. interrupt program) ,state
(ON/OFF) only keep one scan cycle ,state will be reset when the next scan cycle started,state
reset to OFF,general use for temporary variable or the parameter of the program block be called.
AI,analog input channel connect to external device,used for measure the continuous change of
When the signal of external analog input channel be changed,can be reflect to the analog
The signal type. quantities. up and down rang of quantities of each analog input channel can
When the value of analog output register AQ be changed, corresponding the signal of the
-32768~+32767,2 continuous 16 bits register is 32 bits register,long integer can express the range
V can be devided power-off preserve and no power-off preserve :the value of no power-off
preserve V will be reset to 0 when PLC STOP .The value of power-off preserve V will be retain
(program block. sub program. interrupt program) ,not the same as internal register V.
The function range of V:in the all program in the project ,all of the scan cycle.
The function range of LV:in local area (program block. sub program. interrupt program) ,value
only keep one scan cycle ,value will be reset to 0 when the next scan cycle started,general use
How to input the register indexed and representation in the program:base address of the
register+indexed addressing point P.e.g.:V100P6 presentation the base address is V100,use the
value of P6 as excursion value for indexed addressing,as if the value of P6 is 10,indicate access
Reality access register =base address of the register + excursion of indexed address point.
Note:
1. When indexed addressing use the P,If base address of the register + excursion of indexed
address point (reality access register )exceed the uplimit ,it will be error of the indexed addressing
3. Part of the instruction does not support indexing:RESH. HHSC. HCWR. SPD. PWM. PLSY.
PLSR. ZRN. SETZ. PPMR. CIMR. SPLS. SYNP. COMM. MODR. MODW. HWRD. HWWR. RCV.
instructions of others PLC , support up to 200 application instructions , among there are
FTOC. CTOF). data combination disperse instructions (BUNB. BUNW. WUNW. BDIB.
OR Logic OR √ √
RST Reset √ √ √
TON Delay ON √ √ √
TP Pulse timer √ √ √
High speed
control SHC Single high speed counter √ √ √
instruction
RESH IO refresh √ √ √
Shift instruction
LBST Low byte evaluation √ √ √
Support
Instruction Instruction 32 bit language
8 bit model Instruction function
type name model
LD FBD IL
FILL Fill √ √ √
Data
conversion ENCO Encoder √ √ √
instruction
DECO Decoder √ √ √
Arithmetical
instruction WNOT D.WNOT Negation √ √ √
Floating point
instruction FCMP Floating point comparison √ √ √
FSIN Sine √ √ √
FCOS Cosine √ √ √
FTAN Tangent √ √ √
FASIN Arcsine √ √ √
FATAN Arctangent √ √ √
Support
Instruction Instruction 32 bit language
8 bit model Instruction function
type name model
LD FBD IL
FXY Exponent √ √ √
Communication
instruction SUM SUM.LB SUM verify √ √ √
Interrupt
instruction ATCH Interrupt binding √ √ √
MC Master control √ √ √
Special
function GPWM General pulse width modulation √ √ √
instruction
VC Valve control √ √ √
2. Eno Enable output: Eno is the Enable output item of the instruction, indicate the
properly then Eno output have electricity (ON), when En have not electricity (OFF)
Eno output have not electricity (OFF). The application instruction in LD. FBD
language ,the great mass of the instruction have Eno Enable output item, All IL
instructions have not Eno output item,it will be instead of the ENO instruction in IL
language.
3. In LD language the AND. OR. XOR instructions, will be instead of logic link.
5. 8 bit instruction at 16 bit instruction behind the name plus ".LB", indicate only use
the low byte of the register .Such as COMM,16 bit instruction is COMM,8 bit
instruction is COMM.LB.
Note: except CV48~CV79 are 32 bit register (total 32 entries),PLC other registers (AI.
AQ. V. SV. LV. TV. CV. P) all are 16 bit register, one 16 bit register have 2 byte
Compare switch
Compare switch used in LD program language dedicated, divide into:16 bit compare
Compare mode have:equal to (=). unequal to (<>). greater than(>). greater than or
equal to (≥). less than (<). less than and equal to(≤) six type.
Step instruction
3. If a step is ON ,the program within the step be executed, then not executed.
4. Support step branch . step combine process.
5. Jump between the step, the last step state and OUT instruction outputs . timer
coil T and current value TV . counter coil C and current value CV within the step
6. When the step roll-out ,Y output want keep ON be use SET instruction drive the
7. Step number Sn cannot repeat , without step instruction in the program the S
8. If want terminate the step , use RST Sx to reset the step, batch reset use the
ZRST instruction.
9. Any S component can be used the start step , start step use STO or SET start ,
10. The program can activate 10 different step process at the same time .
STL(Step start)
Instruction
Without Without
format
STL instruction represent a step start , if the step have electricity ,the program
[Instruction example]
[Program description]:
2. When S3=ON, moreover jump condition X0=ON, then go to step S20,by now
S20=ON. S3=OFF
3. When S20=ON then Y0=ON, when jump condition X1=ON , then go to step
4. When S30=ON then Y1=ON, when jump condition X2=ON , then go to step
5. When S40=ON then Y2=ON, when jump condition X3=ON , then go to step
6. When S31=ON then Y3=ON, when jump condition X5=ON , then go to step
7. When S41=ON then Y4=ON, when jump condition X6=ON , then go to step
8. When S32=ON then Y5=ON, when jump condition X10=ON , then go to step
9. When S42=ON then Y6=ON, when jump condition X11=ON , then go to step
10. When S50=ON then Y7=ON, when jump condition X12=ON , then go to step
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
Without Without
format
[Instruction example]
[Program description ]:
1. When program start the first scanning cycle SM2=ON, start step S3,by now
S3=ON
2. When S3=ON, moreover jump condition X0=ON , then go to step S20,by now
S20=ON. S3=OFF
3. When S20=ON then Y0=ON, when jump condition X1=ON , then go to step
S30 S31 (step parallel branch)at the same time,by now S30=ON. S31=ON.
S20=OFF. Y0=OFF
4. When S30=ON then Y1=ON, when jump condition X2=ON , then go to step
6. When S31=ON then Y3=ON, when jump condition X3=ON , then go to step
9. When S60=ON then Y7=ON, when jump condition X6=ON , then go to step
10. If M2=ON ,then batch reset 100 steps start from s0 ,that is S0~S99.
STO(Step jump)
In
Program
Language LD FBD IL
example
Instruction
Without Without
format
[Instruction example]
[Program description]:
2. When S3=ON, moreover jump condition X0=ON , then go to step S20,by now
S20=ON. S3=OFF
3. When S20=ON then Y0=ON,at the same time start timer T0, when T0 time is
4. When S30=ON then Y1=ON, when jump condition X1=ON , then go to step
5. When S60=ON then Y7=ON, when jump condition X2=ON , then go to step
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
OR Logic OR √ √
SET Setting √ √ √
RST Reset √ √ √
AND(Logic AND)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
Without AND In1, In2 [, … , In15], Out
format
In1 Operand 1 √
In2 Operand 2 √
… … …
In15 Operand 15 √
AND instruction logic AND a group bit component of Input and then output ,only
In1~In15 Input states all are ON the Out=ON ,otherwise Out=OFF,support 2~15
variable Input.
OR(Logic OR)
In
Program
Language LD FBD IL
example
Instruction
Without OR In1, In2 [, … , In15], Out
format
In1 Operand 1 √
In2 Operand 2 √
… … …
In15 Operand 15 √
OR instruction logic OR a group bit component of Input and then output ,if only one
variable Input.
XOR(Logic XOR)
In
Program
Language LD FBD IL
example
Instruction
Without XOR In1, In2 [, … , In15], Out
format
In1 Operand 1 √
In2 Operand 2 √
… … …
Parameter Parameter define Input Output Declare
In15 Operand 15 √
XOR instruction logic XOR a group bit component of Input and then output , when
OUT(Coil output)
In
Program
Language LD FBD IL
example
Instruction
OUT In, Out
format
In Input √
Out Output √
Out=OFF.
SET(Setting)
In
struction format and parameter specification
Program
Language LD FBD IL
example
Instruction
SET In, Out
format
In Input √
Out Output √
then Out keep the original state.SET instruction general used edge Input
executed.
RST(Reset)
In
Program
Language LD FBD IL
example
Instruction
RST In, Out
format
In Input √
Out Output √
Out=OFF,In=OFF then Out keep the original state.RST instruction general used
2. If Out is timer Tx,at the same time reset the timer coil T and current value TV, if
Output is counter Cx,at the same time reset the counter coil C and current value
CV.
3. If Out is step relay S,except reset the step state, if the step is executing then
reset the output of the OUT instruction . timer coil T and current value TV . counter
In
Program
Language LD FBD IL
example
Instruction
ALT In, Out
format
In Input √
Out Output √
ALT instruction negation the input state to output state, In=ON then Out negation it
self,In=OFF then Out keep the original state.ALT instruction general used edge
Input executed.
ZRST(Batch reset)
In
Program
Language LD FBD IL
example
Instruction
ZRST En, N, Des
format
En Enable Input √
Component numbers to be √
N 1~256
reset
2. If Des is timer Tx, will reset timer coil T and current value TV,Iif Output is
counter Cx, will reset counter coil C and current value CV.
3. if Des is step state S,except reset the step state, if the step is executing then
reset the output of the OUT instruction . timer coil T and current value TV . counter
In
struction format and parameter specification
Program
Language LD FBD IL
example
Instruction
Without Without EnO Out
format
Out Output √
1. IL Language All instruction without Eno Enable outpu item in IL Language ,for
function, in IL language special add ENO instruction, it's function equal to the Eno
2. ENO instruction only one Output item,the state of Output items only relate to the
first item near the ENO instruction in BD or LD language have Eno Output
instruction.
[Instruction example]
[Program description]
item, moreover nearest ENO instruction(because OUT instruction have not Eno
Output item), so in program, the output item state M0 of ENO instruction relate to
4. X2=OFF,Y0=OFF
6. M0=ON,ADD instruction执行,AQ0=V10+200
Timer
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
TON Delay ON √ √ √
TP Pulse timer √ √ √
Note:T252~T255 time base fixed to 1ms.Others timer time base can be set arbitrarily
TON(Delay ON)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
TON.ns In, Pt, Tx
format
In Input √
Pt Set time √
TV Current time √
1. TON is delay ON instruction , when In=ON, start timer timing,TV is the current
value of the timer, when TV equal to the set time (time time to),Out(timer output
coil Tx)=ON,and stop timing.When In turn into OFF,Out(timer output coil Tx)=OFF,
moreover TV value reset to zero.In the timing process(time non-arrival),In turn into
OFF, then stop timing,Out(timer output coil Tx)=OFF, moreover TV value reset to
zero.
[Instruction example]
[Program sketch map]
[Program description]
T0=OFF(Y0=OFF),TV=0.
TOF(Delay OFF)
In
Program
Language LD FBD IL
example
Instruction
TOF.ns In, Pt, Tx
format
In Input √
Parameter Parameter define Input Output Declare
Pt Setting time √
TV Current time √
state from ON go to OFF, start timer timing,TV is the timer current value, when TV
equal to setting time (time time to),Out(Timer coil Tx)=OFF, and stop
[Instruction example]
TP(Pulse timer)
In
Program
Language LD FBD IL
example
Instruction
TP.ns In, Pt, Tx
format
In Input √
Pt Setting time √
TV Current time √
timer current value, when TV equal to setting time (time arrival),Out(Timer coil
Tx)=OFF,stop timing moreover TV value reset to zero.In the timing process(time
[Instruction example]
[Program description]
Counter
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
In
Program
Language LD FBD IL
example
16. 32 bit
CTU Cu, PV, Cx
Instruction
D.CTU Cu, PV, Cx
format
PV Counter preset √
Out Counter coil Cx √ Among C48~C79 are 32 bit counter ,total 32 point
CTU is 16 bit increase counter instruction (D.CTU is 32 bit), when increase count
input Cu from OFF go to ON, counter add 1, when CV great than or equal to PV,
Out (counter coil Cx)=ON. Counting reached,if the counting pulse input again,
counting will be continue ,CV value will be added 1 continue , until reach maximum
value(16 bit counter maximum value is 32767,32 bit counter maximum value is
[Instruction example]
[Program description]
reach,C0=ON(Y0=ON).
In
Program
Language LD FBD IL
example
16. 32 bit
CTD Cd, PV, Cx
Instruction
D.CTD Cd, PV, Cx
format
PV Counter preset √
Parameter Parameter define Input Output Declare
Out Counter coil Cx √ Among C48~C79 are 32 bit counter ,total 32 point
count input Cu from OFF go to ON, counter subtract 1, when CV=0 then counting
reached, Out (counter coil Cx)=ON.Counting reached ,if the counting pulse input
2. When CTD instruction loaded or reset ,CV = PV, that is CTD decrease from
preset to 0.
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
16. 32 bit
CTUD Cu, Cd, PV, Cx
Instruction
D.CTUD Cu, Cd, PV, Cx
format
Decrease input
Cd √
Input
PV Counter preset √
Out Counter coil Cx √ Among C48~C79 are 32 bit counter ,total 32 point
when increase count input Cu from OFF go to ON,counter add 1, when decrease
equal to PV, Out (counter coil Cx)=ON, When CV less than PV, Out (counter coil
Cx)=OFF.
[Instruction example]
[Program description]
10,C0=OFF(Y0=OFF).
High speed control instruction
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
RESH IO refresh √ √ √
1. PLC high speed counter and high speed pulse output defined by channel
,related the hardware of the PLC ,Configured by "PLC hardware configure". High
speed counter channel signify by HSCx ,each channel use 2 high speed pulse
input point .High speed pulse output channel signify by PLSx , each channel use 2
In
Program
Language LD FBD IL
example
Instruction
SHC En, PV, Dir, Reset, X, Out, HVal
format
Enable
En √
Reset Reset √
X Pulse input √
1. SHC instruction counts the high-speed impulse input of the Xn input point , it
does not use the HSCx high-speed pulse input channel, one high-speed pulse
input channel has two high-speed pulse input points. Therefore the host with eight
pulse input channels can achieve the fucntion of 16 ways high-speed pulse input.
2. SHC instruction is a 32-bit high-speed pulse counter, it does not generate high-
3. Dir terminal control the counting direction, when Dir = OFF it adds
4. Reset terminal controls the reset of the counter,when Reset = ON , it resets the
counter.
5. When "HVal" is greater than or equal to "PV" , "Out" is equal to "ON", when
[Program description]
1. When M0=ON , HSC high-speed counter works, it begings counting the high-
RESH(IO refresh)
In
Program
Language LD FBD IL
example
Instruction
RESH En, IO, N
format
Enable
En √
Number of component be
N √ 1~256
refreshed
1. RESH instruction use for refresh the state of external digital Input . Output (X.
2. En is the enable item of the instruction , when the state of En ON, the N
Note: the instruction used for real-time or high accuracy control circumstance ,as
high speed control . interrupt processing etc. .Without RESH instruction in the
program ,PLC external Input . Output state will be updated after the total program
scaned finish.
[Instruction example]
[Program description]
In
struction format and parameter specification
Program
Language LD FBD IL
example
Instruction
HHSC En, PV, N, Mod, HSCx, Out
format
Enable
En √
Number of compare √
N 1-48
segments
Comp
0-2:0 is single segment compare , 1 is absoulte compare ,
Mod √
2 is relatively compare
are model
1. HHSC instruction is deal with the high speed pulse input , it can deal with input
pulse counting and measure the pulse frequency at the same time.
2. High speed counter support :pulse/direction . positive/negative pulse . A/B
count value=preset value generate " HSCx current value=preset value ( the preset
value of each segment will be generated) " interrupt , when the direction of input
pulse changed will be generate "HSCx input direction changed " interrupt .
5. HHSC instruction have self-learning function ,in the self-learning can record the
current value to the preset value , can continuous multi-segment self-learning .The
high speed counter HSCx will be reset while enter into or quit the self-learning
state .
6. Reset high speed counter . modify the preset value real time . modify the current
Times Decrease
Model Increase count
frequency count
0 --pulse/direction 1
1 --pulse/direction 2
2 --
1
foreward/reversal
Count model Pulse waveform
Times Decrease
Model Increase count
frequency count
3 --
2
foreward/reversal
4 -- A/B phase 1
5 -- A/B phase 2
6 -- A/B phase 4
[Instruction example 1]
[Program 1 declare]
PV Value Declare
component
200 First segment preset
V1000V1001
V1002V1003 500
Second segment preset
1200
V1004V1005 Third segment preset
V1006V1007 1500
Fourth segment preset
1. When M0=ON ,HHSC instruction executing ,high speed counter HSC0 set to
compare.
2. When M1=ON ,instead HSC0 current segment number to 2,then HSC0 second
4. When M3=ON ,reset HSC0 ,HSC0 current value =0,HSC0 current segment
number=1
[Instruction example 2]
200
V1000V1001 First segment preset
V1002V1003 500
Second segment preset
1000
V1004V1005 Third segment preset
V1006V1007 1500
Fourth segment preset
[program 2 declare]
1. When M0=ON ,HHSC instruction executing , high speed counter HSC0 set as
2. When M3=ON ,reset HSC0 ,HSC0 current value =0,HSC0 current segment
number=1
[Instruction example 3]
PV Declare
Value
component
300
V1000V1001 First segment preset
V1002V1003 200
Second segment preset
[Program 3 declare]
number=1
[Instruction example 4]
[Program 4 declare]
1. When M0=ON ,HHSC instruction executing, high speed counter HSC0 set as
segment of number 1.
2. When M1=ON ,SM25=ON,HSC0 enter into study state, reset HSC0 at the
same time.
next segment ,if segment number great than number of segments (this example
N=4) then segment number =1.each SM26=ON once record one segment preset
value .
In
Program
Language LD FBD IL
example
Instruction
HCWR En, Val, Kind, HSCx
format
Enable
En √
1. HCWR instruction use for high speed counter assist control ,use cooperate
HHSC instruction ,accomplish reset high speed counter . modify the preset value
real time . modify high speed counter current value . modify current segment
number.
[Instruction example]
[Program description]
When M3=ON, reset high speed counter HSC0,HSC0 current value =0,current
SPD(Speed detection )
In
struction format and parameter specification
Program
Language LD FBD IL
example
Instruction
SPD En, TnP, X, HFre
format
Enable
En √
X pulse input √
1. SPD instruction detection the pulse frequency of the high speed input point
XnInput of MPU .It nonuse HSCx high speed pulse input channel ,1 high speed
pulse input channel have 2 high speed pulse input point .That is the MPU with 8
channels high speed pulse can realize detection 16 channels high speed input
pulse .
frequency , when TnP>0 then use time model to detection frequency (unit
0.1ms), when TnP<0 then use number of pulse model to detection frequency
please use time model to detection (Suggestion detection time great than
500ms,TnP>5000) , when input pulse frequency less than 19KHz please use
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
Instruction
PWM En, PulR, PulF, Out
format
Enable
En √
1. PWM instruction output assigned frequency . duty factor pulse via high speed
pulse output point Yn of MPU .It nonuse PLSx high speed pulse output channel ,1
high speed pulse output channel have 2 high speed pulse output point .That is the
MPU with 8 channels high speed pulse can realize detection 16 channels high
use minimum frequency , when PulF> maximum frequency then use maximum
frequency .
3. When PulF>0,if PulR>0 moreover PulR<1000 ,Out output pulse of duty factor
PulR . frequency Pul ,if PulR=0 then Out output low level ,if PulR≥1000 then Out
[Instruction example]
[Program description]
1. When M0=ON, from Y3 output pulse which duty factor is 30%. frequency is
In
Program
Language LD FBD IL
example
16. 32 bit
PLSY En, PulF, PulN, PLSx
Instruction
D.PLSY En, PulF, PulN, PLSx
format
Enable
En √
The channel of
Number
Pn √ Occupy 2 system register
of pulse already
output
Parameter Parameter define Input Output Declare
express output reverse pulse ;when PulN=0 and relative address mode ,express
3. PulF is pulse output frequency .PulN=0 (output continuous pulse not take into
pulse,PulF<0 express output reverse pulse. PulN≠0 ,if PulF≤0 then no output,
PulF great than 0 however less than minimum frequency (10Hz) then according to
minimum frequency output, PulF greater than maximum frequency then according
generate pulse output interrupt , instruction start executing pulse output general
"PLSx start output pulse " interrupt , instruction executed complete stop pulse
6. PLSY instruction there is not number of branches ,can coexist with others pulse
output instruction ,but each pulse output channel only one instruction at the same
time .
7. At instruction executing pulse output process, PulF pulse output frequency can
[Instruction example]
[Program description]
1. When M0=ON ,pulse output channel PLS0 use 50KHz frequency output 30000
2. When M1=ON ,pulse output channel PLS0 use 200KHz frequency output
In
Program
Language LD FBD IL
example
16. 32 bit
PLSR En, MaxF, PulN, Tms, PLSx
Instruction
D.PLSR En, MaxF, PulN, Tms, PLSx
format
Enable
En √
1. PLSR is have accelerate and decelerate single segment pulse output instruction
.Tms accelerate and decelerate time , when Tms=0 express have no accelerate
and decelerate , when Tms< minimum accelerate and decelerate time then
decelerate time.
greater than 0 however less than minimum frequency (10Hz) then according
parameter error.
3. PulN is total output pulses ,greater than 0 express output forward pulse ,less
than 0express output reverse pulse, equal to 0 then no output, report no.3
parameter error .
general pulse output interrupt, instruction start executing pulse output general
"PLSx start output pulse " interrupt , instruction executed complete stop pulse
OFF, instruction according to Tms slow down brake stop (no setup brake stop
),Eno=OFF.
6. PLSR instruction there is not number of branches ,can coexist with others pulse
output instruction ,but each pulse output channel only one instruction at the same
time .
7. At instruction executing pulse output process, MaxF. PulN can not be modified
[Instruction example]
[Program description]
1. When M0=ON, pulse output channel PLS1 use 50KHz frequency output 30000
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
ZRN En, DOG, PulF, DPulF, Tms, PLSx, End
format
Enable
En √
order to reduce pulse direction,The current location < electric origin, in order to
add pulse direction.After they back to the origin of the electric current position is
set to 0.If the current location = electrical origin, the instruction is not action.
3. DOG = 1, said back to the mechanical origin, no near point signal.The current
position > mechanical origin, in order to reduce pulse direction,The current location
< mechanical origin, in order to add pulse direction.After they back to the origin of
the mechanical ,Set the current position = mechanical origin.If the current location
4. DOG terminal specified external input point X,Said use near point signal back to
the mechanical origin.When using the DOG near point signal,ZRN instruction with
a). The current position when the outside of the DOG,ZRN instruction from near
point frequency acceleration origin return frequency ,when the near point signal (DOG)
from OFF to ON,started to slow down to near point frequency (Crawl speed),when the
near point signal (DOG) from ON to OFF,pulse output to stop,the origin return to
complete.After back to the mechanical origin, set the current position = mechanical
origin.
b). The current location on the interior of the DOG or the DOG,ZRN instruction from
near point frequency acceleration origin return frequency,until met LSR back limit switch
to slow down to zero,then reverse forward;When the near point signal (DOG) from ON
to OFF,slowed to zero and then back again;When the near point signal (DOG) from
OFF to ON,started to slow down to near point frequency (Crawl speed),when the near
complete.After back to the mechanical origin, set the current position = mechanical
origin.
5. When design the near point signal (DOG) , please think about DOG front and
back have enough length , thus after sensed the DOG signal from OFF go to ON
offset .
6. Near point signal (DOG) should connect to PLC MPU X input point , no then be
8. When PulF=0,report no.3 parameter error no output pulse , no then when PulF
10. When Tms<minimum accelerate and decelerate time then use minimum
turn off .
[Instruction example]
[Program description]
1. When M0=ON,PLS0 use 50KHz frequency output 4000 forward pulse ,output
2. When M1=ON ,set (4000,3000) to electrical origin point, mechanical origin point
changed to (-4000,-3000).
(4000, 3000).
frequency of 1 KHZ near point back to the electrical origin,current location (0, 0).
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
SETZ En, PLSx
format
Enable
En √
When system initial ,electrical origin point is mechanical origin point .after
executed SETZ instruction ,set current position to electrical origin point, current
[Instruction example]
[Program sketch map]
[Program description]
1. When M0=ON,PLS0 use 50KHz frequency output 4000 forward pulse ,output
2. When M1=ON ,set (4000,3000) to electrical origin point, mechanical origin point
changed to (-4000,-3000).
PPMR(Linear interpolation)
In
Program
Language LD FBD IL
example
Enable
En √
Y pulse o
YPLSx √
utput channel
Parameter Parameter define Input Output Declare
Li
End √
near interpolation
complete
1. PPMR instruction use current position for starting point, use (XTpos,YTpos) end
2. Starting point and end point can not the same point , no then report no.3
parameter error.
4. When PulF=0,report no.3 parameter error no pulse output , no then When PulF
reports the error of the No.3 parameter. When ATms>maximum acceleration time
or maximum deceleration time, then use the maximum acceleration time or the
deceleration function. DTms<0 reports the error of the No.3 parameter. When
6. After the instruction started, all of parameter can not modified ,until instruction
turn off.
[Instruction example]
[Program sketch map]
[Program description]
1. Via initial register table " linear interpolation parameter" setup 4 segment linear
coordinate value .
Reg Value
ister Declare
component
7000
V1000V1001 X target location0
V1002V1003 7000
Y target location0
14000
V1004V1005 X target location1
V1006V1007 0
Y target location1
7000
V1008V1009 X target location2
-7000
V1010V1011 Y target location2
0
V1012V1013 X target location3
0
V1014V1015 Y target location3
50000
V1016V1017 Pulse frequency
50
V1018 Accelerate time
50
V1019 Decelerate time
2. The program first scan cycle SM2=ON, setup PLS0. PLS1 position model to
CIMR(Circular interpolation )
In
Program
Language LD FBD IL
example
Instruction CIMR En, XTpos, YTpos, CR, PulF, ATms, DTms, Dir,
format XPLSx, YPLSx, End
Enable
En √
Y pulse o
YPLSx √
utput channel
Circular interpolation
End √
complete
2. Starting point and end point can not the same point , if radius less than half
distance from staring point to end point (CR<L / 2,L= distance from staring point
3. CR>0 express minor arc( the arc which less than semi-circle ),CR<0 express
is direction of motion
(0-clockwise,1-anticlockwise)
minimum frequency (10Hz) then use minimum frequency , when PulF> maximum
reports the error of the No.3 parameter. When ATms>maximum acceleration time
or maximum deceleration time, then use the maximum acceleration time or the
deceleration function. DTms<0 reports the error of the No.3 parameter. When
7. After the instruction started, all of parameter can not modified ,until instruction
turn off.
[Instruction example]
[Program sketch map]
[Program description]
1. Via initial register table " circular interpolation parameter" setup 2 segment arc
coordinate value.
Reg Value
ister Declare
component
9000
V1000V1001 X target location0
V1002V1003 0
Y target location0
0
V1004V1005 X target location1
V1006V1007 0
Y target location1
4500
V1008V1009 Circle radius
50000
V1010V1011 Pulse frequency
60
V1012 Accelerate time
60
V1013 Decelerate time
2. The program first scan cycle SM2=ON, set PLS1. PLS3 position model absolute
addressModel(SM115=ON,SM147=ON).
radius is 4500.
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
SPLS En, MaxF, PulN, Tms, Out, End, Pn
format
Enable
En √
1. SPLS instruction via MPU high speed pulse output point Yn output high speed
pulse, it not use PLSx high speed pulse output channel,1 high speed pulse output
channel have 2 high speed output points. Thus MPU with 8 pulse output channel
2. SPLS instruction only output pulse, direction need controlled by Y output point
in the program ,it will not generate pulse output interruption ,not use SM. SV.
3. When Tms=0 express no accelerate and decelerat, no then when Tms<
minimum accelerate and decelerate time then use minimum accelerate and
decelerate time, when Tms>maximum accelerate and decelerate time then use
(10Hz) then use minimum frequency , when MaxF> maximum frequency then
5. When PulN=0 express not take into account pulse output ;when PulN>0 then
according to PulN pulses output, pulse output complete End set; when PulN<0
no pulse output .
6. MaxF can be modified real time ,PulN can not be modified real time .
[Instruction example]
[Program description]
1. When M0=ON ,Y3 use 50KHz frequency output 30000 pulses ,Y15=OFF(OFF
3. When M1=ON ,Y3 use 200KHz frequency output 15000 pulses ,Y15=ON (ON
In
Instruction
SYNP En, RMul, RDiv, PulN, Maixs, SPLSx
format
Enable
En √
D
RDiv √ Occupy 2 continuous component
ivide factor
1.SYNP instruction realizes electronic gear function, specifing that the slave axis
SPLSx pulse output follows the change of the pulse of master axis Maxis, the ratio
between them coefficient K = RMul / RDiv. SPLSx direction consistent with the
direction of the spindle Maxis, RMul and RDiv must be greater than zero.
2.Maxis is defined as the master axis. When Maxis are specified as X0, X2, X4,
X6, X8, X10, X12 and X14, they indicate the high-speed pulse input channels
HSC0~ HSC7.
3.PulN specifies the number of delay pulses. After Maxis inputs "pulN" pulses,
4.When multiple SYNP instructions execute at the same time , Maxis can be
repeated, SPLSx can not be repeated, that is to say a master axis can drive
change interrupt.
6.SYNP instruction does not have the limitation on the number, it can coexist with
other pulse output instructions, but each pulse output channel can only execute
7.After this instruction is started, the parameters RMul and RDiv can't be modified
in real time.
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
Instruction
PSTOP En, PLSx
format
Enable
En √
[Instruction example]
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
CMP. D.CMP(Compare)
In
16. 32 bit
CMP En, In1, In2, Out
Instruction
D.CMP En, In1, In2, Out
format
Enable
En √
In1 Input1 √
In2 Input2 √
[Instruction example]
[Program description]
1. 16 bit compare CMP instruction, when AI1>500 then M10=ON, when AI1=500
In
Program
Language LD FBD IL
example
16. 32 bit
ZCP En, In, Up, Down, Out
Instruction
D.ZCP En, In, Up, Down, Out
format
Enable
En √
In Input √
them automatic .
[Instruction example]
[Program description]
1. 16 bit compare ZCP instruction , when AI1>3000 then M10=ON, when AI1≤3000
In
Program
Language LD FBD IL
example
16. 32 bit
MATC En, In, Par, N, Out
Instruction
D.MATC En, In, Par, N, Out
format
Parameter Parameter define Input Output Declare
Enable
En √
In Input √
MATC: occupy
MATC instruction compare In input and N data start from Par ,if In equal to one of
[Instruction example]
[Program description]
In
struction format and parameter specification
Program
Language LD FBD IL
example
16. 32 bit
ABSC En, In, Par, N, Out
Instruction
D.ABSC En, In, Par, N, Out
format
Enable
En √
In Input √
ABSC: occupy 2N c
1-
Number of compare
N √
segments
64
1. ABSC instruction region compare In input N segment data start from Par
2. To the segment which lower limit ≤ upper limit , if lower limit≤In≤ upper limit,
Number of
Par component Out component
Number compare
meaning meaning
segments N
[Instruction example]
40
V1000 1 segment lower limit
100
V1001 1 segment upper limit
V1002 120
2 segment lower limit
210
V1003 2 segment upper limit
140
V1004 3 segment lower limit
60
V1005 3 segment upper limit
[Program description]
In
Program
Language LD FBD IL
example
Instruction
BON En, In, N, Out
format
Enable
En
Parameter Parameter define Input Output Declare
In Input √
BON instruction use to determine the bit of the register whether or not 1,result
output to Out.
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
16. 32 bit
BONC En, In, Out
Instruction
D.BONC En, In, Out
format
Enable
En √
In Input √
Enable
Eno √
output
Out Output √
BONC instruction get the number which the bit is 1 of the register, result output to
Out.
[Instruction example]
[Program description]
MAX. D.MAX(Maximum)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
16. 32 bit
MAX En, Par, N, Out
Instruction
D.MAX En, Par, N, Out
format
Enable
En √
MAX instruction compare N data start from Par ,maximum output to Out.
[Instruction example]
[Program description]
MIN. D.MIN(Minimum)
In
Program
Language LD FBD IL
example
16. 32 bit
MIN En, Par, N, Out
Instruction
D.MIN En, Par, N, Out
format
Enable
En √
MIN instruction compare N data start from Par ,minimum output to Out.
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
16. 32 bit
SEL En, G, In1, In2, Out
Instruction
D.SEL En, G, In1, In2, Out
format
Enable
En √
G selection condition √
Parameter Parameter define Input Output Declare
[Instruction example]
[Program description]
MUX. D.MUX(Multi-choice)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
16. 32 bit
MUX En, K, Par, N, Out
Instruction
D.MUX En, K, Par, N, Out
format
Enable
En √
K Select channel √
MUX instruction select one of data according to the value of select channel
K(K=0~N-1) from N address continuous register output to Out (multi select one).
[Program description]
Shift instruction
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
FILL Fill √ √ √
In
Instruction
LBST En, In, Out
format
Enable
En √
In Input √
LBST use for specified assignment to the low byte of output register Out , high
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
HBST En, In, Out
format
Enable
En √
In Input √
HBST use for specified assignment to the high byte of output register Out , low
[Instruction example]
[Program description]
MOV. D.MOV(Move)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
16. 32 bit
MOV En, In, Out
Instruction
D.MOV En, In, Out
format
Enable
En √
In Input √
Out DataOutput √
Move instruction MOV also call assign instruction, use for assign the specified
[Instruction example]
[Program description]
Assign the initial value will the program first scan cycle,V0=80,V10V11=-50.
BMOV(Block move)
In
struction format and parameter specification
Program
Language LD FBD IL
example
Instruction
BMOV En, Sou, N, Des
format
Enable
En √
[Instruction example]
[Program description]
Sou
component Initial Move result
value
30
V1000 V0=30
-
V1001 150 V1=-150
V1002 25
V2=25
8
V1003 V3=8
95
V1004 V4=95
-
V1005 20 V5=-20
X0 ON
Y2=ON
OFF
X1 Y3=OFF
ON
X2 Y4=ON
ON
X3 Y5=ON
OFF
X4 Y6=OFF
FILL(Fill)
In
Instruction
FILL En, In, N, Des
format
Enable
En √
In Data to fill √
Fill instruction FILL use for fill the In value into Des start N component.Can use for
[Instruction example]
[Program description]
M100~M105 to ON.
In
Program
Language LD FBD IL
example
Enable
En √
1. 16 bit instruction XCH is byte swap , use for start from Sou N registers swap the
2. 32 bit instruction D.XCH is register swap ,use for start from Sou N register
component each border upon 2 register swap, if N is odd then the last one
3. XCH
[Instruction example]
[Program description]
When M0=ON, Swap high low byte of V1000. V1001 these 2 registers ,swap
30
V1000 (0x001E) V1000=7680 (0x1E00)
-
V1001 150 (0xFF6A) V1001=27391(0x6AFF)
V1002 25
V1002=8
8
V1003 V1003=25
95
V1004 V1004=-20
-
V1005 20 V1005=95
BXCH(Block swap)
In
Program
Language LD FBD IL
example
Instruction
BXCH En, Sou1, Sou2, N
format
Enable
En √
1. Block swap instruction BXCH use for start from Sou1 N components and start
2. BXCH
[Instruction example]
[Program description]
register.
c Sw
Initial value
omponent ap result
30
V1000 V1000=8
-
V1001 150 V1001=95
V1002 25 V1002=-20
8
V1003 V1003=30
95
V1004 V1004=-150
-
V1005 20 V1005=25
In
Program
Language LD FBD IL
example
Instruction
SHL En, In, Sou, N, Num, Out
format
En Enable √
1. According to Num a group,SHL instruction use start from Sou N components left
shift Num bit, shift start from In Num components ,shift out start from Out Num
components.As follows:
2. If Sou is register component, then use start from Sou N registers left shift
[Instruction example]
[Program description]
1. When M0=ON, M100~M105 left shift 3 bit, shift in X0~X2,shift out put Y0~Y2.
Sou c Initial Left shift result
value
omponent
O
M100 M100=OFF
N
M103 ON M103=ON
ON
M104 M104=OFF
ON
X1
X2 ON
Y0 Y0=ON
Y1 Y1=ON
Y2 Y2=OFF
M200~M202.
Sou c
Initial value Left shift result
omponent
ON
X1
X2 ON
M200 M200=ON
M201 M201=ON
M202 M202=ON
In
struction format and parameter specification
Program
Language LD FBD IL
example
Instruction
SHR En, In, Sou, N, Num, Out
format
En Enable √
Source start
Sou √ Occupy N continuous component
component
1. According to Num a group ,SHR instruction use start from Sou N components
right shift Num bit, shift start from In Num components ,shift out start from Out
[Instruction example]
[Program description]
O
M100 M100=ON
N
M103 ON M103=OFF
M104 ON M104=ON
ON
X1
X2 ON
Y0 Y0=ON
Y1 Y1=OFF
Y2 Y2=OFF
在M200~M202.
Sou c
Initial value Right shift result
omponent
ON
X1
X2 ON
M200 M200=OFF
M201 M201=ON
M202 M202=ON
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
WSHL En, In, Sou, N, Num, Out
format
En Enable √
1. WSHL instruction use start from Sou N components left shift Num word, shift
start from In Num components ,shift out start from Out Num components.As
follows:
2. 1≤Num≤N, no then instruction not execute.
[Instruction example]
[Program description]
V100~V102.
Sou c Le
Initial
omponent value ft shift result
V1000 30 V1000=100
V1001 -150 V1001=200
V1002 25
V1002=300
V1003 8 V1003=30
95
V1004 V1004=-150
200
V1
V2 300
V100 V100=8
V101 V101=95
V102 V102=-20
WSHR(Word right shift)
In
Program
Language LD FBD IL
example
Instruction
WSHR En, In, Sou, N, Num, Out
format
En Enable √
1. WSHR instruction use start from Sou N components right shift Num word, shift
start from In Num components ,shift out start from Out Num components.As
follows:
2. 1≤Num≤N, no then instruction not execute.
[Instruction example]
[Program description]
V1000 30 V1000=8
V1001 -150 V1001=95
V1002 25
V1002=-20
V1003 8 V1003=100
95
V1004 V1004=200
200
V1
V2 300
V100 V100=30
V101 V101=-150
V102 V102=25
ROL(Bit rotate left shift)
In
Program
Language LD FBD IL
example
Instruction
ROL En, Sou, N, Num, Out
format
En Enable √
1. According to Num a group ,ROL instruction use start from Sou N components
left shift Num bit, shift start from Sou Num components ,shift out start from Out
bitwise .
[Instruction example]
[Program description]
1. When M0=ON, M100~M105 rotate left shift 3 bits, shift out to Y0~Y2.
Sou c Le
Initial
omponent value ft shift result
O
M100 M100=ON
N
M103 ON M103=ON
ON
M104 M104=OFF
M105 OFF M105=ON
Y0 Y0=ON
Y1 Y1=ON
Y2 Y2=OFF
2. When M1=ON, V1000~V1005 rotate left shift 3 bits, shift out to M200~M202.
Sou c
Initial value
omponent Left shift result
In
Program
Language LD FBD IL
example
Instruction
ROR En, Sou, N, Num, Out
format
En Enable √
1. According to Num a group ,ROR instruction use start from Sou N components
right shift Num bit, shift start from Sou Num components ,shift out start from Out
2. If Sou are register component, then use start from Sou N registers right shift
bitwise .
[Instruction example]
[Program description]
1. When M0=ON, M100~M105 rotate right shift 3 bits , shift out to Y0~Y2.
Sou c Ri
Initial
omponent value ght shift result
O
M100 M100=ON
N
M103 ON M103=ON
ON
M104 M104=OFF
2. When M1=ON, V1000~V1005 rotate right shift 3 bits, shift out to M200~M202.
Sou c
Initial value
omponent Right shift result
M201 M201=ON
M202 M202=ON
In
Program
Language LD FBD IL
example
Instruction
WROL En, Sou, N, Num, Out
format
En Enable √
1. WROL instruction use start from Sou N components left shift Num word, shift
start from Sou Num components ,shift out start from Out Num components.As
follows:
2. 1≤Num≤N, no then instruction not execute .
[Instruction example]
[Program description]
V1000 30 V1000=8
V1001 -150 V1001=95
V1002 25
V1002=-20
V1003 8 V1003=30
95
V1004 V1004=-150
In
Instruction
WROR En, Sou, N, Num, Out
format
En Enable √
1. WROR instruction use start from Sou N components right shift Num word, shift
start from Sou Num components ,shift out start from Out Num components.As
follows:
[Instruction example]
[Program description]
V1000 30 V1000=8
V1001 -150 V1001=95
V1002 25
V1002=-20
V1003 8 V1003=30
95
V1004 V1004=-150
In
Program
Language LD FBD IL
example
Instruction
BSHL En, In, Sou, N, Num, Out
format
Parameter Parameter define Input Output Declare
En Enable √
1. BSHL instruction use start from Sou N components left shift Num byte, shift in
start from In Num bytes, shift out to start from Out Num bytes.As follows:
[Instruction example]
[Program description]
When M0=ON,V1000~V1005 left shift 3 bytes, shift in V0 and V1 low byte, shift out
22136
V1 (0x5678)
V100 V100=8(0xEC00)
V101 V101=95(0x00FF)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
BSHR En, In, Sou, N, Num, Out
format
En Enable √
1. BSHR instruction use start from Sou N components right shift Num byte, shift in
start from In Num bytes, shift out to start from Out Num bytes.As follows:
2. 1≤Num≤2*N, no then instruction not execute.
[Instruction example]
[Program description]
When M0=ON,V1000~V1005 right shift 3 bytes, shift in V0 and V1 low byte, shift
V1 22136
(0x5678)
V100 V100=8(0x001E)
V101 V101=95(0x006A)
ATBL(Append to array)
In
Program
Language LD FBD IL
example
Instruction
ATBL En, In, Tbl, N
format
En Enable √
In Input data √
1. Append to array instruction ATBL will append bit state or register value to the
2. En is instruction Enable item, general use edge type (rising edge or failling
3. Tbl define store data array start component ,N is array length , among the first
register (Tbl)of the array be the numbers of the array element ,Tbl+1 to Tbl+N
total N registers use for store array data.so, if In is bit component ,the maximum
array element can be stored are N*16; If In is regieter ,the maximum array
element can be stored are N. When number of array element exceed the
maximum value of array elements , data con not append into the array .
A. Bit component data: if append to array is bit, store queue of the array as
follows:
Array
Array content
component
Number of
Tbl array
element
First array
b0
element
Second array
b1
Tbl+1 element
......
Sixteen array
b15
element
Tbl+2 seventeen
b0 array
element
eighteen array
b1
element
...... ......
b0 ......
......
...... ......
Array
Array content
component
Number of
Tbl array
element
First array
Tbl+1
element
Second array
Tbl+2
element
Third array
Tbl+3
element
...... ......
[Instruction example]
[Program description]
2. SM5 is clock pulse per second , cycles per second, INC instruction V200 add
1(for simulated data),ATBL instruction append V200 into the array start from V500
3. After 30s ,T0=OFF, per second FIFO instruction will be first in first out get data
In
Program
Language LD FBD IL
example
Instruction
FIFO En, Tbl, Out
format
Parameter Parameter define Input Output Declare
En Enable √
1. FIFO instruction according to first in first out model get out data from array
[Instruction example]
In
Program
Language LD FBD IL
example
Instruction
LIFO En, Tbl, Out
format
En Enable √
1. LIFO instruction according to last in first out model get out data from array ATBL
[Instruction example]
[Program description]
1. First scan SM2=ON, start T0 timer(30s).
2. SM5 clock pulse per second , cycles per second, INC instruction V200 add 1(for
simulated data), ATBL instruction append V200 into the array start from V500 ,
3. After 30s,T0=OFF, per second LIFO instruction get out data from array
SORT(Data sort)
In
Program
Language LD FBD IL
example
Instruction
SORT En, UpDown, Sou, Row, Col, Index, Out
format
Enable
En √
Ascending or descending √
UpDown
order control
1. The data from start Sou Row row Col line total Row×Col elements will be sorted
,sort refer to Index specified line ,sort direction controlled by UpDown, UpDown is
OFF then ascending sort , UpDown is ON then descending sort, data be sorted
2. SORT instruction be executed edge ,if modified the Sou data after sorted, then
must be retrigger.
[Instruction example]
[Program description]
Name
Chinese Math English
If M100=OFF, when M0=ON, start from V1000 5 row 3 line array ,according to line
2(mathematic performance) use ascending sort , result store into start from V0 5x3
elements.
Name
Chinese Math English
If M100=ON, when M0=ON,start from V1000 5 row 3 line array ,according to line
2(mathematic performance) use descending sort , result store into start from V0
5x3 elements.
Name
Chinese Math English
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
ENCO Encoder √ √ √
DECO Decoder √ √ √
ENCO(Encoder)
In
Program
Language LD FBD IL
example
Instruction
ENCO En, Sou, N, Out
format
En Enable √
Encode
Out √
output
1. ENCO instruction use for obtain the position of the maximum ON bit in Sou data .
If the source data have many bits are 1(ON), then only deal with the highest bit
[Instruction example]
[Program description]
V0=7.
2. M0=ON,V100 low 8 bits (2^3=8,high 8 bits not use ) proceed encode ,if
DECO(Decoder)
In
Program
Language LD FBD IL
example
Instruction
DECO En, In, N, Out
format
En Enable √
Parameter Parameter define Input Output Declare
In Decode input √
Decode o
Out √
utput
[Instruction example]
[Program description]
bits total are 0). If V0=7, then among Y0~Y7 only Y6=ON others
OFF,V100=64(00000000 01000000).
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
BTOW En, Sou, N, Out
format
Enable
En √
Out Output √
BTOW instruction convert N bit components start from Sou, convert to integer result
output toOut.
[Instruction example]
[Program description]
When M0=ON,X0~X5 convert to integer ,if X1=ON. X2=ON. X5=ON others are
In
struction format and parameter specification
Program
Language LD FBD IL
example
Instruction
WTOB En, In, N, Out
format
Enable
En √
In Input √
[Instruction example]
[Program description]
Program
Language LD FBD IL
example
16. 8 bit
HEX En, Sou, N, Out
Instruction
HEX.LB En, Sou, N, Out
format
En Enable √
Number of characters √
N 1~256
converted
1. HEX instruction convert start from Sou ASCII code to HEX value, number of N
2. 8 bit model instruction HEX.LB only convert low byte of Sou , high byte not use .
[Instruction example]
[Program description]
When M0=ON, start from V1000 ASCII code convert to data ,HEX convert result to
components start form V0 ,HEX.LB only convert to low byte ASCII code of V1000 ,
HEX
N HEX.LB
V1 V0 V11 V10
1 0x8 0x8
2 0x89 0x8A
3 0x89A 0x8A4
4 0x89AB 0x8A42
5 0x8 0x9AB4 0x8 0xA42E
6 0x89 0xAB45 0x8A 0x42E9
7 0x89A 0xB452 0x8A4 0x2E91
8 0x89AB 0x4523 0x8A42 0xE91C
ASCI. ASCI.LB(Hexadecimal convert to ASCII)
In
Program
Language LD FBD IL
example
16. 8 bit
ASCI En, Sou, N, Out
Instruction
ASCI.LB En, Sou, N, Out
format
En Enable √
number of character be √
N 1~256
converted
1. ASCI instruction convert start from Sou value to ASCII code character , number of
N characters will be converted, convert result stored to start from Out component .
2. 8 bit model instruction ASCI.LB only store convert low byte to low byte of Out
,hight byte is 0.
[Instruction example]
[Program description]
V1100 0x4523
V1101 0x89AB
When M1=ON,ASCI instruction convert the value of start from V1100 to ASCII code,
result to start from V100 component,ASCI.LB instruction put the result to start from
V2000 components (Only low byte, hight byte is0),N=1~8 convert ed result as follows
.
In
Out c
struction N
omponent 1 2 3 4 5 6 7 8
format
Low byte "3" "2" "5" "4" "B" "A" "9" "8"
V100
Hight byte "3" "2" "5" "4" "B" "A" "9"
Low byte "3" "2" "5" "4" "B" "A"
V101
Hight byte "3" "2" "5" "4" "B"
ASCI
Low byte "3" "2" "5" "4"
V102
Hight byte "3" "2" "5"
Low byte "3" "2"
V103
Hight byte "3"
V200 Low byte "3" "2" "5" "4" "B" "A" "9" "8"
V201 Low byte "3" "2" "5" "4" "B" "A" "9"
V202 Low byte "3" "2" "5" "4" "B" "A"
V203 Low byte "3" "2" "5" "4" "B"
ASCI.LB V204 Low byte "3" "2" "5" "4"
V205 Low byte "3" "2" "5"
V206 Low byte "3" "2"
V207 Low byte "3"
Program
Language LD FBD IL
example
Instruction
BUNB En, Table, Des
format
En Enable √
BUNB instruction use for combination the discrete bit which Table define to continuous
bit components .
Discrete bit table: may be called by BUNB. BUNW. BDIB. WDIB instruction Table item.
how to define the discrete bit table please refer to " instruction use table" section.
[Instruction example]
[Program description]
When M0=ON,BUNB instruction combine the "read discrete bit table" defined bit to
1 M500 = X3
2 M501 = M10
3 M502 = M301
4 M503 = S21
5 M504 = M77
6 M505 = M100
7 M506 = X1
8 M507 = Y6
In
Program
Language LD FBD IL
example
Instruction
BUNW En, Table, Des
format
En Enable √
BUNW instruction use for combination the discrete bit which Table define to
Discrete bit table:May be called by BUNB. BUNW. BDIB. WDIB instruction Table item.
How to define the discrete bit table please refer to " instruction use table" section.
[Instruction example]
[Program description]
1 X3
2 M10
3 M301
4 S21
5 M77
6 M100
7 X1
8 Y6
When M1=ON,BUNW instruction combination bitwise "read discrete bit table" defined
1 V0.b0 = X3
2 V0.b1 = M10
3 V0.b2 = M301
4 V0.b3 = S21
5 V0.b4 = M77
6 V0.b5 = M100
7 V0.b6 = X1
8 V0.b7 = Y6
In
struction format and parameter specification
Program
Language LD FBD IL
example
Instruction
WUNW En, Table, Des
format
En Enable √
WUNW instruction use for combination the discrete register which Table define to
item. How to define discrete register component table please refer to " instruction use
[Instruction example]
[Program description]
1 AI1
2 V10
3 V106
4 AQ0
When M0=ON, WUNW instruction combination move the "read discrete register table "
1 V200 = AI1
2 V201 = V10
3 V202 = V106
4 V203 = AQ0
In
Program
Language LD FBD IL
example
Instruction
BDIB En, Sou, Table
format
En Enable √
BDIB instruction use for disperse the bit components start from Sou to discrete bit
How to define the discrete bit table please refer to " instruction use table" section.
[Instruction example]
[Program description]
1 Y4
2 M10
3 M301
4 S21
5 M77
6 M100
7 Y0
8 Y6
When M0=ON,BDIB instruction combination move the start from M500 continuous bit
1 Y4 = M500
2 M10 = M501
3 M301 = M502
4 S21= M503
5 M77= M504
6 M100 = M505
7 Y0 = M506
8 Y6 = M507
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
WDIB En, Sou, Table
format
En Enable √
WDIB instruction use for disperse the bit components start bitwise from Sou register to
Discrete bit table: may be called by BUNB. BUNW. BDIB. WDIB instruction Table item.
How to define the discrete bit table please refer to " instruction use table" section.
[Instruction example]
[Program description]
1 Y4
2 M10
3 M301
4 S21
5 M77
6 M100
7 Y0
8 Y6
When M1=ON, WDIB instruction discrete bitwise the start from V0 register to "write
1 Y4 = V0.b0
2 M10 = V0.b1
3 M301 = V0.b2
4 S21= V0.b3
5 M77= V0.b4
6 M100 = V0.b5
7 Y0 = V0.b6
8 Y6 = V0.b7
In
Program
Language LD FBD IL
example
Instruction
WDIW En, Sou, Table
format
En Enable √
Discrete register component table: may be called by WUNW. WDIW instruction Table
item. How to defined discrete register component table please refer to " instruction
[Instruction example]
[Program description]
1 V90
2 V10
3 V106
4 AQ0
When M0=ON, WDIW instruction discrete the register start from V200 to "read discrete
1 V90 = V200
2 V10 = V201
3 V106 = V202
4 AQ0 = V203
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
16,32 bit
BCD En, In, Out
Instruction
D.BCD En, In, Out
format
En Enable √
In Input √
Out Output √
1. BCD instruction (D.BCD is 32 bit instruction) use for convert the value to BCD code.
2. 16 bit instruction value input range is 0~9999,32 bit instruction value input range is
[Instruction example]
[Program description]
When M0=ON,BCD instruction convert V1000 value to BCD code result to V0,D.BCD
In
Program
Language LD FBD IL
example
16. 32 bit
BIN En, In, Out
Instruction
D.BIN En, In, Out
format
En Enable √
In Input √
Out Output √
1. BIN instruction (D.BIN is 32 bit instruction) use for convert BCD code to value.
2. BCD code (Binary-coded Decimal) also name binary code decimal numbers. binary-
decimal code or 8421 code, that is expand the decimal number to binary number
according to 8421 model .BCD code is four digit binary code, that is convert decimal
number to binary number , but different from the general convert , each decimal
express is 00010000, that is BCD code come across 1001 generate carry bit , unlike
[Instruction example]
[Program description]
When M1=ON,BIN instruction convert the BCD code of V1100 to value result to
In
Program
Language LD FBD IL
example
Instruction
ITOL En, In, Out
format
En Enable √
Parameter Parameter define Input Output Declare
In Input √
ITOL instruction use for convert 16 bit integer to 32 bit long integer .
[Instruction example]
[Program description]
When M0=ON,ITOL instruction convert V1000 to long integer result to V0V1, convert
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
GRAY En, In, N, Out
format
En Enable √
[Instruction example]
[Program description]
When M0=ON, convert the low 7 bits of V0 to gray code output to Y0~Y6,convert
O
M10
N
M11 OFF
M12 OFF
V10=21
M13 ON
ON
M14
M15 OFF
M16 OFF
In
Program
Language LD FBD IL
example
Instruction
GBIN En, In, N, Out
format
En Enable √
[Instruction example]
[Program description]
When M1=ON, convert Y0~Y6 gray code to value output to V20, convert the gray code
O
Y0
N
Y1 OFF
Y2
ON V20=25
Y3 OFF
ON
Y4
Y5 OFF
Y6 OFF
M100=ON
M101=OFF
M102=OFF
V10 21 M103=ON
M104=ON
M105=OFF
M106=OFF
Character instruction
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
In
Program
Language LD FBD IL
example
Instruction
GHLB En, Sou, N, Out
format
En Enable √
GHLB instruction separate the high low byte of start from Sou N registers low byte
output to Out.
[Instruction example]
[Program description]
V0 0x1E
V1000 0x001E
V1 0x00
V2 0x6A
V1001 0xFF6A
V3 0xFF
0x0E19 V4 0x19
V1002
V5 0x0E
V6 0x08
V1003 0x1208
V7 0x12
V8 0x5F
V1004 0x0D5F
V9 0x0D
In
struction format and parameter specification
Program
Language LD FBD IL
example
Instruction
GETB En, Sou, Start, N, Out
format
En Enable √
GETB instruction capture N bytes from start byte of the byte string start from Sou.
[Instruction example]
[Program description]
When M0=ON, capture 7 bytes from second byte of the byte string start from V1000
,output to V0~V3.
Sou c Value Output Output result
omponent component
In
Program
Language LD FBD IL
example
16. 8 bit
BCMP En, In1, In2, N, Out
Instruction
BCMP.LB En, In1, In2, N, Out
format
En Enable √
BCMP instruction compare the byte string of In1 and In2,compare n bytes, if equal to
then Out=ON, no then Out=OFF. BCMP.LB is low byte model, only compare low byte
part.
[Instruction example]
[Program description]
When M0=ON, compare byte string V1000~V1004 and byte string V1010~V1014
In
Program
Language LD FBD IL
example
16. 32 bit
ITOC En, In, Out
Instruction
D.ITOC En, In, Out
format
En Enable √
Parameter Parameter define Input Output Declare
In Input √
ITOC instruction use for integer convert to character ,D.ITOC use for long integer
express12 characters, if convert result not enough 12 characters then the behind
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
CTOI En, Sou, N, Out
format
En Enable √
1. CTOI use for convert N character start Sou to long integer , if convert result exceed
long integer range then not convert moreover Eno is 0(OFF),Out maintain original not
changed .
2. N is will be converted character number, valid range 1~11,if exceed range then not
replace space to ahead , lop back .For example: character '123'. '123dfg'. 'A123'
[Instruction example]
[Program description]
follows table .
In c
In
Program
Language LD FBD IL
example
Instruction
FTOC En, In, Out
format
En Enable √
FTOC instruction use for floating point convert to character.Output automatic occupy 6
continuous register ,total can express12 character, if convert result not enough 12
[Instruction example]
[Program description]
When M0=ON,FTOC use for convert floating point V1000V1001 to character output to
table .
In c
In
Program
Language LD FBD IL
example
Instruction
CTOF En, Sou, N, Out
format
En Enable √
1. CTOF convert N characters start from Sou to floating point, if convert result exceed
floating point range then not convert moreover Eno is 0(OFF),Out maintain original
not changed .
2. N is number of character be converted, valid range 1~11, if exceed range then not
character), eplace space to ahead , lop back .For example: character '1.23'. '1.23dfg'.
[Instruction example]
[Program description]
follows table .
In c Initial value convert result
omponent
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
WNOT. D.WNOT(Negation)
In
Program
Language LD FBD IL
example
16. 32 bit
WNOT En, In, Out
Instruction
D.WNOT En, In, Out
format
En Enable √
In Input √
Out Output √
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
16. 32 bit
WAND En, In1, In2, Out
Instruction
D.WAND En, In1, In2, Out
format
En Enable √
In1 Input1 √
In2 Input2 √
Out Output √
WAND instruction use for In1. In2 bitwise logical AND operation output.
[Instruction example]
In
Program
Language LD FBD IL
example
16. 32 bit
WOR En, In1, In2, Out
Instruction
D.WOR En, In1, In2, Out
format
En Enable √
In1 Input1 √
Parameter Parameter define Input Output Declare
In2 Input2 √
Out Output √
WOR instruction use for In1. In2 bitwise logical OR operation output.
[Instruction example]
In
Program
Language LD FBD IL
example
16. 32 bit
WXOR En, In1, In2, Out
Instruction
D.WXOR En, In1, In2, Out
format
En Enable √
In1 Input1 √
In2 Input2 √
Out Output √
WXOR instruction use for In1. In2 bitwise logical XOR operation output.
[Instruction example]
ADD. D.ADD(Addition)
In
Program
Language LD FBD IL
example
16. 32 bit
ADD En, In1, In2, Out
Instruction
D.ADD En, In1, In2, Out
format
En Enable √
In1 Augend √
In2 Addend √
Out Output √
[Program description]
V1000+V1002;V2V3=V1000V1001-V1002V1003;V4V5=V1000*
SUB. D.SUB(Subtraction)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
16. 32 bit
SUB En, In1, In2, Out
Instruction
D.SUB En, In1, In2, Out
format
En Enable √
In1 Minuend √
In2 Subtracter √
Out Output √
[Instruction example]
INC. D.INC(Increase 1)
In
Program
Language LD FBD IL
example
16. 32 bit
INC En, In
Instruction
D.INC En, In
format
Parameter Parameter define Input Output Declare
En Enable √
In Augend √
[Instruction example]
[Program description]
DEC. D.DEC(Decrease 1)
In
Program
Language LD FBD IL
example
16. 32 bit
DEC En, In
Instruction
D.DEC En, In
format
En Enable √
In Minuend √
[Instruction example]
[Program description]
MUL. D.MUL(Multiplication)
In
Program
Language LD FBD IL
example
16. 32 bit
MUL En, In1, In2, Out
Instruction
D.MUL En, In1, In2, Out
format
En Enable √
In1 Multiplicand √
In2 Multiplier √
MUL instruction use for In1 multiply by In2 output to out. Out+1,32 bit instruction
D.MUL use for (In1. In1+1) multiply by (In2. In2+1),arithmetic result output to (Out.
[Instruction example]
DIV. D.DIV(Division)
In
Program
Language LD FBD IL
example
16. 32 bit
DIV En, In1, In2, Out
Instruction
D.DIV En, In1, In2, Out
format
En Enable √
Parameter Parameter define Input Output Declare
In1 Dividend √
In2 Divisor √
1. 16 bit instruction (DIV), use for In1 divide In2,arithmetic result quotient store to
2. 32 bit instruction (D.DIV), use for (In1. In1+1) divide (In2. In2+1),arithmetic
[Instruction example]
ACCU. D.ACCU(Accumulation)
In
Program
Language LD FBD IL
example
16. 32 bit
ACCU En, Sou, N, Out
Instruction
D.ACCU En, Sou, N, Out
format
En Enable √
Parameter Parameter define Input Output Declare
1. ACCU instruction use for accumulation sum of N 16 bit integer start from Sou
2. D.ACCU instruction use for accumulation sum of N 32 bit integer (216 bit
register)start from Sou , arithmetic result store to out. Out+1. Out+2. Out+3.
[Instruction example]
[Program description]
V1000 2702
V1001 16827
V0V1 =17839
V1002 -186
V1003 -1504
AVG. D.AVG(Average)
In
16. 32 bit
AVG En, Sou, N, Out
Instruction
D.AVG En, Sou, N, Out
format
En Enable √
1. AVG instruction use for get average value N 16 bit integer start from Sou
2. D.AVG instruction use for get average value N 32 bit integer (two 16 bit register
)start from Sou, arithmetic result store to out. Out+1, remainder store to Out+2.
Out+3.
[Instruction example]
[Program description]
omponent
V1000 2702
V1001 16827
V0=4459, remainder V1=3
V1002 -186
V1003 -1504
In
Program
Language LD FBD IL
example
16. 32 bit
ABS En, In
Instruction
D.ABS En, In
format
En Enable √
In Input √
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
16. 32 bit
NEG En, In, Out
Instruction
D.NEG En, In, Out
format
En Enable √
In Input √
Out Output √
[Instruction example]
[Program description]
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
FSIN Sine √ √ √
FCOS Cosine √ √ √
FTAN Tangent √ √ √
FASIN Arcsine √ √ √
FATAN Arctangent √ √ √
FXY Exponent √ √ √
PLC floating point use IEEE754 standard, use 32 bit express floating point (occupy 2
registers), value range is ±2-126 to ±2+128 also as ±1.1755e-38 to
±3.4028e+38,format as follows:
In
Program
Language LD FBD IL
example
Instruction
FCMP En, In1, In2, Out
format
En Enable √
Parameter Parameter define Input Output Declare
In1 Input1 √
In2 Input2 √
these 3 result.
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
Instruction
FZCP En, In, Up, Down, Out
format
Parameter Parameter define Input Output Declare
En Enable √
In Input √
1. FZCP is floating point regional comparison instruction, at the same time output
>. =. < these 3 result.
2. If region upper limit< region lower limit, then instruction automatic swap they .
[Instruction example]
[Program description]
In
Instruction
FMOV En, In, Out
format
En Enable √
In Input √
Out Output √
Floating point move instruction FMOV also name floating point valuation
[Instruction example]
[Program description]
In
Instruction
FADD En, In1, In2, Out
format
En Enable √
In1 Augend √
In2 Addend √
Out Output √
FADD instruction use for floating point In1 add floating point In2 output to out.
[Instruction example]
[Program description]
When M0=ON,excete as follows floating point arithmetic,V0V1=
V1000V1001+V1002V1003;V2V3=V1000V1001-
V1002V1003;V4V5=V1000V1001* V1002V1003;V6V7=V1000V1001\
V0V1 =-963.7429
V1000V1001 23.38015
V2V3 =1010.503
V4V5 =-23079.09
V1002V1003 -987.123
V6V7 =-0.02368515
In
Program
Language LD FBD IL
example
Instruction
FSUB En, In1, In2, Out
format
En Enable √
In1 Minuend √
In2 Subtrahend √
Out Output √
[Instruction function and effect declare]
FSUB instruction use for floating point In1 subtracte floating point In2 output to
out.
[Instruction example]
In
Program
Language LD FBD IL
example
Instruction
FMUL En, In1, In2, Out
format
En Enable √
In1 Multiplicand √
In2 Multiplier √
Out Output √
FMUL instruction use for floating point In1 multiply by floating point In2 output to
out.
[Instruction example]
In
Program
Language LD FBD IL
example
Instruction
FDIV En, In1, In2, Out
format
En Enable √
In1 Dividend √
In2 Divisor √
Out Output √
FDIV instruction use for floating point In1 divide floating point In2 output to out.
[Instruction example]
FACCU(Accumulation)
In
Program
Language LD FBD IL
example
Instruction
FACCU En, Sou, N, Out
format
En Enable √
Out Output √
FACCU instruction use for accumulation sum of N floating point start from Sou
[Instruction example]
[Program description]
follows table .
c Initial value Arithmetic result
omponent
V1000V1001 198.012
V1002V1003 23.781
V0V1 =316.4277
V1004V1005 -3.714
V1006V1007 98.3487
FAVG(Average)
In
Program
Language LD FBD IL
example
Instruction
FAVG En, Sou, N, Out
format
En Enable √
Out Output √
FAVG instruction use for get floating point average value N floating point start from
[Instruction example]
[Program description]
When M0=ON,V0V1=
V1000V1001 198.012
V1002V1003 23.781
V0V1=79.10693
V1004V1005 -3.714
V1006V1007 98.3487
In
Program
Language LD FBD IL
example
Instruction
FMAX En, Sou, N, Out
format
Enable
En √
FMAX instruction compare N floating point data start from Sou ,maximum output
to Out.
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
Instruction
FMIN En, Sou, N, Out
format
Enable
En √
FMIN instruction compare N floating point data start from Sou ,minimum output to
Out.
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
FTOI En, In, Out
format
En Enable √
In Input √
Out Output √
[Instruction example]
[Program description]
In
16. 32 bit
ITOF En, In, Out
Instruction
D.ITOF En, In, Out
format
En Enable √
In Input √
Out Output √
[Instruction example]
[Program description]
When M0=ON, ITOF instruction convert V1000 to floating point result store to
V0V1, convert V1000V1001 to floating point result store to V2V3,as follows table
.
In c
In
Program
Language LD FBD IL
example
Instruction
FABS En, In
format
En Enable √
In Input √
FABS instruction get floating point In absolute value result again store to In.
[Instruction example]
[Program description]
When M0=ON, get floating point V1000V1001 absolute value, as follows table .
c
Program
Language LD FBD IL
example
Instruction
FSQR En, In, Out
format
En Enable √
In Input √
Out Output √
[Instruction example]
[Program description]
When M0=ON, get floating point V1000V1001 square root,as follows table .
c
FSIN(Sine)
In
Program
Language LD FBD IL
example
Instruction
FSIN En, Angle, Out
format
En Enable √
Angle Angle √
Out Output √
[Instruction example]
[Program description]
When M0=ON, get sine of floating point V1000V1001, cosine of floating point
FCOS(Cosine)
In
Program
Language LD FBD IL
example
Instruction
FCOS En, Angle, Out
format
En Enable √
A
Angle √
ngle
Out Output √
[Instruction example]
In
Program
Language LD FBD IL
example
Instruction
FTAN En, Angle, Out
format
En Enable √
A
Angle √
ngle
Out Output √
[Instruction example]
FASIN(Arcsine)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
FASIN En, In, Out
format
En Enable √
FASIN instruction get arcsine of In .InInput range :-1 ~ 1 among, if In exceed range
[Instruction example]
[Program description]
When M0=ON, get arcsine floating point V1000V1001 , arc cosine of floating point
omponent
V1000V1001 0.8912 Arcsine V0V1=1.099984
V1002V1003 -0.3409 Arccosine V2V3=1.91867
V1004V1005 23.0912 Arctangent V4V5=1.527517
FACOS(Arc cosine)
In
Program
Language LD FBD IL
example
Instruction
FACOS En, In, Out
format
En Enable √
FACOS instruction get arc cosine of In .InInput range :-1 ~ 1 among , if In exceed
[Instruction example]
FATAN(Arctangent)
In
Instruction
FATAN En, In, Out
format
En Enable √
In Input √
[Instruction example]
FLN(Natural logarithm)
In
Program
Language LD FBD IL
example
Instruction
FLN En, In, Out
format
En Enable √
Parameter Parameter define Input Output Declare
In Input √
Out Output √
FLN instruction get natural logarithm of In .InInput must greater than 0, no then
[Instruction example]
[Program description]
When M0=ON, get natural logarithm of floating point V1000V1001, the base-10
In
struction format and parameter specification
Program
Language LD FBD IL
example
Instruction
FLOG En, In, Out
format
En Enable √
In Input √
Out Output √
FLOG instruction get the base-10 logarithm of In. In Input must greater than 0, no
[Instruction example]
FEXP(Nature exponential)
In
Program
Language LD FBD IL
example
Instruction
FEXP En, In, Out
format
Parameter Parameter define Input Output Declare
En Enable √
In Input √
Out Output √
FEXP instruction get n ature exponential of In. In Input must less than 88.72284,
[Instruction example]
In
Program
Language LD FBD IL
example
Instruction
FRAD En, Angle, Out
format
En Enable √
Angle Angle √
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
Instruction
FDEG En, In, Angle
format
En Enable √
Input
In √
radian
A
Angle √
ngle
[Instruction example]
FXY(Exponent )
In
Program
Language LD FBD IL
example
Instruction
FXY En, X, Y, Out
format
En Enable √
X Base number √
Parameter Parameter define Input Output Declare
Y Exponent √
Out Output √
FXY instruction get X^Y value. If X=0 moreover Y≤0 or X<0 moreover Y magnitude
[Instruction example]
[Program description]
In
Program
Language LD FBD IL
example
Instruction
TCMP En, Clock, Out
format
Enable
En √
1. TCMP use for compare system real time clock and clock setup clock ,if system
real time clock >clock output>state, if system real time clock =clock output=state,
[Instruction example]
[Program description]
3. System clock exit in SV12~SV18, when system real time clock >Clock then
M10=ON, when system real time clock =clock then M11=ON, when system real
time clock <clock then M12=ON.
In
Program
Language LD FBD IL
example
Instruction
TACCU En, Rst, CT
format
En Enable √
Rst Reset √
2.
Accumulative time
CT must use power-off preserve area register, default power-off preserve registers are
V1000~V2047.
3. After accumulative second(CT. CT+1) reach maximum value 2147483647
automatic reset to 0.
[Instruction example]
[Program description]
1. Network 1 get electricity from busbar , that is accumulative PLC running time .
In
Program
Language LD FBD IL
example
Instruction
SCLK En, Clock
format
En Enable √
1. SCLK instruction modify the PLC real time clock by the set clock data .
5. Also can modify by program software menu[PLC/ set PLC clock], must not
[Instruction example]
[Program description]
TIME(Time switch)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
TIME En, OnTime, OffTime, Act, Out
format
En Enable √
ON
OnTime √
actuation time
1. TIME instruction use week as control cycle, get by set ON. OFF actuation time
control output.
control model, when it relevant bit is1 then express the data ON. OFF actuation
3. If ON actuation time <OFF actuation time , express in current data ON and OFF.
4. Ontime. Offtime if is register input, then high byte is hour(0~23) low byte is
08:05).
5. If Ontime is invalid time then ON actuation invalid. If Offtime is invalid time then
[Instruction example]
[Program description]
DATE(Date switch)
In
Program
Language LD FBD IL
example
Instruction
DATE En, OnDate, OffDate, Out
format
En Enable √
1. DATE instruction use year as control cycle, get by ON. OFF actuation time
control output.
OFF.
3. OnDate. OffDate if is register input, then high byte is month(1~12) low byte is
4. If OnDate is invalid data then ON actuation invalid. If OffDate is invalid data then
[Instruction example]
[Program description]
When M0=ON ,DATE instruction executing, from current year august 1to next year
INVT(Count down)
In
Program
Language LD FBD IL
example
Instruction
INVT En, Clock, Out, Rtv
format
Parameter Parameter define Input Output Declare
En Enable √
clock calculate from current value to set time still remaining data(Rtv). hour(Rtv+1).
minute(Rtv+2). second(Rtv+3),when reach the timing time output Out.
[Instruction example]
[Program description]
current value to 2013-12-25 8:0:0 remaining data. hour. minute. second, after
timing time reach output Y0=ON.
Communication instruction
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
etc. HMI) can direct use Modbus protocol access PLC. refer to
communication port , all can use for program . upload download program. monitor
. networking.
succeed or not , can use it for alarm the communicate fail between slave.
not support so high speed communication, can assigned SV141 to insert a interval
In
Program
Language LD FBD IL
example
16. 8 bit
SUM En, Sou, N, Out
Instruction
SUM.LB En, Sou, N, Out
format
En Enable √
SUM verify
Out √
code output
[Instruction function and effect declare]
Sum verify code computing method: use for get accumulation sum start from Sou
N number of bytes , get low byte, exceed 256 part overflow.SUM.LB is Low byte
model, only calculate sum verify code of low byte, high byte notuse .
[Instruction example]
[Program description]
V1000 0x8181
V1001 0x0152
V1002 0x0000 V0=0xB3 V2=0x30
V1003 0x0153
V1004 0x0D0A
In
Program
Language LD FBD IL
example
16. 8 bit
BCC En, Sou, N, Out
Instruction
BCC.LB En, Sou, N, Out
format
En Enable √
BCC verify code computing method: use for XOR operation start from Sou N
Number of bytes .BCC.LB is Low byte model, only calculate low byte BCC verify
[Instruction example]
[Program description]
V1000 0x8181
V1001 0x0152
V1002 0x0000 V0=0xB V2=0x8A
V1003 0x0153
V1004 0x0D0A
Program
Language LD FBD IL
example
16. 8 bit
CRC En, Sou, N, Out
Instruction
CRC.LB En, Sou, N, Out
format
En Enable √
CRC calculate CRC verify code start from Sou N number of bytes .CRC.LB is
Low byte model, only calculate low byte CRC verify code, high byte not use.
[Instruction example]
[Program description]
When M0=ON, calculate CRC verify code, as follows table .
Sou c
Initial value
omponent CRC Output CRC.LB Output
V1000 0x8181
V1001 0x0152
V2=0xB4
V1002 0x0000 V0=0x98AC
V3=0x51
V1003 0x0153
V1004 0x0D0A
In
Program
Language LD FBD IL
example
16. 8 bit
LRC En, Sou, N, Out
Instruction
LRC.LB En, Sou, N, Out
format
En Enable √
N number of bytes and then O 2's complement code. LRC.LB is low byte model,
only calculate low byte LRC verify code, high byte not use.
[Instruction example]
[Program description]
V1000 0x8181
V1001 0x0152
V2=0xD0
V1002 0x0000 V0=0xFE4D
V3=0xFE
V1003 0x0153
V1004 0x0D0A
In
Program
Language LD FBD IL
example
16. 8 bit COMM En, Txd, Tn, Rn, Ptotocol, Port, Out, Err, Rxd
Instruction COMM.LB En, Txd, Tn, Rn, Ptotocol, Port, Out, Err,
format Rxd
Parameter Parameter define Input Output Declare
En Enable √
Communication complete
Out √
output
COMM instruction send and receive data .At the moment PLC is master, external
equipment is slave.
2. When Tn=0 ,COMM instruction only receive data without send data .When Rn=0
,COMM instruction only send data without receive data .When Tn=Rn=0 ,COMM
communication format ( baud rate . data bit . stop bit . verification mode) use for
Txd start Tn number of bytes data send to Port assigned serial port ,after send
complete , if Rn>0 then automatic go to receive state, receive complete Out=ON,
received data put on Rxd; if Rn=0 then not receive data Out=ON, system execute
Err=ON.
4. COMM instruction have two modes send data: high low byte send mode
5. COMM instruction can use with XMT. MODR. MODW. HWRD. HWWR
instruction at the same time .but can not use the same communication port with
RCV instruction .
[Instruction example]
[Program description]
initial register value table " read AI-708M itinerant detector command" :
In Declare
component itial value
V1000 0x8383
V1001 0x0152 First channel read
V1002 0x0000 command
V1003 0x0155
V1004 0x8484
V1005 0x0152 Second channel read
V1006 0x0000 command
V1007 0x0156
V1008 0x8585
V1009 0x0152 Third channel read
V1010 0x0000 command
V1011 0x0157
2. 3 COMM instruction get electricity from busbar and always execute, PLC
detector moreover use for returned measure value output to instruction Rxd.
MODR(Modbus read)
In
Program
Language LD FBD IL
example
En Enable √
Communication complete
Out √
Output
1. MODR instruction use for communication with all the third party equipment are
2. When PLC communication with external equipment by the serial port ,use
MODR instruction read data from external equipment . This moment PLC as
3. MODR instruction do not write any verify code, it automatic verified the returned
4. MODR instruction can use with COMM . XMT. MODW. HWRD. HWWR
instruction at the same time .but can not use the same communication port with
RCV instruction.
[Instruction example]
[Program description]
1. MODR instruction read station 1 external module (If module is S04AI) 4 channel
2. Different model module the CR number not the same, detail information refer to
MODW(Modbus write)
In
Program
Language LD FBD IL
example
En Enable √
Parameter Parameter define Input Output Declare
Be rote data
Val √ Occupy N continuous component
start component
Communication complete
Out √
Output
1. MODW instruction use for communication with all the third party equipment are
2. When PLC communication with external equipment by the serial port ,use
MODW instruction write data to external equipment . This moment PLC as master
3. MODW instruction do not write any verify code, it automatic verified the returned
4. MODW instruction can use with COMM . XMT. MODR. HWRD. HWWR
instruction at the same time .but can not use the same communication port with
RCV instruction.
[Instruction example]
[Program description]
HWRD(Speedbus read)
In
Program
Language LD FBD IL
example
Instruction
HWRD En, Slave, Table, Port, Out
format
En Enable √
Speedbus read √
Table
communication table
Communication complete
Out √
Output
3. HWRD instruction can use with COMM . XMT. MODR. MODW. HWWR
instruction at the same time .but can not use the same communication port with
RCV instruction .
[Instruction example]
[Program description]
1. Define Speedbus read communication table " read 2# PLC data "as follows:
Sequence
number Read data from
Write date to slave
slave
1 X0 M10
2 X3 M11
3 V11 V80
4 V12 V81
5 AI0 V20
6 AI1 V21
2. Define Speedbus write communication table " write 2# PLC data "as follows:
Sequence
number Read data from Write date to slave
slave
1 X0 M100
2 X1 M101
3 V0 V100
4 V50 V102
5 Y4 M0
6 Y5 Y0
7 V60 V200
8 V61 V201
3. HWRD. HWWR instruction get electricity from busbar and always execute,
HWWR(Speedbus write)
In
Program
Language LD FBD IL
example
Instruction
HWWR En, Slave, Table, Port, Out
format
Parameter Parameter define Input Output Declare
En Enable √
Speedbus write √
Table
communication table
Communication complete
Out √
Output
3. HWWR instruction can use with COMM . XMT. MODR. MODW. HWRD
instruction at the same time .but can not use the same communication port with
RCV instruction .
[Instruction example]
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
RCV En, Schr, Echr, Rn, Ptotocol, Port, Out, Rxd
format
En Enable √
Communication complete
Out √
Output
moreover upper computer must use freedom communication protocol need use
RCV instruction.
2. RCV instruction passive receiving data sent from upper computer , if need
response to upper computer then use XMT instruction sent the response data.
3. Schr is start character define, if Schr=0 express no start character, if Schr high
high byte=0 low byte<>0 express only one ending character (e.x. Echr=0x000D,
ending character is 0x0D), if Echr high byte<>0 express2 ending character (e.x.
succeed , receive data output to Rxd;When Schr and Echr all is 0,that is start
character and ending character all not define, then RCV instruction use for
the communication frame .When receive the first byte of a new frame or
communicate overtime RCV instruction will automatic reset Out and Rxd.
6. Rn is receive data number of bytes, e.x. :RCV instruction want receive 22 bytes
send from upper computer , then assign Rn=22.Note: if the length of the
command send from upper computer not fixed, then use for receive number of
7. One communication port only use one RCV instruction, moreover use with
communication port .
[Instruction example]
[Program description]
1. Network 1 start one RCV passive receiving instruction, start character match
2. When M0=ON receive data correct, compare second byte (V0 high byte), if
In
struction format and parameter specification
Program
Language LD FBD IL
example
16. 8 bit
XMT En, Txd, Tn, Ptotocol, Port, Out
Instruction
XMT.LB En, Txd, Tn, Ptotocol, Port, Out
format
En Enable √
Communication complete
Out √
Output
moreover upper computer must use freedom communication protocol need use
XMT instruction.
2. XMT instruction general use for cooperate RCV instruction , RCV instruction
receive data send from upper computer , if need response to upper computer then
4. XMT instruction can repeat ,XMT instruction different from COMM instruction ,it
[Instruction example]
In
Program
Language LD FBD IL
example
Instruction
FROM En, Slot, CR, N, Out
format
Enable
En √
Cr CR register be read √
1. FROM use for read extend module parameter get by parallel bus in program .
general not use FROM instruction.detail refer to "PLC hardware configure "
section.
3. Different model extend module CR register not the same ,detail refer to
[Instruction example]
[Program description]
1. When M0=ON, read first extend module (if module model is S04AI) 4 Input
2. When M1=ON, modify the zero point corrected value to 30 (If V1000=30)of first
Program
Language LD FBD IL
example
Instruction
TO En, Slot, CR, Val, N
format
Enable
En √
Cr CR register be wrote √
Data
Val √ Occupy N continuous component
start component be wrote
1. TO use for write extend module parameter get by parallel bus in program. May
"PLC hardware configure " window configure module parameter, when PLC
instruction.
2. Different model extend module CR register not the same ,detail refer to
[Instruction example]
In
Program
Language LD FBD IL
example
Instruction
TCPMDR En, IP, Code, Read, N, Slave, Out, Rxd
format
En Enable √
Communication complete
Out √
Output
TCPMDR instruction is used for reading the data of the device supporting Modbus
TCP protocol.
[Instruction example]
[Program description]
1. TCPMDR instruction will read the four channels' measurement value (CR
2. Different model module the CR number not the same, detail information refer to
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
TCPMDW En, IP, Code, Write, Val, N, Slave, Out
format
En Enable √
Be rote data
Val √ Occupy N continuous component
start component
Communication complete
Out √
Output
TCPMDW instruction writes the data to the device supporting the Modbus TCP
protocol.
[Instruction example]
[Program description]
1. TCPMDW instruction writes the data V0 ~ V3 to the four output channels (CR
2. Different model module the CR number not the same, detail information refer to
In
Program
Language LD FBD IL
example
Instruction
TCPHWR En, IP, Table, Slave, Out
format
En Enable √
Speedbus read √
Table
communication table
Parameter Parameter define Input Output Declare
Communication complete
Out √
Output
1. TCPHWR instruction automatically exchanged the data with the slave device
[Instruction example]
[Program description]
1. Define Speedbus read communication table " read 2# PLC data "as follows:
Sequence
number Read data from
Write date to slave
slave
1 X0 M10
2 X3 M11
3 V11 V80
4 V12 V81
5 AI0 V20
6 AI1 V21
2. Define Speedbus write communication table " write 2# PLC data "as follows:
Sequence
number Read data from Write date to slave
slave
1 X0 M100
2 X1 M101
3 V0 V100
4 V50 V102
5 Y4 M0
6 Y5 Y0
7 V60 V200
8 V61 V201
3. TCPHWR, TCPHWW instructions will execute after getting charged from the
table", and will automaticaly exchange the data with the 2# PLC of IP address
192.168.1.111.
In
Program
Language LD FBD IL
example
Instruction
TCPHWW En, IP, Table, Slave, Out
format
En Enable √
Speedbus write √
Table
communication table
Communication complete
Out √
Output
1. TCPHWW instruction automatically exchanged the data with the slave device
[Instruction example]
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
1. PLC support up to 52 system interrupt source, include pulse output. edge catch .
high speed counter and timer interrupt. refer to "system interrupt table ".
moreover system generate the interrupt executed once ,others any time not
3. Interrupt program must try to do short and small ,only necessary instruction in
ATCH(Interrupt binding)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
ATCH En, Int, IntP
format
En Enable √
ATCH instruction use for binding IntP interrupt program and Int interrupt number ,
when system generate Int interrupt, automatic execute binding IntP interrupt
[Instruction example]
1. At "PLC hardware configure " window configure "DI digital Input Parameter"
2. Write interrupt program "X1 rising edge catch", only one instruction,V0 increase
1,as follows.
3. Write main program "ATCH" as follows:
[Program description]
1. M0=ON, use for Interrupt program binding "X1 rising edge catch " and Interrupt
number I18(X1 rising edge interrupt), thus when X1 from OFF go to ON ,system
generate I18 interrupt moreover call interrupt program "X1 rising edge catch".
2. M1=ON, release interrupt number I18 bind, by now even if system generate
3. M2=ON, enable system interrupt, thus when X1 from OFF go to ON, system
4. M3=ON, disable system interrupt, thus system not generate any interrupt.
DTCH(Interrupt release)
In
Program
Language LD FBD IL
example
Instruction
DTCH En, Int
format
En Enable √
DTCH instruction release Int Interrupt number bind interrupt program, instruction
[Instruction example]
ENI(Enable interrupt)
In
Program
Language LD FBD IL
example
Instruction
ENI En
format
En Enable √
ENI instruction open system interrupt function , system default open interrupt,
[Instruction example]
DISI(Disable interrupt)
In
Program
Language LD FBD IL
example
Instruction
DISI En
format
Enable
En √
[Instruction example]
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
MC Master control √ √ √
MC(Master control)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction
MC En, N
format
En Enable √
N Label √
as usual executed .
2. When En=OFF ,the instructions inner master control N ( between MC and MCR
instruction) skiped, moreover reset OUT instruction output. timer coil T and
current value TV. counter coil Cand current value CV at the same time .
[Instruction example]
[Program description]
1. Network 1 define master control 1 start , network 3 define master control 1 finish
In
Instruction
MCR N
format
N Label √
MCR is master control finish instruction ,N is master control number, only pair use
with MC instruction .
FOR(Loop command)
In
Program
Language LD FBD IL
example
Instruction
FOR En, Index, Init, Final
format
En Enable √
S
Init √
tart value
1. FOR instruction and NEXT instruction must be used in pairs , among FOR sign
the start of the circulate, NEXT sign the finish of the circulate .The statement
body until reach cycle count, among, count value of the cycle count store
4. In loop body ,user can modify stop value Final, thus modify the stop condition of
the loop .
5. If many cycle count , then the program execute time possible exceed system
watchdog timer value ,thus possible triggering system watchdog action cause
safeguard stop,by now must add REWD instruction in the loop body to reset
watchdog.
[Instruction example]
[Program description]
1. M0=ON, each scan cycleV10 increase 1,Network 2 start one loop, loop index
V0, cycle count 30(0~29),Network 3 loop body instruction,V2 each increase 1(after
NEXT(Loop end)
In
Program
Language LD FBD IL
example
Instruction
NEXT
format
WAIT(Delay wait)
In
Program
Language LD FBD IL
example
Instruction
WAIT En, Tms
format
En Enable √
Unit
Tms Delay time √
0.1ms
1. WAIT instruction make PLC program execute pause, pause time setup by
parameter Tms .
2. WAIT instruction extend the scan cycle, may be trigger the watchdog actuation ,
CALL(Call subroutine)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
En Enable √
Sub
SubP √
routine name
Input parameter(Can be no √
Par1~8
parameters)
Output
Out1~3 parameter ( √
Can be no parameters)
1. CALL instruction use for call subroutine. Call subroutine can with parameter or
subroutine attribute window, may be modify and edit the parameter of the
subroutine ;When SubP parameter item input the subroutine name, programming
software use for according to the defined parameter of the subroutine the program
give the input . output parameter item and parameter name to call the subroutine ,
instruction input output parameter item enable input data type and the data type of
2. Use CALL call subroutine, if the subroutine called not defined parameter, then
parameter item omit .to with parameter call subroutine ,parameter therefore
3. Use CALL instruction reach call subroutine program named main program ,
subroutine may be called repeat, support nest call subroutine ,maximum nesting 8
level.
CALL instruction call the subroutine , instruction input output parameter item allow
input data type no difference of the data type of the subroutine defined parameter .
IN Input parameter, by CALL instruction use for parameter data incoming subroutine
Input output parameter ,first CALL instruction use for parameter data incoming subroutine
IN_OUT
,subroutine execut use for again incoming result to CALL instruction parameter
Output parameter ,subroutine after executed again incoming result to CALL instruction
OUT
parameter
6. subroutine data type as follows:
Data
Mean
type
[Instruction example]
1. Program one subroutine "measuring range transfer ", the subroutine achieve SC
[Program description]
1. Subroutine with 4 input parameter and 1output parameter, calculate Out = (In -
EXIT(Condition exit)
In
Program
Language LD FBD IL
example
Instruction
EXIT En
format
En Enable √
EXIT is condition exit instruction, only use which need early exit from subroutine or
In
struction format and parameter specification
Program
Language LD FBD IL
example
Instruction
REWD En
format
En Enable √
2. When program need loop execution at some condition , thus possible triggering
system watchdog actuation cause protect stop ,by now must add REWD
3. REWD instruction make watchdog out of action, must try to do not use.
JMPC(Condition jump)
In
Program
Language LD FBD IL
example
Instruction
JMPC En, N
format
En Enable √
N Jump label √
[Instruction function and effect declare]
1. JMPC is with condition jump instruction, when En=ON, program use for jump to
label N appoint position next instruction continue execution, if En=OFF then do not
2. N Jump label must use LBL instruction define, if label not exist, then the
[Instruction example]
[Program description]
1. Network 1 INC instruction from busbar get electricity , each scan cycle use for
V0 increase 1.
In
Program
Language LD FBD IL
example
Instruction
LBL N
format
N Jump label √
LBL instruction use for define jump label, to JMPC instruction use .
Support
Instruction language
8 bit model 32 bit model Instruction function
name
LD FBD IL
VC Valve control √ √ √
In
Program
Language LD FBD IL
example
Instruction
GPWM En, PulR, PulT, Out
format
Enable
En √
1. GPWM instruction use for common transistor output point Yn output pulse which
factor is PulR. period is PulT, if PulR=0 then Out output low level, if PulR≥1000
[Instruction example]
[Program description]
1. When M0=ON, from Y20 output the pulse which duty factor is 30%. period is
30ms.
In
Program
Language LD FBD IL
example
Instruction
FTC En, PV, SV, Out, MV
format
Parameter Parameter define Input Output Declare
En Enable √
Co
Act √ 0-reaction,1-direct action, others invalid.
ntrol mode
Out
Pulse width √
modulation output
MV Control output √
1. FTC instruction use for fuzzy temperature control special purpose instruction,
the instruction need not set any parameter completely automatic regulate output
,simpleness use .
normal use for heat control),Act=1 is direct action(PV increase,MV output trend
5. Many external factor will influence temperature control effective , such as:
sensor accuracy . sensor install position . heat function big or small etc., if FTC
temperature control effective unsatisfactory ,may be use PID or program
[Note]: When the FTC instruction first run, it will automatically control the output
Out=On, MV=1000, this process is used to calculate the fuzzy factor, and should
be used when PV is in room temperature,and the calculation process will take less
than 1.5 minutes. The calculated fuzzy coefficients will be stored in the instruction,
and it wil not be lost when the plc is shut down. If the program is re-
downloaded,then the FTC instruction which is again in the first run will
[Instruction example]
[Program description]
Y3=OFF,V100=0.
PID(PID control)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction PID En, Act, PV, SV, P, I, D, T, Span, PVH, PVL, MVH,
format MVL, MV
En Enable √
Co
Act √ 0-reaction,1-direct action, others invalid.
ntrol mode
PV Measure value √
SV Set value √
Deri
D √ Unit 10ms
vative time
PV m
PVH √
easuring upper limit
MV Control output √
normal use for heat control),Act=1 is direct action(PV increase,MV output trend
3. Many external factor will influence temperature control effective ,need time and
again adjust P. I. D these 3 parameters to meet the control object, also can
4. P. I. D parameters direct influence reality control effective stand and fail , below
Integral time (I) regulating effect : make system eliminate steady state error,
until have not error, integral control stop , integral control output a constant
.Integral functional strong and weak depend on integral time I,I big ,integral
functional weaker, regulate response faster, add integral control make system
change trend , so can generate ahead of control function, before deviation not
differential functional can not alone used , must use with others two regulating
set to 0, no iderivative.
5. Incremental PID arithmetic :
Among:u(n):MV Output
u(n-1):last output
e(n-1):last deviation
[Instruction example]
[Program description]
execute,AQ0=0.
2. If need use for PID instruction analog output turn into digital duty factor output,
use GPWM instruction ,PulT=5000 express pulse period 5 second, Note PID
In
Program
Language LD FBD IL
example
16. 32 bit
HAL En, In, Up, Span, Out
Instruction
D.HAL En, In, Up, Span, Out
format
En Enable √
In Input √
In<(Up-Span), then Out=OFF, when In and Up deviation value less than equal to
[Instruction example]
[Program description]
When M0=ON start upper limit alarm function .If AI0 is temperature measure
AI0<2980(298°) Y3=OFF.
In
Program
Language LD FBD IL
example
16. 32 bit
LAL En, In, Down, Span, Out
Instruction
D.LAL En, In, Down, Span, Out
format
En Enable √
Parameter Parameter define Input Output Declare
In Input √
In>(Down+Span), then Out=OFF, when In and Down deviation value less than
[Instruction example]
[Program description]
When M0=ON start lower limit alarm function .If AI0 is temperature measure value
Y3=OFF.
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
16. 32 bit
LIM En, In, Up, Down, Out
Instruction
D.LIM En, In, Up, Down, Out
format
En Enable √
In Input √
U
Up √
pper limit
Out Output √
[Instruction example]
[Program description]
When M0=ON start range limitation. If V1000=800,V1001=20, when V0<20
In
Program
Language LD FBD IL
example
16. 32 bit
SC En, In, InUp, InDown, OutUp, OutDown, Out
Instruction
D.SC En, In, InUp, InDown, OutUp, OutDown, Out
format
En Enable √
In Input √
InDown) + OutDown.
[Instruction example]
[Program description]
VC(Valve control)
In
Program
Language LD FBD IL
example
Program
Language LD FBD IL
example
Instruction VC En, OLim, CLim, JOG, PV, SV, Span, Ts, Open,
format Close
En Enable √
PV Measure value √
SV Set value √
Motor
Ts √ Unit 秒
running time
Valve close
Close √
output
[Instruction function and effect declare]
controler.
compare, if both difference value greater than dead band span, then action to
Valve control output (open or close), each the motor running time longest is
Ts(second).
4. Open valve open control:when (SV - PV)> Span ,Open=ON valve open output;
When (SV - PV)≤ Span ,Open=OFF valve open stop .In control valve process, if
5. Close valve close control:when (PV - SV)> Span ,Close=ON valve close output;
When (PV - SV)≤ Span ,Close=OFF valve close stop .In control valve process, if
6. Valve jog control:when JOG from OFF go to ON, use for according to SV. PV.
Span three current value make out open or close the valve( control according to
and on-off control the same as), each jogthe motor running time longest is
Ts(second).
7. If Ts>0,valve guard time valid ,In Ts valve not reach the preset position (Set
value), on-off action stop , in case valve appear mechanical error and yet damage
8. If Ts=0, express time-out output, note the valve lose protect function .
11. VC instruction can cooperate PID etc. instruction realize more complex control
function .
[Instruction example]
In
Program
Language LD FBD IL
example
Instruction
TTC En, Begin, End, Ts, Act, Out, Val, Ct
format
En Enable √
1. TTC instruction use for control data value in given time from start point value
(Begin) to end point value (End) changing process, that is ratio control.
instruction not execute, without unit is second or minute instruction all each
3. When Act=0 (restart mode), at TTC instruction start ,reset Out=OFF, then from
moreover read current value Val, according the condition to execute of Val in
Begin~End interzone.
1). Begin<End (ascent stage), if Val≤Begin then from start point value
(Begin) start timing control output Val; if Val≥End then timing out ,Val invariant
moreover Out=ON; if Val at Begin~End interzone then from Val start timing
2). Begin>End (decline stage), if Val≥Begin then from Begin start timing
control output Val; if Val≤End then timing out ,Val invariant moreover Out=ON; if
Val at Begin~Endinterzone then from Val start timing control output Val.
3). Begin=End ( maintain stage), if Val=Begin then from start point value
(Begin) start timing control output Val; if Val≠Begin then timing out ,Val invariant
moreover Out=ON.
modified not take effect at real time, need re-execute the instruction).
[Instruction example]
[Program description]
V1000 300
V1001 1200
V1002 -2
V1003 1200
V1004 1200
V1005 30
V1006 1200
V1007 300
V1008 60
1. When M10=ON, start first segment curve , from 300 to 1200 take 2 minute,
complete M27=ON.
2. When M27=ON, start second segment curve ,from 1200to 1200 take30 second ,
complete M28=ON.
3. When M28=ON, start third segment curve ,from 1200 to 300 take 60 second,
complete M29=ON.
In
Program
Language LD FBD IL
example
Instruction
APID En, Act, Start, PV, SV, P, I, D, MV
format
En Enable √
PV Measure value √
SV Set value √
Deri
D √ Unit 10ms
vative time
MV Control output √
normal use for heat control),Act=1 is direct action(PV increase,MV output trend
3. When Start=ON, it starts the auto-tuning, after the finishing of the self-tuning the
the auto-tuning is not satisfactory, you can reactivate "Start" to carry out the auto-
tuning again, or manually input the parameter. There is much external factors
4. P. I. D parameters direct influence reality control effective stand and fail , below
Integral time (I) regulating effect : make system eliminate steady state error,
until have not error, integral control stop , integral control output a constant
.Integral functional strong and weak depend on integral time I,I big ,integral
functional weaker, regulate response faster, add integral control make system
change trend , so can generate ahead of control function, before deviation not
differential functional can not alone used , must use with others two regulating
set to 0, no iderivative.
the entire auto-tuning process takes less than 1.5 minutes. The PID coefficient
P、I、D terminals, so the P、I、D terminals of the instruction should use latched
registers.
[Instruction example]
[Program description]
execute,AQ0=0.
2. If need use for APID instruction analog output turn into digital duty factor output,
Programming environment
Overview
Menu
1. "File" submenu : use for mange the related operations of the program
project file.
2. "Edit" submenu : use for edit the program related operations.
remote module.
Tools bar
user can program quickly. When move mouse onto tools bar button the
click menu. Via mouse right button click to popup right click menu.
menu:
2. At LD language programming environment , pitch up instruction or
Shortcut key
write the program, may be use shortcut key improve programming speed
Program
project Ctrl + S Save program project
operation
Ctrl + P Print
Ctrl + R Redo
Ctrl + X Cut
Ctrl + C Copy
Ctrl + V Paste
Ctrl + G Go to …
Ctrl + F Search
F3 Search next
LD program :equal to
Ctrl + Shift + 5 switch(floating point number
compare)
Status bar
Status bar use for indicate programming software current status and
Working area
User working area is use for write control program . configure PLC
hardware information.At the area, user may be edit current program or PLC
use tree form structure display total project all content: project name. main
configure. all kinds of instruction etc.. Project manager support right click
resource" page total 5 sub pages, list current program project CPU all
resources of MPU, and system status bit. system register. interrupt and
error code.
Component comment table
comment.
Instruction declare window
Double click the application instruction in the program, can open the
different instruction.
When select "Instruction forbidden" , the instruction can not be executed
When select "Low byte mode" ,the instruction is 8 bit mode; when select
At the window also my be modify the timer time base. counter number.
At " instruction attribute window" double click input or output item can
Program structure
User program have main program . sub program . interrupt program
Main program block. sub program . interrupt program three sum total can
All program block all can alone setting up the password, realize local
encryption function.
Main program
Main program is the main part and frame of user program ,PLC permit
many main program block ,between blocks of the main program category
May via menu [Debug/ program executed block] regulate the executed
sequence .
Sub program
User program may be without sub program ,also include one or many sub
programs .
Sub program may call other sub program ,but can not call itself, also can
Interrupt program
System assign a interrupt number for each interrupt event, refer to "System
interrupt table".
instruction binding the interrupt program and the interrupt event (interrupt
number), two is system happen the interrupt event. Among, catch X0~X7
rising edge or falling edge interrupt must at "PLC hardware configuration "
User program may be without interrupt program , also may be include one
prohibit) instruction ,at interrupt prohibit, system can not happen interrupt
Via click menu [File/new program project]. click tools bar button or
At "CPU type " select among pull listing "CPU also MPU type ".
Latched area after power off may be defined just as user wishes, may set
component and the length. System default latched area after power off
listing as follow:
Component Latched area Component
type after power number
off
V V1000~V2047 1048
M M1536~M2047 512
S S156~S255 100
T T96~T127 32
C C64~C127 64
At "Project name" input new project name, The project name will be display
At " User name". "Designer". "Versions". "Company" etc. column input the
three type program block constitute. User build many program block
At "block name" input the name of new program block( the name will be
displayed in the project manager), the select program block type and
Password" and" confirm password" two text is use for set the program
If set password for the program block, then request user input correct
password and then search or edit it, each program block may be set
When build a new sub program or open sub program attribute window,
bottom of the window will listed the sub program parameter table, as
follows.
One sub program maximum define 8 input (IN) or input output (IN_OUT)
parameter type (IN. OUT. IN_OUT) and data type (BOOL. WORD.
When use CALL instruction call sub program ,CALL instruction input output
parameter data type must fit the parameter data type of the sub program
defined.
Press "Add" button add a new parameter line, new parameter type default
Click parameter name field of the parameter ,at textbox input the parameter
Click the parameter type field ,at select among pull listing the parameter
type of the parameter (IN. IN_OUT. OUT), system will automatic sort the
Click parameter line will be deleted , press "Delete" button , the parameter
will be deleted.
via right button menu "Open " open the program block .
Delete program block
Click menu [Debug/ program block execution sequence], open " program
sequence program block ,click "Move up" or "move down" button, may
these tables may reduce many program workload, save program space,
realize as initialized the data etc. function. Each table can be set password
item parameter ,when communicate between PLC and PLC via Speedbus
table " automatic read data from slave and then write to master PLC. As
follows:
Speedbus write communication table
item parameter ,when communicate between PLC and PLC via Speedbus
table " automatic read data from master PLC and then write to slave PLC.
As follows:
use for BUNB. BUNW. BDIB. WDIB instruction Table item parameter ,
Use for defined the initial value of register component ,when program
project downloaded to PLC , set initial value in the table will be downloaded
follow the program ,may define integer. long integer. floating point number.
At "Decima". "Hexadecimal" mode ,at "16 bit register value" field input 16
bit integer, at "32 bit register value" field input 32 bit integer. Note:"32 bit
At "Floating point number" mode direct input the floating point number.
continuation registers.
New table
Right button click "Project manager" window will be new build table name,
Tools bar button select the table type which will be new build , thus will
different table .
At "Table name" input the name of new table ( the name will be displayed in
project manager), may write some note declare in the note text field .
"Password " and "Confirm password" two text field are use for set the
protect password of the table. If the table password be set , then require
after user input the correct password can be search or edit, each table can
The "initial register value table " defined the "Start component" and "Length
", then input value of the component. Others kind of tables via "Add".
"Insert". "Delete". "Move up" and "Move down " button to edit the content of
the table.
At "Note" input the note of the table, at " component note" bar Edit
component note.
Open table
Double click "Project manager" catalog of tree or via right button menu
Delete table
Right button click "Project manager" window the table name which will
"PLC hardware configuration " window. user in rise reality hardware model
add extend modules ,may be add. delete or regulate the position of the
PLC MPU type at new program project may be selected and confirm, if
want to modify the MPU type menu [File/ program project attribute]Open "
program project" window, select correct "PLC series " and "CPU type
1. Open up project manager "PLC module" catalogue tree, find the module
model will be added, double click the module or drag the module to the
3. Click the module will be deleted , press "Del" key, the module will be
deleted .
PLC external I/O component (X. Y. AI. AQ) will be automatic assigned
Note
, when module I/O point number is not 8 times will be generated the not
continuation number
Can set external digital input "Filter time", filter time get over long then
response get over slow. filter efficiency get over well, filter time get over
short then response get over fast. filter efficiency get over poor.
CPU built-in X0~X7 digital input support edge catch function, if ant to use
edge catch, must tick relevant X channel "Rising edge catch" or "Falling
When configurate the Y channel to "Stop output" ,when PLC stop the Y
[0,10]V. [-10,10]V.
channel measuring range resolve via "Upper limit" and "Lower limit" , if
"Sample times" influence the AI channel response time and filter efficiency
,sample times get over big then response time get over long. filter
efficiency get over well ;sample times get over small then response time
If external sensor generate zero deviation, may via set "zero revise" to
regulation moreover don't replace the sensor. when sensor minus deviation
the zero deviation set to positive value, when sensor positive deviation the
channel measuring range resolve via "Upper limit" and "Lower limit" , if
When configurate AQ channel "Stop output", may set a output value, thus
when PLC stop the AQ channel will keep output the set value.
model
High speed counter channel signify by HSCx ,each channel use 2 high
parameter, relevant high speed input point may be use in common X point.
PLS high speed output parameter
High speed pulse output channel signify by PLSx ,each channel use 2 high
If there is no high pulse output instruction (PLSY. PLSR. PPMR. CIMR etc.)
LD work area
instruction etc..
Switch edit
move to the start position will be parallel branch (X0 switch position) and
click , then mouse move to the end position (X2 switch position ) and click,
may select the switch. Can input the switch component . change the switch
which needed change the status, use shortcut key or mouse right button
LD instruction edit
Double click project manager instruction name in the instruction tree then
may add the instruction to the network, also may use drag mode pull the
will automatic popup instruction input window, input instruction name then
press enter may add instruction, may press "ESC" close the window at any
time.
After select the instruction, may copy. cut. delete the instruction, also may
change instruction mode. set instruction forbidden. set timer time base etc.
operation .Double click input. output item may open " Item" window, via
When mouse move to the instruction input item will turn up a red box,
use mouse right button callout right button menu then may change
instruction input item status (Normal open. Normal close. Rising edge.
Failling edge).
Branch edit
the instruction, if the same logical condition to execute the instruction then
use parallel output; if not the same logical condition to execute instruction
position which will be added branch and click then may add new branch,
which will be deleted branch and click then may delete the branch.
Mouse pull down at the network, may select current network or many
networks, selected network content will display reverse, press "Del" key
Mouse double click network title may edit the network comment, when
gridlines at the network title position may direct input the network comment.
At FBD work area process FBD language edit, as add new page. add.
sequence etc..
Top of FBD instruction are the function block number and it executed
Double click project manager instruction name in the instruction tree then
may add the instruction to the network, also may use drag mode pull the
will automatic popup instruction input window, input instruction name then
press enter may add instruction, may press "ESC" close the window at any
time.
Via mouse drag box may select any instruction, may copy. cut. delete the
instruction.
change instruction mode. set instruction forbidden. set timer time base etc.
operation .Double click input. output item may open " Item" window, via
Instruction output item can not connect to self input item, input item only a
enable flow line input, output item may be output many enable flow lines .
Enable flow line connected will automatic change function block instruction
executed sequence.
Between instruction may connect not use enable flow line , direct input
instruction parameter.
Mouse click enable flow line will prompt the enable flow line detail connect
information.
Change FB executed sequence
Mouse right button click instruction, callout right button menu click
When mouse move to the instruction input item will turn up a blue box,
use mouse right button callout right button menu then may change
instruction input item status (Normal open. Normal close. Rising edge.
Failling edge).
Page edit
Click button delete the last page, if the page have instruction then can
not be deleted.
FBD comment
IL work area
At IL work area process IL language edit, as add. delete instruction.
IL instruction edit
Double click Project manager instruction name in the instruction tree then
may add the instruction to the tail of the program, also may use drag mode
will automatic popup instruction input window, input instruction name then
press enter may add instruction, may press "ESC" close the window at any
time.
Mouse click or use keyboard move the gridlines to instruction position,
Via mouse drag box may select any instruction, may copy. cut. delete the
instruction, also may move up. move down instruction executed sequence.
change instruction mode. set instruction forbidden. set timer time base etc.
operation .Double click input. output item may open " Item" window, via
When mouse move to the instruction input item, use mouse right button
callout right button menu then may change instruction input item status
(Normal open. Normal close. Rising edge. Failling edge).
IL comment
Others
constant.
Find the instruction.
Via menu[Edit/Go To...] or shortcut key "Ctrl+G" open "Go To..." window,
position to line.
Compile program
During write the program may compiled the program at any time, to
window as follows:
automatic start compile operation , only have not any error the program
Compile window will list the error number and alarm number and them
may fast position the position in the program which generated the error or
Click " program ". "Table". "Component comment table" select the imported
file type ,click "Open " button select the imported file.
click "Import" button import the file to current program project.
May export the current program project program block . table and
Via menu [File/Export] open "Export" window, select exported content and
If you need print the program content via project file mode, via
window, In the window may select print copies. pages etc. information, also
Via menu [File/Print preview] or click tools bar button preview the
used, also detail statistics the component read times. write times and
Component comment may use after the component follow "//" direct input,
comment file.
Simulate and online debugging
This section introduce the how to use the program software built-in
Overview
Program software built-in simulator ( offline simulate), entirety realize
the PLC program simulate running . When you are programming of after
completed the program , can use the simulator simulate running the PLC
executed whether or not correct, vastly reduce the debug time at local ,
debug program, can search the whole PLC which connected the PLC,
display all online PLC running status . fault status . RUN/STOP switch
information, can select any PLC process online monitor, look up all PLC
Simulation environment
At simulating or online monitoring , the bottom of main windows will
appear a "PLC hardware simulator windows". all divide into four page
windows : message windows. curve real time monitoring . locked data
simulate tools bar at top left corner, cooperate right-hand button menu,
Simulate tools bar use for control the power off. power on. start. stop.
Right-click menu
Force ON: force the bit component status to ON of the mouse position.
Force OFF: force the bit component status to OFF of the mouse
position.
Force: open " force " window, force component status or value.
Lock data: open " Lock " window, lock component status or value.
Unlock data: release the component locked data of the mouse position.
Unlock all the data: release all the component locked data.
Component status table : open " component status table ",can arbitrarily
6. Find: open " find " window, find component or instruction in the
program.
" Hardware simulate window " list the hardware configure of current
program project , display the name of MPU and module and all X(DI)or
Click " hardware simulate window " AI or AQ channel may be open "
can modify the channel value( can modify AI and AQ in simulate status ,
" data lock window " list all locked component and them status or
value.
" Real time curve window " according real time curve to monitor the
Message window
communication error message etc., user can check the message at the
status table ". " real time curve monitor " or "PLC hardware simulate "
etc. numerous simulate debug tools for monitor the result of the program
program executing .
communication simulator " simulate the return data from slave device.
may be start " interpolation simulator " according to diagram the result of
Stop simulator ,return to edit status. If the result of the program not
Start simulator
start simulator ,System auto compile the current project ,if there are error
or alarm after the program compiled, if there are error or alarm after the
List all error and alarm information in the listing frame , double click the
the program.
If there is error during compiling the program , simulator can not be
started , until user modify the program have not any error and then the
program until there is no any alarm information and then start simulator .
status . At simulate status , can not modified the program , only after
stop simulator and return to edit status , just can be modified the
program
omponent monitor
monitor the component status and value , and the instruction execute
monitor .
When the instruction frame is red, express the instruction is executing
executed error( the instruction parameter error ,as DIV instruction divisor
is 0).
display V100=199.8.
Constant open switch and the compare switch have red diamonds ,
status of constant close and constant open is opposite ; rising edge and
descend edge because is edge ,only generate edge connect once, rest
value.
" component status table " can monitor current status or value of the
all component of the PLC, maximum may build 10 status tables, allow
V1000-1005. M0.
For register component display is "16 bit register value " and "32 bit
register value ".Note:"32 bit register value" column display border upon 2
value.
Right-hand button click may be popup the right-hand menu , via right-
hand menu may be forced . locked . release locked. add or delete status
change the display format of the register( include decimal base. floating
Force
Force change component status or value.
Bit component be forced: at " type " select bit component type , at "
component is external high speed pulse input point then can select input
type , at " component " input component number, input the value be
forced, may be input 16 bit integer . 32 bit integer. floating point number
select " low byte mode ",each register only store one character .
Lock data
Bit component be locked: at " type " select bit component type , at "
type , at " component " input component number, input the value be
locked, may be input 16 bit integer . 32 bit integer. floating point number
select " low byte mode ",each register only store one character .
Difference between force and lock:
value.
value (such as digital input X and analog input AI). May be locked the
1. Please use the lock data function carefully, lock data might be produce
unforeseeable effect.
2. If locked data in PLC, will generate error code 142, be "SV3=142 have
problem, please release the locked data after the location problem
handled finish.
register component ( such as V. AI. AQ etc. ) value may be use real time
2. At " upper limit value " and " lower limit value " input the register upper
3. Tick the leftmost select box, express draw real time curve of the
component.
4. Register component default 16 bit integer ,if 32 bit integer must be tick
"32 bits" select box, if floating point number must be tick " floating point
5. " Pause " option pause the curve drawing. during pause, may be use
left mouse button click the point of the curve to read the point value .
All control system or device all might be power off, strong control
program should consider the device power off factor fully , make sure the
program still can proper functioning after power off then power on.
Click simulator tool bar button ,simulate PLC power off , the program
stop executing.
Click simulator tool bar button ,simulate PLC again power on , the
whether or not proper functioning after power off then power on, may be
Communication simulator
" Communication simulator " is a simulation tool be exclusively used
click tools bar button to start " communication simulator ", default "
executed and generate the send and receive data . press " clear " button
clear all message , tick " Pause " stop refresh communication instruction
Left lower frame use for manual input return response information from
slave.
Right list all communication instruction using the same communication
double click instruction may fixed position the instruction location at the
program.
When upper left message frame display " wait response" , at left lower
input frame input response data frame from slave ( data content please
"Hex". "ASCII" use for select Hexadecimal or ASCII code mode input and
display data .
"CRC". "LRC". "BCC" and "SUM" button use for calculate the check code
Tick " use reality serial port communicate with slave " enter use computer
instruction send command frame to slave via computer serial port , also
"PC port " listbox list the total serial port of the computer , out of select
counting model .
[High speed counter mode and pulse oscillogram ]
Frequency Decrease
Mode Increase count
multiplication count
0 --pulse/direction 1
1 --pulse/direction 2
2 --
1
foreward/reversal
3 --
2
foreward/reversal
4 -- A/B phase 1
Counting mode Pulse oscillogram
Frequency Decrease
Mode Increase count
multiplication count
5 -- A/B phase 2
6 -- A/B phase 4
High speed counter channel express by HSCx , each channel use 2 high
speed pulse input point .Can force input frequency of the high speed
force X0 pulse
force
rogram example:
Pulse output simulate
total 5 output mode, high speed pulse output channel express via PLSx ,
Y2 blink
no pulse
output Y2=OFF,Y3=OFF.
no pulse
output Y2=OFF,Y3=OFF.
Y3=OFF.
During high speed pulse output instruction simulate execute process will
rogram example:
Interpolation simulate
be generated.
coordinate axis .
zone .
At middle part list motion plane each axis corresponding pulse output
count.
trail describe .
modify the component status or data value and program execution result
output only happen in simulator .
and program execution result output happen in PLC ,real time response
external input singal (DI or AI), output signal (DO or AO) produce real
PLC.
number 1~15( binary number from 0001 ~ 1111), method of modify the
Up picture is the 4 bit DIP switch use to set the station number of the
PLC, above is ON, below is OFF, in the picture black part express the
switch position, the bit set side to ON express the bit is 1, set side to
OFF express the bit is 0, first bit in up picture is ON, other bits are OFF.
The first bit of the DIP switch express the 0 bit of binary(b0), the fourth
bit of the DIP switch express third bit of binary(b3),thus ,such as the DIP
ON side, moreover others witch set to OFF side ,then be 0011, also
As follows:
Tick "Use PLC soft address", input PLC address value, click "Confirm"
. After use PLC soft address the hardware 4 bit DIP switch will be invalid.
monitor etc..
Click menu[PLC/PLC online] or click tools bar button, open "PLC
online" window.
Set the relate parameter, general condition use default parameter not
the computer , system will automatic search all useable COM serial
19200.
is "N,8,2 RTU".
"Start address" input the minimum station number of the PLC, "End
computer and PLC. RS232 or RS485 etc. wired mode online default
200ms , wireless mode online (ex. via GPRS) must according to the
Online operation
Online: direct click "Online" button, searched PLC (online
will try all baud rate . all data format to communicate with the PLC,
so need spend longer time for waitting for search the PLC, searched
the problem, if can not exclusion please connect the technical support .
the driver.
after exit "PLC online" window will automatic open "Online PLC
window", as follows.
On the left side of the upper is PLC listing , here display the already
connected PLCs. May be double click any PLC in the listing to select be
current PLC, all online operation of the PLC as: upload download
parameter. firmware upgrade etc. only for current PLC, don't influence
others PLC.
On the left side of the bottom is monitor zone , online monitoring use for
display current PLC detail status ,as: PLC running status. program big
Download program
Download current program project (hardware configuration. program.
current program project, if the program compiled error, then list all error,
after user modify the program until have not any error then can be
uploaded. This way protect the intellectual property of the user program .
Without stop download: if tick the option, during download program the
PLC will not stop executing, thus online modify program. Please careful
use the function, did not debugged program maybe produce cannot
foresee result.
Hardware match: listing detail list the match status between "Program
the same, program downloaded to target PLC will produce error code
Upload program
Upload the target PLC program to the computer. If the program
selected "Forbid upload" during downloaded, then the program can not
be uploaded.
Click menu [PLC/PLC program upload ] or click tools bar button, open
PLC project, and the file can be released and downloaded to the PLC
uploaded..
Clicking menu[PLC/Download PLC executable file]or clicking button of
executable file".
Clicking "Download" button,so that downloaded PLC executable file to
PLC.if the hardware is not compatible with target or the password is not
module, make CPU MPU oe extend module support the new function.
" window
Click "Open" button, select the upgrade file according to the upgraded
module.
At "PLC firmware upgrade " window, up table listed firmware upgrade file
version. module type etc. information, bottom listed target PLC name.
[Note]
1. At PLC CPU MPU set a start stop switch, when switch at "STOP"
position, PLC be stop status; when switch at "RUN" position, PLC be run
status.
"Start or stop PLC running" function: according to start stop switch prior,
when PLC power off again power on, if start stop switch at STOP
position, then now PLC will be stop status; if start stop switch at RUN
position, then now PLC will automatic change to run status. only PLC at
position.
4. User control "Start PLC running" or "Stop PLC running" via the
Affirm whether or not clear PLC program, if select "Yes", will initialize the
the password correct, maybe clear the target PLC program. Also prompt
user whether or not clear the PLC password after clear the PLC
program, if want clear the PLC password, select yes. Then PLC
Program compare
Compare between the current program project and the target PLC.
PLC Diagnosis
To comprehensive diagnosis PLC of online, PLC listed all of the
information system, convenient for the user can quickly find the problem
in exceptional cases.
Set PLC password
Set target PLC password, use for protect the PLC program and
hardware configuration etc. information. After set the password, include
program upload . program download. program clear etc. must after input
Click menu [PLC/Set PLC password ], open "Set PLC password "
window.
.
At password and confirm password field, input the same password , click
If PLC already set password , user want modify or cancel the password
window, input "Original password ", after password checked correct will
open "Set PLC password " window, again set new password, password
. Click "Confirm" button maybe set the computer current data and time to
COM4. COM5.
communication parameter.
Note: all the communication port default parameter is 19200
address.
window.
Set PLC name maybe convenience distinguish many PLCs on the
PLC scan overtime time: thus watch dog time, unit is milliscond (ms).
When PLC program running reality scan time greater than the value, will
generate error code 141, thus "SV3=141 scan overtime, watch dog
Tick "Use PLC soft address", input PLC address value , click " Confirm".
After use PLC soft address the hardware 4 DIP switch will be invalid.
Networking communicate function
This section introduce PLC networking communicate function.
Feature
communication protocol .
networking with the third part device which has communication function (
be mix use all kinds of protocol easy complete you need communication
function.
networking.
,already support parallel bus ( use extend bus connect to the parallel
interface of the PLC MPU ) also support serial bus ( use communication
MPU ),When expand via serial bus (remote IO module), don't limit by
system expand point ,may distributed installation .This very important for
humidity. differential pressure. blowing rate. flow. fan rotate speed. valve
open degree etc. ) need be sampled and monitored in the system, easy
capacity, reduce wire and work load of all kinds of signal , meanwhile
reduce disturb because analog signal wire too long, save project invest
cost.
Modbus communication
PLC built-in Modbus RTU/ASCII protocol ,when the third part device
[E.X.]
[Example program]
3. MODW. MODR instructions get electricity from busbar and all along
Modbus protocol , whether use any protocol , slave station need no any
[E.X.]
[Example program]
as follows:
D
Number Read data
component from ata component
slave wrote to master
1 X0 M10
2 X3 M11
3 V11 V80
4 V12 V81
5 AI0 V20
6 AI1 V21
data" as follows:
1 X0 M100
2 X1 M101
3 V0 V100
4 V50 V102
5 Y4 M0
6 Y5 Y0
7 V60 V200
8 V61 V201
,whether slave equipment use any protocol ,so long as know it protocol
(byte string) to slave, and receive response data from slave then
[Example 一]
PLC networking communicate with multifunction electric energy
meter which accord with DLT-645 standard ,read the meter constant (
active power ) and current active power total electric energy data
value.
[Example 一 program]
Program use COMM.LB instruction( low byte mode) send low byte
of V1000~V1013 component receive, 17 bytes return data
received store to V920~V928. If 17 bytes data which returned are
0xC343,store to " read current active power total meter constant "
table.
power V522=9364.
[Example 二]
PLC communicate with METTLER TOLEDO T600 weigh terminal
,use it CB920 communication protocol read real time weight value.
[Example 二 program ]
1 V1000=0x0052 R
2 V1001=0x0045 E
3 V1002=0x0041 A
4 V1003=0x0044 D
5 V1004=0x000D /CR
6 V1005=0x000A /LF
Program use COMM.LB instruction (low byte mode) send low byte
of V1000~V1006 component,18 bytes data received store to
V0~V8. If 18 bytes data returned as:53 54 2C 4E 54 2C 2B 20 20
2. communication simulator .
Hardware manual
Here are resume of PLC hardware, include type. specification. parameter. install guide. wire
drawing. etc.
PLC specification
Item Specification Declare
Support quantities
Analog input AI0~AI255 256 point convert. sample times an
AI
register zero point correct
Support quantities
Analog output AQ0~AQ255 256 point convert,power-off
AQ preserve output can be
register
configured
System
SV SV0~SV900 901 point
register
Indexed
P addressing P0~P29 30 point,use for indirect addressing
point
-32768~+32767(16
10 Decimal bits),-2147483648~+2147483647(32 bits)
Constant
16 0000~FFFF(16 bits),00000000~FFFFFFFF(32
Hexadecimal bits )
Other specification
1. Power specification
Instant surge MAX 20A 1.5ms @220VAC MAX 20A 1.5ms @24VDC
24VDC
power
supply
for 24V,-15%~+15%,500
24V,-15%~+15%,500mA(maximum)
output mA(maximum)
Output and
power extend
supply modules
24VDC
power
supply Direct use the 24VDC input power
for input 24V,-15%~+15%,200mA(maximum) supply
and
external
device
Transformer/photoelectricity
Isolation model No electrical isolation
isolation,1500VAC/1 minute
Protect the 24VDC output over the limit of the DC power input polar against. over
power supply current volatge
NPN or PNP
Item Relay output-R
transistor output -T/P
maximum
load Inductive load 50VA 5W/24VDC
Off-On 10us,On-Off
Response time Off-on 10ms,On-off 5ms
120us
RTD Thermocou
Item Voltage input Current input
input Input
RTD Thermocou
Item Voltage input Current input
input Input
S. K. T. E. J
Pt100. N. R. Wre3/
Pt1000. Wre5/26.
Input range -10V~+10V 0V~+10V 0V~+5V 1V~+5V 0~20mA 4~20mA
Cu50. 20]mV. [0
Cu100 50]mV. [0
100]mV
MPU use internal power supply, extend module use external power supply 24VDC ±10
Power 5VA
supply
Power 24VDC
24VDC ±20%,100mA(maximum)
consumption ±20%,50mA(maximum
6. Analog output(AO)specification
10mA
Drive
capabilit
Response 3ms
time
0.2% F.S
Precision
Indicator declare
1. CPU indicator declare
Check module
parallel bus (check
Communication abnormal between Yellow flicker:On 0.8
the RTC battery;
modul,auto dislodge the abnormal seconds and Off 0.2
check extension
module,permit user keep on operate seconds
module power
the user program
supply)
Note:the specific error code please check the system register SV3,error code corresponding the content
Module bus
Consult manage LINK the state of the indicator
state
Module no
Not light
communication
MPU
identification
the module but Green constant light
Normal have not
communication
Serial or
Green flicker:indicator light 30ms
parallel
not light 30ms
communicating
Without serial
Yellow flicker:indicator light 0.5s
or parallel
parallel power not light0.5s
communicate
supply not
enough,must
connect to external With serial or Yellow dark and shake
power supply parallel alternately:indicator not light 0.5s
communicate shark 0.5s
Without serial
Red flicker:indicator light 0.5s not
or parallel
Upgrade the light 0.5s
communicate
fireware
fail,reupgrade the
fireware of the With serial or Red dark and shake
module parallel alternately:indicator not dark 0.5s
communicate shark 0.5s
Without serial
or parallel Red constant light
communicate
Maintain
With serial or Red shark quickly:indicator light
parallel 30ms not light 30ms
communicate
Note:the specific error code please check the module parameter register CR15,error code
I/O
Indicate
indicator the state of the indicator
information
type
Without signal
Not light
output
DO With signal
Constant light
output
Pulse signal Flicker(high frequency
output often bright)
Without signal
Not light
AI Input
Without signal
output (Channel Not light
AQ abnomal)
With signal
Constant light
output
PLC be installed,must be in closed switching box,installed any mode,PLC must can heat dissipation
well,prevent temperature build-up,the plc be sure not to installed near the bottom side. up side and in
vertical direction ,and keep space all around the PLC (as follows).
2. Screw mount :each MPU or extend module have two screw fix hole ,the diameter of the hole is
4.5mm,the position and distance please refer to the external dimension diagram.
3. Connect the extend module :extend module connect to the MPU by BUS,each extend module default
comes with a extend cable when ex-factory for connect to the last module .Connection method : open
tthe right expansion interface of the last module(MPU or extend module),insert the extend cable to the
expansion interface,reset the renovate after fast the extend cable,the right expansion interface of the
module for the next extend module.in this way connect all extend module.
[ power supply and earth]
PLC power supply divide into AC and DC,pay attention to as follows when use:
1. AC supply Input voltage is 100~240VAC 50/60Hz,two line of the power supply (power line and zero
line) please connect to the L. N terminal blocks,please connect the power line (L) to the L terminal
2. DC supply Input voltage is 24VDC -15%~+20%,the positive and negative of the power
supply connect +24V. 0V terminals.
3. if connect the AC110V or AC220V to +24V terminal or Input point terminals ,the PLC will be damaged
4. Please connect the PLC to earth correctly ,the diameter of the line must be above 1.6mm.
1. Please don't mount the PLC within dust . lamblack . electric conduction dust and corrosivity or
combustible gas .Please don't mount the PLC within the environment high temperature . moisture
condensation .
2. The machine is a OPEN TYPE enclosure ,so it must be used within the environment dustproof .
moistureproof . anti-corrosionbe . safe against electric shock and impact of external forces .Must have
safeguard procedures ( as: opened by special tools or key) prevent not maintenance personnel
3. When holemaking the screw hole and wiring ,don't drop-in the scrap iron or wire head to the machine,
4. There is a seal cover the aspirail of the PLC when ex-factory, use for prevent dust or foreign bodies
invaded, before wiring, don't wipe off, after wiring , before proceed power on the PLC, please evulsion
the seal cover, in order to heat dissipation very well. Otherwise potential trigger fire hazard. fault or
malfunction.
5. Please secure mount the connecting line and all kinds of the extend modules , bad contact potential
malfunction.
6. Keep 50mm space all around the PLC , and far away the high voltage line and large electric power to
remote IO module
Overview
PLC extend module built-in a RS485 communication port , support
parallel bus ( use extend bus connect to parallel interface of PLC MPU )
differential pressure. blowing rate. flow. fan rotate speed. valve open
capacity, reduce wire and work load of all kinds of signal , meanwhile
reduce disturb because analog signal wire too long, save project invest
cost.
Click menu [Tools/Remote module] or click tool bar button , open
" remote module " manage window. All control the remote module via the
window complete.
Up picture is the 4 bit DIP switch use to set the station number of the
module, above is ON, below is OFF, in the picture black part express the
switch position, the bit set side to ON express the bit is 1, set side to
OFF express the bit is 0, first bit in up picture is ON, other bits are OFF.
The first bit of the DIP switch express the 0 bit of binary(b0), the fourth
bit of the DIP switch express third bit of binary(b3),thus ,such as the DIP
to ON side, moreover others witch set to OFF side ,then be 0011, also
If 4xbit DIP switch express the hardware address not enough to use or
set the station number. after online with the module may be modify the
"Address", then click " Parameter download", change the module station
number.
Note :If there is external DIP switch of the module, the address
set by switch will be granted (4 bit DIP switch may be set the
After only online with the module succeed ,then may be control
the module on the network ,such as up down load . parameter.
online monitor etc. .
Click " remote module " window button , open " Online " window .
Set the related parameters , general condition use the default parameter
search all useable COM serial port of the computer to user for select
by user .
19200.
is "N,8,2 RTU".
module.
will try all baud rate . all data format to communicate with the
module, so need spend longer time for waitting for search the
listing.
the problem, if can not exclusion please connect the technical support .
E. Use "USB convert to RS232 serial port data line" not correct installed
the driver
Parameter modify
as follow:
A. On the left side of the upper is module listing , here display the
listing to select be current module, all online operation of the module as:
type, major include signal type. use quantities. quantities upper lower
limit. sampling number of times. zero revise . filtering time etc.. Refer to
User can modify the parameter arbitrarily, then via " parameter download
external sensor .
Parameter upload
Click button will upload and display the parameter of
Parameter download
Click button will download the modified parameter to the
object module.
Note :any parameter be modified, only take effect after via
Firmware upgrade
Upgrade the firmware of the module, make the module support new
function.
Click " open " button , select the upgrade file according to the module.
Click "Upgrade" button ,upgrade the firmware of the module.
Online monitor
Click button enter into monitor status. Real time monitor input
channel data of current module , also may force change the output data
program, each SM has a special function.Do not use the SM which unlisted.
Power-
SM Function declare R/W off Default
preserve
SV system register
SV system register is a group of special internal register of the system,can be used unlimited in the
program, each SV has a special function.Do not use the SM which unlisted.
SV Function declare R/W Power- Default
off
preserve
SV12 Year R No 0
SV13 Month(1-12) R No 0
SV14 Day(1-31) R No 0
SV15 Hour(0-23) R No 0
SV16 Minute(0-59) R No 0
SV17 Second(0-59) R No 0
SV18 Week(1-7,Monday~Sunday) R No 0
interruption.
Interruption Priority
Interruption type
No. Declare level
1 Pulse output
PLS0 pulse output start
interruption
Hight to low
2
PLS0 pulse output complete
(the small
Interruption interruption
Priority
Interruption type no.level
priority
No. Declare
the big
interruption
no.)
3
PLS1 pulse output start
4
PLS1 pulse output complete
6
PLS2 pulse output complete
7
PLS3 pulse output start
8
PLS3 pulse output complete
9
PLS4 pulse output start
10
PLS4 pulse output complete
11
PLS5 pulse output start
12
PLS5 pulse output complete
13
PLS6 pulse output start
14
PLS6 pulse output complete
15
PLS7 pulse output start
16
PLS7 pulse output complete
17 Edge catch
X0 rise edge catch
interruption
18
X1 rise edge catch
19
X2 rise edge catch
21
X4 rise edge catch
22
X5 rise edge catch
23
X6 rise edge catch
Interruption Priority
Interruption type
No. Declare level
24
X7 rise edge catch
26
X1 drop edge catch
27
X2 drop edge catch
28
X3 drop edge catch
29
X4 drop edge catch
30
X5 drop edge catch
31
X6 drop edge catch
32
X7 drop edge catch
38
HSC2 input direction changed
40
HSC3 input direction changed
42
HSC4 input direction changed
44
HSC5 input direction changed
Interruption Priority
Interruption type
No. Declare level
46
HSC6 input direction changed
48
HSC7 input direction changed
50
T253 timer reaches target
Timed interruption
51
T254 timer reaches target
1. PLC bit component table(equivalently Modbus address type 0. 1,support Modbus function code 1.
2. 5. 15)
Modbus communication
Component Name Component range Read/Write address code Declare
Hexadecimal Decimal
2. PLC component table(equivalently Modbus address type 3. 4,sepport Modbus function code 3. 4. 6.
16)
System special
SV SV0~SV900 R/W 0x4400~0x4784 17408~18308
register
3. Declare:
1. PLC use the standard Modbus protocol(support RTU and ASCII mode),can communicate to HMI
2. PLC's Modbus addressing number from 0,Some HMI or onfiguration soft from 1,if HMI or
4x0512;if HMI or onfiguration soft modbus addressing from 1 then the address must add
component type(0/1 is bit relay ,3/4 is word register , 0/4 can read and write,1/3 read only)other
A Hardware failure, user program not runnable, needs to return to factory repair, red indicator light keeps on
Firmware excep on or user program excep on, user program not runnable, red indicator light will be on 0.5
B
seconds and be off 0.5 seconds
C Communica on excep on between the modules, automa cally remove the module with excep on, yellow
indicator light will be on 0.8 seconds and be off 0.2 seconds
Incorrect so ware setup, allow the user program to con nu, yellow indicator light will be on 0.2 seconds and
D
be off 0.8 seconds
Indicator
Error Code Message indicated Error category Indicator effect
color
0 System normal
Configuration data is illegal when power supply On 0.5 seconds and Off 0.5
95 B Red
drop seconds
Number of instructions for the same sort out of On 0.5 seconds and Off 0.5
98 B Red
scope seconds
Storage program and running program On 0.8 seconds and Off 0.2
133 C Yellow
inconsistent seconds
Normal
0
No end character
7
PC(RS232) PLC(COM1)