ManualProgramacion Xinje
ManualProgramacion Xinje
ManualProgramacion Xinje
XC Series PLCs differ from the controllers in that the signal and execution of the program
occur in the controller. In this chapter, we begin with the program forms, introduce the
main features, the supported two program languages etc.
1-2Programming Language
1-3Program Formats
Program Language
XC series PLCs support two kinds of programming language; Instruction List and Ladder, the
two languages can convert to each other.
Program Security
The program is encrypted to prevent unlawful copying or modification. When uploading the
encrypted program, you will be asked to input a password. This maintains the users
Copyright.
Program Comments
When the user program becomes too long, adding comments to the program and its soft
components may be necessary.
Offset Function
Adding offset appendix (like X3[D100], M10[D100], D0[D100]) behind coils, data registers can
realize indirect addressing. For example, when D100=9, X3[D100]=X14; M10[D100]=M19,
D0[D100]=D9
With enough basic instructions XC Series PLCs can fulfill basic sequential control; data
moving and comparing; arithmetic operation; logic control; data loop and shift etc.
XC Series PLCs also support special comparisons; high speed pulse; frequency testing;
precise time; PID control: position control etc. for interruption, high speed counter (HSC).
XC Series PLCs support C language function block. Users can call the edited function block
freely. This function reduces the program size greatly.
XC Series PLCs support Stop when Power ON PLC function. With this function, if there is a
serious problem whilst the PLC is running, this function will allow the system to stop all output
immediately.
Communication Function
XC series PLCs support many communication formats, for example, Modbus communication,
CAN-Bus communication and Free Format communication. Via a special network module
PLCs can also be connected to Ethernet or GPRS net.
Instruction List
Instruction list inputs in the form of LD, AND, OUT etc. This is the basic input form of the
programs, but its hard to read and understand;
Ladder List
With sequential control signal and soft components, it is possible to draw the sequential control
graph on the program interface, this method is called Ladder. This method uses coil signs etc.
to represent sequential circuits, so its easier to understand the program. Meantime, it allows
monitoring of the PLC showing the circuits status.
E.g.:
X0 X2
Y5
Y5
1-2-2 Alternation
Instruction Ladder
Direct Input
The above two program methods allow input in the corresponding interface separately,
however, in the ladder window, there is an instruction hint function, this improves the program
efficiency greatly.
Some of the functions, like PID anf high speed counters, have a faceplate wizard which help
guide the user when inputing the configuration and settings.
In chapter 1, we briefly covered the program languages of XC Series PLCs. However, the
most important element to a program is the operands. These elements relate to the relays
and registers inside the controller. In this chapter, we will describe the functions and
methods of using these.
2-7Timers (T)
2-8Counters (C)
2-10Constant (K, H)
2-11Pointer (P, I)
2-12Program Principle
There are many relays, timers and counters inside PLCs. They all have countless
NO (Normally ON) and NC (Normally Closed) contactors. Connecting these contactors with
the coils will make a sequential control circuit. Below, we will introduce these soft components
briefly;
Input Relay ( X )
In each basic unit, specify the ID of input relay, output relay in the form of
X000~X007X010~X017,Y000~Y007Y010~Y017 (octal form).
The expansion modules ID obeys the principle of channel 1 starts from X100/Y100,
channel 2 starts from X200/Y200 7 expansions can be connected in total.
Points to pay attention to when using:
For the input relays input filter, we use digital filter. Users can change the filter
parameters via relate settings.
PLCs are equipped with with more relays than are required for the input/output
points, these can be utilized as auxiliary relays, program as normal contactors/coils.
Output Relay ( Y )
Auxiliary relays are equipped inside PLC, represent with the sign of M;
Address assignment principle
In basic units, assign the auxiliary address in decimal form.
Points to note:
This type of relay differs from the input/output relay, it cant be used to take an
external load, it can only use in program.
A retentive relay can keep its ON/OFF status in case of PLC power OFF.
Status Relays ( S )
Timer ( T )
To facilitate different application and purposes, we can divide the counters to different types as
detailed below:
For internal count (for general use/Power OFF retentive usage)
16 bits counter: for increment count, the count range is 1~32,767
32 bits counter: for increment count, the count range is 1~2,147,483,647
These counters can be used by PLCs internal signal. The response speed is one
scan cycle or longer.
For High Speed Count (Power OFF retentive)
32 bits counter: for increment/decrement count, the count range is -2,147,483,648~
+2,147,483,647
(single phase increment count, single phase increment/decrement count, AB phase cont)
The counters are tied to specific digital input channels.
The high speed counter can count 80KHz frequency, it synchronizes with the PLCs
scan cycle.
Data Register ( D )
Constant ( B ) ( K ) ( H )
There are many registers in XC Series PLCs. In addition to the common data registers D and
FlashROM registers, we can also make registers by combining bit soft components.
Data Register ( D )
M8002
MOV K0 D0
M2
MOV K5 D0
M8000
MOV D10[D0] D100
Y0[D0]
Therein, D10[D0]=D[10+D0]Y0[D0]=Y[0+D0]
The word offset combined by bit soft components: DXn[Dm] represents DX[n+Dm]
The soft components with offset, the offset can be represented by soft component D.
X0
T11 K99
M0
MOV T11 D0
T11
Y1
FlashROM Register ( FD )
For common usage, 16 bits, (via combine two sequential 16 bits registers).
The soft components which can be combined to be words are: X, Y, M, S, T, C.
Format: add D in front of soft components, like DM10, represents a 16 bits data from
M10~M25.
Get 16 points from DXn, but not beyond the soft components range.
E.g.:
M0
MOV K21 DY0
M1
MOV K3 D0
M8000
MOV DX2[D0] D10
When M0 changes from OFF to be ON, the value in the word which is combined by
Y0~Y17 equals 21, i.e. Y0, Y2, Y4 becomes to be ON
Bit soft components structure is simple, the common ones are X, Y, M, S, T, C however, a bit of
a register can also represent:
Relay
Registers Bit
D0.4
Y0
D5[D1].4
Y1
XC1 Series
Range points
Mnemonic Name
10I/O 16 I/O 24 I/O 32 I/O 10 I/O 16 I/O 24 I/O 32 I/O
Input Points X0~X4 X0~X7 X0~X13 X0~X17 5 8 12 16
I/O points1
Output Points Y0~Y4 Y0~Y7 Y0~Y13 Y0~Y17 5 8 12 16
2
X Internal Relay X0~X77 64
3
Y Internal Relay Y0~Y77 64
M0~M199M200~M3194 320
C620~C621
C630~C631
D0~D99D100~D1494 150
XC2 Series
Range Points
Mnemonic Name 14 16 48/60
14 I/O 16 I/O 24/32 I/O 48/60 I/O 24/32 I/O
I/O I/O I/O
X0~X15 X0~X33
Input Points X0~X7 X0~X7 8 8 14/18 28/36
X0~X21 X0~X43
1
I/O Points
Output Y0~Y11 Y0~Y23
Y0~Y5 Y0~Y7 6 8 10/14 20/24
Points Y0~Y15 Y0~Y27
Internal
X2 X0~X1037 544
Relay
Internal
Y3 Y0~Y1037 544
Relay
M0~M2999
Internal 8000
M M3000~M79994
Relay
For Special Usage5M8000~M8767 768
S0~S511
S Flow 4
1024
S512~S1023
XC3 Series
Range Points
Mnemonic Name 24/32 48/60
14 I/O 24/32 I/O 48/60 I/O 14 I/O
I/O I/O
X0~X15 X0~X33
Input Points X0~X7 8 14/18 28/36
X0~X21 X0~X43
I/O Points1
Y0~Y11 Y0~Y23
Output Points Y0~Y5 6 10/14 20/24
Y0~Y15 Y0~Y27
M0~M2999
8000
M Internal Relay M3000~M79994
DATA 8000
D D4000~D79994
REGISTER
For Special Usage5D8000~D9023 1024
EXPANSIONS
7
ED INTERNAL ED0~ED16383 16384
REGISTER
XC5 Series
X0~X15 X0~X33
Input Points 14/18 28/36
X0~X21 X0~X43
I/O Points1
Y0~Y11 Y0~Y23
Output Points 10/14 20/24
Y0~Y15 Y0~Y27
M0~M3999
8000
M Internal Relay M4000~M79994
S0~S511
S Flow 4
1024
S512~S1023
DATA 8000
D D4000~D79994
REGISTER
For Special Usage5D8000~D9023 1024
EXPANSIONS
7
ED INTERNAL ED0~ED36863 36864
REGISTER
XCM Series
M0~M2999
8000
M Internal Relay M3000~M79994
DATA 4000
D D4000~D49994
REGISTER
For Special Usage5D8000~D9023 1024
FD0~FD63 64
FlashROM
5
FD For Special Usage FD8000~FD8349
REGISTER6 460
For Special Usage5FD8890~FD8999
EXPANSIONS
7
ED INTERNAL ED0~ED36863 36864
REGISTER
1: I/O points, means the terminal number that users can use to wire the input s/outputs;
2: X, means the internal input relay, the X beyond Input points can be used as middle relay;
3: Y, means the internal output relay, the Y beyond Output points can be used as middle relay;
4: The memory zone in is power off retentive zone, soft components DMSTC can change
the retentive area via setting. Please refer to 2-3-2 for details;
5: for special use, means the special registers occupied by the system, cant be used for other purpose.
6: FlashROM registers neednt set the power off retentive zone, when power is off (no battery), the
8: Input coilsoutput relays are in octal form, the other registers are in decimal form;
9: I/Os that are not connected to external devices can be used as fast internal relays;
10: for the soft components of expansion devices, please refer to related manuals;
The power off retentive area of XC Series PLCs are set as below, this area can be re-set by
user:
Systems
Soft SET Retentive
FUNCTION default
components AREA Zone
value
D FD8202 Start tag of D power off retentive zone 100 D100~D149
M FD8203 Start tag of M power off retentive zone 200 M200~M319
XC1
T FD8204 Start tag of T power off retentive zone 640 Not set
Series
C FD8205 Start tag of C power off retentive zone 320 C320~C631
S FD8206 Start tag of S power off retentive zone 512 S0~S31
D FD8202 Start tag of D power off retentive zone 4000 D4000~D4999
M FD8203 Start tag of M power off retentive zone 3000 M3000~M7999
XC2
T FD8204 Start tag of T power off retentive zone 640 Not set
Series
C FD8205 Start tag of C power off retentive zone 320 C320~C639
S FD8206 Start tag of S power off retentive zone 512 S512~S1023
D FD8202 Start tag of D power off retentive zone 4000 D4000~D7999
M FD8203 Start tag of M power off retentive zone 3000 M3000~M7999
XC3 T FD8204 Start tag of T power off retentive zone 640 Not set
Series C FD8205 Start tag of C power off retentive zone 320 C320~C639
S FD8206 Start tag of S power off retentive zone 512 S512~S1023
ED FD8207 Start tag of ED power off retentive zone 0 ED0~ED16383
D FD8202 Start tag of D power off retentive zone 4000 D4000~D7999
M FD8203 Start tag of M power off retentive zone 4000 M4000~M7999
XC5 T FD8204 Start tag of T power off retentive zone 640 Not set
Series C FD8205 Start tag of C power off retentive zone 320 C320~C639
S FD8206 Start tag of S power off retentive zone 512 S512~S1023
ED FD8207 Start tag of ED power off retentive zone 0 ED0~ED36863
D FD8202 Start tag of D power off retentive zone 4000 D4000~D4999
M FD8203 Start tag of M power off retentive zone 3000 M3000~M7999
XCM T FD8204 Start tag of T power off retentive zone 640 Not set
Series C FD8205 Start tag of C power off retentive zone 320 C320~C639
S FD8206 Start tag of S power off retentive zone 512 S512~S1023
ED FD8207 Start tag of ED power off retentive zone 0 ED0~ED36863
For counter C, we can set not only retentive zone, but also set certain counters retentive zone
Soft Set area Function Retentive Zone
Components
FD8330 Set the start tag of 16 bits positive counters retentive zone The set value~C299
FD8331 Set the start tag of 32 bits positive/negative counters The set value~C599
retentive zone
C
FD8332 Set the start tag of single phase HSCs retentive zone The set value~C619
FD8333 Set the start tag of dual direction HSCs retentive zone The set value~C629
FD8334 Set the start tag of AB phase HSCs retentive zone The set value~C639
1if the whole power off retentive zone is smaller than the segments retentive area, then the
segments area is invalid. If the total counters set range is T200~T640, FD8324 value is 150, then the
100ms accumulate timers retentive area T150~T199 is invalid.
Number List
XC Series PLCs inputs/outputs are all in octal form, each series numbers are listed below:
Range Points
Series Name
10I/O 16 I/O 24 I/O 32 I/O 10 I/O 16 I/O 24 I/O 32 I/O
X X0~X4 X0~X7 X0~X13 X0~X17 5 8 12 16
XC1
Y Y0~Y4 Y0~Y7 Y0~Y13 Y0~Y17 5 8 12 16
Range Points
Series Name 48/60
14 I/O 16 I/O 24/32 I/O 48/60 I/O 14 I/O16 I/O 24/32 I/O
I/O
X0~X15 X0~X33
X X0~X7 X0~X7 8 8 14/18 28/36
X0~X21 X0~X43
XC2
Y0~Y11 Y0~Y23
Y Y0~Y5 Y0~Y7 6 8 10/14 20/24
Y0~Y15 Y0~Y27
Range Points
Series Name 48/60
14 I/O 24/32 I/O 48/60 I/O 14 I/O 24/32 I/O
I/O
X0~X15 X0~X33
X X0~X7 8 14/18 28/36
X0~X21 X0~X43
XC3
Y0~Y11 Y0~Y23
Y Y0~Y5 6 10/14 20/24
Y0~Y15 Y0~Y27
Range Points
Series Name
24/32 I/O 48/60 I/O 24/32 I/O 48/60 I/O
X0~X15 X0~X33
X 14/18 28/36
X0~X21 X0~X43
XC5
Y0~Y11 Y0~Y23
Y 10/14 20/24
Y0~Y15 Y0~Y27
Range Points
Series Name
24 I/O 32 I/O 48 I/O 24 I/O 32 I/O 48 I/O
Output Terminal Y
Input Terminal X
XC Series PLC
CPU unit
Input Relay X
PLCs input terminals are used to accept the external signal input, while the input relays
are a type of optical relays to connect PLC inside and input terminals;
The input relays have countless normally ON/OFF contactors, they can be used freely;
The input relays which are not connected with external devices can be used as fast
internal relays;
Output Relay Y
PLCs output terminals can be used to send signals to external loads. Inside PLC, output
relays external output contactors (including relay contactors, transistors contactors)
connect with output terminals.
The output relays have countless normally ON/OFF contactors, they can be used freely;
The output relays which are not connected with external devices can be used as fast
internal relays;
XC Series PLC
Output Terminal Y
Input Image Area
Input Terminal X
CPU unit
Program
Dispose Area
Input Disposal
Before PLC executing the program, read every input terminals ON/OFF status of
PLC to the image area.
In the process of executing the program, if the input is changed, the content in the
input image area will not change. However, in the next scan cycle, the status of the
input will change.
Output Disposal
Once finished executing all the instructions, transfer the ON/OFF status of output Y
image area is set. This will be the actual output of the PLC.
The contacts used for the PLCs external output will act according to the devices
response delay time.
Number List
The auxiliary relays M in XC Series PLCs are all in decimal form, please refer the details from
tables below:
RANGE
SERIES NAME FOR POWER-OFF
FOR COMMON USE FOR SPECIAL USE
RETENTIVE USE
M8000~M8079
M8120~M8139
XC1 M M000~M199 M200~M319 M8170~M8172
M8238~M8242
M8350~M8370
RANGE
SERIES NAME FOR POWER-OFF
FOR COMMON USE FOR SPECIAL USE
RETENTIVE USE
RANGE
SERIES NAME FOR POWER-OFF
FOR COMMON USE FOR SPECIAL USE
RETENTIVE USE
RANGE
SERIES NAME FOR POWER-OFF
FOR COMMON USE FOR SPECIAL USE
RETENTIVE USE
RANGE
SERIES NAME FOR POWER-OFF
FOR COMMON USE FOR SPECIAL USE
RETENTIVE USE
In PLC, auxiliary relays M are used frequently. This type of relays coil is same with the output
relay. They are driven by soft components in PLCs;
auxiliary relays M have countless normally ON/OFF contactors. They can be used freely, but
this type of contactors cant drive external loads.
For common use
This type of auxiliary relays can be used only as normal auxiliary relays. i.e. if power
supply suddenly stops during running, the relays will disconnect.
Common usage relays cant be used for power off retentive, but the zone can be
modified;
RANGE
SERIES NAME
FOR COMMON USE FOR POWER-OFF RETENTIVE USE
XC1 S S000~S031 -
RANGE
SERIES NAME
FOR COMMON USE FOR POWER-OFF RETENTIVE USE
RANGE
SERIES NAME
FOR COMMON USE FOR POWER-OFF RETENTIVE USE
RANGE
SERIES NAME
FOR COMMON USE FOR POWER-OFF RETENTIVE USE
RANGE
SERIES NAME
FOR COMMON USE FOR POWER-OFF RETENTIVE USE
Status relays are very import in ladder programming; usually use them with
Function
instruction STL. In the form on flow, this can make the programs structure
much clearer and easy to modify;
RANGE
SERIES NAME
FOR COMMON USE POINTS
T0~T23: 100ms not accumulation
T100~T115: 100ms accumulation
T200~T223: 10ms not accumulation
XC1 T 80
T300~T307: 10ms accumulation
T400~T403: 1ms not accumulation
T500~T503: 1ms accumulation
T0~T99: 100ms not accumulation
T100~T199: 100ms accumulation
XC2
T200~T299: 10ms not accumulation
XC3
T T300~T399: 10ms accumulation 640
XC5
T400~T499: 1ms not accumulation
XCM
T500~T599: 1ms accumulation
T600~T639: 1ms with precise time
We use OUT or TMR instruction to time for the normal timers. We use constant (K) to set the
value, or use data register (D) to indirect point the set value;
Timer T0~T599 is 16 bits linear increment mode (0~K32,767), when the timers value
Timer Value
reaches the max value K32767, it stops timing. The timers status keeps still;
(Output Delay off timer)
X0 T2
Action Y0 X0
Example Y0 X0
T2 K200 Y0 T2
X0 T2
T1 K20
Counter X0
T1
T2 K10 T1 T2 T1
Y0
Y0
Number List XC Series PLCs - all decimal counter C to be addressed, for series of
numbers see the table below:
RANGE
SERIES NAME
FOR COMMON USE POINTS
C0~C23: 16 bits forward counter
C300~C315: 32 bits forward/backward counter
XC1 C C600~C603: single-phase HSC 48
C620~C621
C630~C631
C0~C299: 16 bits forward counter
XC2
C300~C599: 32 bits forward/backward counter
XC3
C C600~C619: single-phase HSC 640
XC5
C620~C629: double-phase HSC
XCM
C630~C639: AB phase HSC
TYPE DESCRIPTION
16 bits forward counter C0~C299
32 bits forward/backward C300~C599 (C300,C302...C598)(each occupies 2 counters number)
counter the number should be even
C600~C634(C600,C602...C634)( (each occupies 2 counters number)
HSC (High Speed Counter)
the number should be even
Function The assignment of common use counters and power off retentive
counters can me changed via FD parameters from peripheral devices;
16 bits binary increment counters, the valid value is K1~K32,767 (decimal type
constant). The set value K0 and K1 has the same meaning. i.e. the output
contact works on the first count starts
If you cut off the power programmable
Sixteen counter for general use \ Latched
X0
RST C0 controller, the general count of the
counter is cleared, and the latched
X1
C0 K10 counter can be used to store the count
value before the power outage, so the
C0 last time the counter value according to
Y0
the cumulative count.
X001 count input C0 of each drive coil once the counter current value plus 1,
the coil in the implementation of the tenth command, the output contact action.
Enter the X001 again after the counter movement, counter current value will
continue to add 1.
If the reset input X000 is ON, the RST instruction is executed, the counter's
current value is 0, reset input contact.
Counter set value, in addition to the constant K set, but also by the data
register number specified. For example, specify the D10, if the contents of D10
to 123, then set the K123 with the same time.
In a MOV instruction to set the value of such data is written above the current
value register, then the next input, the output coil connected to the current
value into a register set value.
X2
M8238 If the X2 driver M8238, was counting
down; was not driven by the count.
X3
RST C300
According to constant K D of the
X4 content or data register, setting the
C300 K10
value is positive. The even number
C300 data register as a pair, as 32-bit data
Y1
processing. Thus, when the
designated D0, D1 and D0 two 32-bit
settings as a treatment. C300 X004
driver using the input coil count when
the up / down counting.
If the reset input X3 is ON, the RST instruction is executed, the current value of the
counter becomes 0, the output contact is reset.
Use for Latched counter, the counter's current value, the output contacts reset
state action and latched.
16-bit counter
X001
C0 K100 X000
MOV K100 D5
X001
C0 D5
32-bit counter
X001
C300 K43,100 X000
DMOV K43100 D0
X001
C300 D0D1
Count
Counter C0 ~ C299 counting mode is 16-bit linear increment mode (0 ~ K32, 767), when
the counter reaches the maximum count K32, 767 will stop the clock, the counter remains
unchanged.
Counter C300 ~ C599 counting mode is 32-bit linear add / drop mode (-2,147,483,648
+2,147,483,647), when the counter reaches its maximum count value increment K2,
147,483,647 will become K-2, 147,483,648, when the counter counts down to minimum K-2,
147,483,648 will become K2, 147,483,647, the state of the counter with the count should
change.
Number List XC Series PLCs - all data register D to be addressed in decimal, for
series of numbers see the table below:
RANGE
SERIES NAME FOR POWER OFF
FOR COMMON USE FOR SPECIAL USE
RETENTIVE USE
D8000~D8029
D8060~D8079
D8120~D8179
XC1 D D0~D99 D100~D149 138
D8240~D8249
D8306~D8313
D8460~D8469
D8000~D8511
XC2 D D0~D999 D4000~D4999 612
D8630~D8729
XC3
D D0~D3999 D4000~D7999 D8000~D9023 1024
XC5
Data register is used to store data devices, including 16-bit (MSB is sign
Structure
bit), 32 (a combination of two data registers, the MSB is sign bit) of two
types.
Read and write data register values commonly used application instructions.
In addition, through other devices, such as man-machine interface to the
PLC to write or read values.
In the specified 32-bit register, if specified low as D0, the default of its high for the
subsequent D1. Low can be odd or even any of the device to specify, but for the
convenience, we recommend the use of even lower device number.
Function
General Use
When the data register to write successfully, just not re-write, then the data in the
register will remain unchanged.
When the PLC goes from RUN to STOP or STOP to RUN, all data will be cleared.
Latched
Latched area of data registers in the PLC from RUN to STOP or power failure, the
data remains unchanged.
Latched area range, can be set by the user.
Special Use
Special register is used to write with the specific purpose of data, or specific content
is written by the system data.
Some special registers in the data, the PLC is powered on, is initialized.
M2
MOV K5 D0
M8000
MOV D10[D0] D100
Y0[D0]
Example Data register D can handle a variety of data, the data register can be achieved
Action through a variety of control.
Data Storage
M0 is turned on, write to the D0 16-bit, decimal number 100.
M0
MOV K100 D0
M1 is turned on, to D11D10 write 32-bit decimal number 41100.
M1 As the value of 41100 is 32 bits (over 32,767), and therefore
DMOV K41100 D10
store data, although designated as D10, but D11 is also
automatically occupied.
Data Transfer
M0
MOV D0 D10 M0 is switched on, the D0 of the data transfer to the D10.
M0
MOV C10 D0 M0 is switched on, the counter current value of C10 in the
D0 in reading.
Constant K
K is the symbol that a decimal integer, such as K10, expressed in decimal 10. It is
used for the specified timer, counter settings, and application instructions and
number of operations.
Constant H
H is the hex number of symbols, such as H10, is the hex number 10. Mainly used to
specify the application instruction operand values.
Tag PI
Tag for branch (P) is used in condition jump or subroutines jump target;
Tag for interruption (I) is used to specify the e input interruption, time interruption;
The tags P, I are both in decimal form, each coding principle is listed below:
XC1XC2XC3XC5XCM P P0~P9999
RANGE
FOR EXTERNAL INTERRUPTION
SERIES NAME Falling
Input Rising edge For time interruption
edge
terminals interruption
interruption
X2 I0000 I0001 There are 10 channels time interruption, the
XC2 I X5 I0100 I0101 represent method is: I40**~I49**. (**
X10 I0200 I0201 represents interruption time, the unit is mm)
RANGE
FOR EXTERNAL INTERRUPTION
SERIES NAME I/O
Input Rising edge Falling edge For time interruption
terminals interruption interruption
14 X7 I0000 I0001
X2 I0000 I0001
24
X5 I0100 I0101 There are 10 channels time interruption,
32
XC3 I X10 I0200 I0201 the represent method is: I40**~I49**. (**
19 X10 I0000 I0001 represents interruption time, the unit is mm)
48 X7 I0100 I0101
60 X6 I0200 I0201
RANGE
FOR EXTERNAL
INTERRUPTION
SERIES NAME I/O
Rising Falling For time interruption
Input
edge edge
terminals
interruption interruption
X2 I0000 I0001
X5 I0100 I0101 There are 10 channels time interruption, the
24
XCM I X10 I0200 I0201 represent method is: I40**~I49**. (**
32
X11 I0300 I0301 represents interruption time, the unit is mm)
X12 I0400 I0401
Condition Jump CJ
X0
CJ P1
If coil X0 gets ON, jump to the step behind
X1 tag P1;
Y0
If the coil X0 is not ON, do not execute
P1 jump action, but run with the original
program;
X2
RST T0
Tag P
X0
CALL P10
Main program
P10
Subroutine
SRET
Accepts input signal from the special input terminals, not effected by the scan
cycle. Activates the input signal, executes the interruption subroutine.
With external interruption, PLC can dispose the signal shorter than scan cycle;
Tag I
Time interruption
Input disposal
Before PLC executing the program, read all the input terminals ON/OFF status of
PLC to the image area. In the process of executing the program, even the input
changed, the content in the input image area will not change. However, in the input
disposal of next scan cycle, read out the change.
Output disposal
Once finished executing all the instructions, transfer the ON/OFF status of output Y
image area to the output lock memory area. This will be the actual output of the PLC.
The contacts used for the PLCs exterior output will act according to the devices
response delay time.
When using this input/output format in a batch, the drive time and operation cycle of input
filter and output device will also appear as per the response delay.
3-3[AND], [ANI]
3-4[OR], [ORI]
3-6[LDD], [LDDI]
3-7[ORB]
3-8[ANB]
3-9[MCS], [MCR]
3-10[ALT]
3-11[PLS], [PLF]
3-12[SET], [RST]
3-14[NOP], [END]
3-15[GROUP], [GROUPE]
3-16Programming Notes
All XC1, XC2, XC3, XC5, XCM series support the instructions below:
XYMSTCDn.mFDn.m
Directly)
X
LDI Initial logical operation 3-2
(LoaD contact type NC (normally BGOON S1 S2
Inverse) closed)
XYMSTCDn.mFDn.m
X
LDP Initial logical 3-5
(LoaD Pulse) operation-Rising edge pulse
XYMSTCDn.mFDn.m
XYMSTCDn.mFDn.m
X
ANDP Serial connection of rising 3-5
(AND Pulse) edge pulse D
XYMSTCDn.mFDn.m
XYMSTCDn.mFDn.m
XYMSTCDn.mFDn.m
X
ORI Parallel connection of NC 3-4
(OR Inverse) (normally closed) contacts D
XYMSTCDn.mFDn.m
X
ORP Parallel connection of rising 3-5
(OR Pulse) edge pulse
XYMSTCDn.mFDn.m
XYMSTCDn.mFDn.m
Y
SET Set a bit device permanently 3-12
(SET) ON D
YMSTCDn.m
YMSTCDn.m
XYMSTCDn.m
XYMSTCDn.m
None
GROUP Group 3-15
None
GROUPE Group End S D n 3-15
X0
PMOV D5 D10 K3
None
TMR Time 2-7
Operands: XYMSTCDn.mFDn.m
DevicesXYMSTCDn.mFDn.m
Operands: XYMSTCDn.m
Statements
Connect the LD and LDI instructions directly to the left bus bar, or use them to define
a new block of program when using ANB instruction.
OUT instruction is the coil drive instruction for the output relays, auxiliary relays
status, timers, counters. But this instruction cant be used for the input relays
Can not sequentially use parallel OUT command for many times.
For the timers time coil or counters count coil, after using OUT instruction, set
constant K is necessary.
10ms Timer
132,767 0.01327.67 sec
100ms Timer
0.13276.7 sec
Program
X0 LD X0
Y100
OUT Y100
X1
M1203 LDI X1
OUT M1203
T0 K19
OUT T0 K19
T0
Y1 LD T0
OUT Y1
Operands: XYMSTCDn.mFDn.m
Operands: XYMSTCDn.mFDn.m
Statements
Use the AND and the ANI instruction for serial connection of contacts. As many
contacts as required can be connected in series. They can be used for many times.
The output processing to a coil, through writing the initial OUT instruction is called a
follow-on output (For an example see the program below: OUT M2 and OUT Y003).
Follow-on outputs are permitted repeatedly as long as the output order is correct.
Theres no limit for the serial connected contacts Nr. and follow-on outputs number.
Program LD X2
D1 D2
AND M1
X0 OUT Y2
MSET M10 M120 LD Y2
ANI X3
OUT M2
AND T1
OUT Y3
Operands: XYMSTCDn.mFDn.m
Operands: XYMSTCDn.mFDn.m
Statements
Use the OR and ORI instructions for parallel connection of contacts. To connect a block
that contains more than one contact connected in series to another circuit block in
parallel, use an ORB instruction, which will be described later;
OR and ORI start from the instructions step, parallel connect with the LD and LDI
instructions step said before. There is no limit for the parallel connect times.
LD X5
Program OR X6
D2
OR M11
OUT Y6
LDI Y6
AND M4
OR M12
ANI X7
OR M13
OUT M100
Relationship with ANB
Operands: XYMSTCDn.mFDn.m
Z R S T M 5 0 0 M 5 5 9
Z R S T D 0 D 1 0 0
pulse)
Operands: XYMSTCDn.mFDn.m
Operands: XYMSTCDn.mFDn.m
Operands: XYMSTCDn.mFDn.m
LDP, ANDP, ORP are active for one program scan after the associated devices switch
from OFF to ON.
LDF, ANDF, ORF are active for one program scan after the associated devices switch
from ON to OFF.
LDP X5
Program
D 2 ORP
OUT
X6
M13
LD M8000
ANDP X7
OUT M15
contact directly D
Devices: X
LDDI Read the normally closed X0
contact directly D
Devices: X
ANDD Read the status from the X0
contact directly D
Devices: X
ANDDI Read the normally closed X0
contact directly D
Devices: X
ORD Read the status from the
contact directly X0
D
Devices: X
ORDI Read the normally closed
contact directly X0
D
Devices: X
OUTD Output to the contact Y0
D
directly
Devices: Y
The function of LDD, ANDD, ORD instructions are similar with LD, AND, OR;
LDDI, ANDDI, ORDI instructions are similar with LDI, ANDI, ORI; but if the operand is X,
the LDD, ANDD, ORD commands read the signal from the terminals directly, this is the
only difference.
OUTD and OUT are output instructions. But if OUTD is used, output immediately if the
condition comes true, needn't wait the next scan cycle.
LDD X0
D 1
LDDI X2
Program
ORD X2
ANB
OUTD Y0
Statements
The serial connection with two or more contacts is called "serial block". If parallel connect
the serial block, use LD, LDI at the branch start place, use ORB at the stop place;
As the ANB instructionan ORB instruction is an independent instruction and is not
associated with any device number.
There are no limitations to the number of parallel circuits when using an ORB instruction in
the sequential processing configuration.
Program
Recommended good
Non-preferred batch
programming method
programming method
LD X0
LD X0
AND X1
AND X1
LD X2
LD X2
AND X3
AND X3
LD X4
ORB
AND X5
LD X4
ORB
AND X5
ORB
ORB
OUT Y10
Statements
(1) To declare the starting point of the circuit block, use a LD or LDI
instruction. After completing the parallel circuit block, connect it to the
preceding block in series using the ANB instruction.
(2) It is possible to use as many ANB instructions as necessary to connect
a number of parallel circuit blocks to the preceding block in series.
Program
LD X0
OR X1
LD X2 Start of a branch
AND X3
LDI X4
AND X5
ORB End of a parallel circuit block
OR X6
ANB
OR X7 Serial connect with the preceding circuit
OUT Y20
DevicesNone
Statements
After the execution of an MCS instruction, the bus lineLD, LDIshifts to
a point after the MCS instruction. An MCR instruction returns this to the
original bus line.
MCS, MCR instructions should use in pair.
The bus line could be used nesting. Between the matched MCS, MCR
instructions use matched MCS, MCR instructions. The nest level
increase with the using of MCS instruction. The max nest level is 10.
When executing MCR instruction, go back to the upper bus line.
When use flow program, bus line management could only be used in the
same flow. When end some flow, it must go back to the main bus line.
X1 X2 LD X1
Program Y0
MCS Bus line starts
M1 M3
Y1 LD X2
M2 OUT Y0
Y2
LD M1
MCS Bus line nest
LD M3
OUT Y1
LD M2
OUT Y2
MCR
MCR Bus line back
LDP M100
Program
ALT M0
CM
LS D LD
OUT
LDI
M0
Y0
M0
OUT Y1
Devices YMSTCDn.m
PLF Falling/trailing
(Pulse edge pulse SHL D n
Falling)
Devices YMSTCDn.m
Program LD X0
PLS M0
SH
RD n
LD M0
SET Y0
----------------------
LD X1
PLF M1
LD M1
RST Y0
Devices YMSTCDn.m
Statements Turning ON X010 causes Y000 to turn ON. Y000 remains ON even after
X010 turns OFF. Turning ON X011 causes Y000 to turn OFF. Y000
remains OFF even after X011 turns OFF. Its the same with M, S.
SET and RST instructions can be used for the same device as many times
as necessary. However, the last instruction activated determines the
current status.
It is also possible to use RST instruction to reset the current contents of
timer, counter and contacts.
When use SET, RST commands, avoid to use the same ID with OUT
command.
Programming of
high speed
In the preceding example, when M0 is ON, carry on positive count with OFFON
of X0.
Counters current value increase, when it reaches the set value (K or D), the
output contact is reset.
When M1 is ON, counters C600 output contact is reset, counters current value
turns to be 0.
Mnemonic Function
Format and DevicesNone
When executing END instruction, refresh monitor timer. (Check if scan cycle is a long
timer.)
Devices: None
GROUPE GROUP END
WTD S D
Devices: None
Statements
There are other methods. E.g. jump instructions or step ladder. However, when use step ladder,
if the main programs output coil is programmed, then the disposal method is the same with
dual coil, please note this.
4-3Flow Instructions
4-5Move Instructions
4-8Data Convert
4-9Floating Operation
4-10Clock Operation
Program Flow
X 1
B M O V D 1 0 D 9 K 3
S D n
X0
OR OR activates ifS1S2 PMOV D5 D10 K3 4-4-3
S D n
OR OR activates ifS1S2 X0
DFMOV D0 D10 K3 4-4-3
ZCP X2
FW R T D 0 FD 0 K3 4-5-2
area
D 1 D2
BMOV Block move X0
MSET M 10 M 120 4-5-4
D 1 D 2
X 0
Z R S T M 5 0 0 M 5 5 9
D
1
0 D
D 2
1 0 0
4-5-11
SFTL S D n1 n2
SFTL Bit shift left 4-7-4
SFTR S D n1 n2
SFTR Bit shift right 4-7-5
Clock Operation
In this manual, the applied instructions are described in the following manner:
1: Summary
ADDITION [ADD]
16 bits ADD 32 bits DADD
Execution Normally ON/OFF, Rising/Falling Suitable XC1.XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S1 Specify the augend data or register 16 bits/32 bits, BIN
S2 Specify the summand data or register 16 bits/32 bits, BIN
D Specify the register to store the sum 16 bits/32 bits, BIN
Description
<16 bits instruction>
S1 S2 D
X0
ADD D10 D12 D14
D10D12D14
D11D10D13D12D15D14
2. If the result of a calculations is 0, the 0 flag acts. If the result exceeds 323,767(16 bits
limit) or 2,147,483,648 ( 32 bits limit), the carry flag acts. ( refer to the next page). If the
result exceeds -323,768 (16 bits limit) or -2,147,483,648 (32 bits limit ) , the borrow flag
acts (Refer to the next page).
3. When carry on 32 bits operation, word devices 16 bits are assigned, the device follow
closely the preceding devices ID will be the high bits. To avoid ID repetition, we
recommend you assign devices ID to be even ID.
4. The same device may be used a source and a destination. If this is the case then the
result changes after every scan cycle. Please note this point.
Related Flag
M8021 Borrow
OFFthe calculate result is not over 32767(16bits) or 2147483647(32bits)
M8022 Carry
OFFthe calculate result is not over 32767(16bits) or 2147483647(32bits)
Double word32 bitengrosses two data register, its composed by two consecutive data
registers, the first one is assigned by double word object instruction. The dispose bound is:
1Flag after executing the instruction. Instructions without the direct flag will not display.
2 S Source operand, its content wont change after executing the instruction.
3 D Destinate operand, its content changes with the execution of the instruction.
4Tell the instructions basic action, using way, applied example, extend function, note items etc.
1: Summary
As used to run a part of program, CJ shorten the operation cycle and using the dual coil
Condition Jump [CJ]
16 bits CJ 32 bits -
Execution Normally ON/OFF coil Suitable XC1.XC2.XC3.XC5.XCM
condition Models
Hardware - Software -
requirement requirement
2.Operands
Operands Function Data Type
Pn Jump to the target (with pointer Nr.) P (P0~P9999) Pointer's Nr.
Other Pointer
P I
X0
CJ P6
In the left graph, Y000 becomes to
X1 be dual coil output, but when
Y0
X000=OFF, X001 activates; when
X2 X000=ON, X005 activates
RST T246
CJ cant jump from one STL to
X3 another STL;
T246 K1000
After driving time T0~T640 and
X4 HSC C600~C640, if execute CJ,
MOV K3 D0 continue to work, the output
activates.
P6
X0
CJ P7
X5
Y0
P7
X6
RST T246
2.Operands
Operands Function Data Type
Pn Jump to the target (with pointer Nr.) P Pointer's Nr.
(P0~P9999)
Others Pointer
P I
X0
Description CALL P10
Main Program
1: Summary
Instructions to specify the start, end, open, close of a flow;
Open the specified flow, close the local flow [SET]
16 bits SET 32 bits -
Execution Normally ON/OFF, Suitable Models XC1.XC2.XC3.XC5.XCM
condition Rising/Falling edge
Hardware - Software -
requirement requirement
Open the specified flow, not close the local flow [ST]
16 bits ST 32 bits -
Execution Normally ON/OFF, Suitable Models XC1.XC2.XC3.XC5.XCM
condition Rising/Falling edge
Hardware - Software -
requirement requirement
Flow starts [STL]
16 bits STL 32 bits -
Execution - Suitable Models XC1.XC2.XC3.XC5.XCM
condition
Hardware - Software -
requirement requirement
Flow ends [STLE]
16 bits STLE 32 bits -
Execution - Suitable Models XC1.XC2.XC3.XC5.XCM
condition
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
Sn Jump to the target flow S Flow ID
Bit System
Operands
X Y M S T C Dn.m
Sn
STL and STLE should be used in pairs. STL represents the start of a flow, STLE
represents the end of a flow.
After executing of SET Sxxx instruction, the flow specified by these instructions is ON.
After executing RST Sxxx instruction, the specified flow is OFF.
In flow S0, SET S1 close the current flow S0, open flow S1.
In flow S0, ST S2 open the flow S2, but dont close flow S0.
When flow turns from ON to be OFF, reset OUTPLSPLFnot accumulate timer etc.
SET S0
STL S0
SET S1
ST S2
STLE
STL S1
STLE
STL S2
STLE
1: Summary
Loop execute the program between FOR and NEXT with the specified times;
Loop starts [FOR]
16 bits FOR 32 bits -
Execution Rising/Falling edge Suitable Models XC1.XC2.XC3.XC5.XCM
condition
Hardware - Software -
requirement requirement
Loop ends [NEXT]
16 bits NEXTs 32 bits -
Execution Normally ON/OFF, Suitable Models XC1.XC2.XC3.XC5.XCM
condition Rising/Falling edge
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Programs loop times between FOR~NEXT 16 bits, BIN
S
M0
FO R K5
M1
FO R K6
IN C D0 [A ]
NEXT
M3 [C ]
FO R K7
IN C D1 [B ]
NEXT
NEXT
1: Summary
FEND means the main program ends, while END means program ends;
main program ends [FEND]
Execution condition - Suitable Models XC1.XC2.XC3.XC5.XCM
Hardware - Software -
requirement requirement
program ends [END]
Execution condition - Suitable Models XC1.XC2.XC3.XC5.XCM
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
None - -
Even though [FEND] instruction represents the end of the main program, if
Description
execute this instruction, the function is same with END. Execute the
output/input disposal, monitor the refresh of the timer, return to the 0th step.
If program the tag of CALL instruction behind FEND instruction, there must be SRET
instruction. If the interrupt pointer program behind FEND instruction, there must be
IRET instruction.
After executing CALL instruction and before executing SRET instruction, if execute
FEND instruction; or execute FEND instruction after executing FOR instruction and
before executing NEXT, then an error will occur.
In the condition of using many FEND instruction, please compile routine or
subroutine between the last FEND instruction and END instruction.
2: Operands
Operands Function Data Type
S1 Specify the Data ( to be compared) or soft 16/32bits, BIN
components address code
S2 Specify the comparands value or soft components 16/32 bits, BIN
address code
Description
X1
LD D200 K-30 SET Y1
M4
2: Operands
Operands Function Data Type
S1 Specify the Data ( to be compared) or soft 16/32bit,BIN
components address code
S2 Specify the comparands value or soft components 16/32bit,BIN
address code
BG
OO
NS1 S2
When the source datas highest bit (16 bitsb1532 bitsb31) is 1
Notes
use the data as a negative.
The comparison of 32 bits counter (C300~) must be 32 bits
instruction. If assigned as a 16 bits instruction, it will lead the program
error or operation error.
2: Operands
Operands Function Data Type
S1 Specify the Data ( to be compared) or soft 16/32 bit,BIN
components address code
S2 Specify the comparands value or soft components 16/32 bit,BIN
address code
Notes When the source datas highest bit (16 bitsb1532 bitsb31) is 1
use the data as a negative.
The comparison of 32 bits counter (C300~) must be 32 bits
instruction. If assigned as a 16 bits instruction, it will lead the program
error or operation error.
2: Operands
Operands Function Data Type
S1 Specify the data (to be compared) or soft components 16 bit,BIN
address code
S Specify the comparands value or soft components 16 bit,BIN
address code
D Specify the compare results address code bit
S1 S D
Description X0
CMP D10 D20 M0
M0
D10 > D20 ON
M1
D10 = D20 ON
M2
D10 < D20 ON
Compare data S1 and S , output the three points ON/OFF status (start
with D
1: Summary
Compare the two specify Data with the current data, output the result.
Data Zone compare [ZCP]
16 bits ZCP 32 bits DZCP
Execution Normally ON/OFF, rising/falling Suitable XC1.XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S1 Specify the down-limit Data (of the compare stand) or 16 bit, BIN
soft components address code
S2 Specify the Up-limit Data (of the compare stand) or 16 bit, BIN
soft components address code
S Specify the current data or soft components address 16 bit, BIN
code
D Specify the compare results data or soft components bit
address code
S1 S2 S D
Description X0
ZCP D20 D30 D0 M0
M0
D20 D0 M0 ON
M1
D20 D0 D31 M1 ON
M2
D0 D31 M2 ON
Even X000=OFF stop ZCP instructionM0~M2 will keep the original status
1: Summary
Move the specified data to the other soft components
MOV [MOV]
16 bits MOV 32 bits DMOV
Execution Normally ON/OFF, rising/falling Suitable XC1.XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Specify the source data or registers address code 16 bit/32 bit, BIN
D Specify the target soft components address code 16 bit/32 bit, BIN
Description
Move the source data to the target
When X000 is off, the data keeps
same
S D
X0 Convert constant K10 to be BIN
MOV K10 D10
code automatically
<read the counters or times current value> <indirectly specify the counters ,times set value>
DMOV D0 D10 Please use DMOV when the value is 32 bits, such as
MUL instruction, high speed counter
DMOV C235 D20
(D1D0)(D11D10)
2: Operands
Operands Function Data Type
S Specify the source data block or soft component 16 bits, BIN; bit
address code
D Specify the target soft components address code 16 bits, BIN; bit
n Specify the move datas number 16 bits, BIN;
Bit
Operands System
X Y M S T C Dn.m
S
D
S D n
X0
BMOV D5 D10 K3
D5 D10
D6 D11 n=3
D7 D12
(2) As the following picture, when the data address overlapped, the
instruction will do from 1 to 3.
X1
BMOV D10 D9 K3
X2
BMOV D10 D11 K3
D10 D9
D11 D10
D12 D11
D10 D11
D11 D12
D12 D13
1: Summary
Move the specified data block to the other soft components
Data block mov[PMOV]
16 bits PMOV 32 bits -
Execution Normally ON/OFF coil Suitable XC1.XC2.XC3.XC5.XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Specify the source data block or soft component 16 bits, BIN; bit
address code
D Specify the target soft components address code 16 bits, BIN; bit
n Specify the move datas number 16 bits, BIN;
Oper system
Bit
ands X Y M S T C Dn.m
S
D
D5 D10
D6 D11 n=3
D7 D12
The function of PMOV and BMOV is mostly the same, but the PMOV
has the faster speed
PMOV finish in one scan cycle, when executing PMOV , close all the
interruptions
Mistake many happen, if there is a repeat with source address and
target address
1: Summary
Move the specified data block to the other soft components
Fill Move [FMOV]
16 bits FMOV 32 bits DFMOV
Execution Normally ON/OFF, rising/falling Suitable XC1.XC2.XC3.XC5.XCM
condition edge Models
Hardware DFMOV need above V3.0 Software -
requirement requirement
2: Operands
Operands Function Data Type
S Specify the source data block or soft component 16 bits, BIN; bit
address code
D Specify the target soft components address code 16 bits, BIN; bit
n Specify the move datas number 16 bits, BIN;
S D n
X0
DFMOV D0 D10 K3
K0 K0 D0
K0 D1
K0 D2
K0 D3
K0 D4
n
K0 D5
K0 D6
K0 D7
K0 D8
K0 D9
1: Summary
Write the specified data to other soft components
FlashROM Write [FWRT]
16 bits FWRT 32 bits DFWRT
Execution rising/falling edge Suitable XC1.XC2.XC3.XC5.XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S The data write in the source or save in the soft 16 bits/32 bits, BIN
element
D Write in target soft element 16 bits/32 bits, BIN
D1 Write in target soft element start address 16 bits/32 bits, BIN
D2 Write in data quantity bit
S D S D1 D2
X1 X2
DFWRT D0 FD0 FWRT D0 FD0 K3
Write value in D0,D1 into FD0,FD1 Write value in D0,D1,D2 into FD0,FD1,FD2
1FWRT instruction only allow to write data into FlashRom register. In this storage, even battery drop,
data could be used to store important technical parameters
2Written of FWRT needs a long time, about 150ms, so frequently operate this operate this operate
operation is recommended
3The written time of Flshrom is about 1,000,000 times. So we suggest using edge signal (LDP, LDF
etc.) to trigger.
4Frequently written of FlashROM
1: Summary
Set or reset the soft element in certain range
Multi-set [MSET]
16 bits MSET.ZRST 32 bits -
Execution Normally ON/OFF Suitable XC1.XC2.XC3.XC5.XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
D1 Start soft element address bit
D2 End soft element address bit
D1 D2
Description X0
MSET M10 M120 Zone set unit M10~M120
When D1 > D2 will not run Zone set, set M8004.M8067and D8067=2
1: Summary
Reset the soft element in the certain range
Multi-reset [ZRST]
16 bits ZRST 32 bits -
Execution Normally ON/OFF Suitable XC1.XC2.XC3.XC5.XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
D1 Start address of soft element Bit:16 bits,BIN
D2 End address of soft element Bit:16 bits,BIN
D1 D2
Description X0 Zone reset bits M5 00~M559
ZRST M500 M559
D1 D2
Zone reset words D0~D100
ZRST D0 D100
When D1 > D2 only reset the soft unit specified in D1 and set
M8004.M8067D8067=2.
1. As soft units separate reset instruction, RST instruction can be used to bit unit
Other Reset
Y, M, S and word unit T, C, D
Instruction
2. As fill move for constant K0, 0 can be written into DX, DY, DM, DS, T, C, D.
1: Summary
Swap the high and low byte
High and low byte swap [SWAP]
16 bits SWAP 32 bits -
Execution Normally ON/OFF Suitable XC1.XC2.XC3.XC5.XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S The address of the soft element 16 bits: BIN
S
Description X0
SWAP D10
D10
8
Upper 8 bits 8
Lower 8 bits
1: Summary
Exchange the data in two soft element
Exchange [XCH]
16 bits XCH 32 bits DXCH
Execution Normally ON/OFF Suitable XC1.XC2.XC3.XC5.XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
D1 The soft element address 16 bits, BIN
D2 The soft element address 16 bits, BIN
1: Summary
Add two numbers and store the result
Add [ADD]
16 bits ADD 32 bits DADD
Execution Normally ON/OFF Suitable XC1.XC2.XC3.XC5.XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S1 The number address 16 bit/32 bit, BIN
S2 The number address 16 bit/32bit, BIN
D The result address 16 bit/32bit, BIN
S1 S2 D
Description X0
ADD D10 D12 D14
D10D12D14
3. The data contained within the two source devices are combined and the total is stored in the
specified destination device. Each datas highest bit is the sign bit, 0 stands for positive1
stands for negative. All calculations are algebraic processed.5+-8=-3
4. If the result of a calculation is 0, the 0 flag acts. If the result exceeds 32376716 bits limit
or 2,147,483,64732 bits limit, the carry flag acts.refer to the next page. If the result
exceeds 323,76816 bits limitor 2,147,483,64832 bits limit, the borrow flag actsRefer
to the next page
5. When carry on 32 bits operation, word devices low 16 bits are assigned, the device following
closely the preceding devices ID will be the high bits. To avoid ID repetition, we recommend
you assign devices ID to be even ID.
6. The same device may be used as a source and a destination. If this is the case then the result
changes after every scan cycle. Please note this point.
Flag meaning:
1: Summary
Sub two numbers, store the result
Subtraction [SUB]
16 bits SUB 32 bits DSUB
Execution Normally ON/OFF Suitable XC1.XC2.XC3.XC5.XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S1 The number address 16 bits /32 bits,BIN
S2 The number address 16 bits /32 bits,BIN
D The result address 16 bits /32 bits,BIN
Description S1 S2 D
X0
SUB D10 D12 D14 D10D12D14
7. S1 appoint the soft units content, subtract the soft units content appointed by S2 in
the format of algebra. The result will be stored in the soft unit appointed by D .
(5-(-8)=13)
8. The action of each flag, the appointment method of 32 bits operations soft units are
both the same with the preceding ADD instruction.
9. The importance is: in the preceding program, if X0 is ON, SUB operation will be
executed every scan cycle
1: Summary
Multiply two numbers, store the result
Multiplication [MUL]
16 bits MUL 32 bits DMUL
Execution Normally ON/OFF Suitable XC1.XC2.XC3.XC5.XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S1 The number address 16 bits/32bits,BIN
S2 The number address 16 bits/32bits,BIN
D The result address 16 bits/32bits,BIN
10. The contents of the two source devices are multiplied together and the result is stored at the
destination device in the format of 32 bits. As in the upward chart:
when (D0)=8,(D2)=9, (D5, D4) =72.
11. The results highest bit is the symbol bit: positive (0), negative (1).
12. When be bit unit, it can carry on the bit appointment of K1~K8. When appoint K4, only the
results low 16 bits can be obtained.
13. When use 2 bits Operation, the result is stored at the destination device in the
format of 64 bits.
14. Even when utilizing word device, 64 bits results cant be monitored at once.
1: Summary
Divide two numbers and store the result
Division [DIV]
16 bits DIV 32 bits DDIV
Execution Normally ON/OFF, rising/falling Suitable XC1.XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S1 The number address 16 bits / 32 bits, BIN
S2 The number address 16 bits /32 bits, BIN
D The result address 16 bits /32 bits, BIN
15. S1 appoints the devices content be the dividend, S2 appoints the devices content
be the divisor, D appoints the device and the next one to store the result and the
remainder.
16. In the above example, if input X0 is ON, devision operation is executed every scan
cycle.
17. The dividend is composed by the device appointedS1by and the next one. The
divisor is composed by the device appointed
S2by and the next one. The result and
D by
the remainder are stored in the four sequential devices, the first one is appointed
18. If the value of the divisor is 0, then an operation error is executed and the operation of
the DIV instruction is cancelled
19. The highest bit of the result and remainder is the symbol bit (positive:0, negative: 1).
When any of the dividend or the divisor is negative, then the result will be negative.
When the dividend is negative, then the remainder will be negative.
2: Operands
Operands Function Data Type
D The number address 16 bits / 32bits,BIN
D
X0
INC D0 D01(D0)
<Decrement [DEC]>
D
X1
DEC D0 D01 D0
1: Summary
Get the mean value of numbers
Mean [MEAN]
16 bits MEAN 32 bits DMEAN
Execution Normally ON/OFF, rising/falling Suitable XC1.XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S The head address of the numbers 16 bits, BIN
D The mean result address 16 bits, BIN
n The number quantity 16 bits, BIN
Description
S D n
X0
MEAN D0 D10 K3
25. The value of all the devices within the source range is summed and
then divided by the number of devices summed, i.e. n.. This generates
an integer mean value which is stored in the destination device (D) The
remainder of the calculated mean is ignored.
26. If the value of n is specified outside the stated range (1 to 64) an error is
generated.
1: Summary
Do logic AND, OR, XOR for numbers
Logic AND [WAND]
16 bits WAND 32 bits DWAND
Execution Normally ON/OFF, rising/falling Suitable XC1.XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
Logic OR[WOR]
16 bits WOR 32 bits DWOR
Execution Normally ON/OFF, rising/falling Suitable XC1.XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
Logic Exclusive OR [WXOR]
16 bits WXOR 32 bits DWXOR
Execution Normally ON/OFF, rising/falling Suitable XC1.XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S1 The soft element address 16bit/32bit,BIN
S2 The soft element address 16bit/32bit,BIN
D The result address 16bit/32bit,BIN
If use this instruction along with CML instruction, XOR NOT operation
could also be executed.
S1 S2 D
X0
WXOR D10 D12 D14
1: Summary
Converse the phase of the numbers
Converse [CML]
16 bits CML 32 bits DCML
Execution Normally ON/OFF, rising/falling Suitable XC1.XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Source number address 16 bits/32 bits, BIN
D Result address 16 bits/32 bits, BIN
D0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Si gn 0=posi t i ve
bi t 1=negat i ve
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
Y17 Y7 Y6 Y5 Y4
27. Each data bit in the source device is inverted 1001 and sent to the
destination device. If use constant K in the source device, it can be auto
convert to be binary.
28. Its available when you want to inverted output the PLCs output
X0
M0 The sequential control instruction in
the left could be denoted by the
X1
M1 following CML instruction.
X2
M2 M8000
CML DX0 DM0
X3
M3
X17
M17
1: Summary
Get the negative number
Negative [NEG]
16 bits NEG 32 bits DNEG
Execution Normally ON/OFF, rising/falling Suitable XC1.XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
D The source number address 16 bits/ bits, BIN
D
Description M0
NEG D10 (D10) +1 (D10)
29. The bit format of the selected device is inverted, I.e. any
occurrence of a 1 becomes a 0 and any occurrence of 0
becomes 1, when this is complete, a further binary 1 is added to
the bit format. The result is the total logic sigh change of the
selected devices contents.
1: Summary
Do arithmetic shift left/right for the numbers
Arithmetic shift left [SHL]
16 bits SHL 32 bits DSHL
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
Arithmetic shift right [SHR]
16 bits SHR 32 bits DSHR
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
D The source data address 16bit/32bit,BIN
n Shift left or right times 16bit/32bit,BIN
< Arithmetic shift left > < Arithmetic shift right >
1: Summary
Do logic shift right/left for the numbers
Logic shift left [LSL]
16 bits LSL 32 bits DLSL
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
Logic shift right [LSR]
16 bits LSR 32 bits DLSR
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2. Operands
LSR and SHR is different, LSR add 0 in high bit when moving, SHR all bits are moved.
< Logic shift left > < Logic shift right >
1: Summary
Continue and cycle shift left or right
Rotation shift left [ROL]
16 bits ROL 32 bits DROL
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
Rotation shift right [ROR]
16 bits ROR 32 bits DROR
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
D Source data address 16 bits/32 bits, BIN
n Shift right or left times 16 bits/32 bits, BIN
< Rotation shift left > < Rotation shift right >
1: Summary
Bit shift left
Bit shift left [SFTL]
16 bits SFTL 32 bits DSFTL
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Types
S Source soft element head address bit
D Target soft element head address bit
n1 Source data quantity 16 bits /32 bits, BIN
n2 Shift left times 16 bits/32 bits, BIN
M15~M12Overflow
M11~M 8M15~M 12
M 7~M 4M11~M8
M 3~M 0M7~M4
X 3~X 0M3~M0
1: Summary
Bit shift right
Bit shift right [SFTR]
16 bits SFTR 32 bits DSFTR
Execution rising/falling edge Suitable XC2.XC3.XC5.XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Source soft element head address bit
D Target soft element head address bit
n1 Source data quantity 16 bits/32 bits, BIN
n2 Shift right times 16 bits/32 bits, BIN
M 3~M 0Overflow
M 7~M 4M3~M0
M11~M 8M7~M4
M15~M12M11~M8
X 3~X 0M15~M12
1: Summary
Word shift left
Word shift left [ [WSFL]
16 bits WSFL 32 bits -
Execution rising/falling edge Suitable XC2.XC3.XC5.XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Source soft element head address 16 bits/32 bits, BIN
D Target soft element head address 16 bits /32 bits, BIN
n1 Source data quantity 16 bits /32 bits, BIN
n2 Word shift left times 16 bits /32 bits, BIN
D25~D22Overflow
D21~D18D25~D22
D17~D14D21~D18
D13~D10D17~D14
D 3~D 0D13~D10
1: Summary
Word shift right
Word shift right [WSFR]
16 bits WSFR 32 bits -
Execution rising/falling edge Suitable XC2.XC3.XC5.XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Source soft element head address 16 bits/32 bits, BIN
D Target soft element head address 16 bits/32 bits, BIN
n1 Source data quantity 16 bits/32 bits, BIN
n2 Shift right times 16 bits/32 bits, BIN
n2
D13~D10Overflow
D17~D14D13~D10
D21~D18D17~D14
D25~D22D21~D18
D 3~D 0D25~D22
1: Summary
Single word integer converts to double word integer [WTD]
16 bits WTD 32 bits -
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Source soft element address 16 bits, BIN
D Target soft element address 32 bits, BIN
S D
Description X0
WTD D0 D10 D0 D11D10
0 or 1 D0
D11 D10
High bits Low bits
1: Summary
16 bits integer converts to float point [FLT]
16 bits FLT 32 bits DFLT 64 bits FLTD
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Source soft element address 16 bits/32 bits/64 bits,BIN
D Target soft element address 32 bits/64 bits,BIN
<64 bits>
S D
X0
FLTD D10 D14 D13,D12,D11,D10 D17,D16,D15,D14
Convert BIN integer to binary float point. As the constant K ,H will auto convert by
the float operation instruction, so this FLT instruction cant be used.
The instruction is contrary to INT instruction
1: Summary
Float point converts to integer [INT]
16 bits INT 32 bits DINT
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Source soft element address 16 bits/32 bits, BIN
D Target soft element address 16 bits/32 bits, BIN
<16 bits>
Description
S D D11,D10 (D20)
X0
INT D10 D20
Binary Float BIN integer
<32 bits>
S D
X0 D11,D10 (D20,D21)
DINT D10 D20
Binary Float BIN integer
The binary source number is converted into a BIN integer and stored at the
destination device. Abandon the value behind the decimal point.
This instruction is contrary to FLT instruction.
When the result is 0, the flag bit is ON
When converting, less than 1 and abandon it, zero flag is ON.
The result is over below data, the carry flag is ON.
16 bits operation: -32,768~32,767
32 bits operation: -2,147,483,648~2,147,483,647
1: Summary
BCD convert to binary [BIN]
16 bits BIN 32 bits -
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Source soft element address BCD
D Target soft element address 16 bits/32 bits, BIN
S D
X0
BIN D10 D0
When source data is not BCD code, M8067Operation error, M8004 (error occurs)
1: Summary
Binary convert to BCD [BCD]
16 bits BCD 32 bits -
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Source soft element address 16 bits/32 bits, BIN
D Target soft element address BCD code
S D
X0
BCD D10 D0
1: Summary
Hex. convert to ASCII [ASCI]
16 bits ASCI 32 bits -
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Source soft element address 2 bits, HEX
D Target soft element address ASCII code
n Transform character quantity 16 bits, BIN
S D n
X0
ASCI D100 D200 K4
S D
Convert each bit of sources (S) Hex. format data to be ASCII code, move separately to
the high 8 bits and low 8 bits of destination (D). The convert alphanumeric number is
assigned with n.
D is low 8 bits, high 8 bits, store ASCII data.
n
Assign start device K1 K2 K3 K4 K5 K6 K7 K8 K9
D
(D100)=0ABCH D200 down [C] [B] [A] [0] [4] [3] [2] [1] [8]
(D101)=1234H D200 up [C] [B] [A] [0] [4] [3] [2] [1]
D201 down [C] [B] [A] [0] [4] [3] [2]
[0]=30H [1]=31H
D201 up [C] [B] [A] [0] [4] [3]
[5]=35H [A]=41H
D202 down [C] [B] [A] [0] [4]
[2]=32H [6]=36H
D202 up [C] [B] [A] [0]
[B]=42H [3]=33H
D203 down [C] [B] [A]
[7]=37H [C]=43H
D203 up [C] [B]
[4]=34H [8]=38H
D204 down [C]
1: Summary
ASCII converts to Hex. [HEX]
16 bits HEX 32 bits -
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Function Date type
Operands
S Source soft element address ASCII
D Target soft element address 2 bits, HEX
n Character quantity 16 bits, BIN
Convert the high and low 8 bits in source S to HEX data. Move 4 bits
every time to destination D . The convert alphanumeric number is
assigned by n.
n=k4
D200 0 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0
D201 0 1 0 0 0 0 1 1 0 1 0 1 0 0 1 0
D100 0 0 0 0 1 0 1 0 1 0 1 1 1 1 0 0
0 A B C
1: Summary
Transform the ASCII code to Hex numbers.
Coding [DECO]
16 bits DECO s -
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Source soft element address ASCII
D Target soft element address 2 bits HEX
n The coding soft element quantity 16bits, BIN
7 6 5 4 2 1 0
0 0 0 0 1 0 0 0
M17 M16 M15 M14 M13 M12 M11 M10
1: Summary
Transform the ASCII code to hex numbers
High bit coding [ENCO]
16 bits ENCO 32 bits -
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S data address need coding 16 bits, BIN; bit
D Coding result address 16 bits, BIN
n soft element quantity to save result 16 bits, BIN
b15 D10 4
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
b0
All be 0
S D n
X1
ENCO D0 D1 K3
b15 D0 b0
0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0
7 6 5 4 2 1 0
b15 D1 4
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
b0
All be 0
If many bits in the source ID are 1, ignore the low bits. If source ID are all 0, dont execute
the instructions.
When drive input is OFF, the instruction is not executed, encode output doesnt change.
When n=8, if encode instructions S is bit unit, its point number is 2^8=256
1: Summary
Transform the ASCII to hex numbers.
Low bit coding [ENCOL]
16 bits ENCOL 32 bits -
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Soft element address need coding
16bit,BINbit
b15 D10 4
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
b0
All be 0
b15 D0 b0
0 1 0 1 0 1 0 1 0 0 1 0 1 0 0 0
7 6 5 4 2 1 0
b15 D1 4
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
b0
All be 0
If many bits in the source ID are 1, ignore the high bits. If source ID are all 0,
When drive input is OFF, the instruction is not executed, encode output dont
change
When n=8, if encode instructions S is bit unit, its point number is 2^8=256
1: Summary
Float Compare [ECMP]
16 bits - 32 bits ECMP
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S1 Soft element address need compare 32 bits, BIN
S2 Soft element address need compare 32 bits, BIN
D Compare result bit
S1 S2 D
X0
ECMP D10 D20 M0
M1 (D11,D10) = (D21<D20)
Binary Floating Binary Floating
(D11,D10) < (D21<D20)
M2
Binary Floating Binary Floating
The status of the destination device will be kept even if the ECMP
instruction is deactivated.
The binary float data of S1 is compared to S2. The result is indicated by 3 bit
devices specified with the head address entered as D
If a constant K or H used as source data, the value is converted to floating point
before the addition operation.
X0
ECMP K500 D100 M10
K500: D101D100M10,M11,M12
1: Summary
Float Zone Compare [EZCP]
16 bits - 32 bits EZCP
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S1 Soft element address need compare 32 bits, BIN
S2 Upper limit of compare data 32 bits, BIN
S3 Lower limit of compare data 32 bits, BIN
D The compare result soft element address bit
S1 S2 S3 D
X0
EZCP D10 D20 D0 M3
The status of the destination device will be kept even if the EZCP
instruction is deactivated.
X0
EZCP K10 K2800 D5 M0
Please set S1<S2, when S2>S1, see S2 as the same with S1 and compare them
1: Summary
Float Add [EADD]
16 bits - 32 bits EADD
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S1 Soft element address need to add 32 bits, BIN
S2 Soft element address need to add 32 bits, BIN
D Result address 32 bits, BIN
The floating point values stored in the source devices S1 and S2 are algebraically
added and the result stored in the destination device D.
If a constant K or H used as source data, the value is converted to floating point
before the addition operation.
X1
EADD D100 K1234 D110
The same device may be used as a source and as the destination. If this is the
case then, on continuous operation of the EADD instruction, the result of the
previous operation will be used as a new source value and a new result calculated.
This will happen in every program scan unless the pulse modifier or an interlock
program is used.
1: Summary
Float Sub [ESUB]
16 bits - 32 bits ESUB
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S1 Soft element address need to subtract 32 bits, BIN
S2 Soft element address need to subtract 32 bits, BIN
D Result address 32 bits, BIN
S1 S2 D
X0
Description ESUB D10 D20 D50
The floating point value of S2 is subtracted from the floating point value of S1 and the
result stored in destination device D.
If a constant K or H used as source data, the value is converted to floating point
before the addition operation.
X1
ESUB K1234 D100 D110
The same device may be used as a source and as the destination. If this is the case
then, on continuous operation of the EADD instruction, the result of the previous
operation will be used as a new source value and a new result calculated. This will
happen in every program scan unless the pulse modifier or an interlock program is
2: Operands
Operands Function Data Type
S1 Soft element address need to multiply 32 bits, BIN
S2 Soft element address need to multiply 32 bits, BIN
D Result address 32 bits, BIN
Description S1 S2 D
X0
EMUL D10 D20 D50
The floating value of S1 is multiplied with the floating value point value of S2. The
result of the multiplication is stored at D as a floating value.
If a constant K or H used as source data, the value is converted to floating point
before the addition operation.
X1
EMUL K100 D100 D110
2: Operands
Operands Function Data Type
S1 Soft element address need to divide 32 bits, BIN
S2 Soft element address need to divide 32 bits, BIN
D Result address 32 bits, BIN
S1 S2 D
Description X0
EDIV D10 D20 D50
X1
EDIV D100 K100 D110
1: Summary
Float Square Root [ESQR]
16 bits - 32 bits ESQR
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S The soft element address need to do square root 32 bits, BIN
D The result address 32 bits, BIN
S D
Description X0
ESQR D10 D20 D11,D10 D21,D20
A square root is performed on the floating point value in S the result is stored in D
If a constant K or H used as source data, the value is converted to floating point
before the addition operation.
X1
ESQR K1024 D110
K1024 D111D110
1: Summary
Float Sine[SIN]
16 bits - 32 bits SIN
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S The soft element address need to do sine 32 bits, BIN
D The result address 32 bits, BIN
Description S D
X0
SIN D50 D60
(D51,D50) (D61,D60)SIN
Binary Floating Binary Floating
This instruction performs the mathematical SIN operation on the floating point value
in S (angle RAD). The result is stored in D.
SIN value
D D61 D60
Binary Floating
1: Summary
Float Cosine[COS]
16 bits - 32 bits COS
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Soft element address need to do cos 32 bits, BIN
D Result address 32 bits, BIN
S D
Description X0
COS D50 D60
(D51,D50)RAD (D61,D60)COS
Binary Floating Binary Floating
This instruction performs the mathematical COS operation on the floating point
value in S (angle RAD). The result is stored in D.
COS value
D D61 D60
Binary Floating
1: Summary
TAN [TAN]
16 bits - 32 bits TAN
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Data Type
S Soft element address need to do tan 32bit,BIN
D Result address 32bit,BIN
S D
Description X0
TAN D50 D60
(D51,D50)RAD (D61,D60)TAN
Binary Floating Binary Floating
This instruction performs the mathematical TAN operation on the floating point
value in S. The result is stored in D.
TAN value
D D61 D60
Binary Floating
1: Summary
ASIN [ASIN]
16 bits - 32 bits ASIN
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware V3.0 and above version Software -
requirement requirement
2: Operands
Operands Function Data Type
S Soft element address need to do arcsin 32 bits, BIN
D Result address 32 bits, BIN
S D
Description X0
ASIN D50 D60
(D51,D50)ASIN (D61,D60)RAD
Binary Floating Binary Floating
This instruction performs the mathematical ASIN operation on the floating point
value in S. The result is stored in D.
1: Summary
ACOS [ACOS]
16 bits - 32 bits ACOS
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware V3.0 and above Software -
requirement requirement
2: Operands
Operands Function Data Type
S Soft element address need to do arccos 32 bits, BIN
D Result address 32 bits, BIN
S D
Description X0
ACOS D50 D60
(D51,D50)ACOS (D61,D60)RAD
Binary Floating Binary Floating
Calculate the arcos value(radian), save the result in the target address
1: Summary
ATAN [ATAN]
16 bits - 32 bits ACOS
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware V3.0 and above Software -
requirement requirement
2: Operands
Operands Function Data Type
S Soft element address need to do arctan 32 bit, BIN
D Result address 32 bit, BIN
S D
Description X0
ATAN D50 D60
(D51,D50)ATAN (D61,D60)RAD
Binary Floating Binary Floating
Calculate the arctan value ( radian), save the result in the target address
1: Instruction Summary
Read the clock data:
Read the clock data: [TRD]
16 bits TRD 32 bits -
Execution Normally ON/OFF, rising/falling Suitable XC2.XC3.XC5.XCM
condition edge Models
Hardware V2.51 and above Software -
requirement requirement
2: Operands
Operands Function Data Type
D Register to save clock data 16 bits, BIN
Functions D
and Actions X0
TRD D0
The current time and date of the real time clock are read and stored in
the 7 data devices specified by the head address D.
2: Operands
Operands Function Data Type
S Write the clock data to the register 16 bits, BIN
Functions S
The 7 data devices specified with the head
X0
and Actions TWR D0 address S are used to set a new current
value of the real time clock.
(3) Write the set clock data into PLCs real time clock.
In order to write real time clock, the 7 data devices specified with the head
address S should be pre-set.
After executing TWR instruction, the time in real time clock will immediately change to be
the new set time. So, when setting the time it is a good idea to set the source data to a
time a number of minutes ahead and then drive the instruction when the real time reaches
this value.
In this chapter we explore high speed counters functions, including high speed count
model, wiring method, read/write HSC value, reset etc.
5-1Functions Summary
5-9HSC Examples
5-10HSC Interruption
24 segments HSC
OUT 5-10
Interruption
XC series PLCs have an HSC (High Speed Counter) function which is independent of the
scan cycle. By choosing different counters, the high speed input signals can be tested with
detect sensors and rotary encoders. The highest testing frequency can reach 80KHz.
The XC Series high speed counter function has three count modes: Increment Mode,
Pulse + Direction Mode and AB phase Mode;
Increment Mode
Under this mode, count and input the pulse signal, the count value increase at each pulses
rising edge;
Under this mode, the pulse signal and direction signal are inputted, the count value increases
or decreases with the direction signals status. When the count signal is OFF, the count inputs
rising edge carry on plus count; When the count signal is ON, the count inputs rising edge
carry on minus count;
Under this mode, the HSC value increases or decreases according to two differential signals
(A phase and B phase). There are two frequyency modes available: 1-time frequency and
4-time frequency. The default count mode is 4-time mode.
1-time Frequency
4-time Frequency
HSCs count range is: K-2, 147, 483, 648 ~ K+2, 147, 483, 647. If the count value overflows
this range, then up flow or down flow appears;
For up flow, it means the count value jumps from K+2, 147, 483, 647 to be K-2, 147, 483, 648,
then continues to count; For down flow, it means the count value jumps from K-2, 147, 483,
648 to be K+2, 147, 483, 647 then continues to count.
For the counters pulse input wiring, things differ with different PLC models and counter models;
several typical input wiring methods are shown below: (take XC3-48 as the example):
Description of Letters:
U Dir A B
Pulse input Count Direction Judgment A phase input B phase input
(OFF=increment, ON=decrement)
Normally, X0 and X1 can accept 80KHz frequency under single phase mode and AB phase
mode. Other terminals can accept only 10KHz under single phase mode, 5KHz under AB
phase mode. X can use as normal input terminals when they are not used as high speed input.
The detailed assignment is shown as below:
XC3-14 PLC
PLC Software Manual Page 194 of 365 LMAN021_R2V2
AB Phase
Increment Pulse+Dir Input
Mode
C60 C60 C60 C60 C60 C61 C61 C61 C61 C61 C62 C62 C62 C62 C62 C63 C63 C63
0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4
*Max.F 10K 10K 10K 10K 10K 10K 5K
4-times F
Count
Interrupt
X000 U U A
X001 Dir B
X002 U
X003 U
X004
X005 U
XC3-19AR-E
AB Phase
Increment Pulse+Dir Input
Mode
C60 C60 C60 C60 C60 C61 C61 C61 C61 C61 C62 C62 C62 C62 C62 C63 C63 C63
0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4
Max.F 10K 10K 10K 10K 10K 10K 5K 5K
4-times F
Count
Interrupt
X000 U U A
X001 Dir B
X002 U U A
X003 Dir B
X004 U
X005 U
XC3-4860 PLC
AB Phase
Increment Pulse+Dir Input
Mode
C60 C60 C60 C60 C60 C61 C61 C61 C61 C61 C62 C62 C62 C62 C62 C63 C63 C63
0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4
Max.F 80K 80K 10K 10K 80K 80K 80K 80K
4-times F
Count
Interrupt
X000 U U A
X001 Dir B
X002 U U A
X003 Dir B
X004 U
X005 U
All high speed counters support read instruction [HSCR] and write instruction [HSCW].
Hardware must be V3.1c and above.
1: Instruction Summary
Read HSC value to the specified register;
Read from HSC [HSCR]/ write to HSC [HSCW]
16 bits - 32 bits HSCR
Instruction Instruction
Execution Normally ON/OFF, rising/falling Suitable
XC2XC3XC5XCM
condition edge models
Hardware V3.1c and above Software -
requirement requirement
2: Operands
Operands Function Type
S Specify HSC code 32 bits, BIN
D Specify the read/written register 32 bits, BIN
When the activate condition is true, read the HSC value in C630 (DWORD) into
D10 (DWORD)
Instruction HSCR reads the HSC value into the specified register, improve HSC
values precision.
Sample Program:
1: Instruction Summary
Write the specified register value into HSC;
Write HSC value [HSCW]
16 bits - 32 bits HSCW
Instruction Instruction
Execution Normally ON/OFF, rising/falling Suitable
XC2XC3XC5XCM
condition edge models
Hardware V3.1c and above Software -
requirement requirement
2: Operands
Operands Function Type
S Specify HSC code 32 bits, BIN
D Specify the read/written register 32 bits, BIN
When the activated condition is true, write the value in D20 (DWORD) into C630
(DWORD), the original value is replaced;
We suggest users to apply high speed counter only with HSCR and HSCW, not with other
instructions like DMOV, LD>, DMUL etc. and users must run after converting HSC to be
other registers.
M0 C600 K2000
M1 C600
R
In the above graph, when M0 is ON, C600 starts to count the input pulse on X0; when
M1 changes from OFF to be ON, reset C600, clears the count value
About AB phase counter, modify the frequency multiplication value via setting FLASH data
register FD8241, FD8242, FD8243. If the value is 1, it is 1-time frequency, if it is 4, it is 4-time
frequency.
Below, we take XC3-60 PLC as the example, to introduce HSCs program form;
When M0 is ON, C600 starts the HSC with the OFFON of X000;
When comes the rising edge of M1, reset HSC C600
Increment Mode
When normally ON coil M8000 is ON, set the value of C600, the set value is
K888888888, read the HSC value (DWORD) into data register D0 (DWORD).
If the value in C600 is smaller than value in D2, set the output coil Y0 ON; If the value
in C600 equals or be larger than value in D2, and smaller than value in D4, set the
output coil Y1 ON; If the value in C600 equals or be larger than value in D4, set the
output coil Y2 ON;
When comes the rising edge of M1, resets HSC C600 and stops counting.
Pulse+Direction Mode
When M4 is ON, C620 starts the HSC with the OFFON of X000; judge the count
direction according to the input X001 status (OFF or ON). If X001 is OFF, its increment
count; if X001 is ON, its decrement count;
When it reaches the rising edge of M5, it will reset HSC C620 and stop counting.
When the rising edge of initial positive pulse coil M8002 comes, i.e. Each scan cycle
starts, HSC C630 reset and clear the count value.
When set coil M8000 ON, C630 starts to count, the count value is set to be K8888888
If the count value is greater than K0 but smaller than K100, the output coil Y0 set ON; If
the count value is greater thanK100 but smaller than K200
the output coil Y1 set ON;
If the count value is greater thanK200, the output coilY2 set ON;
To XC series PLC, each HSC channels has 24 segments 32-bit pre-set value. When the
HSC difference value equals the correspond 24-segment pre-set value, then interruption
occurs according to the interruption tag;
To use this function, please use hardware V3.1c or above;
As shown in the above graph, data register D4000 is the start ID of 24-segment pre-set value
area. As a back-up, save each pre-set value in DWORD form. Please pay attention when
using HSC:
If certain pre-set value is 0, it means count interruption stops at this segment;
Set the interruption pre-set value but not write the correspond interruption program is
not allowed;
24-segment interruption of HSC occurs in order. I.e. If the first segment interruption
doesn't happen, then the second segment interruption will not happen;
24-segment pre-set value can be specified to be relative value or absolute value.
Meantime, users can specify the set value to be loop or not. But the loop mode can't be
used together with absolute value.
In the below table, we list each counter's 24-segment pre-set value to its interruption tag.
E.g.: 24-segment pre-set value of counter C600 correspond with the interruption pointer:
I1001I1002I1003I1024.
E.g. 1, the current value is C630 is 0, the first preset value is 10000, the preset value in
segment 2 is 5000, and the preset value in segment 3 is 20000.
When counting begins: if the counter's current value is 10000, the first interruption I2501 will
be generated.
When counting begins: if the counter's current value is 5000, the first interruption I2502 will be
generated.
When counting begings: if the counter's current value is 25000, the first interruption I2503 will
be generated.
I2501
C600= K0+K10000=K10000
I2502
C600= K10000+K 5000=K5000
I2503
C600= K5000+K20000=K25000
When count begins, if the counter's current value is 20000, this generates first interruption at
I2501;
When count begins, if the counter's current value is 25000, this generates first interruption at
I2502
When count begins, if the counter's current value is 45000, this generates first interruption at
I2503.
I2501
C600= K10000+K10000=K20000
I2502
C600= K20000+K5000=K25000
I2503
C600= K25000+K20000=K45000
With setting the special auxiliary relays, users can set the HSC interruption to be unicycle
mode or continuous loop mode. The loop mode is only suitable with the relative count. The
detailed assignment is show below:
ID HSC ID Setting
M8270 24 segments HSC interruption loop (C600)
M8271 24 segments HSC interruption loop (C602)
M8272 24 segments HSC interruption loop (C604)
M8273 24 segments HSC interruption loop (C606)
M8274 24 segments HSC interruption loop (C608)
M8275 24 segments HSC interruption loop (C610)
M8276 24 segments HSC interruption loop (C612)
M8277 24 segments HSC interruption loop (C614)
OFF: unicycle mode
M8278 24 segments HSC interruption loop (C616)
ON: continuous loop mode
M8279 24 segments HSC interruption loop (C618)
M8280 24 segments HSC interruption loop (C620)
M8281 24 segments HSC interruption loop (C622)
M8282 24 segments HSC interruption loop (C624)
M8283 24 segments HSC interruption loop (C626)
M8284 24 segments HSC interruption loop (C628)
M8285 24 segments HSC interruption loop (C630)
M8286 24 segments HSC interruption loop (C632)
M8287 24 segments HSC interruption loop (C634)
The system theory is shown as below: Control of the inverter via PLC, Processing the
movement, via the feedback signal from encoder, control the knit-weaving machine and realize
the precise position.
In this chapter we explain the pulse function of XC series PLCs. The content includes
pulse output instructions, input/output wiring, items to note in relation to coils and registers
etc.
6-1Functions Summary
6-3Output Wiring
6-4Items to Note
6-5Sample Programs
PULSE OUTPUT
Unidirectional
ration pulse
PLSY output without PLSY S1 S2 D 6-2-1
ACC/DEC time
change
Variable
PLSF frequency PLSF S D 6-2-2
pulse output
Ration pulse
output with
PLSR PLSR S1 S2 S3 D 6-2-3
ACC/DEC
speed
PLSNEXT/ Pulse Section
PLSNT S 6-2-4
PLSNT Switch
Refresh Pulse
PLSMV PLSMV S D 6-2-6
Nr. immediately
Relative
DRVI Position DRVI S1 S2 S3 D1 D2 6-2-8
Control
Absolute
DRVA Position DRVA S1 S2 S3 D1 D2 6-2-9
Control
Absolute
Position
PLSA PLSA S1 S2 D 6-2-10
multi-section
pulse control
Generally, XC3 and XC5 series PLC are equipped with 2CH pulse output function. Via different
instructions, users can realize unidirectional pulse output without ACC/DEC speed;
unidirectional pulse output with ACC/DEC speed; multi-segments, positive/negative output etc.,
the output frequency can reach 400K Hz.
Stepping Motor
Y0 Y1 Y2
COM0 COM1 COM2
Driver
1: To use pulse output, please choose PLC with transistor output, like XC3-14T-E or XC3-60RT-E etc.
2: XC5 series 32I/O PLC has 4CH (Y0, Y1, Y2, Y3) pulse output function.
1: Instruction Summary
Instruction to generate ration pulse with the specified frequency;
Unidirectional ration pulse output without ACC/DEC time change [PLSY]
16 bits PLSY 32 bits DPLSY
instruction instruction
Execution Normally ON/OFF coil Suitable
XC2XC3XC5XCM
condition models
Hardware - Software -
requirement requirements
2: Operands
Operands Function Type
S1 Specify the frequencys value or register ID 16 bits/32 bits, BIN
S2 Specify the pulse number or registers ID 16 bits /32 bits, BIN
D Specify the pulse output port bit
16 bits Instruction
S1 S2 D
M0
PLSY K30 D1 Y0
M8170
RST M0
32 bits Instruction
S1 S2 D
M0
DPLSY K30 D1 Y0
M8170
RST M0
When finish sending the set pulse number, stop outputting automatically
Items to Note
If the control object is stepping/servo motor, we recemend users not use this
instruction, to avoid the motor losing synchronism. PLSR is available.
1: Instruction Summary
2: Operands
Operands Function Type
S Specify the frequency or register ID 16 bits/32 bits, BIN
D Specify pulse output port bit
S D
M0
PLSF D0 Y0
Frequency range: 6Hz~400KHz (when the set frequency is lower than 200Hz,
output 200Hz)
Pulse can only be output at Y000 or Y001.
With the changing of setting frequency in D0, the output pulse frequency changes at
Y0
S D
M0
DPLSF D0 Y0
Frequency range: 6Hz~400KHz (when the set frequency is lower than 200Hz, output
200Hz)
Pulse can only be output at Y000 or Y001.
With the changing of setting frequency in D0, the output pulse frequency changes at
Y0
Accumulate pulse number in register D8170 (DWord)
Output Mode
Sequential output pulse with the set frequency till stop output via the instruction
PLSR/DPLSR instruction has two control modes. Below we will introduce one by one;
1: Instruction Summary
Generate certain pulse quantity (segmented) with the specified frequency and
acceleration/deceleration time
Segmented uni-directional pulse output [PLSR]
16 bits PLSR 32 bits DPLSR
Instruction Instruction
Execution Normally ON/OFF coil Suitable
XC2XC3XC5XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Type
S1 Specify the soft components start ID of the segmented 16 bit/ 32 bit, BIN
pulse parameters
S2 Specify acceleration/deceleration time or soft 16 bit/ 32 bit, BIN
components ID
D Specify the pulse output port Bit
S1 S2 D
M0
PLSR D0 D100 Y0
M8170
RST M0
S1 S2 D
M0
DPLSR D0 D100 Y0
M8170
RST M0
The parameters address is a section starts from Dn or FDn. In the above example (16bit
instruction form): D0 shows the first segment pulses highest frequency; D1 shows the first
segments pulse number; D2 shows the second segment pulses highest frequency; D3
shows the second segments pulse number if the set value in DnDn+1 is 0, this
represents the end of segment, the segment number is not limited.
To 32 bit instruction DPLSR, D0, D1 set the first segment pulses highest frequency; D2,
D3 set the first segments pulse number; D4, D5 set the second segment pulses highest
frequency; D6, D7 set the second segments pulse number
Acceleration/deceleration time is the time from the start to the first segments highest
frequency. Meantime, it defines the slope of all segments frequency to time. In this way
the following acceleration/deceleration will perform according to this slope.
Pulse can be output at only Y000 or Y001
Frequency range: 0~400KHz;
Pulse number range: 0~K32,767 (16 bits instruction) 0~K2,147,483,647 (32 bits
instruction)
Acceleration/deceleration time : below 65535 ms
1: Instruction Summary Generate certain pulse quantity with the specified frequency
acceleration/deceleration time and pulse direction ;
Segmented dual-directional pulse output [PLSR]
16 bits PLSR 32 bits DPLSR
Instruction Instruction
Execution Normally ON/OFF coil Suitable
XC2XC3XC5XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Type
S1 Specify the soft components start ID of the segmented pulse 16 bit/ 32 bit, BIN
parameters
S2 Specify acceleration/deceleration time or soft components 16 bit/ 32 bit, BIN
ID
D1 Specify the pulse output port Bit
D2 Specify the pulse output directions port Bit
operands system
Bit
X Y M S T C Dn.m
D1
D2
S1 S2 D1 D2
M0
PLSR D0 D100 Y0 Y3
M8170
RST M0
The parameters address is a section starts from Dn or FDn. In the above example: D0 set
the first segment pulses highest frequency; D1 sshows the first segments pulse number;
D2 shows the second segment pulses highest frequency; D3 shows the second segments
pulse number if the set value in DnDn+1 is 0, this represents the end of segment, the
number of segments available is not limited.
Acceleration/deceleration time is the time from the start to the first segments highest
frequency. Meantime, it defines the slope of all segments frequency to time. In this way the
following acceleration/deceleration will perform according to this slope.
Pulse can be output at only Y000 or Y001
Y for Pulse direction can be specified freely. E.g.: if in S1 (the first segment) the pulse
number is positive, Y output is ON; if the pulse number is negative, Y output is OFF; Note: in
the first segments pulse output, the pulse direction is only decided by the pulse numbers
nature (positive or negative) of the first segment.
Frequency range: 0~400KHz;
Pulse number range: 0~K32,767 (16 bits instruction)0~K2,147,483,647 (32 bits instruction)
Acceleration/deceleration time : below 65535 ms
1: Instruction Summary
Enter the next pulse output;
Pulse segment switch [PLSNEXT]/[PLSNT]
16 bits PLSNEXT/PLSNT 32 bits -
Instruction Instruction
Execution Rising/falling edge Suitable
XC2XC3XC5XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Type
D Specify the pulse output port Bit
M0
PLSR D0 D100 Y0
D
M1
PLSNEXT Y0
If the pulse output reaches the highest frequency at the current segment, and output
steadily at this frequency; when M1 changes from OFF to ON, then enter the next
pulse output with the acceleration/deceleration time;
Run the instruction within the acceleration/deceleration time is invalid;
Instruction PLSNT is the brief of PLSNEXT, the functions are same;
1: Instruction Summary
Stop pulse output immediately;
Pulse stop [STOP]
16 bits STOP 32 bits -
Instruction Instruction
Execution Rising/falling edge Suitable
XC2XC3XC5XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Type
D Specify the port to stop pulse output Bit
operands system
Bit
X Y M S T C Dn.m
D
M0
PLSR D0 D100 Y0
D
M1
STOP Y0
M8170
RST M0
When M000 changes from OFF to be ON, PLSR output pulse at Y000. D0 specifies the
frequency, D001 specifies the pulse number, D100 specifies the
acceleration/deceleration time; when the output pulse number reaches the set value,
stop outputting the pulse; on the rising edge of M001, STOP instruction stops outputting
the pulse at Y000.
1: Instruction Summary
Refresh the pulse number at the port;
Refresh the pulse number at the port [PLSMV]
16 bits - 32 bits PLSMV
Instruction Instruction
Execution Normally ON/OFF coil Suitable
XC2XC3XC5XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Type
S Specify the pulse number or soft components ID 32bit, BIN
D Specify the port to refresh the pulse Bit
When the working table is moving backward, it gets the origin signal X2, executes
the external interruption, PLSMV command run immediately, this is not effected by
the scan cycle. Refresh the pulse number from Y0 and send to D8170.
This instruction is used remove the accumulation difference caused in pulse
control.
1: Instruction Summary
Back to the Origin
Back to the Origin [ZRN]
16 bits ZRN 32 bits DZRN
Instruction Instruction
Execution Normally ON/OFF coil Suitable
XC2XC3XC5XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Type
S1 Specify the backward speed or soft components ID 16/32bit, BIN
S2 Specify the creeping speed or soft components ID 16/32 bit, BIN
S3 Specify the soft components ID of the close points signal Bit
D Specify the pulse output port Bit
operands system
Bit
X Y M S T C Dn.m
S3
D
1:Instruction Summary
Relative position uni-segment pulse control;
Relative position uni-segment pulse control [DRVI]
16 bits DRVI 32 bits DDRVI
Instruction Instruction
Execution Normally ON/OFF coil Suitable
XC2XC3XC5XCM
condition Models
Hardware - Software -
requirement requirement
2:Operands
Operands Function Type
S1 Specify the output pulse value or soft components ID 16/32bit, BIN
S2 Specify the output pulse frequency or soft components 16/32 bit, BIN
ID
D1 Specify the pulse output port Bit
D2 Specify the pulse output direction port Bit
operands system
X Y M S T C Dn.m
Bit
D1
D2
1:Instruction Summary
Absolute position uni-segment pulse control
Absolute position uni-segment pulse control [DRVA]
16 bits DRVA 32 bits DDRVA
Instruction Instruction
Execution Normally ON/OFF coil Suitable
XC2XC3XC5XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Type
S1 Specify the output pulse value or soft components ID 16/32bit, BIN
S2 Specify the output pulse frequency or soft components ID 16/32 bit, BIN
D1 Specify the pulse output port Bit
D2 Specify the pulse output direction port Bit
(Y0:[D8171,D8170],Y1:[D8174,D8173])
PLSA/DPLSA has two control modes, below we will introduce one by one;
1: Instruction Summary
Generate absolute position segmented pulse with the specified frequency,
acceleration/deceleration time and pulse direction;
Absolute position multi-segment pulse control [PLSA]
16 bits PLSA 32 bits DPLSA
Instruction Instruction
Execution Normally ON/OFF coil Suitable
XC2XC3XC5XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Type
S1 Specify the soft components number to output the pulse 16/32bit, BIN
parameters
S2 Specify the acceleration/deceleration time or soft components 16/32 bit, BIN
number
D Specify the pulse output port Bit
operands system
Bit X Y M S T C Dn.m
D1
The parameters address is a section starts from Dn or FDn. In the above example: D0
shows the first segment pulses highest frequency; D1 shows the first segments absolute
position; D2 shows the second segment pulses highest frequency; D3 shows the second
segments absolute position if the set value in Dn, Dn+1 is 0, this represents the end
of segment. Up to a maximum of 24 segments can be set.
Acceleration/deceleration time is the time from the start to the first segments highest
frequency. Meantime, it defines the slope of all segments frequency to time. In this way
the following acceleration/deceleration will perform according to this slope.
Pulse can be output at only Y000 or Y001
1: Instruction Summary
Generate absolute position pulse with the specified frequency, acceleration/deceleration
time and pulse direction;
Absolute position multi-segment pulse control [PLSA]
16 bits PLSA 32 bits DPLSA
Instruction Instruction
Execution Normally ON/OFF coil Suitable
XC2XC3XC5XCM
condition Models
Hardware - Software -
requirement requirement
2: Operands
Operands Function Type
S1 Specify the soft components number to output the pulse 16/32bit, BIN
parameters
S2 Specify the acceleration/deceleration time or soft components 16/32 bit, BIN
number
D1 Specify the pulse output port Bit
D2 Specify the pulse direction port Bit
The parameters address is a section starts from Dn or FDn. In the above example: D0
shows the first segment pulses highest frequency; D1 sshows the first segments
absolute position; D2 shows the second segment pulses highest frequency; D3 shows
the second segments absolute position if the set value in Dn, Dn+1 is 0, this
represents the end of segment. Up to a mximum of 24 segments can be set.
Acceleration/deceleration time is the time from the start to the first segments highest
frequency. Meantime, it defines the slope of all segments frequency to time. In this way
the following acceleration/deceleration will perform according to this slope.
Pulse can be output at only Y000 or Y001
The Y port to output the pulse direction can be set freely;
Y0 Y1 Y2
COM0 COM1 COM2
Below is the graph to show the output terminals and stepping driver wiring:
PU
Y0
PU
Y1
During ACC/DEC, each step time is 5ms, this time is fixed and not changeable.
The minimum step frequency (each steps rising/falling time) is 10Hz. If the frequency is
lower than 10Hz, calculate as 10Hz; the maximum step frequency is 15Hz. If the
frequency is larger than 15Hz, calculate as 15Hz.
2frequency jump in segment
In case of frequency pulse200Hz,
larger than output please make sure each segments pulse
number no less than 10, if the set value is less than 10, send as 200Hz.
When outputting the segmented pulse, if the current segments pulse has been set out,
while meantime it doesnt reach the highest frequency, then from the current segment to
the next pulse output segment, pulse jump appears, see graph above;
In one main program, users cant write two or more pulse output instructions with one
output port Y;
Therefore the sample below is wrong;
M0
PLSR D0 D100 Y0
M1
PLSR D200 D1000 Y0
M0
Take the sample program as the example, set
M1 two segments pulse output in D0, D1 and D2
D3, with the same frequency value; In second
segment pulse output, set pulse number D3
as the output pulse number after receive M1
signal. This will realize stop at certain length
function. See graph on the left.
M8170
X000
FRQM K20 D0 K1 X003
PLSF D0 Y0
7-1Summary
7-2Modbus Communication
7-3Free Communication
7-4CAN Communication
MODBUS Communication
Free Communication
CAN-bus Communication
XC2-PLC, XC3-PLC, XC5-PLC main units can fulfill your requirements for communication
and networking. They not only support simple networks (Modbus protocol, Free
Communication protocol), but also support complicated networks.
XC2-PLC, XC3-PLC, XC5-PLC offer communication accessthat enables communication
with peripheral devices (such as printers, instruments etc.) that have their own
communication protocol.
XC2-PLC, XC3-PLC, XC5-PLC all support Modbus protocol and Free protocol however,
the XC5-PLC also supports CAN-Bus functions.
COM Port
There are 2 COM ports (Port1Port2) on XC3 Series PLC basic units, while there are 3
COM ports on XC5 Series PLC main units. In addition to the same COM ports (COM1COM2),
they have also CAN COM port.
COM 1 (Port1) is the program port, it can be used to download the program and connect
with the other devices. The parameters (baud rate, data bit etc.) of this COM port are fixed,
cant be re-set.
COM 2 (Port2) is communication port, it can be used to download a program and connect
with the other devices. The parameters (baud rate, data bit etc.) of this COM port can be re-set
via software.
Via BD cards, XC Series PLCs can accommodate other COM ports. These COM ports
can be RS232 and RS485.
COM X1 X3 X5 X7 X11 X13 X15 X17 X21 X23 X25 X27 X31 X33 X35 X37 X41 X43
COM X0 X2 X4 X6 X10 X12 X14 X16 X20 X22 X24 X26 X30 X32 X34 X36 X40 X42
0 1 2 3 4 5 6 7
X PWR
RUN
XC5- 60R- E
PORT1 PORT2 ERR
Y
0 1 2 3 4 5 6 7
24V A CAN+ Y0 Y1 Y2 COM3 Y4 Y6 Y7 Y11 Y13 Y15 COM6 Y20 Y22 Y23 Y25 Y27
0V B CAN- COM0 COM1 COM2 Y3 Y5 COM4 Y10 Y12 COM5 Y14 Y16 Y17 Y21 COM7 Y24 Y26
1 2 4RxD
1 2 2PRG
3 4 5
3 4 5 6 8 5TxD
6 8 4RxD 7
7
5TxD
Mini Din 8 pin female
Mini Din 8 pin female
CAN port can be used to realize CAN-Bus communication. The pin terminals are CAN+,
CAN-
For the detailed CAN communication functions, please refer to 6-8CAN-Bus function (XC5
series)
Communication Parameters
Station
Modbus Station number: 1~254255 (FF) is free format communication
Stop Bit
2 stop bits1 stop bit
Parity
EvenOddNo check
Parameters Setting
FD8221 Communication format Baud rate, data bit, stop bit, parity
1: The PLC will be offline after changing the communication parameters, use stop when reboot
function to keep PLC online.
2: After modifying the data with special FLASH data registers, the new data will come into effect after
reboot.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0300bps
0No check
1600bps
1Odd check
32400 bps
08bits data
44800 bps
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0: 8 bits communication
Reserved
1: 16 bits communication
7-2-1 Function
MASTER FORMAT: When PLC is set to be master, PLC sends request to other slave devices
via Modbus instructions, other devices respond to the master unit.
SLAVE FORMAT: when PLC is set to be slave, it can only communicate with master devices.
7-2-2 Address
For the soft components number in PLC which corresponds with Modbus address number,
please see the following table:
1: Bit soft components XY are in Octal form, the left are in decimal form.
1: Instruction Summary
Read the specified stations specified coil status to the local PLC;
Coil read [COLR]
16 bits COLR 32 bits -
instruction instruction
Execution Normally ON/OFF coil Suitable
XC2XC3XC5XCM
Condition Models
Hardware - Software -
Requirement Requirement
2: Operands
Operands Function Type
S1 Specify the remote communication station or soft components 16bits, BIN
ID
S2 Specify the remote coils start ID or soft components ID 16bits, BIN
S3 Specify the coil number or soft components ID 16bits, BIN
D1 Specify the start ID of the local receive coils bit
D2 Specify the serial ports number 16bits, BIN
S1 S2 S3 D1 D2
Function X0
COLR K1 K500 K3 M1 K2
2: Operands
Operands Function Type
S1 Specify the remote communication station or soft components ID 16bits, BIN
S2 Specify the remote coils start ID or soft components ID 16bits, BIN
S3 Specify the coil number or soft components ID 16bits, BIN
D1 Specify the start ID of the local receive coils bit
D2 Specify the serial ports number 16bits, BIN
S1 S2 S3 D1 D2
Function X0
INPR K1 K500 K3 M1 K2
2: Operands
Operands Function Type
D1 Specify the remote communication station or soft components ID 16bits, BIN
D2 Specify the remote coils start ID or soft components ID 16bits, BIN
S1 Specify the start ID of the local receive coils bit
S2 Specify the serial ports number 16bits, BIN
D1 D2 S1 S2
Function X0
COLW K1 K500 M1 K2
1:Summary
2: Operands
Operands Function Type
D1 Specify the remote communication station or soft components 16bits, BIN
ID
D2 Specify the remote coils start ID or soft components ID 16bits, BIN
D3 Specify the coil number or soft components ID 16bits, BIN
S1 Specify the start ID of the local receive coils bit
S2 Specify the serial ports number 16bits, BIN
D1 D2 D3 S1 S2
Function X0
MCLW K1 K500 K3 M1 K2
1: Summary
2: Operands
Operands Function Type
S1 Specify the remote communication station or soft components ID 16bits, BIN
S2 Specify the remote coils start ID or soft components ID 16bits, BIN
S3 Specify the coil number or soft components ID 16bits, BIN
D1 Specify the start ID of the local receive coils bit
D2 Specify the serial ports number 16bits, BIN
S1 S2 S3 D1 D2
Function X0
REGR K1 K500 K3 D1 K2
1: Summary
Read the specified stations specified input register to the local register
2:Operands
Operands Function Type
S1 Specify the remote communication station or soft components ID 16bits, BIN
S2 Specify the remote coils start ID or soft components ID 16bits, BIN
S3 Specify the coil number or soft components ID 16bits, BIN
D1 Specify the start ID of the local receive coils bit
D2 Specify the serial ports number 16bits, BIN
S1 S2 S3 D1 D2
Function X0
INRR K1 K500 K3 D1 K2
1: Summary
Instruction to write the local specified register into the specified stations specified register;
2: Operands
Operands Function Type
D1 Specify the remote communication station or soft 16bits, BIN
components ID
D2 Specify the remote coils start ID or soft 16bits, BIN
components ID
S1 Specify the start ID of the local receive coils 16bits, BIN
S2 Specify the serial ports number 16bits, BIN
D1 D2 S1 S2
Function X0
REGW K1 K500 D1 K2
1:Summary
Instruction to write the local specified register to the specified stations specified register;
2: Operands
Operands Function Type
D1 Specify the remote communication station or soft 16bits, BIN
components ID
D2 Specify the remote coils start ID or soft 16bits, BIN
components ID
D3 Specify the coil number or soft components ID 16bits, BIN
S1 Specify the start ID of the local receive coils bit
S2 Specify the serial ports number 16bits, BIN
D1 D2 D3 S1 S2
Function X0
MRGW K1 K500 K3 D1 K2
Free format communication transfer data in the form of data block, each block can transfer a
maximum of 128 bytes. Each block can set a start symbol and stop symbol, or not set.
Communication Mode:
Start Symbol (1 byte) Data Block (max. 128 bytes) End Symbol (1 byte)
1: Summary
Write the local specified data to the specified stations specified ID;
Send data [SEND]
16 bits SEND 32 bits -
instruction instruction
Execution Suitable
Normally ON/OFF rising XC2XC3XC5XCM
Condition Models
edge
Hardware - Software -
Requirement Requirement
2: Operands
Operands Function Type
S1 Specify the start ID of local PLC 16bits, BIN
S2 Specify the ASC number to send or soft components 16bits, BIN
ID
n Specify the COM port Nr. 16bits, BIN
S1 S2 n
Function M0
SEND D10 D100 K2
1: Summary
Write the specified stations data to the local specified ID;
Receive data [RCV]
16 bits RCV 32 bits -
instruction instruction
Execution Suitable
Normally ON/OFF rising XC2XC3XC5XCM
Condition Models
edge
Hardware - Software -
Requirement Requirement
2: Operands
Operands Function Type
S1 Specify the start ID of local PLC 16bits, BIN
S2 Specify the ASC number to receive or soft components ID 16bits, BIN
n Specify the COM port Nr. 16bits, BIN
S1 S2 n
Function M1
RCV D20 D200 K2
1: If you require PLC to receive but not send, or receive before send, you need to set
the communication timeout as 0ms
XC5 Series PLCs support CAN-Bus functions. Below we will give some basic concept on
CAN-Bus;
CAN (Controller Area Network) belongs to the industrial area bus category. Compared with
common communication bus, CAN-Bus data communication has performance of outstanding
dependability, real time ability and flexibility.
CAN controller works under multi-master format. In the network, each node can send data to
the bus according to the bus visit priority. These characters enable each node in the CAN-Bus
network to have stronger data communication real time performance, and easy to construct a
redundant structure, improving the systems dependability and flexibility.
In CAN-Bus networks, any node can initiatively send message at any time to any other node,
no master and no slave. Enabling flexible communication; its easy to compose multi-device
backup system, distributing format monitor, control system. To fulfill different real time
requirements, the nodes can be divided to be different priority levels. With non-destroy bus
arbitrament technology, when two nodes send message to the network at the same time, the
low level priority node intuitively stops data sending, while high level priority node can continue
transferring data without any influence. This gives functions of node to node, node to
multi-node, bureau broadcasting sending/receiving data. Each frames valid byte number is 8,
so the transfer time is short, the probability ratio is low.
The wiring among each node of CAN-Bus is shown in the following graph; at the two ends, add
120 ohm middle-terminal resistors.
120R 120R
00 01 02
There are two forms of CAN-Bus network: one is instructions communication format; the
other is internal protocol communication format. These two forms can work at the same
time
Instructions communication format
This format means, in the local PLC program, via CAN-Bus instructions, execute bit or
word reading/writing with the specified remote PLC.
Internal protocol communication format
This format means, via setting of special register, via configure table format, realize allude
with each other among PLCs certain soft components space. In this way, realize PLC
source sharing in CAN-Bus network.
1:Instruction Description
FunctionRead the specified stations specified coil status into the local specified coil.
2: Operands
Operands Function Type
S1 Specify remote communication station ID or soft components 16bits, BIN
number;
S2 Specify the remote coils start ID or soft components number; 16bits, BIN
S3 Specify the coil number or soft components number; 16bits, BIN
D Specify the local receive coils start ID bit
Bit
Operands System
X Y M S T C Dn.m
D
S1 S2 S3 D
Function X0
CCOLR K2 K20 K4 M20
Execute CCOLR instruction when X0 changes from OFF to ON; read the four coils data of
1: Summary
2: Operands
Operands Function Type
D1 Specify remote communication station ID or soft 16 BIN
components number;
D2 Specify the remote coils start ID or soft 16 BIN
components number;
D3 Specify the coil number or soft components 16 BIN
number;
S Specify the local receive coils start ID Position
D1 D2 D3 S
Function X0
CCOLW K2 K20 K4 M20
Execute CCOLW instruction when X0 changes from OFF to ON; write the local M20
1: Summary
Read the specified stations specified register to the local specified register;
2: Operands
Operands Function Type
D1 Specify remote communication station ID or soft components 16bits, BIN
number;
D2 Specify the remote registers start ID or soft components number; 16bits, BIN
D3 Specify the register number or soft components number; 16bits, BIN
S Specify the local receive coils start ID 16bits, BIN
S1 S2 S3 D
Function X0
CREGR K2 K20 K4 D20
Execute CREGR instruction when X0 changes from OFF to ON; read the remote station
1: Summary
Write the specified local input register to the specified stations specified register;
2: Operands
Operands Function Type
D1 Specify remote communication station ID or soft 16bits, BIN
components number;
D2 Specify the remote registers start ID or soft 16bits, BIN
components number;
D3 Specify the register number or soft components 16bits, BIN
number;
S Specify the local receive coils start ID 16bits, BIN
D1 D2 D3 S
Function X0
CREGW K2 K20 K4 D20
Execute CREGW instruction when X0 changes from OFF to ON; write the local D20
Function
Step 2: set each configure items communication object, each item includes four parameters:
remote nodes station; remote nodes object ID; local objects ID; number; the corresponding
register ID is: FD8370~FD8373 represents Nr.1 item; FD8374~FD8377 represents Nr.2
item, FD9390~FD9393 represents Nr.256 item. A maximum of 256 items can be set;
Communication Setting
0: no error
2: initialize error
D8240 CAN error information 30: bus error
31: error alarm
32: data overflow
Show the first number of error
D8241 The configure items Nr. which has error
configure item
D8242 Data package number sent every second -
Data package number received every
D8243 -
second
D8244 CAN communication error count -
1: Instructions Summary
Write the specified data from the unit to a specified address (data transfer in one unit)
CAN Sending [CSEND]
2: Operands
Operands Function Type
S1 specify the ID number to send the data package 16bits, BIN
S2 specify the first ID number of sent data or soft 16bits, BIN
component locally
S3 specify the byte number of sent data 16bits, BIN
M0
CSEND D10 D0 D20
The ID of sending data package is specified by D10, the data number is specified by D20,
the first ID is in D0;
8 bits data transfer: the transferred data is: D0L, D1L, D2L, D3L (D0L means the low byte
of D0)
16 bits data transfer: the transferred data is: D0L, D0H, D1L, D1H (D0H means the high
byte of D0)
Standard Frame: the valid bits of the data package ID number that is specified by D10 is
the low 11 bits, the left bits are invalid;
The expansion frame: the valid bits of the data package ID number that is specified by
D10 is the low 29 bits, the left bits are invalid;
The maximum data bits specified by D20 is 8, if exceeds 8, the instruction will send only 8
bits;
1: Instructions Summary
Write the specified data in one unit to a specified address in another unit (data transfers
between different units)
CAN Receive [CRECV]
2: Operands
Operands Function Type
S1 specify the ID number to receive the data package 16bits, BIN
S2 specify the first ID number of received soft 16bits, BIN
component locally
S3 specify the byte number of received data 16bits, BIN
S4 specify the soft components start ID number of ID 16bits, BIN
filter code
The 32 bits memory combined by [D1, D0] (D0 is low byte, D1 is high byte) is used to
stock ID number of the received data package. The received data length is stored in D20.
The data content is stored in registers start from D10. D30 specifies the received ID filter
code; if the received data doesnt fit the filter codes, then it will keep the RECV status;
ID filter code: D30 specifies the start address of ID filter codes; the instruction specifies
two groups of filter codes, occupy D30~D37 zone;
Standard/ expansion frame: the setting of FD8358 has no effect to reception. If the data
frame fulfills ID mask codes, the standard frame and the expansion frames can be all
received. When receive the standard frame, the ID bits is 11, but will still occupy the 32
bits memory combined by [D1,D0]
8 bits data transfer: the transfer data is: D0L, D1L, D2L, D3L(D0L means the low byte
of D0)
16 bits data transfer: the transfer data is: D0L, D0H, D1L, D1H(D0H means the high
byte of D0)
ID Function Description
M8240 CAN error flag ON: error happens
3: System D8000
ID Function Description
0: no error
2: initializing error
D8240 CAN error information 30: CAN bus error
31: error alarm
32: data overflow
configure item number when
D8241 XC-CAN valid
error happens
data package number sent
D8242 both XC-CAN and FREE modes are valid
every second
data package number
D8243 both XC-CAN and FREE modes are valid
accepted every second
correspond with M8240
CAN communication error
D8244 at every CAN error, M8240 will be set ON
counter
one time, D8244 increase 1
8-6.Application Outlines
PID instructions and auto-tune functions are added into XC Series PLC basic units (Version
3.0 and above). Via auto-tune method, users can achive the best sampling time and PID
parameters and improve the control precision.
The previous versions cannot support PID function on basic units unless they extend with
analog modules or BD cards. PID instruction has brought many facilities to the users.
1. The output can be data form D and on-off quantity Y, user can choose them freely when
programming.
2. Via auto-tune, users can achive the best sampling time and PID parameters and improve
the control precision.
3. User can choose positive or negative movement via software setting. The former is used in
heating control; the later is used in cooling control.
4. PID control separates the basic units with the expansions; this improves the flexibility of this
function.
2: Operands
Operands Usage Type
S1 set the ID Nr. of the target value (SV) 16bits, BIN
S2 set the ID Nr. of the tested value (PV) 16 bits, BIN
S3 set the first ID Nr. of the control parameters 16 bits, BIN
D the ID Nr. of the operation resule (MV) or output port 16 bits, BIN
S1 S2 S3 D
X0
PID D0 D10 D4000 Y0
S3~ S3+ 43 will be occupied by this instruction, do not use them as the common data
registers.
This instruction executes with each sampling time interval.
To the operation result D, the data registers are used to store PID output values; the
output points are used to output the occupy ratio in the form of ON/OFF.
PID control rules are shown as below:
+
Proportion
+
Differential
e(t) = r (t ) c ( t ) (1-1)
u(t) = Kp [ e ( t ) + 1/Tie(t)dt + TD de(t)/dt] (1-2)
Here, e(t) is warp, r(t) is the given value, c(t) is the actual output value, u(t) is the control
value;
In function (1-2), Kp is the proportion coefficient, Ti is the integration time coefficient, and
TD is the differential time coefficient.
The result of the operation:
5. Analog output: MV= digital form of u (t), the default range is 0 ~ 4095.
6. Digital output: Y=T*[MV/PID output upper limit]. Y is the outputs activation time within the
control cycle. T is the control cycle, equals to the sampling time. PID output upper limit
default value is 4095.
Users can call PID instructions in XCP Pro software directly and set the parameters in the
window (see graph below), for the details please refer to XCP Pro user manual. Users can also
write the parameters into the specified registers by MOV instructions before PID operation.
For PID control instructions relative parameters ID, please refer to the below table:
ID Function Description Memo
S3 sampling time 32 bits without sign Unit: ms
S3+1 sampling time 32 bits without sign Unit: ms
S3+2 mode setting bit0:
0: Negative; 1 Negative;
bit1bit6 not usable
bit7:
0: Manual PID; 1: Auto-tune PID
bit8:
1: Auto-tune successful flag
bit9bit14 not usable
bit15:
0: regular mode; 1: advanced mode
S3+3 Proportion Gain (Kp) Range: 132767[%]
S3+4 Integration time (TI) 032767[*100ms] 0 is taken as no integral.
S3+5 Differential time (TD) 032767[*10ms] 0 is taken as no differential.
S3+6 PID operation zone 032767 PID adjustment band width
value.
S3+7 control death zone 032767 PID value keeps constant in
death zone
S3+8 PID Auto-tune cycle full scale AD value *0.3~1%
varied value
S3+9 PID Auto-tune 0: enable overshoot
overshoot permission 1:disable overshoot
S3+10 current target value
adjustment percent in
auto-tune finishing
transition stage
S3+11 current target value
resident count in
auto-tune finishing
transition stage
S3+12~ occupied by PID
S3+39 operations internal
process
Below is the ID of advanced PID mode setting
S3+40 Input filter constant (a) 099[%] 0: no input filter
S3+41 Differential gain (KD) 0100[%] 0: no differential gain
S3+42 Output upper limit value -3276732767
S3+43 Output lower limit value -3276732767
D 1
If the target value is 100, PID operation zone is 10, then the real PIDs operation zone is from
90 to 110.
D 2
Suppose: we set the death region value to be 10. Then in the above graph, the difference is
only 2 comparing the current value with the last value. The PID control will not change value.
The difference is 13 (more than death region 10) comparing the current value with the next
value, this difference value is larger than control death region value, the PID control will start to
vary.
I. Auto-tune mode is suitable for these objectives: temperature, pressure; but is not
suitable for liquid level and flow.
II. Users can set the sampling cycle to be 0 at the beginning of the auto-tune process
then modify the value manually in terms of practical needs after the auto-tune
process is completed.
III. Before selecting auto-tune, the system should be under the no-control steady state. If
the function is to Take the temperature for example: the detected temperature
should be the same as the environment temperature.
To enter the auto-tune mode, please set bit7 of (S3+ 2) to be 1 and turn on PID working
condition. If bit8 of (S3+ 2) turns to 1, it means the auto-tune is successful.
PID auto-tune period value [S3+ 8]
Set this value in [S3+ 8] during auto-tune.
This value decides the auto-tune performance, in a general way, set this value to be the AD
result corresponding to one standard detected unit. The default value is 10. The suggested
setting range:
full-scale AD result 0.3 ~ 1%.
This value does not normally need altering, however, if the system is interfered greatly by
outside, this value should be increased modestly to avoid wrong judgment for positive or
negative movement. If this value is too large, the PID control period (sampling time) set by the
auto-tune process will be too long.
1: if users have no experience, please use the defaulted value 10, set PID sampling time ( control
period ) to be 0ms then start the auto-tune.
Every adjustment percent of current target value at auto-tune process finishing transition
Cutline Explanation:
Current target value adjustment percent is 2/3 (S3 + 10 = 67%), the original temperature of the
system is 0 C, target temperature is 100 C, the current target temperature adjustment
situation is shown as below:
Next current target value = current target value + (final target value current target value)
2/3;
So the changing sequence of current target is 66 C, 88 C, 96 C, 98 C, 99 C, 100 C.
The stay times of the current target value at auto-tune process finishing transition stage
[S3+11]
This parameter is valid only when [S3+9] is 1;
If entering into PID control directly after auto-tune, small range of overshoot may occur.
Overshoot can be prevented if increasing this parameter properly, but it will cause response
lag if this value is too large. The default value is 15 times. The recommended range is from 5 to
20.
Under continuous output, the system whose effectability will die down with the change of
the feedback value can do self-study, such as temperature or pressure. It is not suitable
for flux or liquid level.
Under the condition of overshoot permission, the system will get the optimal PID
parameters from self-study.
Under the condition of overshoot not allowed, the PID parameters got from self-study is
up to the target value, it means that different target value will produce different PID
parameters which are not the optimal parameters of the system and for reference only.
If the self-study is not available, users can set the PID parameters according to practical
experience. Users need to modify the parameters when debugging. Below are some
experience values of the control system for your reference:
Temperature system:
P (%) 2000 ~ 6000, I (minutes) 3 ~ 10, D (minutes) 0.5 ~ 3
Flux system: P (%) 4000 ~ 10000, I (minutes) 0.1 ~ 1
Pressure system: P (%) 3000 ~ 7000, I (minutes) 0.4 ~ 3
Liquid level system: P (%) 2000 ~ 8000, I (minutes) 1 ~ 5
9-1Functions Summary
9-2Instrument Form
9-3Operation Steps
9-6Example Program
9-7Application Points
This is the new added function in XCP Pro software. This function enables the customers to
write function blocks with C language in XCP Pro and call the function blocks at any necessary
place. This function supports most of C language functions, strength the programs security. As
users can call the function at many places and call different functions, this function increases
the programmers efficiency greatly.
2: Operands
Operands Function Type
S1 name of C Function Block, defined by the user String
S2 Correspond with the start ID of word W in C language 16bits, BIN
Function
S3 Correspond with the start ID of word B in C language 16bits, BIN
Function
S1 S2 S3
Functions X0
NAME_C D0 M0
and Actions
The name is composed by numbers, letters and underscores, the first character must not
be a number and the name shouldnt be longer than 8 ASC.
The name cant be same with PLCs internal instructions e.g. LD, ADD, SUB, PLSR etc.
The name cant be same as any function blocks already existing in the PLC.
PLC Software
9-3Manual
Operation Steps Page 292 of 365 LMAN021_R2V2
1: Open PLC edit tool, in the left Project toolbar, choose Function Block, right click it and
choose Add New Function Block
3: After creating the new Function Block, you can see the edit interface as shown below:
Parameters transfer format: if Function Block is called in ladder format, the transferred
D and M is the start ID of W and B. Take the above graph as the example, start with D0
and M0, then W[0] is D0, W[10] is D10, B0 is M0, B10is M10. If in the ladder the used
parameters are D100, M100, then W[0] is D100, B0is M100. So, word and bit
components start address is defined in PLC program by the user.
Parameter W: represent Word soft component, use in the form of data group. E.g.
W[0]=1;W[1]=W[2]+W[3]; in the program, use according to standard C language rules.
Parameter B: represents Bit soft component, use in the form of data group. Supports SET
and RESET. E.g: B[0]=1;B[1]=0; And assignment, for example B[0]=B[1].
Floating Operation: Supports the definition of floating variable in the function, and
executes floating operation;
Function Library: In Function Block, users can use the Functions and Variables in
function library directly. For the Functions and Variables in function library, see the C
Language Function List at the end of this chapter.
Predefined Marco
#define true 1
#define false 0
#define TRUE 1
#define FALSE 0
1: Export
(1) Function: export the function as the file, then other PLCs program can import to use;
2: Import
Function; Import the existing Function Block file, to use in the PLC program;
Choose the Function Block, right click Import Function Block From Disk, choose the
correct file, then click OK.
According to the information shown in the output blank, we can search and modify the
grammar error in C language program. Here we can see that in the program there is no ; sign
behind W[2]=W[0]+W[1];
Compile the program again after modify the program. In the information list, we can confirm
that there is now no grammar error in the program.
(4) Download program into PLC, run PLC and set M0.
(5) From Free Monitor in the toolbar, we can see that D2 changes to be 30, it means the
assignment is successful.
Free Monitor
Download to PLC, then RUN PLC, set M0, via Free Monitor, we can find that values in D6
and D7 are the highest and lowest bit of CRC parity value.
When uploading a PLC program which contains some Function Blocks, the Function
Blocks cant be uploaded, there will be an error say: There is an unknown instruction;
In one Function Block file, you can write many subsidiary functions, can call each other;
Each Function Block files are independent, they cant call its owned functions;
Function Block files can call C language library functions in form of floating, arithmetic like
sin, cos, tan etc.
This chapter describes the basic concepts; internal instruction manipulation; relative
instructions; executing form and application points of Sequential Function Blocks.
Sequential function block, in short BLOCK, is a program block to realize certain functions. We
can treat the block as a special flow, in this special flow, all the programs run according to one
principle, i.e. sequential execution principle; this is how BLOCK differs from other programs.
BLOCK starts with SBLOCK, ends with SBLOCKE, the programmer writes programs between
them. If in one BLOCK there are many send pulse instructions (also same with other type of
instructions), then the pulse instructions will run according to the time order of the activate
conditions; the next pulse instruction runs only after the previous instruction finishes.
USERS EXECUTION
PROGRAM
SBLOCKE
As in XCP Pro, we dont support to run many pulse, communication instructions in one
flow, its troublesome to write the program. With BLOCK, we support writing many pulse,
communication instructions, all the instructions run accord to sequential principle;
Wrong Correct
WITHOUT
BLOCK
WITH
BLOCK
In one program, you can call many BLOCKs. Call BLOCK via XCP Pro. See method below:
Open XCP Pro, in the left toolbar, find Sequence Block, right click it, you can see Add
Sequence Block. See graph below:
Click OK, we can see that in the configure interface, the corresponding information also been
added, see screenshot below:
Meantime, in the left toolbar, you can see the new added block, see graph below:
If you want to move the created BLOCK elsewhere, you should delete the original BLOCK
(choose all and delete), see graph below:
Then move the mouse to the required place, activate this place; right click the created BLOCK,
in the pop-up menu, choose Add To Lad, see graph below:
Here we can see that the BLOCK appears at the activate place, see graph below
If just delete the BLOCK called in the program, you can choose the BLOCK area and delete
(refer the previous method).
If you want to delete one BLOCK thoroughly, choose Delete Sequence Block. After this, you
cant call it any more, the only method is to add it again; see graph below:
In order to add the programs to BLOCK freely, we enable the user to write instructions in form
of instruction list.
Open the edit interface, click Add, see graph below:
Click Common Item, a new interface will pop up, see below:
In the interface, user can add the required programs freely. The point to note is that, Skip is
Click OK, in the ladder you can see program as shown below:
The M0 before Instruction List is the condition to run the instruction or not.
Note: In one BLOCK, user can add many program segments, each segment is controlled by
SKIP. If the condition is true, then skip to run the instruction; if the condition is false or vacant,
execute the instruction.
In the above graph, the instruction list is not shown in details, but you can add the comments
according to the programs function. See below:
After adding the comment, BLOCK changes in the ladder, see graph below:
Open Pulse Config interface with the same method, see below:
In this configure interface, you can set pulse output form, single or 24 segments, opposite or
absolute. Write the other parameters in the corresponding blanks, like frequency, pulse,
acceleration and deceleration time, pulse number etc.
Add two sending pulse instruction into BLOCK, see below:
1In BLOCK, the pulse output instructions are both in 32 bits form;
Modbus instructions configuration is easy, just choose Modbus Item from the draw down
menu, fill in the remote station Nr., COM Nr., local coil ID, coil Nr., the system will generate the
instruction automatically. See below:
Same asthe previous method, open Wait configure interface. Wait instruction is used to wait
AFlag
BTimer Wait
This time is applied for PLCs with XINJE inverters. By changing this interface, user can
The interface includes four parts, they are: inverter station number, COM port number, control
inverter action, monitor inverters status, user define etc. Below we introduce the four parts one
by one:
The station number is used to specify the inverters station number, the COM port is PLCs
COM port, see the configuration below:
This item includes write constant value and write from register. write constant value
For the second form, we take an example to show: write D0 into inverter:
DUser Define
Set the inverter via user define mode, read from and write into inverter directly. The configure
interface is shown below:
There are two methods to set the data. Const data is to set the value directly. Reg is to set
the value via register.
The communication parameters also need to be set. Click serial port config:
1: If there are many blocks, they run as the normal program. The block is running when the
condition is ON.
M2
SBLOCK Sequence block 2
M3
SBLOCK Sequence block 3
M1
M2
M3
M1
M2
M3
When M1, M2, M3 is from OFF to ON, all these blocks will run once.
2: The instructions in the block run in sequence according to the scanning time. They run one
after another when the condition is ON.
M1 Y1
( )
M2
SBLOCK Sequence block1
DPLSR D 0 D2 D4 Y0
DPLSR D 0 D2 D4 Y1
Inverter Config
SBLOCKE
Scanning period 1 Scanning period 2 Scanning period 3 Scanning period 4 Scanning period 5
M2
BLOCK condition is
PLS Y0 PLS Y1 Inverter config
OFF and all the
sequence instructions
BLOCK running
M1 Y1
( )
M2
SBLOCK Sequence block1
M3
DPLSR D 0 D2 D4 Y0
M4
DPLSR D 0 D2 D4 Y1
M5
Inverter config
SBLOCKE
Explanation:
A) When M2 is ON, block 1 is running.
B) All the instructions run in sequence in the block.
C) M3, M4, M5 are the sign of SKIP, when they are ON, this instruction will not run.
D) When M3 is OFF, if no other instructions use this Y0 pulse , DPLSR D0 D2 D4 Y0 will
run; if not, the DPLSR D0 D2 D4 Y0 will run after it is released by other instructions.
E) After DPLSR D0 D2 D4 Y0 is over, check M4. If M4 is OFF, check DPLSR D0 D2
D4 Y1, if M4 is ON, check M5. If M5 is OFF, inverter config will run.
NO YES
M0 M0
M1 M1
DPLSR D0 D2 D4 Y0 DPLSR D 0 D2 D4 Y0
SBLOCKE SBLOCKE
M2 M2
SBLOCK Sequence block2
SBLOCK Sequence block2
SBLOCKE SBLOCKE
2: Do not use the same pulse output terminal in BLOCK and main program.
NO YES
M0 M0
DPLSR D0 D2 D4 Y0 DPLSR D0 D2 D4 Y1
M2 M2
SBLOCK Sequence block1 SBLOCK Sequence block1
SBLOCKE SBLOCKE
3: There only can be one SKIP condition for one BLOCK instruction.
M0 M0
SBLOCK Sequence block1 SBLOCK Sequence block1
M1 M2 M1
DPLSR D 0 D2 D4 Y0 DPLSR D 0 D 2 D4 Y0
SBLOCKE SBLOCKE
4: The SKIP condition only can use M, X, can not use other coil or register.
NO YES
M0 M0
T0 X0
DPLSR D 0 D2 D4 Y0 DPLSR D 0 D2 D4 Y0
M2[D10] M2
DPLSR D 0 D2 D4 Y1 DPLSR D 0 D2 D4 Y1
SBLOCKE SBLOCKE
NO YES
M0 M0
M1
M1
HSCR C600 D0 DPLSY K 30 D1 Y0
M2
M2
PLSF D0 Y0
DPLSR D 0 D2 D4 Y1
M3
PWM K100 D0 Y1
SBLOCKE
SBLOCKE
6LabelKind type can not be used in the block. Sign P, I can not be used in block. (they can be
added to the block but the program does not support this).
1: Summarization
Stop the instructions running in the block
[BSTOP]
16 bits BSTOP 32 bits -
Condition NO,NC coil and pulse edge Suitable
XC1XC2XC3XC5XCM
types
Hardware V3.1i and above Software V3.1h and above
2: Operand
Operand Function Type
S1 The number of the BLOCK 16 bits, BIN
S2 The mode to stop the BLOCK 16 bits, BIN
3: Suitable component
Function
2: Operand
Operand Function Type
S1 The number of the BLOCK 16 bits, BIN
S2 The mode to continue running the BLOCK 16 bits, BIN
3: Suitable component
Function
Scanning period1 Scanning period 2 Scanning period 3 Scanning period 4 Scanning period 5
Condition M0
Condition M1
Condition M3
PLS Y0
Scanning period 1 Scanning period 2 Scanning period 3 Scanning period 4 Scanning period 5
Condition M0
Condition M1
Condition M4
PLS Y0
PLS Y0
3: BSTOPK1 K1+BGOONK1 K0
Condition M0
Condition M2
Condition M3
PLS Y0
4: BSTOPK1 K1+BGOONK1 K1
Condition M0
Condition M2
Condition M4
PLS Y0
PLS Y0
.. .
D8632 BLOCK2 current running instruction BLOCK use this value when
. . monitoring
.. .
Ladder chart:
I0000
The interruption starts
M8000
STOP Y0
Stop outputting the pulse
M8050
( S ) Close the interruption
IRET
The interruption ends
Notes:
M8050: prohibit the exterior interruption
In this chapter, we introduce PWM pulse width modulation, frequency detect, precise time,
interruption etc;
11-2Frequency Detect
11-3Precise Time
11-4Interruption
FRQM S1 D S2 S3
FRQM Frequency Detection 11-2
Time
STR D1 D2
STR Precise Time 11-3
STRS S
STRS Stop Precise Time 11-3
Interruption
EI
EI Enable Interruption 11-4-1
DI
DI Disable Interruption 11-4-1
IRET
IRET Interruption Return 11-4-1
1: Instructions Summary
Instruction to realize PWM pulse width modulation
PWM pulse width modulation [PWM]
16 bits PWM 32 bits -
instruction instruction
execution normally ON/OFF coil suitable
XC1XC2XC3XC5XCM
condition models
hardware - software -
requirement requirement
2: Operands
Operands Function Type
S1 specify the occupy ratio value or soft components ID number 16 bits, BIN
S2 specify the output frequency or soft components ID number 16 bits, BIN
D specify the pulse output port bit
Bit
Operands System
X Y M S T C Dn.m
D
T0
1: Instructions Summary
Instruction to realize frequency testing
frequency testing [FRQM]
16 bits FRQM 32 bits -
instruction instruction
execution normally ON/OFF coil suitable
XC1XC2XC3XC5XCM
condition models
hardware - software -
requirement requirement
2: Operands
Operands Function Type
S1 Specify the sampling pulse number or soft components ID 16 bits, BIN
number
S2 Specify the frequency division choices number 16 bits, BIN
S3 Specify the pulse input port bit
D specify the tested results soft components number 16 bits, BIN
Operands System
Bit
X Y M S T C Dn.m
S3
S1: sampling pulse number: the number to calculate the pulse frequency
D: tested result, the unit is Hz.
S2: Frequency division choice. It can be K1 or K2;
When the frequency division is K1, the range is: no less than 9Hz, precision
range: 9~18KHz.
When the frequency division is K2, the range: no less than 300Hz, precision
range: 300~400KHz.
In frequency testing, if choose frequency division as K2, the frequency testing
precision is higher than frequency division K1.
When X000 is ON, FRQM will test 20 pulse cycles from X003 every scan cycle.
Calculate the frequencys value and save into D100. Test repeatedly. If the tested
frequencys value is smaller than the test bound, then return the test value as 0.
Model X Number
XC2 series 14/16/24/32/48/60 I/O
X1X6X7
14 I/O
X2X3
24/32 I/O
XC3 series X1X11X12
24/32 I/O X3
XC5 series 48/60 I/O
X1X11X12
1: Instruction List
Read and stop precise time when execute precise time;
precise time [STR]
16 bits - 32 bits STR
instruction instruction
execution edge activation suitable
XC1XC2XC3XC5XCM
condition models
hardware - software -
requirement requirements
read precise time [STRR]
16 bits - 32 bits STRR
instruction instruction
execution edge activation suitable
XC1XC2XC3XC5XCM
condition models
hardware V3.0e and above software -
requirement requirements
stop precise time [STRS]
16 bits - 32 bits STRS
instruction instruction
execution edge activation suitable
XC1XC2XC3XC5XCM
condition models
hardware V3.0e and above software -
requirement requirements
2: Operands
Operands Function Type
D Timers Number bit
D1 Timers Number bit
D2 specify timers value or soft components ID 16 bits, BIN
number
operands system
Bit
X Y M S T C Dn.m
D
D1
D1 D2
X0
STR T600 K100
T600
Y0
M0
RST T600
X0
T600
100ms 100ms
M0
D
When M000 changes from OFF to ON, execute STRS
M0 instruction immediately, stop precise time and refresh the
STRS T600
count value in TD600. Regardless of the scan cycle;
When the precise time reaches the count value, generate a corresponding
interruption tag, execute some interruption subroutines.
Start the precise time in precise time interruption;
Every precise timer has its own interruption tag, see table below:
X0
STR T600 K100
When X000 changes from OFF to be ON, timer
T600 starts to time. When time accumulates to
M0
100ms, set T600; meantime, generate an
RST T600
interruption, the program jumps to interruption tag
FEND
I3001 and execute the subroutine.
I3001
11-4 Interruption
The input terminals X can be used to input external interruption. Each input terminal
corresponds with one external interruption. The inputs rising/falling edge can activate the
interruption. The interruption subroutine is written behind the main program (behind FEND).
After interruption generates, the main program stops running immediately, turn to run the
correspond subroutine. After subroutine running ends, continue to execute the main program.
Subroutine
Input interrupt
XC2 seriesXC3-24/32XC5-48/60
XC3-48/60XC3-19AR-E
XC5-24/32XCM-24/32-
Interruption Instruction
PLC Software Manual Page 348 of 365 LMAN021_R2V2
Enable Interruption [EI]Disable Interruption [DI]Interruption Return [IRET]
Within the main programs execution cycle, if you need to handle a special program; or
during the sequential scanning, a special program needs to be executed at a certain
time, time interruption function is required. This function is not affected by PLCs scan
cycle, every Nm, executes a time interruption subroutine.
X0
Y0
FEND
I4010
M8000
INC D0
IRET
Time interruption is defaulted in open status, time interruption subroutine is similar with
other interruption subroutine, it should be written behind the main program, starts with
I40xx, ends with IRET.
There are 10CH time interruptions. The represent method is I40**~I49** (** means time
interruptions time, unit is ms. For example, I4010 means run one channel time interruption
every 10ms.
With EIDI can set interruptions allow or forbidden area. As in the above graph, all time
Interruption Allowed
DI
Interruption Forbidden
EI
Interruption Allowed
FEND
I4010
Interruption Program
IRET
Interruption Forbidden
FEND
In the left example program, if use M0 to
I4020 enable M8056 ON, the forbid 0CHs
Interruption time interruption.
Program
IRET
END
In this chapter, we make some samples about pulse output instruction, Modbus
communication instructions and free format communication instructions etc.
Ladder Program:
M8002
SET M0
M10
DMOV K100000 D200
M1 T0 K20
( )
T0
RST M1
SET M0
M8170
RST M0
SET M1
ALT M10
M0
DPLSR D200 D210 D220 Y0
Instruction List:
LD M8002 //initial positive pulse coil
SET M0 //set M0 ON
LDF M10 //M10 falling edge activate condition
OR M8002 //Initial data
DMOV K100000 D200 //move decimal data 100000 into DWORD D200
DMOV K24000 D210 // move decimal data 24000 into DWORD D210
MOV K100 D220 // move decimal data 100 into DWORD D220
Explanation:
When PLC changes from STOP to be RUN, M8002 gets a scan cycle;
set the high frequency pulse parameters into D200D210,
set the acceleration/deceleration speed to D220,
set M0, the motor starts to run 3 rounds with high frequency.
Meantime M8170 sets; the motor runs 3 rounds and decelerate, stop, coil M8170 reset;
then reset M0, set M1, NOT M10;
set the low frequency pulse parameters into D200D210;
the timer time lags 2sec, when time reaches, reset M1;
set M0, the motors starts to run 1 round with low frequency;
after this starts to run with high frequency.
Repeat this alternation time by time;
E.g.1: realize Modbus read/write among one master and three slaves
Ladder
STL S2
S2 M8137 M0[D0] Flow S2 is used to judge the
( S ) communication status. Failure
M8138 M0[D0] will set the correspond coil;
( R )
success will reset the
M8137 S3
( S ) correspond coil;
M8138
STLE
STL S3
S3 D0 K4
INC D0 If the station number is not larger than 4,
the station register add 1, the offset add
ADD K10 D1 D1
10
D0 K4
MOV K2 D0 If the station number is larger than 4,
evaluate the station register 1; clear the
MOV K0 D1
offset register
S0
( S ) Open flow S0
STLE
END
e.g. 2: Below is a sample of XC Series PLC with two XINJE inverters, they communicate via
Modbus communication, XC Series PLCs write the frequency to the two inverters;
set the first inverters station to be 1; set the second inverters station to be 2; store the
frequencys set value in D1000 and D2000. execute the frequency setting order via COM
ports;
Program Description:
On the rising edge of M8012, write frequency to the first inverter; on the falling edge of M8012,
write frequency to the second inverter;
1Interface Specifications
DH107/108 instruments use Hex data form to represent each instruction code and data;
Read/write instructions:
Read: address code +52H (82) +the para.(to read) code +0+0+CRC parity code
Write: address code +43H67+ the para.(to write) code +low bytes of the wrote data +
Among in, PVSV and the read parameters are all in integral form, each occupies two bytes,
MV occupies one byte, the value range is 0~220, alarm status occupies one byte, CRC parity
code occupies two bytes, totally 10 byes.
CRC parity code is the reminder from the result of PV+SV+ (alarm status *256+MV)+
para. value +ADDR;
(for details, please refer to AIBUS communication description)
After power on the PLC, the PLC read the current temperature every 40ms. During this period,
the user can write the set temperature.
Data zone definition: buffer area of sending data D10~D19
buffer area of accepting data D20~D29
Time 40ms
Output M10
D42
MOV D34 D42 Logic and D42 with HFF, save data in D14
ADD D46 K67 D48 D48 add D34, save data in D50
ADD D48 D34 D50 D50 add D30, save data in D52
MOV D52 D54 Logic and D54 with HFF, save result in D16
ROR D56 K8 Logic and D56 with HFF, save result in D17
Relationship of received (RCV) data (data returned by the instrument) and the registers:
D20 D21 D22 D23 D24 D25 D26 D27 D28 D29
PV low PV SV low SV Output Alarm Read/write Read/write CRC CRC
bytes high bytes high value status low bytes high bytes low high
bytes bytes bytes bytes
When writing a data string according to the communication objects protocol, use SEND and
RCV commands from free format communication, user will get the communication with the
objects.
For help and support regarding your XINJE products visit the online
Support Centre or contact us on: [email protected].
www.listo-ltd.com
www.xinje-support-centre-listo.com
[email protected]
www.xinje-support-centre-listo.com