Programming Manual of IVC Series Small PLC V1 2
Programming Manual of IVC Series Small PLC V1 2
Programming Manual
Version V1.2
Revision date March 17, 2015
INVT Auto-Control Technology provides customers with technical support. Users may contact the nearest INVT local
sales office, service center or headquarters.
PORT0 and PORT1 are for communication. PORT0 is RS232, and use socket Mini DIN8, while IVC1 series PORT1 is RS485
or RS232, IVC1L series PORT1 and PORT2 is RS485. The bus socket is for connecting extension modules. The mode
selector switch can be set to ON, TM or OFF.
Power supply
电池输入端子
Input terminals
信号输入端子 输入信号状
Input status LEDs
terminals 态指示灯
输出信号状
Output status LEDs
态指示灯
PORT0
通信端口 PORT0
System
系统工作状 status
Output terminals
信号输出端子
通信端口 PORT1 态指示灯
LEDs
The battery socket is designed for CR2354 lithium battery. The bus socket is for connecting extension modules. PORT0 is
RS232 and uses socket Mini DIN8, while the communication port PORT1 is RS485 or RS232. The mode selector switch can
be set to ON, TM or OFF.
Programming manual of IVC series small PLC Chapter 1 Product overview 5
信号输入端子
Input terminals
输入信号状
Input status LEDs
态指示灯
Bus socket
母线插座
Mode selector 模式选
switch 系统工作状
System status
择开关 态指示灯
LEDs
Output
输出信号状 status LEDs
PORT0
PORT0
态指示灯
PORT1 PORT2
PORT1 PORT2 信号输出端子
Output terminals
The battery socket is designed for CR2354 lithium battery. The bus socket is for connecting extension modules. PORT0 is
RS232 and uses socket Mini DIN8, while the communication port PORT1 and PORT2 are RS485. The mode selector switch
can be set to ON, TM or OFF.
You can uninstall the Auto Station software through the Windows control panel. To install the Auto Station software in a new
version, you have to uninstall the old version at first.
工作区 area
Operation
Project management window
管理窗口
指令树窗口
Instruction tree window 信息窗口 Status
Information window 状态栏 bar
For the usage of Auto Station programming software, refer to Auto Station Programming Software User Manual.
IVC1L series
Quick Start User Manual of IVC1L Series PLC
User Manual of IVC1L Series PLC
This chapter introduces the programming resources, theories and system configuration of IVC series PLC as well as how to set
PLC running and operation modes. The system commissioning functions and commissioning software are also introduced.
High-speed pulse
Y0~Y7 4×200kHz, 4×100kHz
output
Digital filtering X0~X7 adopt digital filtering and other terminals adopt hardware filtering
Calling of Maximum number: 64. Maximum nesting levels: 6. Local variables and variable alias are
Special subprograms supported. Each subprogram can provide up to 16 parameter transfer
function Upload password
User program 3 kinds of password. Not longer than 8 letters or numbers. Case
Download password
protection sensitive
Monitor password
Auto Station
Programming
programming IBM PC or compatible computer is required
modeNote5
softwareNote6
Realtime clock Built-in, standby batteries supply power
Notes:
Note 1: X and Y elements are addressed in octal system. For example, X10 stands for the eighth input point.
Note 2: Based on the timing precision, T element addresses fall into three categories:
IVC1/IVC1S/IVC1L/IVC2L
1) 100ms: T0~T209
2) 10ms: T210~T251
3) 1ms: T252~T255
IVC2H
1) 100ms: T0~T209
2) 10ms: T210~T479
3) 1ms: T480~T511
Note 3: Based on the width and function of count value, C element addresses fall into three categories:
IVC1/IVC1S/IVC2L
1) 16bit up counter: C0~C199
2) 32bit up/down counter: C200~C235
3) 32bit high-speed counter: C236~C255
IVC2H
1) 16bit up counter: C0~C199
2) 32bit up/down counter: C200~C235
3) 32bit high-speed counter: C236~C255, C301-C307, C256-C300 reserved
Note 4: The analog potentiometer is an instrument that you can use to set the PLC element value. You can use a philips
screwdriver to wind the potentiometer clockwise to the maximum angle of 270°, and the element value will be set from 0 to 255.
Note that the potentiometer could be damaged if you wind it clockwise more than 270°.
Note 5: The element values can be forcedly set to facilitate commissioning and analyzing user program and streamline the
commissioning. You can force up to 128 bit elements and 16 word elements at the same time.
Note 6: The user program can be modified online.
Note 7: Partial PLC elements are reserved. Avoid using those elements in the user program. For details, see Appendix
3Reserved elements.
Programming manual of IVC series small PLC Chapter 2 Function description 15
Execute user
program
Internal tasks
Note
The constant scanning time setting must not be set bigger than the watchdog time setting.
For IVC2H series PLC, the downloaded user program, datablock and system block will be stored permanently in the main
module FLASH and EEPROM areas, while the downloaded auxiliary user information will be stored in the battery backed RAM
area.
Note
1. To embed the downloaded files into the main module, the main module power supply must be maintained for more than 30s
after the download.
2. If the backup battery fails in IVC2L and IVC2H series PLC, the auxiliary user information will be lost, the annotation for the
user program will not be uploaded, and system will report “User information file error”. But the user program will be executed
after all.
Help
Note
1. The power-off data saving function in IVC2L and IVC2H series PLC relies on the support of the backup battery. If batteries
fail, all the saved elements will have uncertain values after power loss.
2. For IVC1 series PLC, the values of its saved elements are stored in the permanent memory.
Note
The EEPROM can be over-written for a limited number of times (usually one million). Do not overwrite EEPROM unless it is
necessary, otherwise EEPROM could fail soon and lead to CPU fault.
The input terminals X0~X17 of IVC2L series main module and X0~X7 of IVC1、IVC1L and IVC2H series main module use
digital filtering to filter the noise at the terminal. You can set the filter constant in the Input Filter tab of System block.
IVC1L、IVC2L and IVC2H series main module can work without battery. When you select the No battery mode in the
Advanced Settings tab of System block, the system will not report system errors caused by lack of battery (battery-backed
data lost, forced-table lost and user information file error).
See the notice for the No battery mode in the Advanced Settings tab of Datablock.
Note
IVC1 series PLC has no battery, therefore it does not support no battery mode.
Protection
Description
measures
Advanced Settings tab in System block, the PLC internal user program, system block and datablock are
protected against formatting.
To lift the formatting ban, you need to re-download the system block and uncheck the Formatting is
prohibited option.
Download
Download limit
password
If you select to disable the upload function during downloading process, it will be prohibited to upload the
Upload ban program from PLC to PC. To enable the upload function, you must re-download the program and check to
enable the upload function during the downloading process.
Upload password Upload limit
Monitor password Download limit
The programmer can set passwords to protect the program, subprogram and interrupt subprogram against
aunthrorized accessing and editing in Auto Station.
Program password Password setting method: Right click the program and select Encrypt/Decrypt in the popped out shortcut
menu, insert the password and confirm it. To cancel the password, just go through the same process and
input the correct password.
Note
If you fail to input the correct password for continuously 5 times, you will be banned from inputting password for the next 5
minutes.
Help
Note
The element range and group number of the saving range are different for different PLC models.
By default, the D, M, S, T and C elements in a certain range will be saved.
You can change the defaults as you need. By clicking the Clear button on the right will set the corresponding number to zero.
For IVC2L and IVC2H series PLC, you can set two groups that form a union.
For IVC1 and IVC1L series PLC, you can set only one group.
Note
The T elements cannot be set in the saving range for IVC1/1L series PLC.
System operation upon power loss: PLC will save the elements in the saving range to the battery backed files.
System operation upon power on: PLC will check the data in SRAM. If the data saved in SRAM is correct, it will remain
unchanged. If the data is incorrect, PLC will clear all the elements in SRAM.
Output table
In the Output Table tab, you can set the state of output points when the PLC is in STOP state. See Figure 2-4.
Programming manual of IVC series small PLC Chapter 2 Function description 20
Help
The output table is used to set the PLC output state when the PLC is stopped. The output states include:
(1) Disable: When the PLC is stopped, all the outputs will be disabled.
(2) Freeze: When the PLC is stopped, all the outputs will be frozen at the last status.
(3) Configure: When the PLC is stopped, the marked outputs will be set as ON.
Set time
See Figure 2-5.
Help
Help
Input point
The Input Point setting tab is shown in Figure 2-7.
In this tab, you can set the following parameters:
1. Input point
When the Disable input point is not checked, you can designate an input terminal (among X0~X17) as a means of external
RUN control. When the designated input terminal is ON, the PLC will be turned from STOP state to RUN state.
2. Disable input point
Check the Disable input point to disable the input point startup function.
Programming manual of IVC series small PLC Chapter 2 Function description 22
Help
Advanced settings
The advanced settings include datablock enabled, element value retained and no battery mode.
Help
1. Datablock enabled
Check the Datablock enabled, and the datablock will be used to initialize the D elements when the PLC changes from STOP to
RUN.
2. Element value retained
Check the Element value retained, and the elements will not be initialized, but saved when the PLC changes from STOP to
RUN.
Programming manual of IVC series small PLC Chapter 2 Function description 23
Note
When the Datablock enabled and Element value retained are both checked, the Datablock enabled prevails. See
2.1.6Initialization of elements.
3. No battery mode
Check this option, and the system will not report the battery backup data lost error and forced table lost error upon battery
failure.
Communication port
You can set the two or three PLC communication ports in the Communication port tab of the System block, as shown in
Figure 2-9. The setting items include protocol selection and the specific protocol parameters.
Help
By default, the communication port 0 uses program port protocol, while the communication port 1 and 2 use no protocol. You
can set as you need.
1. Program port protocol
By default, the communication port 0 uses the program port protocol, the dedicated protocol for the communication of IVC
series PLC programming software. Under this protocol, you can set the communication baud rate between PC and port 0
through the serial port configuration tool of AutoStation. In the TM state, port 0 can only be used for programming
communication.
2. Free port protocol
The free port protocol supports customized data file format, either ASCII or binary code. Only in the RUN state can a PLC use
the free port communication, which cannot be used to communicate with the programming device. In the STOP state, port 0
can only be used for programming communication.
The configurable parameters include baud rate, data bit, parity check, stop bit, allow start character detection, allow end
character detection, intercharacter timeout and interframe timeout.
3. Modbus protocol
The Modbus communication equipment include a master and a slave. The master can communicate with the slave (including
inverters) and send control frames to the slave, and the slave will respond to the master’s requests.
Communication port 0 can be set as a slave, while communication port 1 can be set as a slave or a master.
The configurable parameters include baud rate, data bit, parity check, stop bit, master/slave mode, station No., transmission
mode, timeout time of the main mode and retry times.
4. N:N bus protocol
N:N bus is an INVT-developed communication protocol that supports N to N communication in a small PLC network. The PLCs
in a N:N bus network can automatically exchange part of their D and M elements.
Programming manual of IVC series small PLC Chapter 2 Function description 24
Note
For the detailed information of communication protocols, see Chapter 10 Using Communication Function.
Special module configuration
You can set the Module type and Module property in the Special module configuration tab, as shown in 错误!未找到引用
源。.
Help
1. Module type
As shown in 错误!未找到引用源。, you can set the module type for No.0~No.3 special modules.
2. Module property
After selecting the Module type, the corresponding Module property will be activated. Open the dialogue box as shown
below.
In the dialogue box as shown in 错误!未找到引用源。, you can configure the channel for the special module, including mode
(signal features), digital value at zero, upper limit of digital value and average sampling value. Refer to the user manual of the
specific special module for the meanings and configuration methods of the various parameters.
Priority level of interruption
The priority level of interruption is shown in Figure 2-12.
The PLC built-in interrupts can be set as high priority or low priority.
Help
Communication module
You can set the Communication module, as shown in Figure 2-13.
Inverter configuration
You can select the inverter model and set the station number, as shown below:
2.2.2 Datablock
The datablock is used to set the defaults for D elements. If you download the compiled datablock settings to the PLC, the PLC
will use the datablock to initialize the related D elements upon PLC startup.
The datablock editor enables you to assign initial data to the D register (data memory). You can assign data to words or double
words, but not to bytes. You can also add comments by inputting “//” to the front of a character string.
Besides the datablock of D elements, IVC2H series support the datablock of R elements.
See Auto Station Programming Software User Manual for detailed datablock instruction.
2.2.4 Setting BFM for IVC2L and IVC2H series special modules
There is no need to set the addresses for IVC2L and IVC2H series special modules, for the main module can detect and
address them automatically upon power on.
Among the special modules, the analog extension module includes the analog input module and analog output module.
The parameters of these two special modules, such as the channel characteristics, zero point and maximum digital signal are
by default applicable directly. However, when necessary, you can change the parameters in order to cater for your actual
needs.
IVC2L and IVC2H analog input module
IVC2L and IVC2H analog input module exchanges information with its main module through the BFM area.
When a user program runs on the main module, the TO instruction will write data to the related registers in the BFM area of
IVC2L special module, and change the default settings. The configuration data that can be changed includes zero digital signal,
maximum digital signal, input channel signal characteristic, input channel ready flag, and so on.
The main module uses the FROM instruction to read the data from the BFM area of IVC2L analog input module. The data may
include the analog-digital conversion result and other information.
IVC2L and IVC2H analog output module
IVC2L and IVC2H analog output module exchanges information with its main module through the BFM area.
When a user program runs on the main module, the TO instruction will write data to the related registers in the BFM area of
IVC2L special module, and change the default settings. The configuration data that can be changed includes zero digital signal,
maximum digital signal, output channel signal characteristic, output channel ready flag, and so on.
The main module uses the FROM instruction to read the data from, and uses the TO instruction to write the digital signal to be
convertered to, the BFM area of IVC2L analog output module.
For details about the TO/FROM instruction, refer to 错误!未找到引用源。Application instructions. As for the information about
various special modules, as well as their BFM areas, see the quick start manuals of the special module.
Note
If the Control mode of input point is valid in the main module, the corresponding input terminal must be ON, or the system
will not enter the RUN state after reset.
2. Setting mode selection switch
Programming manual of IVC series small PLC Chapter 2 Function description 28
When the PLC is in STOP state, setting the mode selection switch to ON will change the PLC to RUN state.
3. Setting startup mode of input point
If the Startup mode of input point is valid in the system block, in STOP state, the designated input points (X0~X17) detected
by the system change from OFF to ON, and then the main module enter the RUN state.
Note
The mode selection switch must be set to ON for the input terminal startup mode to be valid.
How to change from RUN to STOP
1. Resetting the PLC
If the mode selection switch is set to OFF or TM, resetting the system (including power-on reset) will change the PLC to STOP
state.
Note
Even when the mode selection switch is ON, the system will also enter the STOP state after reset if the Control mode of input
point is valid in the main module and the designated input point is OFF.
2. Setting mode selection switch
The system will change from RUN to STOP when you set the mode selection switch from ON or TM to OFF.
3. Using the STOP command
The system will enter the STOP state after executing the STOP command in the user program.
4. Auto-stop upon faults
The system will stop executing the user program when a serious fault (like user program error, or user program execution
overtime) is detected.
Yes No
Note
If you select No, the program compiled last time will be downloaded to the PLC, which means the changes are invalid.
If you have set a download password and have not entered it after starting the Auto Station this time, a window asking you to
enter the password will pop up before the download can start.
Programming manual of IVC series small PLC Chapter 2 Function description 29
Uploading
You can upload the system block, data block and user program from a PLC to your PC, and save them in a new project. If the
battery backed data are valid, the user auxiliary information files will be uploaded together. See Figure 2-18.
If you have set a upload password and have not entered it after starting the Auto Station this time, a window asking you to enter
the password will pop up before the upload can start.
During the download, you can select to disable the upload function, which means no PC can upload the program from the PLC.
To enable the upload function, you must re-download the program and check to enable the upload function during the
downloading process.
New
Newuser
userprogram
programerror
新发生的用户程序错误 error
错误记录
SD20 Error
Error record
record 00
0
错误记录
SD21 Error
Error record
record 11
1
错误记录
SD22 Error
Error record
record 22
2
错误记录
SD23 Error
Errorrecord
record33
3
错误记录
SD24 Error record
Error record 44
4
Discard
Only when serious user program execution error occurs will the user program halt and the ERR indicator on the main module
turn on. In less serious cases, the ERR indicator on the main module will not turn on.
Checing the error information online
Connect the PLC with your PC through the serial port, and you can read various PLC state information through the Auto Station,
including the system error and user program execution error.
In the main interface of Auto Station, click PLC->PLC Info to check the PLC information, as shown below:
The System error No. is the No. of the system errors stored in SD3, and Execution error No. is the No. of the execution error
stored in SD20. The error description is for your reference.
Warning
On occasions when casualties or property loss may occur, the online program editing function should be used by professionals
with sufficient protection measures.
Programming manual of IVC series small PLC Chapter 2 Function description 31
Method
After making sure that the PC-PLC communication has been set up and the PLC is in RUN state, click Debug->Online edit in
the Auto Station main interface to enter the online edit state.
In the online edit state, you can edit the main program, subprograms and interrupts as usual. After the edit, click
PLC->Download and the edited program will be compiled and downloaded to the PLC automatically. When the download
completes, the PLC will execute the new program.
Limits
1. In the online edit state, you cannot change the global variable table or any local variable table, nor add or delete any
subprogram and interrupt.
2. Auto Station will quit the online edit state if the PLC is stopped.
PLC time
The PLC time function can be used to display and set PLC present time, as shown in Figure 2-22.
Displayed in the PLC time window is the present date and time of PLC. You can adjust the time setting and click the Set time
button to validate it.
You can see a lock under the forced elements in the LAD, as shown in Figure 2-25:
Unforce
You can unforce any forced elements when forcing them becomes unnecessary. To unforce an element, select the target
element, right click and select Unforce to pop up a dialog box as shown in Figure 2-26. All the forced elements among the
selected elements are listed in the dialog box. You can select to unforce any elements, and click the OK button to confirm. The
forced value will be deleted from the PLC, so is the lock mark.
This chapter details the description, classification and functions of the elements of IVC series small PLC.
User program
Data register D
Output point Y
Input point X
State relay S
Counter C
Timer T
Elements
In this manual, the elements are named according to their types. For example:
Input point X, or “X element” for short
Output point Y, or “Y element” for short
Auxiliary relay M, or “M element” for short
Data register D, or “D element” for short
State relay S, or “S element” for short
Programming manual of IVC series small PLC Chapter 3 Element and data 36
Special auxiliary relay 256 (SM0~SM255) 512 (SM0~SM511) 256 (SM0~SM255) 512 (SM0~SM511) Decimal
State relay 1024 (S0~S1023) 1024 (S0~S1023) 992 (S0~S991) 4096 (S0~S4095) Decimal
Element
Note2 Note2 Note2 Note2
resources Note4 Timer 256 (T0~T255) 256 (T0~T255) 256 (T0~T255) 512 (T0~T511) Decimal
Counter 256 (C0~C255) Note3 256 (C0~C255) Note3 256 (C0~C255) Note3 307 (C0~C256) Note3 Decimal
Data register 8000 (D0~D7999) 8000 (D0~D7999) 8000 (D0~D7999) 8000 (D0~D7999) Decimal
Value assignment
1. The X elements accepts only hardware input state
devices
Internal tasks value and forced operation state value. In the user
program, they cannot be changed through output or
instructions, nor be set during system debugging.
Update I/O Output relay delay 2. You can assign values to Y elements with the OUT
instruction, or set the state value of Y elements, or even
force or write Y element values during system debugging.
Figure 3-2 Schematic diagram of I/O update 3. Through the system block, you can set the output
Classification states of Y elements in the STOP state.
Boolean
Note
Available forms
When using the N:N bus protocol, some M elements will
NO and NC contacts be used by the system.
Boolean
3.1.6 Timer
The T elements with the timing precision of 1ms are 2. Write or force during system debugging.
activated by interrupts, unrelated to the PLC scan cycle. Power loss saving
Their action time is the most precise. The update and
T elements in the
action time of other T elements are related to PLC scan T elements outside
State saving range
cycles. the saving range
(IVC2L series only)
Elements numbered in Power loss Remain unchanged Cleared
RUN → STOP Remain unchanged Remain unchanged
Decimal, starting with 0
STOP → RUN Remain unchanged Cleared
Data type Note: The saving range is set through the system block. See
错误!未找到引用源。错误!未找到引用源。.
Boolean, word
Available forms
Note
The timing and action mode of T elements are determined
The maximum timing value of T element is 32767. The
by the timing instruction that uses them. There are four preset value is -32768~32767. Because T elements act
timing instructions: TON, TOF, TONR and TMON. See 错 only when the counted value reaches or exceeds the
preset value, it is pointless setting the preset value as a
误!未找到引用源。错误!未找到引用源。 for details.
negative number.
Value assignment
1. Through instructions.
3.1.7 Counter
Element mnemonic Available forms
C The instructions that may use the C elements are
Function classified into 4 types: CTU, CTR, DCNT and high-speed
I/O. See 错误!未找到引用源。错误!未找到引用源。 and
The C element contains a bit element and a word (or a
double word) element. The word elements can record 错误!未找到引用源。Application instructions for details.
16-bit or 32-bit counted numbers, and is used as a value The classification of C elements is shown below:
in the program. The bit element represents the state of the C element Type Applicable to
counter coil and is applied to logic control. C0~C199 16bit up counter CTU, CTR
C200~C235 32bit up/down counter DCNT
1 state bit
C bit element C236~C255 32bit high-speed counter High-speed I/O
MSB
Value assignment
Sign bit
16-bit counter LSB
16 bits
1. Through instructions.
Sign bit
MSB 2. Write or force during system debugging.
32-bit counter LSB
16 bits 16 bits Power loss saving
Figure 3-4 C element C elements in the C elements outside
State
saving range the saving range
Classification
Power loss Remain unchanged Cleared
Two types: 16-bit counter and 32-bit counter RUN → STOP Remain unchanged Remain unchanged
STOP → RUN Remain unchanged Cleared
Elements numbered in
Note: The saving range is set through the system block. See
Decimal, starting with 0 错误!未找到引用源。错误!未找到引用源。.
Data type
Boolean, word or double-word
Programming manual of IVC series small PLC Chapter 3 Element and data 40
Notes
If the destination operand uses the Kn addressing mode, while the data to be stored is longer than the length of the destination
operand, the system will keep the lower bits and discard the higher bits.
For example:
Execute instruction DBITS 16# FFFFFFF0 K1M0. After executing the instruction, the operand 2 (K1M0) should store the
calculation result 16# 1c (28). However, the K1M0 is only 4 bits wide, which is not enough for 16# 1c. By discarding the higher
bits, the actual operand 2 is K1M0=16# c (12).
Programming manual of IVC series small PLC Chapter 3 Element and data 43
3.3 Data
Constant D V R
REAL
Programming manual of IVC series small PLC Chapter 3 Element and data 45
If an instruction uses an operand with unsuitable data type, the instruction will be deemed illegal. For example, instruction
“MOV 10 X0” is illegal because operand 2 of the MOV instruction is of signed integer data type, while the X0 element can
store only Boolean data.
Note
1. When the operand is of INT or WORD type, the applicable elements include KnX, KnY, KnM, KnS, KnLM and KnSM, where
1≤n≤4
2. When the operand is of DINT or DWORD type, the applicable elements include KnX, KnY, KnM, KnS, KnLM and KnSM,
where 5≤n≤8
3. When the operand is of INT or WORD type, the applicable C elements are C0~C199.
4. When the operand is of DINT or DWORD type, the applicable C elements are C200~C255, C301~C306.
3.3.3 Constant
You can use constants as the instruction operands. IVC2L series PLC supports input of multiple types of constants. The usual
constant types are listed in the following table:
Table 3-4 Constant types
Constant type Example Valid range Remarks
Decimal constant (16-bit signed
-8949 -32768~32767
integer)
Decimal constant (16-bit unsigned
65326 0~65535
integer)
Decimal constant (32-bit signed
-2147483646 -2147483648~2147483647
integer)
Decimal constant(32-bit unsigned
4294967295 0~4294967295
integer)
Hex constant (16-bit) 16#1FE9 16#0~16#FFFF The hex, octal or binary constants
Hex constant (32-bit) 16#FD1EAFE9 16#0~16#FFFFFFFF are neither positive nor negative by
Octal constant (16-bit) 8#7173 8#0~8#177777 themselves. When used as
Octal constant (32-bit) 8#71732 8#0~8#37777777777 operands, the positive and negative
Binary constant (16-bit) 2#10111001 2#0~2#1111111111111111 nature of these constants are
2#0~2#1111111111111111 determined by the data type of the
Binary constant (32-bit) 2#101110011111
1111111111111111 operand.
Compliant with IEEE-754.
-3.1415E-16 The programming software can
Single-precision floating point 3.1415E+3 ±1.175494E-38~±3.402823E+38 display and input floating point
0.016 constants with 7-bit of operational
accuracy
Programming manual of IVC series small PLC Chapter 4 Programming concepts 46
This chapter details the programming of IVC series small PLC, including the programming language, program components,
data type, addressing mode and annotating function. The programming and usage of subprograms are also introduced, and
finally, the general explanation of instructions.
M
LS1 PB CR
LS2 SS
Figure 4-1 The equivalence between electric control diagram and LAD
If the Datablock enabled is checked in the Advanced Settings tab of System block, the D or R elements will be initialized by
the data block before the PLC executes the user program.
Input your comment into the Block Comment dialog box that pops out and click the OK button
A block comment occupies a whole row. You cannot add a block comment to an occupied row, nor can a row occupied by a
comment be used for other purposes.
Symbol addressing
When the defined variables are used, you can select View->Symbol Addressing to display their names instead of their
addresses in the LAD or IL program.
The following figure shows the LAD program when the Symbol Addressing is not checked.
The following figure shows the LAD program when the Symbol Addressing is checked.
Element comment
You can select View->Element Comment to display the element comments in the LAD program, as shown in 错误!未找到引
用源。.
Programming manual of IVC series small PLC Chapter 4 Programming concepts 51
Note
The block comment, global variable table and local variable table can be compiled and downloaded to IVC2L and IVC2H series
PLC. To store such information, battery backup is needed. However, although battery failure may cause information loss,
comment upload failure and user information file error report, the user program can still run normally.
4.4 Subprogram
4.4.1 Concept
Being an optional part of the user program, a subprogram (SBR) is an independent program organization unit (POU) that can
be called by the main program or other SBRs.
You can use SBRs in your user program to:
1. Reduce the size of the user program. You can write a repeated program section as a SBR and call it whenever necessary.
2. Clarify the program structure, particularly the structure of the main program.
3. Make the user program more transplantable.
Based on the variable data type, the software will automatically assign a fixed LM or V element address to each SBR variable
in sequence.
2. Variable name
You can give each SBR variable a name (alias). You can use a variable in the program by quoting its name.
3. Variable type
The SBR variables are classified into the following four types:
IN: The IN type variables can transfer the inputs of SBR when the SBR is being called.
OUT: The OUT type variables can transfer the SBR execution result to the main program when a SBR calling ends.
IN_OUT: The IN type variables can transfer the inputs of SBR when the SBR is being called, or transfer the the SBR
execution result to the main program when a SBR calling ends.
TEMP: The TEMP variables are local variables that are valid only within the SBR.
4. Data type
The variable data type specifies the range of the data. The variable data types are listed in the following table.
Table 4-1 Variable data types
Data type Description Occupid LM/V element address
BOOL Bit type One LM element address
INT Signed integer type One V element address
DINT Signed double integer type Two consecutive V element addresses
WORD Word type One V element address
DWORD Double word type Two consecutive V element addresses
REAL Floating point type Two consecutive V element addresses
4.4.5 Example
What follows is an example of how to write and call a SBR.
Function of this example SBR
Call SBR_1 in the main program to complete a adding calculation of two integer constants 3 and 2, and assign the result 5 to
D0.
Operation procedures
Step 1: Insert a SBR into the project and name it as SBR_1.
Step 2: Write SBR_1.
1. Set the SBR calling interface through the SBR_1 variable table.
1) Variable 1: Name it as IN1 (variable type: IN). Set the data type as INT. The software will assign it with a V element address
of V0.
2) Variable 2: Name it as IN2 (variable type: IN). Set the data type as INT. The software will assign it with a V element address
of V1.
3) Variable 3: Name it as OUT1 (variable type: OUT). Set the data type as INT. The software will assign it with a V element
address of V2.
2. Write the SBR_1 as:
LD SM0
ADD #IN1 #IN2 #OUT1
The above program is shown in the following figure.
Programming manual of IVC series small PLC Chapter 4 Programming concepts 53
Step 4: Compile, download and run the user program and check the correctness of the SBR logic.
Execution result
When M0 is ON, SBR_1 will be called. Values 2 and 3 are transferred to the operands IN1 and IN2 to carry out the calculation
operation. The result 5 is then returned to the main program, and in the end, D0 is 5.
Source operands: or S (or S1, S2, S3 … when there are more than one of them in the same instruction). The instruction
reads values from source operands for calculation.
Destination operands: or D (or D1, D2, D3 … when there are more than one of them in the same instruction). The
instruction controls or outputs values to the destination operands.
The operands could be bit elements, word elements, double-word elements, or constants. See the specific instruction
description in Chapter 5 or Chapter 6 for details.
This chapter details the basic instruction of IVC series small PLC, including the instruction format (form), operand, influenced
flag bit, function, example and sequence chart.
LAD:
Applicable to IVC1 IVC1S IVC1L IVC2L IVC2H
LD
Note
For the contact logic instructions of IVC1 series, when the
operands are M1536~M2047, the actual program steps will be
the instruction program steps plus 1.
For the contact logic instructions of IVC2H series, when the
operands are M1536~M10240, C256~C511, T256~T511 and
S0~S4096, the actual program steps will be the instruction
program steps plus 1. When the operands are Dx.y, the
program steps will be 4.
LAD:
Influenced flag bit
OR
ORI
Function description LD M0
OR M1
Conduct “and” operation on the
power flow values of two power LD M2
flow blocks, and then assign the OR M3
value to the current power flow. ANB
OUT Y0
When M0 or M1 is on, and M2 or M3 is ON, Y0 is ON.
LAD:
Power flow block 1 Applicable to IVC1 IVC1S IVC1L IVC2L IVC2H
Function description LD M1
AND M2
Conduct “or” operation on the
power flow values of two power LD M3
flow blocks, and then assign the AND M4
value to the current power flow. ORB
OUT Y0
When both M1 and M2 are ON, or both M3 and M4 are ON, Y0
outputs ON.
MRD
Function description
Assign the top value of the power flow output stack to the current power flow.
MPP
IL: MPP Program steps 1
Programming manual of IVC series small PLC Chapter 5 Basic instructions 60
of a scan cycle.
2. In two consecutive scan cycles, the status X X
of M2 contact is ON and OFF respectively,
when the ED instruction detects a trailing
edge, Y3 will output ON status with the width
X
of a scan cycle.
Function description
Reverse the current power flow value and then assign to the current power flow.
Note
In LAD program, the INV instruction shall be used in series rather than in parallel connection with contacts.
INV cannot be used as the first instruction in the input parallel branch.
In LAD program, the INV instruction cannot directly connect to the left power flow bus.
The examples of improper use of INV instructions in LAD program are shown as follows:
X
X X
Operand description
S: Source operand
Operand description OUT, TON, TOF, PWM, HCNT, PLSY, PLSR, DHSCS, SPD,
DHSCI, DHSCR, DHSZ, DHST, DHSP and BOUT will be
S: Source operand
cleared.
Function description 4. If a step is invalid (OFF), the embedded instructions will
1. It indicates the beginning of a step (S). not be executed.
2. If a step is valid (ON), its embedded instructions will be 5. Consecutive STL instructions (serial connection of S
executed. elements) define a parallel merge structure. The STL
3. If a step changes from ON to OFF (falling edge), the instructions can be used up to 16 times in a row (the
embedded instructions will not be executed, and the maximum number of branches of a parallel branch structure
destination operands of the embedded instructions such as is 16).
1. When the input power flow changes from OFF Time sequence chart
to ON (rising edge), and the timing has not started,
the designated timer T (D) will start timing based
on the current value. In the timing status (whose ON ON
length is determined by S), the timing coil output OFF
will maintain ON. M0
ON
2. In the timing status (whose length is determined
by S), no matter how the power flow changes, the OFF OFF
T1 timing coil
timing will keep going, and the timing coil output 0.5s 0.5s
will keep ON. T1=5 T 1=5
3. When the timing value reaches the preset point, T1 timing value
T1=0 T1=0
the timing will stop, the timing value will be
cleared, and the timing coil output will be set OFF.
C0=3
C0=1 C0=2
C0 counting value C0=0
1. When the input power flow changes from Time sequence chart
OFF to ON (rising edge), the 32-bit counter C
(D) will count up or down 1 (depending on the
corresponding SM flag bit).
2. For a up counter, when the counting value is D0=3
D0
larger than or equal to the preset point (S), the
ON
counting coil will be set ON.
Switch to down counting
OFF
3. For a down counter, when the counting value SM235
is less than or equal to the preset point (S), the ON ON ON ON ON ON ON
counting coil will be set OFF. OFF OFF
M0
4. When the counting value is 2147483647, it
ON
will change to -2147483648 if the counter
OFF OFF
counts up once more. C235
counting coil
5. When the counting value is -2147483648, it C235=3
C235=2
C235=1
will change to 2147483647 if the counter counts C235 counting C235=0 C235=2
value C235=1
down once more. C235=0 C235=-1
Note
The address of the C element (D) shall be within
C200~C235.
Programming manual of IVC series small PLC Chapter 6 Application instructions 69
This chapter introduces the application instructions of IVC series small PLC, including the formats, operands, influenced flag bit,
functions, examples and time sequence charts of the instructions.
Indexed
Operand Type Applicable elements
addressing
S INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
Operand description
S: source operand
Function description times. D0 will increase one for each cycle. When the cycle is
over, D0 reaches 100.
1. Instructions FOR and NEXT form a FOR-NEXT structure.
Note
2. When the power flow before FOR is valid, and the cycle
times (S) is larger than 0, the instructions in the FOR-NEXT 1. The FOR-NEXT instruction must be used in pairs in a
structure will be cyclically executed S times. After that, the POU, or the program cannot pass the compiling.
instructions after the FOR-NEXT structure will be executed. 2. Nesting of several FOR-NEXT structures is supported.
3. If the power flow before FOR is invalid, or the cycle times IVC2L series PLC supports up to 8 levels of nesting. (The
(S) is less than or equal to 0, the program will skip over the figure below shows a 3-level nesting of FOR-NEXT
instructions in the FOR-NEXT structure and execute the structure)
following instructions.
Example
LD SM1
MOV 0 D0
LD M2
EU
FOR 100
LD SM0
INC D10 3. You can use the Conditional Jump (CJ) instruction to jump
NEXT out of the structure and end the loop in advance, as shown in
The initial conditions for the operation are: D0=0, M2=OFF. the following ladder diagram:
When M2 changes from OFF to ON, the instructions in the
FOR-NEXT structure will be consecutively executed for 100
Programming manual of IVC series small PLC Chapter 6 Application instructions 70
Note
The execution of the FOR-NEXT structure is time consuming. The bigger the cycle times is, or the more instructions are
contained in the loop, the longer it will take. To prevent the operation overtime error, use the WDT instruction in a
time-consuming loop.
Indexed
Operand Type Applicable elements
addressing
S INT Constant
Indexed
Operand Type Applicable elements
addressing
S INT Constant
Function description
When the power flow is valid, the instruction will clear the user program watchdog, and the watchdog will restart timing.
Function description
1. When the power flow of the EI instruction is valid, the interrupts in the current scan cycle will be enabled.
2. When the EI instruction is valid, the interrupt requests will be allowed to join the interrupt request queue to wait for system
response.
Function description
1. When the power flow is valid, the global interrupt enable flag is inactive, that is, the global interrupt will be off.
2. When the global interrupt enable flag is inactive, the interrupt events will not generate any interrupt request.
Note
When the DI instruction is valid, the system will still respond to the unprocessed interrupt requests in the request queue, but
new interrupt events cannot generate interrupt requests.
Function description
When the power flow is valid, the system will quit the current interrupt program immediately.
Function description
When the power flow is valid, the system will immediately stop the execution of the user program.
Programming manual of IVC series small PLC Chapter 6 Application instructions 73
Function description
When the power flow is valid, the system will call the designated subprogram, execute it, and then return to the main program
to execute the instructions following the CALL instruction.
Note
1. The subprogram called by the CALL instruction must be defined in advance in the user program, or the program cannot pass
the compiling.
2. The operand element type in the CALL instruction must match the Data Type defined in the local variable table of the
subprogram, or the program cannot pass the compiling.
The following examples demonstrates some illegal matches.
Example 1: In the local variable table of subprogram SBR1, the data type of Operand 1 is DINT/DWORD.
The following usages are illegal:
CALL SBR1 Z0 (The data type of Z element cannot be DINT/DWORD)
CALL SBR1 C199 (The data type of elements C0 to C199 cannot be DINT/DWORD)
CALL SBR1 K2X0 (Kn addressing 1≤n≤3, the data type cannot be DINT/DWORD)
Example 2: In the local variable table of the SBR1 subprogram, the data type of Operand 1 is INT/WORD.
The following usages are illegal:
CALL SBR1 C200 (The data type of element C200 to C255 cannot be INT/WORD)
CALL SBR1 K2X0 (Kn addressing 4≤n≤8, the data type cannot be INT/WORD)
3. The operand element type in the CALL instruction must match the Variable Type defined in the local variable table in the
subprogram, or the program will not pass the compiling.
The following examples demonstrates some illegal matches.
Example: In the local variable table of subprogram SBR1, the operand type of Operand 1 is OUT or IN_OUT.
The following usages are illegal:
CALL SBR1 321 (constants cannot be changed, therefore it does not match OUT or IN_OUT)
CALL SBR1 K4X0 (K4X0 is read-only, therefore it does not match OUT or IN_OUT)
CALL SBR1 SD0 (SD0 is read-only, therefore it does not match OUT or IN_OUT)
4. The number of the operands in the CALL instruction must match the local variable table of the subprogram, or the program
will not pass the compiling.
Function description
When the power flow is valid, the program will quit the current subprogram and return to the upper level subprogram.
Programming manual of IVC series small PLC Chapter 6 Application instructions 74
Indexed
Operand Type Applicable elements
addressing
S INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
Indexed
Operand Type Applicable elements
addressing
S DINT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
S: source operand 1. The DMOV instruction supports signed and unsigned double integers. If the two
D: destination operand operands of the instruction are elements, the data types are signed integers. If the
source operand of the instruction is a signed double integer (for example, -10,
Function description
+100), the destination operand will also be signed integer. If the source operand is
When the power flow is valid, the the unsigned double integer (for example, 100, 45535), the destination operand
content of S is assigned to D, and the will also be unsigned integer.
value of S remains unchanged. 2. The corresponding element C only supports C200 to C255.
Example
LD X0
DMOV D0 D10
When X0 is ON, the content of (D0, D1) is assigned to (D10, D11). (D10, D11) is
50000.
Programming manual of IVC series small PLC Chapter 6 Application instructions 75
Indexed
Operand Type Applicable elements
addressing
S REAL Constant D V R √
D REAL D V R √
S: source operand LD X0
D: destination operand RMOV D0 D10
Function description When X0 is ON, the content of (D0, D1) is assigned to (D10, D11). (D10, D11) is
When the power flow is valid, the 50000.5.
content of S is assigned to D, and the
value of S remains unchanged.
Indexed
Operand Type Applicable elements
addressing
S1 INT KnX KnY KnM KnS KnLM D SD C T V R √
D INT KnY KnM KnS KnLM D C T V R √
S2 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
Operand description starting with D, and the contents of S2 elements starting with S1 remain
unchanged.
S: source operand, starting element of
data block Example
D: destination operand, starting LD X0
element of data block BMOV D0 D100 10
S2: size of data block When X0 is ON, the contents of 10 elements starting with D0 are assigned to 10
Function description elements starting with D100. D100=D0, D101=D1, ..., D109=D9.
When the power flow is valid, the
contents of S2 elements starting with
S1 are assigned to the S2 elements
Programming manual of IVC series small PLC Chapter 6 Application instructions 76
Indexed
Operand Type Applicable elements
addressing
S1 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D INT KnY KnM KnS KnLM D C T V R √
S2 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
Operand description elements starting with D element, and the content of S1 remains unchanged.
Indexed
Operand Type Applicable elements
addressing
S1 DINT Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
Indexed
Operand Type Applicable elements
addressing
D INT KnY KnM KnS KnLM D C T V Z R √
Indexed
Operand Type Applicable elements
addressing
D1 INT KnY KnM KnS KnLM D C T V Z R √
D2 INT KnY KnM KnS KnLM D C T V Z R √
Indexed
Operand Type Applicable elements
addressing
D1 DINT KnY KnM KnS KnLM D C T V Z R √
D2 DINT KnY KnM KnS KnLM D C T V Z R √
Indexed
Operand Type Applicable elements
addressing
S1 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D INT D V R √
S2 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
Indexed
Operand Type Applicable elements
addressing
D1 INT D V R √
D2 INT KnY KnM KnS KnLM D C T V Z R √
S INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
Operand description limit), the system will report “Definition error of stack operated”.
2. The stack size does not include the stack bottom element (the
D1: the number of elements in the stack. Its
element designated by D1)
element address plus 1 is the address of the stack
head. 3. S indicates the stack size, range>0.
D2: storage register for popped value Example
S: queue size LD M0
Function description FIFO D100 D0 10
1. When the power flow is valid, the value of the
stack head (the element immediately following D1) Stack
with D1 as the queue head is assigned to D2. At pointer
0 D110 D109 D108 D107 D106 D105 D104 D103 D102 D101 D100 D0
the same time, the value of D1 subtracts 1, the
contents of the S units after D1 will move forward,
and the last unit is filled with 0. 1. When M0 is ON, the content of D101 is filled into D0, and at the
2. When D1 is 0, it indicates that the stack is same time the contents of D101~D110 move forward, and the
empty, the zero flag (SM180) will be set 1. D110 is filled with 0.
2. Before the execution: D0=0, D100=10, D101=1000,
Note
D102=2000, ..., D109=9000, D110=10000.
1. When the stack is illegal (for example, when the
3. After the execution: D0=1000, D100=9, D101=2000,
stack size≤0, the number of elements in the
D102=3000,..., D109=10000, D110=0.
stack<0, or when the stack size is beyond the
Programming manual of IVC series small PLC Chapter 6 Application instructions 80
Indexed
Operand Type Applicable elements
addressing
D1 INT D V R √
D2 INT KnY KnM KnS KnLM D C T V Z R √
S INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
Operand description 2. The stack size does not include the stack bottom element
(the element designated by D1)
D1: the number of elements in the queue. Its element
address plus 1 is the address of the queue’s head. 3. S indicates the stack size, range>0.
Indexed
Operand Type Applicable elements
addressing
S1 INT KnX KnY KnM KnS KnLM D SD C T V R √
D INT KnY KnM KnS KnLM D C T V R √
S2 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
S3 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
Function description D2 D1 D0
Operand description 4. When S1 and D both use Kn addressing, Kn shall be the same.
Function description
When the power flow is valid, the D109 D108 D107 D106 D105 D104 D103 D102 D101 D100
Indexed
Operand Type Applicable elements
addressing
S1 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
S2 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D INT KnY KnM KnS KnLM D C T V Z R √
Operand description is 0, the zero flag bit (SM180) will be set. When the operation
result is less than -32768, the borrow flag bit (SM182) will be
S1: source operand1
set.
S2: source operand2
Example
D: destination operand
Function description
1. When the power flow is valid, add S1 and S2, and assign LD X0
the operation result to D.
ADD D0 D1 D10
2. When the operation result (D) is larger than 32767, the
When X0 is ON, add D0 (1000) and D1 (2000), and assign
carry flag bit (SM181) will be set. When the operation result
the result to D10, D10=3000.
Indexed
Operand Type Applicable elements
addressing
S1 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
S2 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D INT KnY KnM KnS KnLM D C T V Z R √
Operand description result is less than -32768, the borrow flag will be set bit
(SM182).
S1: source operand1
S2: source operand2 Example
D: destination operand
Function description
LD X0
1. When the power flow is valid, S1 subtracts S2, and the
SUB D0 D1 D10
operation result is assigned to D.
When X0 is ON, D0 (1000) subtracts D1 (2000), and the
2. When the operation result (D) is larger than 32767, the
result -1000 is assigned to D10.
carry flag bit (SM181) will be set. When the operation result
is 0, the zero flag bit (SM180) will be set. When the operation
Programming manual of IVC series small PLC Chapter 6 Application instructions 84
Indexed
Operand Type Applicable elements
addressing
S1 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
S2 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D DINT KnY KnM KnS KnLM D C V R √
Indexed
Operand Type Applicable elements
addressing
S1 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
S2 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D INT KnY KnM KnS KnLM D C T V Z R √
Indexed
Operand Type Applicable elements
addressing
S INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D INT KnY KnM KnS KnLM D C T V Z R √
Operand description the decimal fraction, the borrow flag bit (SM182) will be set.
Indexed
Operand Type Applicable elements
addressing
D INT KnY KnM KnS KnLM D C T V Z R √
D: destination operand This instruction is a cyclic decrease instruction, with the range of -32768~32767.
Indexed
Operand Type Applicable elements
addressing
S1 DINT Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
S2 DINT Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
D DINT KnY KnM KnS KnLM D C V R √
Operand description zero flag bit (SM180) will be set. When the operation
result<-2147483648, the borrow flag bit (SM182) will be set.
S1: source operand1
Example
S2: source operand2
D: destination operand
Function description
LD X0
1. When the power flow is valid, add S1 and S2, and assign
DADD D0 D2 D10
the operation result to D.
When X0 is ON, add the value (100000) of (D0, D1) and the
2. When the operation result (D)>2147483647, the carry flag
value (200000) of (D2, D3), and assign the result to (D10,
bit (SM181) will be set. When the operation result is 0, the
D11). (D10, D11)=300000.
Indexed
Operand Type Applicable elements
addressing
S1 DINT Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
S2 DINT Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
D DINT KnY KnM KnS KnLM D C V R √
Operand description zero flag bit (SM180) will be set. When the operation
result<-2147483648, the borrow flag bit (SM182) will be set.
S1: source operand1
S2: source operand2 Example
D: destination operand
Function description
LD X0
1. When the power flow is valid, S1 subtracts S2, and the
DSUB D0 D2 D10
operation result is assigned to D.
When X0 is ON, the value (100000) of (D0, D1) subtracts the
2. When the operation result (D)>2147483647, the carry flag
value (200000) of (D2,D3), and the result -100000 is
bit (SM181) will be set. When the operation result is 0, the
assigned to (D10, D11).
Programming manual of IVC series small PLC Chapter 6 Application instructions 88
Indexed
Operand Type Applicable elements
addressing
S1 DINT Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
S2 DINT Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
D DINT KnY KnM KnS KnLM D C V R √
Indexed
Operand Type Applicable elements
addressing
S DINT Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
D DINT KnY KnM KnS KnLM D C V R √
Indexed
Operand Type Applicable elements address
ing
D DINT KnY KnM KnS KnLM D C V R √
Indexed
Operand Type Applicable elements
addressing
D DINT KnY KnM KnS KnLM D C V R √
Function description LD X0
DDEC D0
When the power flow is valid, D
decreases 1. When X0 is ON, the value (100000) of (D0, D1) decreases 1. After the execution,
(D0, D1)=99999.
Note
This instruction is a cyclic decrease
instruction.
Indexed
Operand Type Applicable elements
addressing
S DINT Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
D DINT KnY KnM KnS KnLM D C V R √
Indexed
Operand Type Applicable elements
addressing
S DINT Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
D DINT KnY KnM KnS KnLM D C V R √
Indexed
Operand Type Applicable elements
addressing
S1 INT KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
S2 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D DINT KnY KnM KnS KnLM D C V R √
Indexed
Operand Type Applicable elements
addressing
S1 DINT KnX KnY KnM KnS KnLM KnSM D SD C V R √
S2 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D DINT KnY KnM KnS KnLM D C V R √
Indexed
Operand Type Applicable elements
addressing
S1 REAL Constant D V R √
S2 REAL Constant D V R √
D REAL D V R √
Operand description 2. When the operation result (D) is not within (-1.701412e+038)~(1.701412e+038),
the carry flag bit (SM181) will be set. When the operation result is 0, the zero flag
S1: source operand1
bit (SM180) will be set.
S2: source operand2
Example
D: destination operand
LD X0
Function description
RADD D0 D2 D10
1. When the power flow is valid, add
When X0 is ON, add the value (-10000.2) of (D0, D1) and the value (2000.5) of (D2,
S1 and S2, and assign the operation
D3), and the result -7999.7 is assigned to (D10, D11).
result to D.
Programming manual of IVC series small PLC Chapter 6 Application instructions 93
Indexed
Operand Type Applicable elements
addressing
S1 REAL Constant D V R √
S2 REAL Constant D V R √
D REAL D V R √
Operand description
S1: source operand1 Example
Indexed
Operand Type Applicable elements
addressing
S1 REAL Constant D V R √
S2 REAL Constant D V R √
D REAL D V R √
Operand description (SM181) will be set. When the operation result is 0, the zero
flag bit (SM180) will be set.
S1: source operand1
S2: source operand2 Example
D: destination operand
Function description LD X0
1. When the power flow is valid, S1 multiplies S2, and the RMUL D0 D2 D10
operation result is assigned to D. When X0 is ON, the value (-10000.2) of (D0, D1), multiplies
2. When the operation result (D) is not within the value (2000.5) of (D2, D3), and the result -20005400.0 is
(-1.701412e+038)~(1.701412e+038), the carry flag bit assigned to (D10, D11) (actually the product is -20005400.1,
but is rounded off to the calculation precision).
Programming manual of IVC series small PLC Chapter 6 Application instructions 94
Indexed
Operand Type Applicable elements
addressing
S1 REAL Constant D V R √
S2 REAL Constant D V R √
D REAL D V R √
Operand description
Note
S1: source operand1
S2≠0, or the system will report “Divided by 0 error”, and the RDIV instruction will
S2: source operand2
not be executed.
D: destination operand
Example
Function description
LD X0
1. When the power flow is valid, S1 is
RDIV D0 D2 D10
divided by S2, and the operation result
is assigned to D. When X0 is ON, the value -10000.2 of (D0, D1) is divided by the value 2000.5 of
2. When the operation result (D) is not (D2, D3), and the result -4.998850 is assigned to (D10, D11).
within (-1.701412e+038)~(1.701412e
+038), the carry flag bit (SM181) will
be set. When the operation result is 0,
the zero flag bit (SM180) will be set.
Indexed
Operand Type Applicable elements
addressing
S REAL Constant D V R √
D REAL D V R √
Operand description
S: source operand Note
D: destination operand S≥0, or the system will report operand error, and the instruction will not be
Function description executed.
When the power flow is valid, get the absolute value of S and RVABS D0 D10
assign the value to D. When X0 is ON, get the absolute value (10000.2) of (D0, D1),
and assign the result to (D10, D11).
1. When the power flow is valid, get the SIN value of S (unit: SIN D0 D10
radian), and assign the result to D. When X0 is ON, get the SIN value of (D0, D1)=1.57, and
2. When the operation result (D) is 0, the zero flag bit assign the value 1 to (D10, D11).
(SM180) will be set.
Programming manual of IVC series small PLC Chapter 6 Application instructions 96
Indexed
Operand Type Applicable elements
addressing
S REAL Constant D V R √
D REAL D V R √
Operand description 2. When the operation result (D) is 0, the zero flag bit (SM180) will be set.
Indexed
Operand Type Applicable elements
addressing
S REAL Constant D V R √
D REAL D V R √
Operand description 2. When the operation result (D) is not within (-1.701412e+038)~(1.701412e +038),
the carry flag bit (SM181) will be set. When the operation result is 0, the zero flag
S: source operand
bit (SM180) will be set.
D: destination operand
Example
Function description
LD X0
1. When the power flow is valid, get
TAN D0 D10
the TAN value of S (unit: radian), and
assign the result to D. When X0 is ON, get the TAN value of (D0, D1) 1.57, and assign the result
1255.848398 to (D10, D11).
Programming manual of IVC series small PLC Chapter 6 Application instructions 97
Indexed
Operand Type Applicable elements
addressing
S1 REAL Constant D V R √
S2 REAL Constant D V R √
D REAL D V R √
Operand description be set. When the operation result is 0, the zero flag bit (SM180) will be set.
Function description 2. When S1<0 and the mantissa of S2 is not 0, the system will report operand error,
and the instruction will not be executed.
1. When the power flow is valid, get
the S2th power of S1, and assign the Example
result to D. LD X0
2. When the operation result (D) is not POWER D0 D2 D10
within (-1.701412e+038)~(1.701412e th 3.0
When X0 is ON, get the (D2, D3) power of (D0, D1) (i.e. 55.0 ), and assign the
+038), the carry flag bit (SM181) will result 166375.0 to (D10, D11).
Indexed
Operand Type Applicable elements
addressing
S REAL Constant D V R √
D REAL D V R √
Operand description +038), the carry flag bit (SM181) will be set. When the operation result is 0, the
zero flag bit (SM180) will be set.
S: source operand
D: destination operand Example
Function description LD X0
LN D0 D10
1. When the power flow is valid, get
the LN value of S1, and assign the When X0 is ON, get the LN value of (D0, D1) 1000.0, and assign the result
result to D. 6.907755 to (D10, D11).
2. When the operation result (D) is not
within (-1.701412e+038)~(1.701412e
Programming manual of IVC series small PLC Chapter 6 Application instructions 98
Indexed
Operand Type Applicable elements
addressing
S REAL Constant D V R √
D REAL D V R √
Operand description 2. When the operation result (D) is not within (-1.701412e+038)~(1.701412e +038),
the carry flag bit (SM181) will be set. When the operation result is 0, the zero flag
S: source operand
bit (SM180) will be set.
D: destination operand
Example
Function description
LD X0
1. When the power flow is valid, get EXP D0 D10
the EXP value of S, and assign the When X0 is ON, get the EXP value of (D0, D1) “10.0”, and assign the result
result to D. 22026.464844 to (D10, D11).
Indexed
Operand Type Applicable elements
addressing
S1 REAL D V R √
S2 INT Constant KnX KnY KnM KnS KnLM KnSM D V R √
D REAL D V R √
Operand description 2. When overflow occurs, the summing operation will stop.
Indexed
Operand Type Applicable elements
addressing
S REAL Constant D V R √
D REAL D V R √
Indexed
Operand Type Applicable elements
addressing
S REAL Constant D V R √
D REAL D V R √
Operand description 2. When the operation result (D) is 0, the zero flag bit (SM180) will be set.
1. When the power flow is valid, get When SM0 is ON, get the TAN-1 value of (D0, D1)(3.14), and assign the result
the TAN-1 value of S, and assign the 1.262481 to (D10, D11).
result to D.
Operand description 2. When the operation result (D) overflows, the carry (overflow) flag bit (SM181)
will be set; when the operation result is 0, the zero flag bit (SM180) will be set.
S: source operand
D: destination operand Example
Example When SM0 is ON, get (180.0) of D0(D1), and assign the result 3.141593 to
D10(D11).
LD SM0
RAD D0 D10
Indexed
Operand Type Applicable elements
addressing
S REAL Constant D V R √
D REAL D V R √
Operand description 2. When the operation result is 0, the zero flag bit (SM180) will be set; when the
operation result overflows, the carry (overflow) flag bit (SM181) will be set.
S: source operand
D: destination operand Example
Indexed
Operand Type Applicable elements
addressing
S DINT Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
D INT KnY KnM KnS KnLM D C T V Z R √
Indexed
Operand Type Applicable elements
addressing
S INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D DINT KnY KnM KnS KnLM D C V R √
When the power flow is valid, S will be When X0 is ON, D0 (1000) will be converted from integer to double integer, and the
converted from integer to double result 1000 is assigned to (D10, D11).
Indexed
Operand Type Applicable elements
addressing
S INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D REAL D V R √
D: destination operand LD X0
Indexed
Operand Type Applicable elements
addressing
S DINT Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
D REAL D V R √
When the power flow is valid, S will be When X0 is ON, (D0, D1) 100000 will be converted from double integer to floating
converted from double integer to point number, and the result 100000.0 is assigned to (D10, D11).
Programming manual of IVC series small PLC Chapter 6 Application instructions 103
Indexed
Operand Type Applicable elements
addressing
S REAL Constant D V R √
D INT KnY KnM KnS KnLM D C T V Z R √
Operand description When the result rounds off the decimal fraction, the borrow flag will be set. the
carry (overflow) flag will be set.
S: source operand
D: destination operand Note
Function description When S>32767, D=32767. When S<-32768, D=-32768, and at the same time the
carry (overflow) flag bit will be set.
1. When the power flow is valid, S will
be converted from floating point Example
number to integer, and the result is LD X0
assigned to D. INT D0 D10
2. This instruction affects the zero flag When X0 is ON, (D0, D1) 10000.5 will be converted from floating point number to
and borrow flag. When the conversion integer and the result 10000 is assigned to D10.
result is 0, the zero flag will be set.
Indexed
Operand Type Applicable elements
addressing
S REAL Constant D V R √
D DINT KnY KnM KnS KnLM D C V R √
Operand description exceeds the range of the double integer, the carry (overflow) flag will be set.
result is assigned to D. When X0 is ON, (D0, D1) 100000.5 will be converted from floating point number to
2. When the conversion result is 0, the double integer, and the result 100000 is assigned to (D10, D11).
zero flag will be set. When the result
rounds off the decimal fraction, the
borrow flag will be set. When the result
Programming manual of IVC series small PLC Chapter 6 Application instructions 104
Indexed
Operand Type Applicable elements
addressing
S WORD Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D WORD KnY KnM KnS KnLM D C T V Z R √
Indexed
Operand Type Applicable elements
addressing
S DWORD Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
D DWORD KnY KnM KnS KnLM D C V R √
Indexed
Operand Type Applicable elements
addressing
S WORD Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D WORD KnY KnM KnS KnLM D C T V Z R √
Indexed
Operand Type Applicable elements
addressing
S DWORD Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
D DWORD KnY KnM KnS KnLM D C V R √
Indexed
Operand Type Applicable elements
addressing
S WORD Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D WORD KnY KnM KnS KnLM D C T V Z R √
Indexed
Operand Type Applicable elements
addressing
S DWORD Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
D DWORD KnY KnM KnS KnLM D C V R √
When the power flow is valid, S will be When X0 is ON, D0 0xFFFF (65535) will be converted from 16-bit Gray code to
converted from 16-bit Gray code to integer, and the result 0xAAAA (43690) is assigned to D10.
Programming manual of IVC series small PLC Chapter 6 Application instructions 107
Indexed
Operand Type Applicable elements
addressing
S DWORD Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
D DWORD KnY KnM KnS KnLM D C V R √
When the power flow is valid, S will be When X0 is ON, (D0, D1) 0xCCCCCCCC (3435973836) will be converted from
converted from 32-bit Gray code to 32-bit Gray code to double integer, and the result 0x88888888 (2290649224) is
assigned to (D10, D11).
Indexed
Operand Type Applicable elements
addressing
S WORD Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D WORD KnY KnM KnS KnLM D C T V Z R √
S1: conversion source, hexadecimal number 1. When S1 and D use Kn addressing, Kn=4.
D: destination operand. 2. When S2 is not within 1~256, the system will report
S2: number of ASCII codes, 1≤S2≤256 operand error and will not execute the instruction, and D will
not change.
Function description
3. If S1 is a constant, S2 will be regarded as 4 by default
When the power flow is valid, the hexadecimal number when S2≥4, and the system will not report operand error.
starting with S1 element will be converted to S2 ASCII codes,
Example
and the result is assigned to the elements starting with D.
When SM186 is OFF, the high/low byte of each D element
will store two ASCII code data. When SM186 is ON, the low
Source data: 0x9876
byte of each D element will store 1 ASCII code data.
LD M0
Programming manual of IVC series small PLC Chapter 6 Application instructions 109
Fill four values of low point measured value VML , high point
operation, and the result is assigned When X0 is ON, D0 2#1011011010010011 (46739) and D1 2#1001001100101110
to D. (37678) will conduct logic exclusive OR operation, and the result
2#0010010110111101 (9661) is assigned to D10.
Program steps 5
IL: WINV (S) (D)
Indexed
Operand Type Applicable elements
addressing
S WORD Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
S: source operand LD X0
WINV D0 D10
D: destination operand
When X0 is ON, conduct logic NOT operation on D0 (46739), and assign the result
Function description 18796 to D10.
When the power flow is valid, conduct
logic NOT operation on S, and assign
the result to D.
Program steps 10
IL: DWAND (S1) (S1) (D)
Indexed
Operand Type Applicable elements
addressing
S1 DWORD Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
S2 DWORD Constant KnX KnY KnM KnS KnLM KnSM D SD C V R √
D DWORD KnY KnM KnS KnLM D C V R √
Operand description Example
Program steps 10
IL: DWOR (S1) (S2) (D)
Indexed
Operand Type Applicable elements
addressing
Programming manual of IVC series small PLC Chapter 6 Application instructions 114
S: source operand LD X0
DWINV D0 D10
D: destination operand
When X0 is ON, logic NOT operation will be conducted on (D0, D1)
Function description 2#10110010101001101110011001010010 (2997282386), and the result
When the power flow is valid, logic 2#01001101010110010001100110101101 (1297684909) is assigned to (D10,
NOT operation will be conducted on S, D11).
and the result is assigned to D.
Programming manual of IVC series small PLC Chapter 6 Application instructions 115
Function description
When the power flow is valid, the data
of S1 will rotate leftward for S2 bits,
and the result is assigned to D. At the
same time the lowest bit of the S2 bits
Programming manual of IVC series small PLC Chapter 6 Application instructions 116
Example
LD M0
ROL D0 D10 15
SM181
After
MSB LSB
1 1 1 0 0 1 1 0 1 1 0 0 1 0 1 0
0 SM181
When M0 is ON, D0 2#1100110110010101 (52629) rotates leftward for 15 bits, and the result 2#1110011011001010 (59082) is
assigned to D10. The final bit will be stored in the carry flag bit. SM181 is OFF.
1. S2≥0. SM181 1
2. When S1 uses Kn addressing, Kn
must be equal to 4.
When M0 is ON, D0 2#1100110110010101 (52629) and the carry SM181 (OFF)
will rotate rightward for 5 bits, and the result 2#0101011001101100 (22124) is
assigned to D10. SM181=ON.
Function description LD M0
DROL D0 D10 30
When the power flow is valid, the data
1. When M0 is ON, (D0, D1) 2#10110011100110001001110010101100
of S1 will rotate leftward for S2 bits,
(3013123244) will rotate leftward for 30 bits, and the result
and the result is assigned to D. At the
2#00101100111001100010011100101011 (753280811) is assigned to (D10, D11).
same time the lowest bit of the S2 bits
The final bit is stored into the carry flag bit. SM181=ON.
will be stored into the carry flag bit
SM181. 2. Please refer to the ROL instruction illustration.
D: destination operand LD M0
DRCL D0 D10 25
S2: source operand2
1. When M0 is ON, (D0, D1) 2#10110011100110001001110010101100
Function description (3013123244) and the carry SM181 (OFF) will rotate leftward for 25 bits, and the
When the power flow is valid, the S1 result 2#001011000101100111001100010011100 (1488165020) is assigned to
data and the carry SM181 will together (D10, D11). SM181 = ON.
rotate leftward for S2 bits, and the 2. Please refer to the RCL instruction illustration.
result is assigned to D.
Note
1. S2≥0.
Operand description
S1: source operand1 Example
D: destination operand LD M0
SHR D0 D10 5
S2: source operand2
Before Rotate rightward 5 bits
Function description MSB LSB
0 1 1 1 1 0 1 0 1 1 0 1 1 1 0 0
When the power flow is valid, the data
of S1 will shift rightward for S2 bits, After
and the result is assigned to D. MSB LSB
0 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0
Note
When M0 is ON, D0 2#0111101011011100 (31452) shifts rightward for 5 bits, and
1. S2≥0.
the result 2#0000001111010110 (982) is assigned to D10.
2. When S1 uses Kn addressing, Kn
must be equal to 4.
Programming manual of IVC series small PLC Chapter 6 Application instructions 120
D: destination operand LD M0
SHL D0 D10 7
S2: source operand2
Before Rotate leftward 7 bits
Function description MSB LSB
0 1 1 1 1 0 1 0 1 1 0 1 1 1 0 0
When the power flow is valid, the data
of S1 will shift leftward for S2 bits, and After
the result is assigned to D. MSB LSB
0 1 1 0 1 1 1 0 0 0 0 0 0 0 0 0
Note
When M0 is ON, D0 2#0111101011011100 (31452) shifts leftward for 7 bits, and
1. S2≥0. the result 2#0110111000000000 (28160) is assigned to D10.
S1: source operand1 1. The elements with smaller SN are at the right, and the elements with larger SN
D: destination operand are at the left.
S2: source operand2 2. S2≥0.
S3: source operand3 3. S3≥0.
2. Before the execution: X0=1, X1=0, 3. After the execution: the contents of X0 to X2 remain unchanged, M10=0, M11=0,
X2=1, M10=0, M11=1, M12=1, M12=1, M13=0, M14=0, m15=0, m16=0, m17=1, m18=0, m19=1.
M13=0, M14=0, M15=1, M16=0,
M17=0, M18=0, M19=1.
6.8.1 FROM: Read word from special module buffer register instruction
Operand description Range: 1~32767. If the target register does not exist, the system will report “BFM
unit of accessed special module exceeds range”.
S1: SN of the special module to be
read, or the target module. Function description
Range: 0~7. If the target module does Read consecutively S3 registers, starting with S2 register, in the BFM of the target
not exist, the system will report target module (SN: S1) and put them into the S3 word elements starting with D.
module address invalid. Note
S2: the starting address in the BFM of
The execution time of the FROM instruction is relatively long, and closely related to
the target module.
S3.
Range: 0~32767. If the BFM address
Example
is invalid, the system will report “BFM
unit of accessed special module LD M0
FROM 0 3 D100 2
exceeds range”.
D: the D element where the data read When M0 is ON, read consecutively 2 registers, starting with register 3, in the BFM
from the target module will be stored. of the target module number 0, and put them into the word elements D100 and
S3: the number of consecutive buffer D101.
registers (single word) to be read.
Programming manual of IVC series small PLC Chapter 6 Application instructions 124
6.8.2 DFROM: Read double word from special module buffer register instruction
Operand description Range: 1~32767. If the target register does not exist, the system will report “BFM
unit of accessed special module exceeds range”
S1: SN of the special module to be
read, or the target module. Function description
Range: 0~7. If the target module does Read consecutively S3 registers, starting with S2 register, in the BFM of the target
not exist, the system will report target module (SN: S1) and put them into the S3 double-word elements starting with D.
module address invalid. Note
S2: the starting address in the BFM of
The execution time of the DFROM instruction is relatively long, and closely related
the target module.
to S3.
Range: 0~32767. If the BFM address
Example
is invalid, the system will report “BFM
unit of accessed special module
exceeds range”.
D: the D element where the data read LD M0
from the target module will be stored.
DFROM 0 3 D200 1
S3: the number of consecutive buffer
When M0 is ON, read 1 double word from register 3, in the BFM of the target
registers (double word) to be read.
module number 0, and put it into the double word element (D200, D201).
Programming manual of IVC series small PLC Chapter 6 Application instructions 125
Operand description S4: the number of consecutive buffer registers (single word) to be written.
Range: 1~32767. If the target register does not exist, the system will report “BFM
S1: the SN of the special module to
unit of accessed special module exceeds range”.
be written, or the target module.
Range: 0~7. If the target module does Function description
not exist, the system will report “Using Write data from consecutive S4 registers starting with S3 to the consecutive S4
FROM/TO instruciton to access buffer registers starting with S2 in the BFM of the target module (SN: S1).
module not existing”. Note
S2: the starting register address in
The execution time of the TO instruction is relatively long, and closely related to S4.
the BFM of the target module.
Range: 0~32767. If the BFM address Example
is invalid, the system will report “BFM LD SM0
unit of accessed special module TO 0 8 1000 2
exceeds range”. When PLC runs, write 1000 respectively to buffer registers 8 and 9 in the BFM of
S3: the data to be written into the target module number 0.
target module.
Programming manual of IVC series small PLC Chapter 6 Application instructions 126
6.8.4 DTO: Write double word to special module buffer register instruction
Operand description S4: the number of consecutive buffer registers (double word) to be written.
Range: 1~32767. If the target register does not exist, the system will report “BFM
S1: the SN of the special module to be
unit of accessed special module exceeds range”.
written, or the target module.
Range: 0~7. If the target module does Function description
not exist, the system will report “Using Write data from consecutive S4 registers starting with S3 to the consecutive S4
FROM/TO instruciton to access module buffer registers starting with S2 in the BFM of the target module (SN: S1).
not existing”. Note
S2: the starting register address in the
The execution time of the DTO instruction is relatively long, and closely related
BFM of the target module.
to S4.
Range: 0~32767. If the BFM address is
invalid, the system will “BFM unit of Example
accessed special module exceeds LD SM0
range”. DTO 0 8 16711935 1
S3: the data to be written into the target When PLC runs, write a double word data 16711935 to buffer registers 8 and 9
module. (which forms a double-word element) in the BFM of target module number 0.
S: the specified potentiometer SN. Read the value of the specified analog potentiometer and store it into the specified
Range: 0~255. If S is set outside this element.
range, the system will report operand Example
error.
LD M0
D: the element where the read analog
VRRD 0 D10
potentiometer value will be stored.
When M0 is ON, read the value of analog potentiometer 0 and put the reading into
Range: 0~255.
D10.
Programming manual of IVC series small PLC Chapter 6 Application instructions 127
D: the starting X or Y element to be refreshed. The specified 1. The subscript values of inputs (Xn, Yn) are integer
starting element address should always be a multiple of 8 (in multiples of 8.
octal system). For example, X0, X10, X20… or Y0, Y10, 2. The refreshed (terminal) number is the integer multiple of
Y20…. 8.
S: the number of inputs and outputs to be refreshed. It 3. Generally, the REF instruction is used to refresh I/O
should always be a multiple of 8, for example, 8, 16, ..., 256, immediately between the FOR-NEXT instruction and the CJ
and so on. instruction.
Function description 4. You can also use the REF instruction to obtain the latest
input and output the operation result without delay during the
Generally, the PLC will not refresh its inputs or outputs
execution of the interrupts with I/Os.
before the user program ends. However, if you want to
5. To refresh a relay output, you need to consider the
refresh the inputs or outputs when the user program is still
response time.
running, you can use this instruction.
Example
LD M0
REF Y0 8
When M0 is ON, the status at Y0~Y7 will be output
immediately regardless of the scan cycle.
Programming manual of IVC series small PLC Chapter 6 Application instructions 128
Operand description When the power flow is invalid, the flag bit of print instruction
in execution will reset.
S: starting SN of the elements to be stored
D: starting Y SN of output data Note
1. When the power flow is valid, only print once.
Function description
2. The flag bit of print instruction in execution can be used to
1. The stored data in low 8-bit (1 byte) of S~S+7 is inputted control the breaking of power flow in print instruction.
to D~D+7 by time division and the enabling signal is Y0.
2. SM71 is the mark of print instruction in execution. SM71 is Example
set in printing process and printing reset is completed.
Instruction input
S S+1 S+2 S+3 S+7
D ~D+7 Data A B C D H
Note
T0 T0 T0:Scan time(ms)
T0 1. Only applicable to transistor output modules
D+8 Gating
2. The instruction is executed with scan cycle at the same
3. When the special register SM70 is OFF, serial output 8 time
bytes; when SM70 is ON, serial output 1~16 bytes. For H00 3. Only one instruction can be executed at the same time.
(NUL code), the previous character is the last one. After printing is completed, execute SM71 reset.
Power flow input .
Data output
˜˜
Beginning character Ending character
˜˜
T T T T: Operation cycle or interrupt time
Printer gating
˜˜
Flag bit in execution
Programming manual of IVC series small PLC Chapter 6 Application instructions 130
Operand description S ④
S: starting bit of input numeric keys (occupy 10 bits)
S+1 ②
D1: data storing units
D2: element number corresponding to input keys ON/OFF S+2 ①
(occupy 11 points)
S+3 ③
Function description
S+9
1. S~S+9 are key inputs, the input data will be stored in D1,
D2~D2+9 are input information of output keys and D2+10
D2
will detect inputs. When any input is ON, D2+10 will be set.
1) Values of D1 D2+1
D: the starting storage element for the system time, which The TRD instruction will fail upon system clock setting error.
occupies the 7 consecutive elements starting with D Example
Function description LD M0
Read the system time and store the value in the storage TRD D10
elements designated by D. When M0 is ON, send the system time to the 7 elements
starting with D10.
The execution result of the instruction is as follows:
Element Item Clock data Element Item
SD100 Year 2000~2099 ――――――→ D10 Year
SD101 Month 1~12 ――――――→ D11 Month
Special data register SD102 Day 1~31 ――――――→ D12 Day
for real time clock SD103 Hour 0~23 ――――――→ D13 Hour
SD104 Minute 0~59 ――――――→ D14 Minute
SD105 Second 0~59 ――――――→ D15 Second
SD106 Week 0~6 ――――――→ D16 Week
Programming manual of IVC series small PLC Chapter 6 Application instructions 132
Operand description
S: the element where the system time is to be written
Element Item Clock data Element Item
――――――→
D10 Year 2000~2099 SD100 Year
――――――→
D11 Month 1~12 SD101 Month
――――――→
D12 Day 1~31 SD102 Day
Data for clock setting ――――――→
D13 Hour 0~23 SD103 Hour
――――――→
D14 Minute 0~59 SD104 Minute
――――――→
D15 Second 0~59 SD105 Second
――――――→
D16 Week 0~6 SD106 Week
Function description
LD X10
When the system time is different from EU
the real time, you can use the TWR MOV 2004 D10
instruction to correct the system time. MOV 12 D11
MOV 7 D12
Note MOV 9 D13
1. The time must use the solar MOV 53 D14
MOV 30 D15
calendar, or the instruction will not be
MOV 2 D16
executed.
LD X11
2. It is recommended to use the edge EU
to trigger the execution of the TWR D10
instruction. LD M0
TRD D20
Example
Changing the system time with the 1. Upon the rising edge of X10, write the time setting into the 7 consecutive units
TWR instruction is shown in the starting with D10.
following figure: 2. Upon the rising edge of X11, write the values of elements D10 into the system
time.
3. When M0 is On, read the system time and store it into D20.
Programming manual of IVC series small PLC Chapter 6 Application instructions 133
D WORD D V R √
Add two time-format data. The 1. When X10 is ON, send the time data to the 3 storage elements starting with D10
operation rules follow the time format. and the 3 storage elements starting with D20.
Note 2. When M0 is ON, add the data starting with D10 and the data starting with D20,
The time data for the operation must and store the result in the 3 storage elements starting with D30.
meet the time setting range 3. The carry flag (SM181) will be set to ON, and the zero flag (SM180) will be set to
requirements. OFF.
Hour: 0~23
Minute: 0~59
Programming manual of IVC series small PLC Chapter 6 Application instructions 134
D WORD D V R √
D2 BOOL Y M S LM
Operand description the current data will be cleared upon PLC power off or when PLC changes from
RUN to STOP.
S: the hour comparison data. Range:
2. The timing still continues even when the alarm output D2 is ON.
0~32767.
3. The hour data in this instruction is a 16-bit integer. It will restart from 0 after
D1: time storage starting element. D1:
32767.
hour. D1+1: second.
D2: alarm output address. When Example
D1≥S, the alarm point changes to ON, LD M0
and generates output. MOV 1000 D100
LD M1
Function description HOUR D100 D200
Make judgment on the time when the M10
LD M10
input contact is ON (unit: hour).
OUT Y10
Note 1. When M0 is ON, set the comparison data of HOUR instruction.
1. To sustain the current data after 2. When M1 is ON, accumulate the time for the input contact.
power off, set D1 within the element 3. M10 will be ON when the accumulated time≥1000.
saving range (see 错误!未找到引用
源。错误!未找到引用源。). Otherwise,
Programming manual of IVC series small PLC Chapter 6 Application instructions 136
IL:
DCMP= (S1) (S2) (D)
DCMP< (S1) (S2) (D)
DCMP> (S1) (S2) (D)
Program steps 7
DCMP<> (S1) (S2) (D)
DCMP>= (S1) (S2) (D)
DCMP<= (S1) (S2) (D)
Indexed
Operand Type Applicable elements
addressing
S1 INT D SD V R √
S2 INT D SD V R √
D BOOL Y M S LM C T
Operand description example, “2004, 9, 31” and “2003, 2, 29” are both illegal.
IL:
TCMP= (S1) (S2) (D)
TCMP< (S1) (S2) (D)
TCMP> (S1) (S2) (D)
Program steps 7
TCMP<> (S1) (S2) (D)
TCMP>= (S1) (S2) (D)
TCMP<= (S1) (S2) (D)
Indexed
Operand Type Applicable elements
addressing
S1 INT D SD V R √
S2 INT D SD V R √
D BOOL Y M S LM C T
Operand description “24, 10, 31” and “13, 59, 60” are both illegal.
Program
IL: HTOS (S) (D) 5
steps
Indexed
Operand Type Applicable elements
addressing
S WORD KnX KnY KnM KnS T C D SD R √
D WORD KnY KnM KnS T C D SD R √
D BOOL Y M S
S3 WORD Constant
6.10.4 DHSPI: High-speed output absolute position compare interrupt trigger instruction
S3 WORD Constant
S1: a 32-bit DINT data, the one with which the high-speed Main user program:
output position element will compare.
Range: -2147483648~2147483647.
S2: high-speed output position element.
Range: SD200,SD320,SD340,SD350,SD360 and SD370.
S3: interrupt SN. Range: 53,54,55,56,57 and 58.
Function description
When the high-speed output position element is equal to S1
in DHSPI instruction, enter S3 interrupt subprogram; you can
write the program that will be executed immediately in
interrupt subprogram. You can select the interrupt SN to be 53 or other high-speed
output postion interrupt sources, and then write the program
Note
executed when passing the postion in interrupt subprogram.
1. Writing to SD element will not trigger position interrupt.
After writing, passing the position that needs interrupt again
will trigger position interrupt.
Programming manual of IVC series small PLC Chapter 6 Application instructions 143
D BOOL Y M S C
Operand description 2. The DHSCR instruction will be validated only by pulse input. You cannot validate
the instruction by changing the counter value with instructions such as DMOV or
S1: a 32-bit DINT data, the one with
MOV.
which the high-speed counter will
3. DHSCR (DHSCI, DHSCS, DHSZ, DHSP, DHST) can be used repeatedly.
compare.
However, at most the first six such instructions can be driven at the same time.
Range: -2147483648~2147483647.
4. The maximum frequency supported by the PLC high-speed counters will be
S2: high-speed counter.
seriously affected by instructions like DHSCS, DHSCI, DHSCR, DHSZ, DHSP and
Range: C236~C255. DHST. For details, see 错误!未找到引用源。错误!未找到引用源。.
D: target bit element. The action on Y,
Example
M, S or C will be valid immediately
regardless of the scan cycle. If D is a LD SM255
OUT Y10
C element, it must be S2.
LD M1
Function description HCNT C255 1000
LD C255
A high-speed counter will count in the
OUT Y20
interrupt mode only when it is driven
LD M2
by the HCNT instruction and the DHSCR 2000 C255
counting input changes from OFF to Y1
ON. When the counter counts to S1, 1. When M1 and X7 are both ON, C255 counts the phase difference of X3 and X4
the D element will be reset (and output, in the interrupt mode. When C255 changes from 999 to 1000, C255 contact will be
for Y elements) immediately. You can set, and reset when C255 changes from 1001 to 1000. When C255 contact drives
use this instruction when you want to Y20, the execution of Y20 will be determined by the user program scan cycle.
reset (and output, for Y elements) a
2. When M2 is ON, and the DHSCR instruction meets the requirements stated in
certain bit element by comparing the
the preceding “Note”, Y1 will be output immediately when C255 reaches 2000,
counter value with a preset value.
regardless of the the scan cycle.
Note 3. When the X3 pulse input is ahead of X4, SM255 is ON. When the X4 pulse input
1. The DHSCR instruction must work is ahead of X3, SM255 is OFF.
together with the HCNT instruction, 4. When X7, the startup signal of C255, is OFF, C255 will not count.
because DHSCR is only applicable to 5. When M1 and X7 are all ON, if X5 is ON, C255 will be cleared, and C255
the high-speed counters that is driven auxiliary contact will be reset.
by HCNT.
Programming manual of IVC series small PLC Chapter 6 Application instructions 144
S3 DINT C
D BOOL Y M S
Operand description because DHSZ is only applicable to the high-speed counters that is driven by
HCNT.
S1: a 32-bit DINT data, one of the two
2. The DHSZ instruction will be validated only by pulse input. You cannot validate
numbers with which the high-speed
the instruction by changing the counter value with instructions such as DMOV or
counter will compare.
MOV.
Range: -2147483648~2147483647.
3. DHSZ (DHSCI, DHSCS, DHSCR, DHSP, DHST) can be used repeatedly.
S2: a 32-bit DINT data, one of the two
However, at most the first six such instructions can be driven at the same time.
numbers with which the high-speed
4. The maximum frequency supported by the PLC high-speed counters will be
counter will compare.
seriously affected by instructions like DHSCS, DHSCI, DHSCR, DHSZ, DHSP and
Range: -2147483648~2147483647.
DHST. For details, see 错误!未找到引用源。错误!未找到引用源。.
S3: high-speed counter.
Example
Range: C236~C255.
LD M0
D: target bit element. The action on Y,
HCNT C249 1000
M or S will be valid immediately
LD M1
regardless of the scan cycle. DHSZ 1500 2000 C249
Function description Y10
LD SM249
1. A high-speed counter will count in OUT Y12
the interrupt mode only when it is LD C249
driven by the HCNT instruction and OUT Y6
the counting input changes from OFF 1. When M0 and X6 are both ON, C249 will count up when X0 changes from OFF
to ON. to ON, or count down when X1 changes from OFF to ON. When C249 changes
2. When the counter value is smaller from 999 to 1000, the C249 contact will be set; when C249 changes from 1001 to
than S1, the D element will be set. In 1000, the C249 contact will be reset. When C249 contact drives Y6, the execution
addition, the D+1 and D+2 elements of Y6 will be determined by the user program scan cycle.
will be reset. 2. When M1 is ON, the DHSZ instruction meets the requirements stated in the
3. When the counter value ≥S1 and preceding “Note”, the states of elements Y10~Y12 are as follows:
≤S2, the D and D+2 elements will be C249<1500: Y10: ON, Y11&Y12: OFF.
reset, while the D+1 element will be 1500≤C249≤2000: Y10, Y12: OFF, Y11: ON.
set.
C249>2000: Y10, Y11: OFF, Y12: ON.
4. When the counter value is bigger
The outputs of Y10, Y11 and Y12 are immediate, regardless of the scan cycle.
than S2, the D and D+1 elements will
3. When M0 and X6 are ON at the same time, SM249 will be reset if X0 changes
be reset, while D+2 element will be
from OFF to ON and the counter counts up, and SM249 will be set if X1 changes
set.
from OFF to ON and the counter counts down.
5. If D is a Y element, it will be output
4. When X6 is OFF, C249 stops counting.
immediately regardless of the scan
5. When M0 and X6 are both ON, if X2 is ON, C249 will be cleared, and C249
cycle.
auxiliary contact will be reset.
Note
1. The DHSZ instruction must work
together with the HCNT instruction,
Programming manual of IVC series small PLC Chapter 6 Application instructions 145
S2 INT Constant
S3 DINT C
S1: the starting D element for table comparison. The 1. The DHST instruction must work together with the HCNT
following three D elements are the comparison data, SN of Y instruction, because DHST is only applicable to the
element and the output state. These four D elements form a high-speed counters that is driven by HCNT.
record. 2. The DHST instruction will be validated only by pulse input.
S2: the number of records for comparison. Range: 1~128. You cannot validate the instruction by changing the counter
S3: high-speed counter. Range: C236~C255. value with instructions such as DMOV or MOV.
3. DHST (DHSCI, DHSCS, DHSCR, DHSP, DHSZ) can be
Function description
used repeatedly. However, at most six such instructions can
1. A high-speed counter will count in the interrupt mode only be driven at the same time.
when it is driven by the HCNT instruction and the counting
4. In a user program, the DHSP and DHST instructions
input changes from OFF to ON.
cannot be valid at the same time. That means a valid DHST
2. When the counter value equates the comparison data of (or DHSP) instruction will make the following DHSP (or
the present record, the corresponding Y element will be DHST) instructions invalid.
output.
5. The maximum frequency supported by the PLC
3. The Y element specified in the present record will be high-speed counters will be seriously affected by instructions
output immediately, regardless of the scan cycle. like DHSCS, DHSCI, DHSCR, DHSZ, DHSP and DHST. For
4. You can use the DHST instruction when you want to details, see 错误!未找到引用源。错误!未找到引用源。.
immediately output, according to certain comparison data,
the Y elements specified in a certain table.
Example
The table for comparison is shown below:
Comparison data
Y element Set/Reset Operation flow
MSB LSB
D100=0 D101=100 D102=0 D103=1 1
D104=0 D105=200 D106=1 D107=0 2
D108=0 D109=300 D110=2 D111=1 3
4
D112=0 D113=300 D114=3 D115=1
Return to 1
The following is the user program:
Programming manual of IVC series small PLC Chapter 6 Application instructions 146
LD SM1
DMOV 100 D100
MOV 0 D102
MOV 1 D103
DMOV 200 D104
MOV 1 D106
MOV 0 D107
DMOV 300 D108
MOV 2 D110
MOV 1 D111
DMOV 100 D112
MOV 3 D114
MOV 1 D115
LD M0
HCNT C244 1000
LD M1
DHST D100 4 C244
LD M2
OUT SM244
LD C244
OUT Y10
1. In the first user-program scan cycle, assign elements D100~D115 with values to generate the table for comparison.
2. When M0 and X6 are both ON, the C244 will count when X0 changes from OFF to ON (for the input frequency, see 错误!
未找到引用源。错误!未找到引用源。). When C244 changes from 999 to 1000, the C244 contact will be set; when C244 changes
from 1001 to 1000, the C244 contact will be reset. When the C244 contact drives Y10, the execution of Y10 will be determined
by the user program scan cycle.
3. When M1 is ON, and the DHST instruction meets the requirements in the preceding “Note”, the compare will start with the
first record. The compare with the second record will not start until the first compare is over and the corresponding Y element
has been output. After the compare with the last record is over, the compare with the first record will start again, and SM185 will
be set. SD184 is the SN of the present record, and SD182&SD183 are the present data for comparison. The corresponding
output will be immediate, regardless of the scan cycle.
4. When M2 is ON, SM244 is ON, and C244 will count down. If M2 is OFF, SM244 is OFF, and C244 will count up.
5. When X6 is OFF, C244 is invalid.
6. When M0 and X6 are both ON, if X2 is ON, C244 will be cleared, and C244 auxiliary contact will be reset.
Programming manual of IVC series small PLC Chapter 6 Application instructions 147
S3 DINT C
Operand description 2. When the DHSP instruction is used together with the
PLSY instruction, the values assigned to SD180 and SD181
S1: the starting D element for table comparison. The
must meet the frequency output requirement of the PLSY
following three D elements are the comparison data, and the
instruction. For details, see the description of the PLSY
data to output to SD180&SD181. These four D elements
instruction.
form a record.
3. To stop the comparison at the last record, set the last
S2: the number of records to be compared. Range: 1~128.
output data of the table as 0. Under this situation, other
S3: high-speed counter. Range: C236~C255. DHST and DHSP instructions will be invalid. But at this time,
Function description the DHSP instruction is not regarded as a high-speed
instruction when it comes to the number limit of high-speed
1. A high-speed counter will count in the interrupt mode only
instructions.
when it is driven by the HCNT instruction and the counting
input changes from OFF to ON. 4. The DHSP instruction will be validated only by pulse input.
You cannot validate the instruction by changing the counter
2. When the counter value equates the comparison data of
value with instructions such as DMOV or MOV.
the present record, the output data of the present record will
become the values of SD180&SD181. 5. DHSP (DHSCI, DHSCS, DHSCR, DHST, DHSZ) can be
used repeatedly. However, at most the first six such
3. You can use the DHSP instruction when you want to
instructions can be driven at the same time.
control the high-speed output or assign values to certain
parameters according to a table. For example, you can set 6. In a user program, the DHSP and DHST instructions
the SD180&SD181 (double word) as the output frequency of cannot be valid at the same time. That means a valid DHSP
the PLSY instruction, and the PLSY output frequency will be (or DHST) instruction will make the following DHST (or
adjusted by the table compare result. DHSP) instructions invalid.
7. The maximum frequency supported by the PLC
Note
high-speed counters will be seriously affected by instructions
1. The DHSP instruction must be used together with the like DHSCS, DHSCI, DHSCR, DHSZ, DHSP and DHST. For
HCNT instruction, because the DHST instruction cannot be details, see 错误!未找到引用源。错误!未找到引用源。.
executed unless the related high-speed counter is driven by
the HCNT instruction.
Example
The table for comparison is shown below:
Comparison data Output data (to SD180&SD181)
Operation flow
MSB LSB MSB LSB
D100=0 D101=100 D102=0 D103=1 1
D104=0 D105=200 D106=0 D107=2 2
D108=0 D109=300 D110=0 D111=3 3
4
D112=0 D113=100 D114=0 D115=4
Return to 1
The following is the user program:
Programming manual of IVC series small PLC Chapter 6 Application instructions 148
LD SM1
DMOV 100 D100
MOV 0 D102
MOV 1 D103
DMOV 200 D104
MOV 0 D106
MOV 2 D107
DMOV 300 D108
MOV 0 D110
MOV 3 D111
DMOV 100 D112
MOV 0 D114
MOV 4 D115
LD M0
HCNT C244 1000
LD M1
DHSP D100 4 C244
LD M2
OUT SM244
LD C244
OUT Y10
LD M3
PLSY SD180 0 Y0
1. In the first user-program scan cycle, assign elements D100~D115 with values to generate the table for comparison.
2. When M0 and X6 are both ON, C244 will count when X0 changes from OFF to ON (for the input frequency, see 错误!未找
到引用源。错误!未找到引用源。). When C244 changes from 999 to 1000, the C244 contact will be set; when C244 changes
from 1001 to 1000, the C244 contact will be reset. When the C244 contact drives Y10, the execution of Y10 will be determined
by the user program scan cycle.
3. When M1 is ON, and the DHSP instruction meets the requirements in the preceding “Note”, the compare will start with the
first record. The compare with the second record will not start until the first compare is over and the output data has been
output to SD180&SD181. After the compare with the last record is over, the compare with the first record will start again, and
SM185 will be set. SD184 is the SN of the present record, and SD182&SD183 are the present data for comparison. The output
data will be output to SD180&SD181 immediately, regardless of the scan cycle. If you want to stop the at the last record, set the
output data of the last record to 0.
4. When M2 is ON, and SM244 is ON, C244 will count down. When M2 is OFF, and SM244 is OFF, C244 will count up.
5. When X6 is OFF, C244 is invalid.
6. When M0 and X6 are both ON, if X2 is ON, C244 will be cleared, and the C244 contact will be reset.
D WORD D V R √
Operand description S2: time unit for input point detection. Unit: ms. Operand
S2>0.
S1: input point. Range: X0~X5.
Programming manual of IVC series small PLC Chapter 6 Application instructions 149
To detect the number of pulses input through X0~X5 in the D10: measured
specified period of time (ms) and store the result in the D11: current
value
Note
1. SPD, HCNT, external input interrupt and pulse capture are
1000ms 1000ms
contradictory in their occupation of hardware. For details,
see 错误!未找到引用源。错误!未找到引用源。.
2. For IVC1 and IVC2L, the SPD instruction supports input 1000
points X0~X5. For IVC2H, the SPD instruction supports input
D12: elapsed time
points X0~X7.
3. Maximum pulse input frequency: 10kHz. Detection may
Input X0
be faulty when frequency is higher than 10kHz.
Example
N(fpn)
Proximity switch
n pulse/round
D BOOL Y
Programming manual of IVC series small PLC Chapter 6 Application instructions 150
PLC
External is complete.
power supply
5. SD50: the MSB of the output pulse number at Y0 for
PLSY and PLSR instructions.
100m A
SD51: the LSB of the output pulse number at Y0 for
4. With large load and current, the transistor off time is relatively PLSY and PLSR instructions.
longer. The PWM, PLSY and PLSR instructions require that the SD52: the MSB of the output pulse number at Y1 for
transistor output terminal be connected to their corresponding PLSY and PLSR instructions.
loads. When the output waveform does not conform to the SD53: the LSB of the output pulse number at Y1 for
instruction operand, increase the load current of the transistor PLSY and PLSR instructions.
(the transistor load current ≤100mA). SD54: the MSB of the total output pulse number at Y0
5. During or after the execution of the high-speed instruction, no and Y1 for PLSY and PLSR instructions.
other instructions can use the same port, unless the high-speed
SD55: the LSB of the total output pulse number at Y0
pulse output instruction is invalid.
and Y1 for PLSY and PLSR instructions.
6. Using multiple PLSY instructions can get independent pulse
6. SD50~SD55 can be changed with the instruction
outputs. You can also use PWM or PLSR instructions to get
DMOV or MOV, or through the ConstrolStar software.
independent pulse outputs at different output ports.
7. Refer to the DHSP instruction if you want to use the
7. When multiple PWM, PLSY or PLSR instructions work on the
input pulse number to control the PLSY output pulse
same output point, the first valid instruction will control the state
frequency.
of the output point, and others will not affect the output point
state.
8. Just like other high-speed instructions (DHSCS, DHSCR,
DHSZ, DHSP, DHST and HCNT), the PLSY instruction must
meet the system’s requests on high-speed I/O.
Programming manual of IVC series small PLC Chapter 6 Application instructions 151
Relevant elements:
Address Name Action and function R/W
SM80 Y0 high-speed pulse output control Y0 high-speed pulse output stop instruction R/W
SM81 Y1 high-speed pulse output control Y1 high-speed pulse output stop instruction R/W
SM82 Y000 pulse output monitor (busy/ready) Y0 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM83 Y001 pulse output monitor (busy/ready) Y1 high-speed pulse output monitor (ON: busy, OFF: ready) R
At ON, you can use PLSY instructions in interrupts and subprograms,
SM86 Y0 interrupt drive pulse ouptut valid R/W
and continuous and repeated drive with power flow in main programs
At ON, you can use PLSY instructions in interrupts and subprograms,
SM87 Y1 interrupt drive pulse ouptut valid R/W
and continuous and repeated drive with power flow in main programs
SM262 Y002 pulse output stop instruction After setting, Y002 pulse will be disabled R/W
SM264 Y004 pulse output stop instruction After setting, Y004 pulse will be disabled R/W
SM265 Y005 pulse output stop instruction After setting, Y005 pulse will be disabled R/W
SM266 Y006 pulse output stop instruction After setting, Y006 pulse will be disabled R/W
SM267 Y007 pulse output stop instruction After setting, Y007 pulse will be disabled R/W
SM272 Y002 pulse output monitor (busy/ready) Y002 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM274 Y004 pulse output monitor (busy/ready) Y004 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM275 Y005 pulse output monitor (busy/ready) Y005 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM276 Y006 pulse output monitor (busy/ready) Y006 high-speed pulse output monitor (ON: busy, OFF: ready)) R
SM277 Y007 pulse output monitor (busy/ready) Y007 high-speed pulse output monitor (ON: busy, OFF: ready) R
SD210 Current position of Y1 output locating instruction (MSB) (IVC1L, IVC2L) R/W
SD211 Current position of Y1 output locating instruction (LSB) (IVC1L, IVC2L) R/W
SD320 Current position of Y2 output locating instruction (MSB) (IVC1L, IVC2H) R/W
SD321 Current position of Y2 output locating instruction (LSB) (IVC1L, IVC2H) R/W
SD330 Current position of Y3 output locating instruction (MSB) (IVC1L) R/W
SD331 Current position of Y3output locating instruction (LSB) (IVC1L) R/W
SD340 Current position of Y4 output locating instruction (MSB) (IVC2H) R/W
SD341 Current position of Y4 output locating instruction (LSB) (IVC2H) R/W
SD350 Current position of Y5 output locating instruction (MSB) (IVC2H) R/W
SD351 Current position of Y5 output locating instruction (LSB) (IVC2H) R/W
Programming manual of IVC series small PLC Chapter 6 Application instructions 152
7
ep
Sp
4
st
ee
10
6
d
5 Speed change
ch
an
5
ge
most 1/10 of S1
in
4 2,147,483,647pls
ch
7
10
d
ee
st
3 8
ep
Sp
2 9
1 10
Note
1. The output frequency of this instruction is 10~20,000Hz. When 1. When M0 is ON, Y0 and Y1 output 110 pulses
the acceleration/deceleration rate exceeds that range, it will be respectively at set frequencies. When M0 changes from
automatically adjusted according to that range, regardless of the OFF to ON, pulses will be output again. When M0 is
scan cycle. OFF, the output will stop.
2. Use the transistor output. During the high-speed pulse output, 2. The operand change during the execution of the
the output current must comply with the related regulations. The instruction will not be valid until the next time this
waveform at output points (Y0&Port 0, Y1&Port 1) is related to instruction is executed.
the load: so long as the current does not exceed the rated load 3. SM80&SM81 controls the ON/OFF of the output at Y0
current, the smaller the load is, the closer the output waveform is and Y1 respectively. When SM80 or SM81 is 1, the
to the set operand. output will stop.
3. During the execution of the high-speed instruction, so long as 4. SM82&SM83 are the output monitors of Y0&Y1
the power flow is not OFF, no other instructions can use the respectively. SM82 & SM83 will be ON when the output
same port, unless the high-speed pulse output instruction is is going on, or OFF when the output is over.
invalid. 5. SD50: the MSB of the output pulse number at Y0 for
4. Using two PLSR instructions can output two independent PLSY and PLSR instructions.
pulses at Y0 and Y1. You can also use PLSR and the PWM (or SD51: the LSB of the output pulse number at Y0 for
PLSY) instruction to get independent pulse outputs at different PLSY and PLSR instructions.
output ports (Y0, Y1). SD52: the MSB of the output pulse number at Y1 for
5. When multiple PWM, PLSY or PLSR instructions work on the PLSY and PLSR instructions.
same output point, the first valid instruction will control the state SD53: the LSB of the output pulse number at Y1 for
of the output point, and others will not affect the output point PLSY and PLSR instructions.
state. SD54: the MSB of the total output pulse number at Y0
6. Just like other high-speed instructions (DHSCS, DHSCR, and Y1 for PLSY and PLSR instructions.
DHSZ, DHSP, DHST and HCNT), the PLSR instruction must
SD55: the LSB of the total output pulse number at Y0
meet the system’s requests on high-speed I/O.
and Y1 for PLSY and PLSR instructions.
Example 6. SD50~SD55 can be changed with the instruction
DMOV or MOV, or through the AutoStation software.
LD M0
PLSR 10 110 1000 Y1
PLSR 10 110 1000 Y0
Relevant elements:
Address Name Action and function R/W
SM80 Y0 high-speed pulse output control Y0 high-speed pulse output stop instruction R/W
SM81 Y1 high-speed pulse output control Y1 high-speed pulse output stop instruction R/W
SM82 Y0 high-speed pulse output monitor Y0 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM83 Y1 high-speed pulse output monitor Y1 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM262 Y002 pulse output stop instruction After setting, Y002 pulse will be disabled R/W
SM264 Y004 pulse output stop instruction After setting, Y004 pulse will be disabled R/W
SM265 Y005 pulse output stop instruction After setting, Y005 pulse will be disabled R/W
SM266 Y006 pulse output stop instruction After setting, Y006 pulse will be disabled R/W
SM267 Y007 pulse output stop instruction After setting, Y007 pulse will be disabled R/W
SM272 Y002 pulse output monitor (busy/ready) Y002 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM274 Y004 pulse output monitor (busy/ready) Y004 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM275 Y005 pulse output monitor (busy/ready) Y005 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM276 Y006 pulse output monitor (busy/ready) Y006 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM277 Y007 pulse output monitor (busy/ready) Y007 high-speed pulse output monitor (ON: busy, OFF: ready) R
SD210 Current position of Y1 output locating instruction (MSB) (IVC1L ,IVC2L) R/W
SD211 Current position of Y1 output locating instruction (LSB) (IVC1L ,IVC2L) R/W
SD320 Current position of Y2 output locating instruction (MSB) (IVC1L ,IVC2H) R/W
SD321 Current position of Y2 output locating instruction (LSB) (IVC1L ,IVC2H) R/W
SD330 Current position of Y3 output locating instruction (MSB) (IVC1L) R/W
SD331 Current position of Y3 output locating instruction (LSB) (IVC1L) R/W
SD340 Current position of Y4 output locating instruction (MSB) (IVC2H) R/W
SD341 Current position of Y4 output locating instruction (LSB) (IVC2H) R/W
SD350 Current position of Y5 output locating instruction (MSB) (IVC2H) R/W
SD351 Current position of Y5 output locating instruction (LSB) (IVC2H) R/W
SD360 Current position of Y6 output locating instruction (MSB) (IVC2H) R/W
SD361 Current position of Y6 output locating instruction (LSB) (IVC2H) R/W
SD370 Current position of Y7 output locating instruction (MSB) (IVC2H) R/W
SD371 Current position of Y7 output locating instruction (LSB) (IVC2H) R/W
Operand description
S1: the starting D element Function description
S2: output section number. Range: 0~255 1. Use the ConstrolStar instruction wizzard to generate the
D: high-speed pulse output point. Range: IVC1, IVC2L: Y0, PLS instruction, which can be called like subprograms.
Y1;IVC1L: Y0,Y1,Y2,Y3; IVC2H: Y0, Y2, Y4, Y5, Y6, Y7. When the power flow is ON, the system will output
corresponding pulses according to the configuration. You
Programming manual of IVC series small PLC Chapter 6 Application instructions 155
can control ON or OFF of the PG, and set frequency & pulse ( FN FN 1 ) ( FN FN 1 ) Tup
P
number. 2000 ( Fmax Fmin )
2. There is no output when the section number is 0. 2) When the speed of step N is smaller than that of step N-1,
3. SM80 and SM81 can be used to stop the high-speed the pulse number of step N must meet the following
pulse output. Other flag bits are the same as other condition:
high-speed I/O instructions. ( FN FN 1 ) ( FN FN 1 ) Tdown
P
4. The subprogram PLS_SET generated by the AutoStation 2000 ( Fmax Fmin )
is as follows (n: D element addr. M: total section number): 3. In particular,
LD SM0 1) When N=1, the frequency of step N-1 is used instead of
DMOV section 1 step frequency Dn Fmin in the above format.
DMOV section 1 step pulse number Dn+2 2) When all the step number is 1, that is to say, only one
DMOV section 2 step frequency Dn+4 section, the pulse number must meet the following condition:
DMOV section 2 step pulse number Dn+6 ( F1 Fmin ) ( F1 Fmin ) (Tup Tdown )
P
DMOV section 3 step frequency Dn+8 2000 ( Fmax Fmin )
DMOV section 3 step pulse number Dn+10 3) The pulse number of the last step must meet the following
... format:
DMOV section M step frequency Dn+4M-4 ( FM FM 1 ) ( FM FM 1 ) (Tup Tdown )
P
DMOV section M step pulse number Dn+4M-2 2000 ( Fmax Fmin )
DMOV max. speed Dn+4M 4) The frequency set in every step must be within the range
MOV min. speed Dn+4M+2 of maximum speed and minimum speed.
MOV acceleration time Dn+4M+3 5) The maximum total pulse number of all steps is 999,999.
MOV deceleration time Dn+4M+4 4. Use the transistor output. During the high-speed pulse
Note output, the output current must comply with the related
regulations. The waveform at output points (Y0&Port 0,
1. It is recommended to use the PTO instruction wizard to
Y1&Port 1) is related to the load: so long as the current does
generate PLS instruction. If you write the PLS instruction
not exceed the rated load current, the smaller the load is, the
manually, note that the pulse number of the steps must not
closer the output waveform is to the set operand.
be too small. With set acceleration, the pulse number of
5. During the execution of the high-speed instruction, so long
each step must be bigger than the min. pulse number
as the power flow is not OFF, no other instructions can use
required by frequency transfer.
the same port, unless the high-speed pulse output
2. Use P to stand for the pulse number that a certain step
instruction is invalid.
outputs; FN : frequency of section N; F max : the maximum 6. The PLSY, PLSR, PLS and locating instructions can
speed; Fmin : the minimum speed; Tup : the acceleration time; output high-speed pulses through Y0 and Y1. Note that only
Tdown : the deceleration time. one instruction can use one output port at one time.
1) When the speed of step N is bigger than that of step N-1,
the pulse number of step N must meet the following
condition:
Address Name Action and function R/W
SM80 Y0 high-speed pulse output control Y0 high-speed pulse output stop instruction R/W
SM81 Y1 high-speed pulse output control Y1 high-speed pulse output stop instruction R/W
SM82 Y0 high-speed pulse output monitor Y0 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM83 Y1 high-speed pulse output monitor Y1 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM262 Y002 pulse output stop instruction After setting, Y002 pulse will be disabled R/W
SM264 Y004 pulse output stop instruction After setting, Y004 pulse will be disabled R/W
SM265 Y005 pulse output stop instruction After setting, Y005 pulse will be disabled R/W
SM266 Y006 pulse output stop instruction After setting, Y006 pulse will be disabled R/W
SM267 Y007 pulse output stop instruction After setting, Y007 pulse will be disabled R/W
SM272 Y002 pulse output monitor (busy/ready) Y002 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM274 Y004 pulse output monitor (busy/ready) Y004 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM275 Y005 pulse output monitor (busy/ready) Y005 high-speed pulse output monitor (ON: busy, OFF: ready)) R
SM276 Y006 pulse output monitor (busy/ready) Y006 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM277 Y007 pulse output monitor (busy/ready) Y007 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM88 Evelope loop execution Evelope loop execution at ON R/W
Programming manual of IVC series small PLC Chapter 6 Application instructions 156
6.10.13 PLSB: Count pulse with base frequency and acceleration/deceleration output instruction
PLSB (S1) (S2) (S3) (S4) (D) Influenced flag bit Zero, carry, borrow
Operand description S3: total output pulse number (PLS). Range: 5~999999.
When S3 is outside this range, the system will report
S1: base frequency (Hz). Range: 0~20000Hz. When S1 is instruction operand error, output no pulse, and no hardware
outside this range, the system will report instruction operand resources will be occupied.
error, output no pulse, and no hardware resources will be S4: acceleration time (ms). Range: 0~10000. When S4 is
occupied. outside this range, the system will report instruction operand
error, output no pulse, and no hardware resources will be
S2: maximum frequency (Hz). Range: 10~20000 (Hz). When
occupied.
S2 is outside this range, the system will report instruction
D: pulse output point. Range: IVC1, IVC2L: Y0, Y1; IVC2H:
operand error, output no pulse, and no hardware resources
Y0, Y2, Y4, Y5, Y6, Y7.
will be occupied.
Function description
The PLSB instruction is a high-speed pulse output instruction with base frequency and acceleration/deceleration functions. It is
used for locating. Targeting at the specified maximum frequency, the pulse output will accelerate evenly from base frequency.
After the output pulse number reaches the preset value, the pulse output will decelerate evenly to base frequency.
The operation process is shown in the following figure:
4. Use the transistor output. During the high-speed pulse 1. When M0 is ON, Y0 and Y1 output 10000 pulses
output, the output current must comply with the related respectively at set frequencies. When M0 changes from OFF
regulations. The waveform at output points (Y0&Port 0, to ON, pulses will be output again. When M0 is OFF, the
Y1&Port 1) is related to the load: so long as the current does output will stop.
not exceed the rated load current, the smaller the load is, the 2. The operand change during the execution of the
closer the output waveform is to the set operand. instruction will not be valid until the next time this instruction
5. During the execution of the high-speed instruction, so long is executed.
as the power flow is not OFF, no other instructions can use 3. SM80&SM81 controls the ON/OFF of the output at Y0 and
the same port, unless the high-speed pulse output Y1 respectively. When SM80 or SM81 is 1, the output will
instruction is invalid. stop.
6. Using two PLSB instructions can output two independent 4. SM82&SM83 are the output monitors of Y0&Y1
pulses. You can also use PWM or PLSY instruction to get respectively. SM82&SM83 will be ON when the output is
independent pulse outputs at different output ports. going on, or OFF when the output is over.
7. When multiple PWM, PLSY or PLSB instructions work on 5. SD50: the MSB of the output pulse number at Y0 for
the same output point, the first valid instruction will control PLSB instruction.
the state of the output point, and others will not affect the SD51: the LSB of the output pulse number at Y0 for PLSB
output point state. instruction.
8. Just like other high-speed instructions (DHSCS, DHSCR, SD52: the MSB of the output pulse number at Y1 for PLSB
DHSZ, DHSP, DHST and HCNT), the PLSB instruction must instruction.
meet the system’s requests on high-speed I/O. SD53: the LSB of the output pulse number at Y1 for PLSB
9. The high-speed, envelope and locating instructions can instruction.
output high-speed pulses through Y0 and Y1. Note that only
SD54: the MSB of the total output pulse number at Y0 and
one instruction can use one output port at one time.
Y1 for PLSB instruction.
Example SD55: the LSB of the total output pulse number at Y0 and Y1
for PLSB instruction.
6. SD50~SD55 can be changed with the instruction DMOV
or MOV, or through the AutoStation software.
LD M0
PLSR 100 10000 10000 1000 Y1
PLSR 100 10000 10000 1000 Y0
Relevant elements:
Address Name Action and function R/W
SM80 Y0 high-speed pulse output control Y0 high-speed pulse output stop instruction R/W
SM81 Y1 high-speed pulse output control Y1 high-speed pulse output stop instruction R/W
SM82 Y0 high-speed pulse output monitor Y0 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM83 Y1 high-speed pulse output monitor Y1 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM262 Y002 pulse output stop instruction After setting, Y002 pulse will be disabled R/W
SM264 Y004 pulse output stop instruction After setting, Y004 pulse will be disabled R/W
SM265 Y005 pulse output stop instruction After setting, Y005 pulse will be disabled R/W
SM266 Y006 pulse output stop instruction After setting, Y006 pulse will be disabled R/W
SM267 Y007 pulse output stop instruction After setting, Y007 pulse will be disabled R/W
SM272 Y002 pulse output monitor (busy/ready) Y002 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM274 Y004 pulse output monitor (busy/ready) Y004 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM275 Y005 pulse output monitor (busy/ready) Y005 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM276 Y006 pulse output monitor (busy/ready) Y006 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM277 Y007 pulse output monitor (busy/ready) Y007 high-speed pulse output monitor (ON: busy, OFF: ready) R
Y0 or Y1 output is ON.
Y0
2. The waveform at output points (Y0&Port 0, Y1&Port 1) is related
to the load: so long as the current does not exceed the rated load To
current, the smaller the load is, the closer the output waveform is to t
3. During the execution of the high-speed instruction, so long as the Where “t” is the pulse width and T0 is the pulse cycle.
power flow is not OFF, no other instructions can use the same port, 1. When M0 is ON, Y0 and Y1 output PWM pulses
unless the high-speed pulse output instruction is invalid. with the width of 40ms and cycle of 200ms. When M0
4. Using two PWM instructions can output two independent pulses is OFF, the output will stop, regardless of the scan
at Y0 and Y1. You can also use the PLSY and PLSR instructions to cycle.
get independent pulse outputs at different output ports (Y0, Y1). 2. SM80 and SM81 control the output ON/OFF of Y0
5. When multiple PWM, PLSY or PLSR instructions work on the and Y1 respectively. When SM80 and SM81 are ON,
same output point, the first valid instruction will control the state of the output will stop.
the output point, and others will not affect the output point state. 3. SM82 and SM83 monitor the output of Y0 and Y1
6. Just like other high-speed instructions (DHSCS, DHSCR, DHSZ, respectively. When M0 is OFF, SM82 and SM83 are
DHSP, DHST and HCNT), the PWM instruction must meet the OFF.
system’s requests on high-speed I/O.
Example
LD M0
PWM 40 200 Y0
Relevant elements:
Address Name Action and function R/W
SM80 Y0 high-speed pulse output control Y0 high-speed pulse output stop instruction R/W
SM81 Y1 high-speed pulse output control Y1 high-speed pulse output stop instruction R/W
SM82 Y0 high-speed pulse output monitor Y0 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM83 Y1 high-speed pulse output monitor Y1 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM84 PWM time base unit Microsecond at ON and millisecond at OFF
SM264 Y004 pulse output stop instruction After setting, Y004 pulse will be disabled R/W
SM265 Y005 pulse output stop instruction After setting, Y005 pulse will be disabled R/W
SM266 Y006 pulse output stop instruction After setting, Y006 pulse will be disabled R/W
SM267 Y007 pulse output stop instruction After setting, Y007 pulse will be disabled R/W
SM274 Y004 pulse output monitor (busy/ready) Y004 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM275 Y005 pulse output monitor (busy/ready) Y005 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM276 Y006 pulse output monitor (busy/ready) Y006 high-speed pulse output monitor (ON: busy, OFF: ready) R
SM277 Y007 pulse output monitor (busy/ready) Y007 high-speed pulse output monitor (ON: busy, OFF: ready) R
S1 INT D R √
S2 INT D R √
S3 INT D R √
D INT D R √
S3+18: PID output value (negative change) alarm point. Range: S3+18
No output
0~32767 (when BIT2&BIT5 of S3+1 are 1&0 respectively). Lower limit
With output
Output lower limit: -32768~32767 (when BIT2&BIT5 of S3+1 are 0&1 limits
Time
respectively).
S3+19: PID alarm output
8. Alarm setting: when the output thresholds are set valid (in S3+1, BIT1 is 1, BIT2 is 1 and BIT 5 is 0), the PID instruction will
compare the current value with the preset value in S3+15~S3+18. If the current value is bigger than the preset value, PID will
report alarm, and the corresponding BITs in S3+19 will be set. In this way, you can monitor the input change and output change.
See the following figures.
Programming manual of IVC series small PLC Chapter 6 Application instructions 162
Positive change
Positive change
0 Sampling times
0 Sampling times
Negative change
Negative change
Alarm flag
Alarm flag
S3+19
bit 0 ON OFF S3+19
bit 2 ON OFF
S3+19
bit 1 OFF S3+19
bit 3 OFF ON
ON
EVn PVnf 1 SV
Forward TD
Dn PVnf PVnf 2 2 PVnf 1 αD TD Dn 1
TS αD TD T S α D T D
MVn ΔMV
Operand description:
Symbol Description Symbol Description
EVn Dn
The current error value The current differential value
Example
// PID initialization. If the control operands are the same, you can initialize the operands only once.
LD SM1 //Initialization, executed only once
MOV 1000 D500 //Setting target value
MOV 500 D510 //Sampling time(Ts) Range: 1~32767(ms). It must be bigger than the
//calculation time
MOV 7 D511 //Action direction
MOV 70 D512 //Input filtering constant (α) Range: 0~99[%]. Zero means no input filtering
MOV 100 D513 //Proportional gain (Kp) Range:1~32767[%]
MOV 25 D514 //Integral time (TI) Range: 0~32767(×100ms). Zero means limit, or no integral
MOV 0 D515 //Differential gain (KD) Range: 0~100[%]. Zero means no differential gain
MOV 63 D516 //Differential time (TD) Range: 0~32767 (×10ms). Zero means no differential
// processing
FMOV 0 D517 8 //Clearing the memory for the transit data of PID calculation
MOV 2000 D525 //Process value (positive change) alarm setting 0~32767
MOV 2000 D526 //Process value (negative change) alarm setting 0~32767
MOV 2000 D527 //Output value (positive change) alarm setting 0~32767
MOV 2000 D528 //Output value (negative change) alarm setting 0~32767
Programming manual of IVC series small PLC Chapter 6 Application instructions 163
D1 INT D V R √
S3 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z R √
D2 BOOL Y M S LM C T
Operand description
S1: starting value D1
S2: end value
D1: output value
S3: step number (S3>0, or system will report operand error D2
and do not execute the calculation)
D2: output state 0
SM15
Function description
S3
In each scan cycle, when the power flow is ON, this
instruction can determine the increment and current output
Note
value D1 according to the ramp wave height and step
number. When the output value D1 reaches S2, it will keep 1. If the result is not divisible when calculating the program
stable, and the output state D2 will be set ON. If the power steps, round off to the nearest whole number.
flow falls, the output state D2 will be set OFF, but the output 2. The instruction will generate one ramp data upon every
value D1 will not change, until the power flow rises again, rising edge.
when D1 will be initialized as S1, and continue to conduct 3. When S1=S2, D1=S2, D2=ON.
the next ramp calculation. 4. The total number of RAMP, HACKLE and TRIANGLE
See the following figure: instructions in a program should not exceed 100.
Example
pf
//Initialize registers upon the first scan cycle after the
S2 power-on
S1 LD SM1
D1
MOV 0 D0
MOV 2000 D1
D2
//Execute RAMP instruction when X0 is ON
pf: state of the power flow
LD X0
Analysis of the execution process of the ramp instruction is
RAMP D0 D1 D10 1000 M0
shown in the following figure (S3=5):
//Output the ramp function result to external DA module
when X1=ON to generate ramp wave form
LD X1
TO 0 6 D10 1
The LAD of the preceding instructions is shown below:
Programming manual of IVC series small PLC Chapter 6 Application instructions 165
D2 BOOL Y M S LM C T
Operand description
pf
S1: starting value
S2
S2: end value
S1
D1: output value D1
S3: step number (S3>0, or system will report operand error,
and do not execute the calculation) D2
Note
1. When designating the element in S1, k=4.
2. When designating the counter SN in S2, the range is
C0~C199.
M0 is power flow input, X1 is the rotatry angle signal of 1 3. The instruction is affected by scan cycle.
pulse per degree
D ON ON
Function description
When the power flow is ON, the Example
element will act reversely in each scan
cycle, as shown below:
S3 INT D R √
Operand description
S1: designated communication channel because they will be added to the data automatically in the
S2: starting address of the data to be transmitted sending process.
S3: starting address of the data to be received 2. You do not need to set the length for the data to be sent.
The system will set the length automatically based on the
Function description
instruction.
1. When being a master station and the input conditions are
met, the system will transmit the data stored in the unit S2 Slave address
starting with S2, and then receive the data and store it to the S2+1 Function code
unit starting with S3. S2+2 Data 1
2. When being a slave station, the system needs no
...
instruction control for transceiving data.
S2+N+1 Data N
3. This instruction is executed upon the rising edge.
Note 3. The data, when received through Modbus, will be stored
in RTU-mode, regardless of whether you set it in RTU mode
1. Sending data through Modbus, whether the data is in RTU
mode or ASCII mode, you only need to store the RTU-mode or ASCII mode. That is, when you set the data to ASCII
mode, the system will automatically convert them to
data into the unit starting with S2. You do not need to store
the starting character, ending character and checksum,
Programming manual of IVC series small PLC Chapter 6 Application instructions 170
hexadecimal, remove the starting character and ending 1. Store the data sent through Modbus into the element
character, and store them to the data area starting with S3. starting with D0.
4. The sent and received data are stored in the low bytes of 2. Store the data received in the elements starting with
the word element. High bytes are not used. D100.
Example 3. After receiving data through Modbus, the system will
conduct CRC check, address check and instruction check. If
there is any error, the error flag (SM136) will be set, and the
error details will be recorded in the special register SD139.
4. SM114 and SM124 are the flags of free serial port, and
they can be also flags of MODBUS communication status.
The communication error codes are shown below:
Code Description
0x01 Illegal instruction
0x02 Illegal register address
0x03 Wrong number of data
LD SM1
Communication timeout. The communication
MOV 3 D0 0x10
exceeds the preset communication time limit
MOV 1 D1 0x11 Error in receiving data frame
MOV 0 D2 Operand error. Operand (mode or
0x12
MOV 10 D3 master/slave) setting error
Error occurs because t he local station SN is
MOV 5 D4 0x13
the same as that set by the instruction
AND SM124
For the detailed application methods, see 错误!未找到引用
Modbus 1 D0 D100
源。错误!未找到引用源。.
Operand description 1. Set serial port 1, inverter address #1, and control the
inverter forward running through communication in the
S1: designated communication channel (IVC1,IVC2L: Modbus protocol.
channel 1; IVC1L,IVC2H: channen1 and channel 2) 2. After the inverter receives the data, it will conduct CRC
S2: inverter address. Broadcast mode. Broadcast address: check, address check and instruction check and set the
00. Slave address range: 1~247. communication completion flag (SM135) after the
communication. If there is any error, the error flag (SM136)
Function description will be set, and the error details will be recorded in the
special register SD139.
1. Control the inverter forward running through
The error codes in inverter instruction communication are
communication in the Modbus protocol. listed below:
2. This instruction is executed upon the rising edge. Error
Description
code
Note
0x1 Illegal instruction
The total number of the instructions for the communication 0x2 Illegal register address
between Modbus and inverter does not exceed 128. 0x3 Data error. The data exceed the range
Slave operation failure, including the error
Example 0x4
caused by invalid data within the data range
Instruction valid, processing. It is used to
0x5
store data to EEPROM.
LD M1 Slave busy, please try again later. It is used
IVFWD 1 1 0x6
to store data to EEPROM.
Programming manual of IVC series small PLC Chapter 6 Application instructions 171
Error Error
Description Description
code code
Information frame error, including the RUN state (only EV3100 supports this
0x18
information length error and check error function)
0x20 The parameter cannot be modified 0x22 The parameter is protected by password
0x21 The parameter cannot be modified in the
S2 WORD Constant D V R √
S2: inverter address. Broadcast mode. Broadcast address: 1. Set the serial port 1, inverter address #1, and control the
00. Slave address range: 1~247. inverter reverse running through communication in the
Modbus protocol.
Function description
2. After the inverter receives the data, it will conduct CRC
1. Control the inverter reverse running through check, address check and instruction check, and set the
communication in the Modbus protocol. communication completion flag (SM135) after the
2. This instruction is executed upon the rising edge. communication. If there is any error, the error flag (SM136)
will be set, and the error details will be recorded in the
special register SD139.
S2 WORD Constant D V R √
Operand description LD M1
IVFRQ 1 1 50
S1: designated communication channel (IVC1,IVC2L:
1. Set the serial port 1, inverter address #1, and the running
channel 1; IVC1L,IVC2H: channen1 and channel 2)
frequency of the inverter 50Hz, and control the running
S2: inverter address. Broadcast mode. Broadcast address:
frequency of the inverter through communication in the
00. Slave address range: 1~247.
Modbus protocol.
S3: frequency of the inverter
2. After the inverter receives the data, it will conduct CRC
Function description check, address check and instruction check, and set the
1. Control the running frequency of the inverter through communication completion flag (SM135) after the
communication in the Modbus protocol. communication. If there is any error, the error flag (SM136)
2. This instruction is executed upon the rising edge. will be set, and the error details will be recorded in the
special register SD139.
Example
communication. If there is any error, the error flag (SM136) special register SD139.
will be set, and the error details will be recorded in the
2. After the inverter receives the data, it will conduct CRC communication. If there is any error, the error flag (SM136)
check, address check and instruction check, and set the will be set, and the error details will be recorded in the
communication completion flag (SM135) after the special register SD139.
3. Reset the sending completed flag (SM122) before 4. When the sending is completed, set the sending
sending the data. completed flag (SM122).
Operand description For IVC1, V1.23 or higher version supports the instruction
and needs to match with Auto Station of V2.39 or higher
S1: designated communication channel(IVC1,IVC2L: version.
channel 1; IVC1L,IVC2H: channen1 and channel 2)
Example
S2: address (slave address range: 1~247, broadcast
*The following example is only valid for IVC1 series PLC.
address is applicable to write elements)
1. Standard polling
S3: function code. IVC1 supports 01 (read coil), 02 (read
discrete input), 03 (read register), 04 (read input register), 05 The example is the simple polling, M1, M2 and M3 are set,
(write single coil), 06 (write single register), 15 (write multiple and three MODRW instructions access the device in turn.
coils), 16 (write multiple registers) In operation, reset any M element, the corresponding
S4: starting address of read/write elements MODRW instruction will exit polling but other MODRW
S5: number of read/write elements. The number of instructions will still execute by polling. For example, reset
read/write elements for IVC1 is limited by Max. RTU frame M2, MODRW instructions of M1 and M3 access the device.
length (256), as shown below: Similarly, one MODRW instruction can be inserted in
Number of Number of D operation. For example, set M2 and three MODRW
Code Name
elements elements instructions access the device in turn.
01 Read coil 1~2000 (S5+15)/16
02 Read discrete input 1~2000 (S5+15)/16
03 Read register 1~125 S5
04 Read input register 1~125 S5
05 Write single coil 0 (fixed) 1
Write single
06 0 (fixed) 1
register
15 Write multiple coils 1~1968 (S5+15)/16
Write multiple
16 1~123 S5
registers
*The number of 05 and 06 must be 0 in S5.
The number of read/write elements for IVC2L and IVC2H
(S5≤16), the maximum number of word elements and bit
elements is 16 and all bit elements are stored into a word.
D1: storage address of read/write elements. For the number
of elements needed by IVC1, refer to above table.
Function description
When the power flow is valid, send messages and receive
the returned data.
Note
For IVC2L and IVC2H
1. The number of elements is 16 at most.
2. The bit elements read 16 at most, the small address is
stored at low bit, and one byte stores 16 bits.
3. The returned abnormal code is Modbus instruction.
Programming manual of IVC series small PLC Chapter 6 Application instructions 178
M0
T6 : the waiting time of master station is determined by salve
SM30 station and the maximum value cannot exceed timeout time
SM135
of the set main mode
T1 T2
Interfra Bytes to be received characterlength
me
interval
T7 1000 (ms) 1ms
Instructi
on
executio
Baud rate (bps)
n Data
sending
T4 T5 T6 T7 T8 T9
Execute the next
MODBUS instruction T11 is the maximum scan cycle
The time for T12 is less than 1ms
Data
receiving
O ther
processi
Slave
For example: The set communication specification is 19200,
ng
station
processin
g
Data
even check, 8 data bits, 1 stop bit, RTU transmission mode,
T11 T12 sending
Operand description default. That is, the high bytes are taken as 0, and the check result has
16 bits.
S1: the starting element of the data to be
checked Example
S1: the starting element of the data to be checked 1. Conduct CRC16 check on the S2 data starting with S1, and
S2: the number of the data to be checked; S2≥0, or assign the result to D unit.
the system will report operand error 2. The expression for CRC16 check algorithm is: X^16+X^15+X^2+1
D: check result
Programming manual of IVC series small PLC Chapter 6 Application instructions 181
Note Example
1. For the system will bring value of D into the
operation each time the instruction is executed,
make sure to clear D before executing the CRC16 LD SM1
MOV 16#00 D0
instruction.
MOV 16#11 D1
2. The standard Modbus CRC check requires that MOV 16#22 D2
the D element (checksum) be initialized as 16#FFFF, MOV 16#33 D3
and the high/low byes (8 high, 8 low) shall be MOV 16#44 D4
swapped. MOV 16#55 D5
3. The data within the checking data zone starting MOV 16#66 D6
MOV 16#77 D7
with S2 are stored in byte mode by default. That is,
LD X0
the high bits will be taken as 0, and the check result
MOV 0 D100
has 16 bits. CRC16 D0 8 D100
D: destination operand 1. When a C element is reset, the counting value in it will also be
S: source operand cleared.
2. When a T element is reset, the timing value in it will also be cleared.
Function description
Example
When the power flow is valid, reset S bit-elements
LD SM0
starting with D.
ZRST M10 10
When SM0 is ON, the 10 units M10, M11, M12 ... M19 will be
completely cleared.
D: destination operand 2. If S is outside the range of 0~15, D will not be changed when the power flow is
valid. Instead, the system will report operand error.
Function description
Example
When the power flow is valid, set bit S
LD SM0
in word element D to 1, and clear other
DECO 2 D9
bits.
When the power flow is valid, bit 2 in D9 will be set as 1, other bits will be cleared.
S: source operand; When the value of multiple bits in S is 1, the smallest bit number will be written into
D, as shown in the following figure:
D: destination operand
Function description
When the power flow is valid, assign Example
the number of the bit whose value is 1 LD M0
in word element S to D. ENCO 2#0010 D0
When the power flow is valid, operand 1 is 2#0010, bit 1 is 1, hence 1 is written into
D0.
S: source operand LD M1
BON D0 Y0 5
D: destination operand
Function description When the power flow is valid, S1 in BON instruction is ConstantD0, the
state of bit 5 is ON, and the result is stored into Y0.
When the power flow is valid, count the status
of bit S2 in element S1, and store the result
into D.
Programming manual of IVC series small PLC Chapter 6 Application instructions 185
LAD:
Applicable to IVC2L IVC1 IVC1S IVC2H IVC1L
Operand description other nodes to drive the operation of the following operation.
LAD:
Applicable to IVC2L IVC1 IVC1S IVC2H IVC1L
Note: because the logic relationship is visualized in the diagram, the Influenced flag bit
BANI instruction is displayed in LAD as BLDI
Operand description other nodes to drive the operation of the following stage.
D: destination operand LD X0
BSET D0 15
S2: designated bit. 0≤S2≤15, or system
will report operand error When the power flow is valid, set BIT15 of element D0 (1000:
2#0000001111101000). After the execution, D0=33768
Function description
(2#1000001111101000).
Set bit S of element D.
D: destination operand LD X0
BRST D0 8
S2: designated bit. 0≤S2≤15, or system will
report operand error When the power flow is valid, reset BIT8 of element D0 (1000:
2#0000001111101000). After the execution, D0=744
Function description
(2#0000001011101000).
Reset bit S of element D.
Programming manual of IVC series small PLC Chapter 6 Application instructions 189
6.16.1 LD (=, <, >, <>, >=, <=): Compare integer LD※ instruction
6.16.2 AND(=, <, >, <>, >=, <=): Compare integer AND※ instruction
6.16.3 OR(=, <, >, <>, >=, <=): Compare integer OR※ instruction
6.16.4 LDD(=, <, >, <>, >=, <=): Compare double integer LDD※ instruction
6.16.5 ANDD(=, <, >, <>, >=, <=): Compare double integer ANDD※ instruction
6.16.6 ORD(=, <, >, <>, >=, <=): Compare double integer ORD※ instruction
Compare (D0, D1) and (D2,D3), and use the comparison result in parallel
connection with other nodes to determine the output status of the following
element.
Programming manual of IVC series small PLC Chapter 6 Application instructions 195
S1: data to be comparison values or element SN When the power flow is valid, execute the instruction and compare S1
S2: data to be comparison source or element SN and S2. Set one of (D)(D+1)(D+2) ON according to the result (<, =, >).
D: starting element SN of output result Example
LD m0
CMP 1000
2000 M3
Operand description S2. Set one of (D)(D+1)(D+2) ON according to the result (<, =, >).
Operand description S2. Set one of (D)(D+1)(D+2) ON according to the result (<, =, >).
S1: starting element SN for saving the data of add operation When the operation result overflows, the carry flag will not
S2: starting element SN for constant or saving the data of be set ON.
add operation Example
D: starting element SN for saving the result of add operation
S3: number of data
Function description LD M1
1. When the power flow is valid, execute the instruction, add BKADD D10 D100 D1000 5
S3 point 16bit data starting with S1 and S3 point 16bit data When M1=ON, add the content of 5 units starting with D10
(BIN) starting with S2, and store the result in S3 point and 5 units starting with D100, and store the result in 5 units
starting with D. starting with D1000.
2. 16bit constant can be designated in S2. If S2 is constant, D1000=D10+D100, D1001=D11+D101,…,D1004=D14+D104.
add S3 point 16bit data starting with S1 and S2, and store
the result in S3 point starting with D.
S1: starting element SN for saving the data of subtract 1. When the power flow is valid, execute the instruction,
operation subtract S3 point 16bit data starting with S1 and S3 point
S2: starting element SN for constant or saving the data of 16bit data (BIN) starting with S2, and store the result in S3
subtract operation point starting with D.
D: starting element SN for saving the result of subtract 2. 16bit constant can be designated in S2. If S2 is constant,
operation subtract S3 point 16bit data starting with S1 and S2, and
store the result in S3 point starting with D.
S3: number of data
Programming manual of IVC series small PLC Chapter 6 Application instructions 201
LD M1
BKSUB D10 D100 D1000 5
Output D (output)
Operand description
S1: lower limit
S1 (lower limit)
S2: upper limit
Input S2 (upper limit)
S3: input value controlled by upper/lower limit
D: starting element SN for saving output value in
upper/lower limit control
Example
Function description
Judge whether the input value designated in S3
is in the range of S1 and S2 to control and store
LD M1
the result in D. If S3<S1, D=S1; if S3>S2, D=S2;
LIMIT D0 D10 D100 D1000
if S1<=S3<=S2, D=S2.
When M1=ON, execute D0~D10 upper/lower limit control on the content
of D100 and store the result in D1000.
D0(10)<=D100(30)<=D10(100), D1000=30.
Operand description D: starting element SN for saving output value controlled by dead band
S2: upper limit of dead band Judge whether the input value designated in S3 is in the range of S1 and
S3: input value in dead band control S2 to control and store the result in D. If S3<S1, D=S3-S1; if S3>S2, D=
S3-S2; if S1<=S3<=S2, D=0.
Programming manual of IVC series small PLC Chapter 6 Application instructions 203
Output D(output)
S1 (lower limit) LD M1
Input 0S2 (upper limit)
DBAND D0 D10 D100 D1000
Output D (output)
Operand description
S2 (negative deviation)
S1: negative deviation value to be added to input
value
Input 0 S3 (input)
S2: positive deviation value to be added to input
S1 (positive deviation)
value
S3: input value controlled by zone
Example
D: starting element SN for saving output value in
zone control
Function description
LD M1
Judge the input value designated in S3 adds
ZONE D0 D10 D100 D1000
the deviation value in S1 or S2 to control and
store the result in D. If S3<0, D=S3+S1; if S3>0, When M1=ON, execute D0~D10 zone control on the content of D100
D=S3+S2; if S3=0, D=0. and store the result in D1000.
D100(30)>0, D1000=D100(30)+D10(100), D1000=130.
X coordinate S2+3
Point 2
Y coordinate S2+4
… … …
X coordinate S2+2n-1 Point 3 (30, 60)
Point n (end)
Y coordinate S2+2n
D (40) Point 4 (50, 40)
Note
Point 2 (20, 20)
1. The data of X in the table should be in an ascending order.
If part of data are not in an ascending order but detect from Point 5 (60, 0)
Point 1 (10, 0) S1 (25) X
low bit, the operation before will still be executed.
S1: starting element SN to search the same data, Max. value 1. Search S3 data starting with S1 and the data the same
and Min. value with S2, and store the result in D-D+4.
S2: element SN to search reference values of the same data, 2. Store the number of the same data and the locations of
Max. value and Min. value or store target elements the initial/final value, Max. value and Min. value for 5
D: starting element SN to store the number after searching elements starting with D when there are same data.
the same data, Max. value and Min. value 3. Store 0 for starting 3 elements and other 2 elements as
S3: number of the same search data, Max. value and Min. above when there are no same data..
value (1≤S3≤256)
Programming manual of IVC series small PLC Chapter 6 Application instructions 205
LD M1
When M1=ON, search the content of 8 units starting with D10 and store the result in 5 units starting with D1000.
Comparison
Search element S1 Value Data location Search result D Value
element value S2
D10 100 100 0 D1000 3
D11 78 1 D1001 0
D12 92 2 D1002 7
D13 100 3 D1003 5
D14 110 4 D1004 6
D15 -20 5
D16 145 6
D17 100 7
Operand description quotation marks indicate the delimiter in upper computer software, so it
st
cannot be identified;
S1: the 1 string unit
nd
2. When the stored result in S1 and S2 is ‘00H’, add ‘0000H’ in D;
S2: the 2 string unit
3. When the element addresses of S1 and D or S2 and D overlap, the
D: storage added string unit
system will report operand error;
Function description 4. When no ‘00H’ exists in the range of relevant elements of string units
1. When the power flow is valid, add string units starting with S1 or S2, the system will report operand error.
starting with S1 and S2, and store the result in Example
the element starting with D;
2. The instruction refers to add the first character
of S2 to the end character of S1 and leave out
LD M1
the end flag of S1;
STRADD D10 D100 D1000
3. The valid data of string units are the data from
st When M1=ON, add the string unit starting with D10 and the string unit
the element designated by string units to the 1
detected ‘00H’; starting with D100, and store the result in the unit starting with D1000.
4. When the number of strings after connection B15---b8 b7---b0 B15---b8 b7---b0 B15---b8 b7---b0
is odd, add ‘00H’ to the high byte of the end D10 0x32 0x31 D100 0x38 0x37 D1000 0x32 0x31
character element; when the number is even, D11 0x34 0x33 + D101 0x61 0x39 D1001 0x34 0x33
add ‘0000H’ to the next element of the end D12 0x36 0x35 D102 0x00 0x62 D1002 0x36 0x35
character element. D13 0x00 0x00 D1003 0x38 0x37
Note D1004 0x61 0x39
D1005 0x00 0x62
1. When designating strings, S1 and S2 allow 32
characters at most. The comma and double
Programming manual of IVC series small PLC Chapter 6 Application instructions 206
When M1=ON, detect the string unit length starting with D10,
and store the result in D100.
Operand description 4. The valid data of string units are the data from the element designated
st
by string units to the 1 detected ‘00H’.
S1: string unit
D: storage read string unit Note
S2: number of read strings 1. When no ‘00H’ exists in the range of relevant elements of string units
Function description starting with S1, the system will report operand error;
2. S2≥0;
1. When the power flow is valid, read S2 starting
3. S2≤the number of S1
from the end valid character of S1 (except ‘00H’),
and store the result in the element starting with Example
D;
2. When S2=0, store ‘00H’ in D;
3. When the number of read strings is odd, add LD M1
‘00H’ to the high byte of the end character STRRIGHT D10 D100 3
element; when the number is even, add ‘0000H’ When M1=ON, read 3 characters on the right of string units starting with
to the next element of the end character D10, and store the result in D100.
element;
Programming manual of IVC series small PLC Chapter 6 Application instructions 207
Operand description 2. The valid data of string units are the data from the element
st
designated by string units to the 1 detected ‘00H’.
S: source string unit
Note
D: target unit
1. When no ‘00H’ exists in the range of relevant elements of
Function description
string units starting with S, the system will report operand
1. Move all data of S including ‘00H’ to the element unit error;
starting with D;
Programming manual of IVC series small PLC Chapter 6 Application instructions 210
2. When the number of S is even, ‘00H’ will be stored in low B15---b8 b7---b0 B15---b8 b7---b0
byte while it can be stored in corresponding high byte in D; D10 0x32 0x31 D100 0x32 0x31
3. When designating strings, S1 allows 32 characters at
D11 0x34 0x33 D101 0x34 0x33
most. The comma and double quotation marks indicate the
D12 0x36 0x35 D102 0x36 0x35
delimiter in upper computer software, so it cannot be
identified.
D13 0x00 0x00 D103 0x00 0x00
Example
LD M1
STRMOV D10 D100
When M1=ON, move the string starting with D10 to the unit
starting with D100.
Operand description 3. When S2=1024, the execution time for the instruction will
be about 80ms. In actual use, please set watchdog time
S1: element unit of extension register for data storage
correctly.
S2: number of read points (1≤S2≤1024)
Example
Function description
Read S2 starting with S1 in extension file register stored in
the memory into the element starting with S1 in the LD M1
extension register.
LOADR R0 16
Note
When M1=ON, read 16 data starting with R0 unit in memory
1. When S2=0, no execution; card R backup area, and store the result in 16 element units
2. When the memory is not connected, the system will report starting with R0.
no memory card;
Operand description 3. After the instruction is executed, set SM189 for the end of
execution.
S1: element unit of extension register for data storage (only
designate the starting address of the stage) Note
S2: number of write points in each operation cycle 1. When S2=2048, the execution time for the instruction will
(1≤S2≤2048) be about hundreds of milliseconds. In actual use, please set
D: stored number of write points watchdog time correctly;
2. Before driving SAVER, execute INITER or INITR
Function description
instruction and initialize the operation stage. If the write data
1. By 2048/S2 (aliquant, add 1 to the result) operation cycle, in extension file register are inconsistent with those in
write the data in extension register from S1 to S1+2047 into extension register, report memory card operation error;
the same units in the memory;
3. When the value designated in S2 is 0, execute the
2. In write process, store the number of write points in D; instruction according to S2=2048.
4. The value in S1 must be the starting element number of the stage, as shown below:
Starting element Range of write memory Starting element Range of write memory
Stage No. Stage No.
No. card R backup area No. card R backup area
0 R0 R0~R2047 8 R16384 R16384~R18431
1 R2048 R2048~R4095 9 R18432 R18432~R20479
2 R4096 R4096~R6143 10 R20480 R20480~R22527
3 R6144 R6144~R8191 11 R22528 R22528~R24575
4 R8192 R8192~R10239 12 R24576 R24576~R26623
5 R10240 R10240~R12287 13 R26624 R26624~R28671
6 R12288 R12288~R14335 14 R28672 R28672~R30719
7 R14336 R14336~R16383 15 R30720 R30720~R32767
Operand description
S1: unit of extension register and extension file register for initialization (only designate the starting address of the stage)
S2: number of stages of extension register and extension file register for initialization (S2=1)
Function description
1. Initialize S2 stage extension register and extension file register starting with S1, initial value: 0xFFFF;
2. The initialization is executed in stages.
Programming manual of IVC series small PLC Chapter 6 Application instructions 212
Note
1. The value in S1 must be the starting element number of the stage, as shown below:
Starting element Range of write memory Starting element Range of write memory
Stage No. Stage No.
No. card R backup area No. card R backup area
0 R0 R0~R2047 8 R16384 R16384~R18431
1 R2048 R2048~R4095 9 R18432 R18432~R20479
2 R4096 R4096~R6143 10 R20480 R20480~R22527
3 R6144 R6144~R8191 11 R22528 R22528~R24575
4 R8192 R8192~R10239 12 R24576 R24576~R26623
5 R10240 R10240~R12287 13 R26624 R26624~R28671
6 R12288 R12288~R14335 14 R28672 R28672~R30719
7 R14336 R14336~R16383 15 R30720 R30720~R32767
2. When the memory card is not used, the instruction will be Example
not executed;
3. When connecting the memory card under memory
hardware write protection, report memory card operation LD M1
error;
INITR R0 1
4. The instruction can only initialize one stage at a time. If
When M1=ON, initialize extension register R0~R2047 at
the memory card is used, the initialization time for each
stage 0. If the memory card is used, ER0~ER2047 will be
stage is about 100ms. In actual use, please set watchdog
also initialized.
time correctly.
S3: starting element address 1. When using the memory card, initialize the login stages. If
S4: stage of elements (1~16) the data for logging in extension file register are inconsistent
with the starting data of S1, report memory card operation
D: number of logged data
error. The initialization can be executed on the login stages
Function description by INITR or INITER instruction or on all ER elements by
1. When the power flow is valid, till the extension register menu clear command from background memory card (need
starting with S3 and S4 extent of the extension file register to select user program, global variable, data block and
are filled totally, log in S2 point starting with S1 all the time; system block at the same time). In order to avoid data loss,
please back up the content of the memory card by
background software before initialization.
Programming manual of IVC series small PLC Chapter 6 Application instructions 213
2. The value in S3 must be the starting element number of the stage, as shown below:
Starting element Range of write memory Starting element Range of write memory
Stage No. Stage No.
No. card R backup area No. card R backup area
0 R0 R0~R2047 8 R16384 R16384~R18431
1 R2048 R2048~R4095 9 R18432 R18432~R20479
2 R4096 R4096~R6143 10 R20480 R20480~R22527
3 R6144 R6144~R8191 11 R22528 R22528~R24575
4 R8192 R8192~R10239 12 R24576 R24576~R26623
5 R10240 R10240~R12287 13 R26624 R26624~R28671
6 R12288 R12288~R14335 14 R28672 R28672~R30719
7 R14336 R14336~R16383 15 R30720 R30720~R32767
3. Under memory hardware write protection, report memory card operation error.
4. Format of login data
Storage address of the 1st login data
S3~S3+S2-1 D=S2
S3~S3+S2-1
Storage address of the 2nd login data Data write area
S3+S2~S3+2S2-1 D=2S2
S3~S3+S2-1 1926 * S4
S3+2S2~S3+3S2-1 D=3S2
………… ………… ……
Storage area of login data
Control area of write location
Each time use 1 word write area,
S3+1926*S4-1 change ON to OFF in turn from 0 bit of Control area
~S3+2048*S4-1 S3+1926*S4-1. When all 122 * S4
S3+1926*S4-1 become OFF, use next
element S3+1926*S4.
Example LD M1
LOGR D0 5 R0 1 D100
When M1=ON, log in the data of D0~D4 in R0~R2047 at
stage 0, and record the login data number in D100.
S1: extension register unit in the same address as extension 1. Initialize S2 stage extension file register starting with S1 in
file register unit to be initialized (only designate the starting memory and write 0xFFFF;
address of the stage) 2. The initialization is executed in stages.
S2: stage number of extension register and extension file
register to be initialized (S2=1)
Note
1. The value in S1 must be the starting element number of the stage, as shown below:
Starting element Range of write memory Starting element Range of write memory
Stage No. Stage No.
No. card R backup area No. card R backup area
0 R0 R0~R2047 8 R16384 R16384~R18431
1 R2048 R2048~R4095 9 R18432 R18432~R20479
2 R4096 R4096~R6143 10 R20480 R20480~R22527
3 R6144 R6144~R8191 11 R22528 R22528~R24575
Programming manual of IVC series small PLC Chapter 6 Application instructions 214
S1: zero return speed, specifying the zero return start speed 1. Because the ZRN instruction is incapable of searching the
32-bit instruction: IVC1, IVC2L: 10~100000(Hz); IVC1L: Y0, proximity signal automatically, the zero return operation must
Y1 10~100000(Hz), Y2, Y3 10~10000(Hz); IVC2H: start earlier than where the proximity sensor is located.
10~200000(Hz) 2. During the return to zero process, the value of the current
S2: crawling speed, specifying the relatively low speed when value register will decrease.
the proximity signal is ON 3. The minimum value of actual output pulse frequency is
S3: proximity signal, specifying the X point for inputting determined by the following formula:
proximity signal Fmax 500
Fmin_ acc
If a non-X element is specified, the position offset of the zero T
point will increase due to the influence of the PLC calculation Fmax is the maximum speed set by SD85 and SD86, T is
cycle.
ACC/DEC time set by SD87 (unit: ms), Fmin_ acc is the
D: starting address of the high-speed pulse output minimum output frequency limit.
IVC1, IVC2L: Y0 or Y1; IVC1L: Y0,Y1,Y2,Y3; IVC2H: Y0, 4. The output pulse frequency will still output the frequency
Y2, Y4, Y5, Y6, Y7 of the calculated result even if designated the value lower
Function description than the calculated result. The frequency of the initial
acceleration and final deceleration cannot be lower than the
When SM85 clearing function is enabled, the CLR signals
for high-speed pulse outputs Y0 and Y1 are output through calculated result. If the maximum speed is below the
Y2 and Y3 respectively. When SM85 is set, the CLR signals calculated result, there will be no pulse output.
will be output to the servo amplifier through Y2 and Y3. 5. 0<crawling speed<one tenth of the Max. speed
6. Refer to Chapter 11 Using locating function.
Programming manual of IVC series small PLC Chapter 6 Application instructions 215
S2 Crawling speed
Pulse output
Position
Zero return
starting point
ON
OFF
Position
ON
Note 1 OFF
Clearing signal
Width: 20ms + scan cycle Within 1ms
ON
Note 2
OFF
Monitoring of Position
pulse output
Note 1: When SM85 is set, the clearing function is valid
Note 2: SM82 & SM83 are the monitors of Y0 & Y1 pulse
outputs respectively
Applicable to
LAD: IVC2L IVC1 IVC2H IVC1L
Influenced flag bit
Applicable to
LAD: IVC2L IVC1 IVC1S IVC2H IVC1L
Influenced flag bit
Operand description 5. During the execution of the instruction, the output will
decelerate to stop when the driven contact turns OFF. The
S1: output pulse number (relatively specified)
execution completion flag SM will not act then.
32-bit instruction: -999999~+999999
6. If the corresponding high-speed pulse output control
S2: output pulse frequency(Hz) (SM80 or SM81) is ON, the contact driven by the instruction
32-bit instruction: IVC1, IVC2L: 10~100000(Hz); IVC1L: will not be driven by the instruction again after the the power
Y0,Y1 10~100000(Hz),Y2,Y3 10~10000(Hz); IVC2H: flow turns OFF.
10~200000(Hz)
Note
D1: starting address of the high-speed pulse output
1. The minimum value of actual output pulse frequency is
IVC1, IVC2L: Y0 or Y1; IVC1L: Y0,Y1,Y2,Y3; IVC2H: Y0, Y2,
determined by the following formula:
Y4, Y5, Y6, Y7
D2: starting address of rotating direction signal output. Its Fmax 500
Fmin_ acc
T
state is determined by S1:
Fmax is the maximum speed set by SD85 and SD86, T is
When S1 is positive: D2 is ON
When S1 is negative: D2 is OFF ACC/DEC time set by SD87 (unit: ms), Fmin_ acc is the
minimum output frequency limit.
Function description
2. The output pulse frequency will still output the frequency
1. S1 is stored in the following current registers: of the calculated result even if designated the value lower
Y0 output: SD80, SD81 (32-bit) than the calculated result. The frequency of the initial
Y1 output: SD82, SD83 (32-bit) acceleration and final deceleration cannot be lower than the
2. When D2 is OFF, the value of the current value register calculated result. If the maximum speed is below the
will decrease. calculated result, there will be no pulse output.
3. The rotating direction is determined by the positive or 3. 0<crawling speed<one tenth of the Max. speed
negative nature of S1. 4. Refer to Chapter 11 Using locating function.
4. Changing the operands during the execution of the
instruction will not take effect until the next cycle when the
instruction is executed again.
Programming manual of IVC series small PLC Chapter 6 Application instructions 217
SD80
Y0 outputs the current position of locating 5. During the execution of the instruction, the output will
instruction (MSB)(IVC1) decelerate to stop when the driven contact turns OFF. The
Y0 outputs the current position of locating
SD81 execution completion flag SM will not act then.
instruction (LSB)(IVC1)
Y1 outputs the current position of locating 6. If the corresponding high-speed pulse output control
SD82
instruction (MSB) (IVC1) (SM80 or SM81) is ON, the contact driven by the instruction
SD83
Y1 outputs the current position of locating will not be driven by the instruction again after the the power
instruction (LSB) (IVC1) flow turns OFF.
Y0 outputs the current position of locating
SD200
instruction (MSB) (IVC2L,IVC1L,IVC2H) Note
Y0 outputs the current position of locating
SD201 1. The minimum value of actual output pulse frequency is
instruction (LSB) (IVC2L, IVC1L,IVC2H)
determined by the following formula:
Y1 outputs the current position of locating
SD210
instruction (MSB) (IVC2L, IVC1L) Fmax 500
Fmin_ acc
Y1 outputs the current position of locating T
SD211
instruction (LSB) (IVC2L, IVC1L)
Fmax is the maximum speed set by SD85 and SD86, T is
Y2 outputs the current position of locating
SD320
instruction (MSB) (IVC1L,IVC2H) ACC/DEC time set by SD87 (unit: ms), Fmin_ acc is the
Y2 outputs the current position of locating minimum output frequency limit.
SD321
instruction (LSB) (IVC1L,IVC2H)
2. The output pulse frequency will still output the frequency
Y3 outputs the current position of locating
SD330 of the calculated result even if designated the value lower
instruction (MSB) (IVC1L)
Y3 outputs the current position of locating than the calculated result. The frequency of the initial
SD331
instruction (LSB) (IVC1L) acceleration and final deceleration cannot be lower than the
Y4 outputs the current position of locating calculated result. If the maximum speed is below the
SD340
instruction (MSB) (IVC2H)
calculated result, there will be no pulse output.
Programming manual of IVC series small PLC Chapter 6 Application instructions 218
3. 0<crawling speed<one tenth of the Max. speed 4. Refer to Chapter 11 Using locating function.
D1 BOOL Y M S
Operand description
S: the input point from servo 2. The read current value D2 can be stored in any word
The input points occupies three consecutive Xs (S, S+1 and element, but the current value must be eventually stored in
S+2) or other bit elements. SD80 or SD82.
D1: output points to servo. 3. The power flow of the ABS instruction should be ON after
the current value is read, otherwise the servo amplifier will
The output points occupies three consecutive Ys (D1, D1+1
turn OFF.
and D1+2) or other bit elements
4. SM82 and SM83 are the output monitors of Y0 and Y1.
D2: the current value (32-bit) read from servo.
The monitors will turn OFF after the output is complete.
The current value occupies two word elements: D2 (MSB)
5. When the power flow is valid and the servo is ON, the
and D2+1 (LSB). Because the read current value must be
written into SD80 or SD82 (32-bit signed integer), you can ABS instruction will send the transmission mode signal.
directly specify SD80 or SD82 as D2. 6. When the data transmission ready signal and the ABS
request signal coincide with each other, the (32+6)bit data
Function description
communication will start.
1. You should power on the PLC and servo amplifier at the 7. The data are tranmitted through the ABS 2-bit (bit0 & bit1)
same time, or power on the servo amplifier first, in order to loop.
make sure that the servo amplifier is ON before the PLC
8. The system error code for ABS Data Read Timeout is 79;
enters the RUN state.
for ABS Data Read and Check Error, 80.
The wire connection for the I/O signals of the ABS instruction is as shown in the following figure:
ON
Power supply
OFF
Note 4
Servo ON signal ON
(SON)
Note 1 OFF
ABS transmission ON
mode (ABSM).
Note 1 OFF
ABS transmission
ON
request (ABSR)
Note 1 OFF
Note 5
Data transmission ON
ready (TLC).
Note 2 OFF
Note 5
Ready for
Ready. Note 2
operation.
RD Ready for Note 3
peration.
Note 3
Note 1: the signal PLC sends to servo amplifier
Note 2: the signal servo amplifier sends
Note 3: system data transmission over, ready for normal operation. After RD is set, ABSM signal will not be accepted
Note 4: Here the SON signal is set before ABSM signal. Despite that, the main circuit will not be ON until ABSM is set ON. If
transmission mode is interrupted with ABSM being set OFF during the ABS trasmission, the servo amplifier will report overtime alarm
(AL.E5).
Note 5: These signal pins' definitions will change upon ABSM set/reset. See the related Mitsubishi product information.
Note
The ABS instruction supports the Mitsubishi MR~J2 and MR~J2S servo amplifiers and use its specialized data transmission
protocol to read the current value of absolute position. The ABS instruction is a dedicated 32-bit instruction. For the servo
amplifiers of other brands, reading the current value of absolute position requires communication or other designated methods.
When the ABS instruction is executed, the related I/O points will be processed accordingly. Therefore, the ABS instruction is
applicable only to Mitsubishi servo amplifiers.
Operand description
S1: element SN of near-point input signal (DOG). When D1: pulse SN of output pulse. IVC1, IVC2L: Y0 or Y1;
designated to input the element, due to the influence from IVC1L: Y0,Y1,Y2,Y3; IVC2H: Y0, Y2, Y4, Y5, Y6, Y7
PLC operation cycle, the origin position offset will be D2: object SN of rotating direction signal output
enlarged.
S2: element SN of zero-point input signal. Range: X0~X7
Programming manual of IVC series small PLC Chapter 6 Application instructions 220
When the event of interrupt source generates (X6 rising primary function simultaneously to avoid scanning the
edge), Y0 will stop immediately regardless of the scan cycle. instruction and restarting high-speed output after Y0 stops.
Note: When executing STOPDV instruction, disconnect
relevant power flow of high-speed instruction for Y0 in
Operand description (1) In the incremental mode, the target trace adopts relative
address, referring to the move distance of X and Y axes from
S: starting address of storage area for parameter list
the current position to the target.
D1: corresponding output point SN of X axis pulse signal (or
(2) In the absolute mode, the target trace adopts absolute
positive pulse signal). Range: Y0, Y4, Y5, Y6, Y7
address, referring to the absolute coordinate of the target
D2: corresponding output point SN of X axis direction signal
position on X and Y axes.
(or negative pulse signal)
Note
D3: corresponding output point SN of Y axis pulse signal (or
positive pulse signal). Range: Y2, Y4, Y5, Y6, Y7 1. D1 and D3 must be used in group. When the output group
D4: corresponding output point SN of Y axis direction signal is Y0 and Y2, Y1 and Y3 can be direction signal or negative
(or negative pulse signal) pulse output signal to match with Y0 and Y2 separately. D1
and D3 can select any two of Y4, Y5, Y6, Y7 for interpolation,
Function description
and the corresponding direction signals are free to select.
1. Move to the target position in linear trace at designated 2. Output group (Y0, Y2) can be designated to
vector speed. “pulse+direction” mode or “positive pulse+negative pulse”
2. Definitions of parameter list mode, the Max. speed 100k; Y4, Y5, Y6, Y7 for interpolation
D are output in “pulse+direction” mode, the Max. speed 20k.
Content
element 3. The move distance of each axis should not exceed
S Reserved
16,777,215 pulses at a time.
Relation between action mode and output logic
(configuration code in decimal) 4. Note that only one of PLSY, PLS or locating instructions
Configuration Mode Output logic can be used for one high-speed port at one time.
Pulse+direction
00 Incremental (positive ON/ Example
negative OFF)
S+1 Positive pulse
01 Incremental
+negative pulse
Pulse+direction
10 Absolute (positive ON/
negative OFF)
Positive pulse
11 Absolute
+negative pulse
S+2 Resultant speed, initial speed Fmin(Hz) (MSB)
S+3 Resultant speed, initial speed Fmin(Hz) (LSB)
S+4 Resultant speed, Max. speed Fmax(Hz) (MSB)
S+5 Resultant speed, Max. speed Fmax(Hz) (LSB)
S+6 ACC/DEC time T(ms) (MSB)
S+7 ACC/DEC time T(ms) (LSB)
S+8 X axis target position (move distance) (MSB)
S+9 X axis target position (move distance) (LSB)
S+10 Y axis target position (move distance) (MSB)
S+11 Y axis target position (move distance) (LSB)
Programming manual of IVC series small PLC Chapter 6 Application instructions 224
S+7 (Reserved)
S+8 X axis move distance (target position) (MSB) Starting point Center of the
S+9 X axis move distance (target position) (LSB) (2000,5000) circle (6000,5000)
S+10 Y axis move distance (target position) (MSB)
S+11 Y axis move distance (target position) (LSB)
End point
Center of a circle of X axis/
S+12 (6000,1000)
X coordinate of passed point (MSB)
X axis (SD200)
S+13 Center of a circle of X axis/
Programming manual of IVC series small PLC Chapter 6 Application instructions 225
The incremental mode can be used. The displacement of end point relative to starting point is (4000, -4000) and the
displacement of center of the circle relative to starting point is (4000, 0). The programming can be:
D
Operand description Content
element
S: starting address of storage area for parameter list Method to form circular arc
D1: corresponding output point SN of X axis pulse signal (or Configuration Mode
S 0 Designate center of a circle
positive pulse signal). Range: Y0, Y4, Y5, Y6, Y7 1 Designate passed position
D2: corresponding output point SN of X axis direction signal
Relation between action mode and output logic
(or negative pulse signal) (configuration code in decimal)
D3: corresponding output point SN of Y axis pulse signal (or Configuration Mode Output logic
Pulse+direction
positive pulse signal). Range: Y2, Y4, Y5, Y6, Y7 00 Incremental (positive ON/
D4: corresponding output point SN of Y axis direction signal negative OFF)
S+1 Positive pulse
(or negative pulse signal) 01 Incremental
+negative pulse
Function description Pulse+direction
10 Absolute (positive ON/
1. Move to the target position in counterclockwise circular negative OFF)
Positive pulse
trace at designated linear speed. 11 Absolute
+negative pulse
2. Definitions of parameter list S+2 (Reserved)
S+3 (Reserved)
S+4 Resultant speed (MSB)
S+5 Resultant speed (LSB)
S+6 (Reserved)
S+7 (Reserved)
S+8 X axis move distance (target position) (MSB)
Programming manual of IVC series small PLC Chapter 6 Application instructions 226
Y axis (SD320)
Y coordinate of passed point (MSB)
Center of a circle of Y axis/
S+15
Y coordinate of passed point (LSB) End point Center of the circle
(2000,5000) (6000,5000)
(1) In the incremental mode, the target trace adopts relative
address, referring to the move distance of X and Y axes from
Starting point
the current position to the target. (6000,1000)
(2) In the absolute mode, the target trace adopts absolute X axis (SD200)
address, referring to the absolute coordinate of the target The incremental mode can be used. The displacement of
position on X and Y axes.
end point relative to starting point is (-4000, 4000) and the
Note
displacement of center of the circle relative to starting point
1. D1 and D3 must be used in group. When the output group is (0, 4000). The programming can be:
is Y0 and Y2, Y1 and Y3 can be direction signal or negative
pulse output signal to match with Y0 and Y2 separately. D1
and D3 can select any two of Y4, Y5, Y6, Y7 for interpolation,
and the corresponding direction signals are free to select.
2. Output group (Y0, Y2) can be designated to
“pulse+direction” mode or “positive pulse+negative pulse”
mode, the Max. speed 100k; Y4, Y5, Y6, Y7 for interpolation
are output in “pulse+direction” mode, the Max. speed 20k.
3. The move distance of each axis should not exceed
16,777,215 pulses at a time.
4. Note that only one of PLSY, PLS or locating instructions
can be used for one high-speed port at one time.
5. The coordinate of passed point designated in passed
position mode refers to the position the whole circle passes
while the path of user-defined trace may not pass.
Programming manual of IVC series small PLC Chapter 6 Application instructions 227
Operand description primary axis to run after ACC and DEC process. When the
primary axis outputs S3, two axes will be consistent in speed
S1: total pulses of secondary axis in the following process
and start constant speed synchronization. When the pulses
S2: total pulses of primary axis in the followed process of the primary axis from the target position is S4, constant
S3: pulses of primary axis before reaching constant speed speed synchronization will be over and the secondary axis
synchronization will start decelerating. When the primary axis arrives at the
S4: pulses of primary axis after completing constant speed target position, the secondary axis will stop.
synchronization 3. When the primary axis is defined as output axis, S6 will be
S5: corresponding output point SN of secondary axis pulse Y0~Y7; when it is defined as input axis, S6 is C236~C255 or
signal. Range: Y4, Y5 C301~C306.
S6: corresponding output point SN or high-speed counter 4. When the power flow is ON, the secondary axis will run.
SN of primary axis pulse signal. Range: Y0~Y7, C236~C255, The instruction supports calling methods of main programs,
C301~C306 subprograms and interrupt programs.
Function description 5. The direction signal of output axis does not need
designation and its ON/OFF state will not change in the
1. The instruction realizes simple synchronous functions of
following process.
two axes. The secondary axis measures and follows the
speed and position of the primary axis. The primary axis can Note
be high-speed output port of the module or high-speed input 1. Note that only one of PLSY, PLS or locating instructions
port. can be used for one high-speed port at one time.
Total amount of 2. The output point SN D corresponding to high-speed pulse
movement
Amount of Amount of
movement movement
can be: Y0, Y2, Y4, Y5, Y6, Y7. Y1 and Y3 can be direction
before after signal or negative pulse output signal to match with Y0 and
synchronizing synchronizing
Amount of Y2 separately.
movement of
secondary axis
Example
Total amount
of movement
Amount of
Speed of movement of
secondary primary axis
axis
Speed Synchronization
Start End
synchronized completed
Indexed
Operand Type Applicable elements
addressing
S1 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T R √
S2 INT Constant D R √
D INT KnY KnM KnS KnLM D SD C R √
Indexed
Operand Type Applicable elements
addressing
S1 INT D SD C T R √
S2 INT D SD C T R √
D INT Constant D R √
Operand description
S1: starting element SN to store the data which will be separated in byte unit
S2: data number to be separated (S2≥0)
D: starting element SN to store the data which has been separated in byte unit
Function description
1. Separate the 16bit data stored in S2/S elements starting with S1 into S2 bytes, store the result into the low bytes of S2
elements starting with D and clear the high bytes.
Programming manual of IVC series small PLC Chapter 6 Application instructions 230
…
+2 00H High byte
…
? When n is odd, carry bit and get the value.
Save H00
2. When S2 is odd, only the high bytes (8bit) in the last data of separation source are the object data.
For example, n=5, the data of low bytes of S~S+2 will be stored in D~D+4.
b15 -- -- -- -- -- --b8 b7 -- -- -- -- -- -- b0 b15 -- -- -- -- -- --b8 b7 -- -- -- -- -- -- b0
+3 00H 78H
n=5, ignore
+4 00H FEH
Save H00
LD M1
WTOB D0 D10 6
When M1=ON, separate 3 unit data starting with D0 into 6 units according to high/low bytes, and store the result into 6 units
starting with D10. When D0=0x102, D1=0x304 and D2=0x506, D10=0x01, D11=0x02, D12=0x03, D13=0x04, D14=0x05 and
D15=0x06.
Programming manual of IVC series small PLC Chapter 6 Application instructions 231
Indexed
Operand Type Applicable elements
addressing
S1 INT D SD C T R √
S2 INT D SD C T R √
D INT Constant D R √
Operand description
S1: starting element SN to store the data which will be combined in byte unit
S2: data number to be combined (S2≥0)
D: starting element SN to store the data which has been combined in byte unit
Function description
1. Store the data after the combination of low bytes (8bit) of S2 16bit data starting with S1 into S2/2 elements starting with D.
Ignore (8bit) high bytes of 16bit data (after S1) of combination source.
b15 -- -- -- b8 b7 -- -- -- -- -- -- -- -- -- b0 b15 -- -- -- -- -- --b8 b7 -- -- -- -- -- -- b0
S . +0 st
data of the 1 byte D . +0 the 1st byte the 2nd byte
+1 data of the 2nd byte +1 the 3rd byte the 4th byte
n data of the 3rd byte
…
+2
…
bytes
n/2? the (n-1)th byte the n th byte
…
+3 ABH 78H
n=5, “H00”
+4 CDH 9AH
LD M1
BTOW D0 D10 6
When M1=ON, store 3 unit data after the combination of 6 unit data starting with D0 into 3 units starting with D10. When
D0=0x01, D1=0x02, D2=0x03, D3=0x04, D4=0x05 and D5=0x06, D10=0x102, D11=0x304 and D12=0x506.
Programming manual of IVC series small PLC Chapter 6 Application instructions 232
Indexed
Operand Type Applicable elements
addressing
S1 INT D SD C T R √
S2 INT D SD C T R √
D INT Constant D R √
Operand description
S1: starting element SN to store the data which will be combined
S2: combined data (0-4, S2=0, no processing)
D: element SN to store the data which has been combined
Function description
1. Store S2 16bit data starting with S1 into S2 elements starting with D.
b15 -- -- -- -- -- -- -- b4 b3 -- -- -- -- b0
S. +0 low 4bit
1 low 4bit
2 low 4bit
3 low 4bit
D.
b15 -- -- -- -- -- -- -- b4 b3 -- -- -- -- b0
S . +0 low 4bit
+1 low 4bit
+2 low 4bit
D.
Ignored Data to be combined
n=3, it is 0.
3. When the range of S2 is 1-4 and S2=0, the instruction will not be executed.
4. Source operand and destination operand cannot be overlapped.
Example
LD M1
UNI D0 D10 4
When M1=ON, combine low 4bit of 4 unit data starting with D0 and store the result into D10. When D0=0x01, D1=0x02,
D2=0x03 and D3=0x04, D10=0x1234.
Programming manual of IVC series small PLC Chapter 6 Application instructions 233
Indexed
Operand Type Applicable elements
addressing
S1 INT D SD C T R √
S2 INT D SD C T R √
D INT Constant D R √
Operand description
S1: starting element SN to store the data which will be separated
S2: separated data (0-4, S2=0, no processing)
D: element SN to store the data which has been separated
Function description
1. Store S2 16bit data starting with S1 into S2 elements starting with D.
S . D . +0 Low 4bit
+1 Low 4bit
+2 Low 4bit
+3 Low 4bit
2. The valid range of S2 is 1-4. The instruction will not be executed for other data.
3. The high 12bit in S2 elements starting with D is cleared.
4. Source operand and destination operand cannot be overlapped.
Example
LD M1
DIS D0 D10 4
When M1=ON, separate D0 unit data every 4 bits, and store the result into 4 units starting with D10. When D0=0x1234,
D10=0x01, D11=0x02, D12=0x03 and D13=0x04.
Programming manual of IVC series small PLC Chapter 6 Application instructions 234
Indexed
Operand Type Applicable elements
addressing
S1 INT T √
S2 INT Constant D R √
D BOOL S √
This chapter introduces the basic concepts and programming methods of Sequential Function Chart (SFC). In addition, the
points to note during the programming is also introduced.
A normal step, numbered as Sn. The “n” must not repeat. The S element
Normal step
range for the normal step is S20--S991
A transfer. It can be built-in with a transfer condition (embeded LAD). You can
compile the transfer condition so that the S element connected with this
Transfer
transfer will be set when the condition is met and enter the next step. The
transfer must be used between steps.
A jump, used after the transfer. It can set the specified S element to ON when
Jump
the transfer conditions are met. It is used to cycle or jump among steps
A reset, used after the transfer. It can set the specified S element to OFF
Reset
when the transfer conditions are met. It is used to end the SFC program
Multiple independent transfer conditions, used after a step. When the transfer
condition of one branch is met, the last step will end and the next step of the
Selection branch
corresponding branch will start. After that, no other parallel branch will be
selected
Connected after a step, the parallel branches share the same transfer
Parallel branch conditions. When the transfer conditions are met, the parallel branches are
validated and executed at the same time
A merge of parallel branches. The next step will start only after all the parallel
Parallel merge
steps are finished and the transfer conditions are met
The LAD block presents LAD instructions for operations besides the SFC
Ladder chart block
flow, such as starting the initial step and other general operations
In a simple structured SFC program, when the step transfer conditions are met, the program will run from the current step to the
next step in a linear flow. At the last step, when the transfer conditions are met, the SFC program section will exit end or
transfer to the initial step.
1. Ladder chart block
The ladder chart block is used to start SFC program section. To be specific, to set the S element of the initial step to ON. In the
preceding figure, the program uses the power-on startup mode.
The ladder chart block can also be used as other general program sections besides the SFC program.
2. Initial step
As shown in 错误!未找到引用源。, the initial step is started by a ladder chart block. The range of S elements for initial-step is
0~19.
3. Normal step
The normal step is the main component of the program. The range of S elements for normal-step is 20~991 (for IVC2L series)
or 20~1023 (for IVC1 series).
4. Transfer or reset
The program shown in 错误!未找到引用源。 is ended with a jump, which leads the program to the initial step. This is a cyclic
program.
However, the program can also be ended with a reset, which can reset the status of the last step, end a program, and wait for
the next round of execution.
Selection branch structure
The selection branch structure is shown in the following figure, with LAD on the left and SFC on the right.
1. Selection branch
A branch step is validated when its corresponding transfer conditions are met. You must ensure that the transfer conditions of
different branches are all exclusive, so as to make sure that each time only one branch will be selected. As shown in the
preceding figure, steps S27 and S28 in row N12 of LAD program are transferred from conditions M20 and M21 respectively.
The conditions M20 and M21 must not be met at the same time in order to ensure that S27 and S28 will not be selected at the
same time.
Programming manual of IVC series small PLC Chapter 7 SFC tutor 239
2. Selection merge
The selection merge is the structure where all selection branches merge to the same step. The transfer conditions are set
respectively. As shown in the preceding figure, the transfer condition in the branch of S27 is that time is up for T12, while that
for the branch of S28 is that time is up for T13. However, the results are the same: step S29 starts.
Parallel branch structure
The parallel branch structure is shown in the following figure, with LAD on the left and SFC on the right.
1. Parallel branch
When the transfer conditions are met for the parallel branches, all branch steps will be validated at the same time. This enables
the PLC to process multiple procedures at the same time, a quite usual sequential control process. As shown in the preceding
figure, in program row N5, the steps S30 and S31 will be validated at the same time when condition M30 is met.
2. Parallel merge
The parallel merge is the structure where all parallel branches merge to the same step by invalidating all branch steps at the
same time. As shown in the preceding figure, in program row N6, when the program is running both S30 and S31 at the same
time, if condition M31 is met, the program will start S32 and end S30&S31.
The sequential control behind the parallel merge structure is that no next step can be executed unless all the parallel steps are
finished.
Jump structure
The applications of jumps include: to omit certain steps, to recycle by returning to the initial step or a normal step, and to jump
to another independent procedure.
1. Omitting certain steps
In a procedure, when certain steps are unnecessary under certain conditions, the program can jump directly to the needed step
and omit the unnecessary steps, as shown in the following figure, with LAD on and left and SFC on the right.
In the SFC program shown in the preceding figure, S21 is used as the jump, while step S20 is omitted. The jump is actually a
selection branch.
While in the LAD counterpart, the second branch in row N0 is the jump instruction, which uses the OUT coil instead of the SET
instruction in the transfer. When step S0 is valid, and if M1 is ON, the program will jump to step S21.
2. Recycling
In a procedure, when it is necessary to recycle a part or all of the steps under certain conditions, you can use the jump function.
you can recycle a part of the steps if you jump to a previous normal step, or all the step if you jump to the initial step.
Shown in the following figure is a program that can realize the above two recycles, with LAD on the left and SFC on the right.
Programming manual of IVC series small PLC Chapter 7 SFC tutor 240
In the SFC, when step S22 is valid, the program may jump to step S21 to recycle S21 and S22, or jump to the initial step S0 to
recycle all the steps. Which recycle will be selected is determined by a selection branch structure.
While in the LAD, the two kinds of jumps are realized in row N3, where you can see the OUT coil.
3. Jumping to another independent procedure
The SFC of IVC series PLC supports multiple independent procedures and jumping among these procedures is allowed. You
can set certain transfer conditions in an independent procedure for jumping to a random step (initial or normal) of another
independent procedure.
Note
Jumping among multiple independent procedures complicates the program. Use it with prudence.
Shown in the following figure is a jump from one independent procedure to another, with LAD on the left and SFC on the right.
In the SFC, when the S0 in the first procedure is valid, the program can jump to step S23 in the second procedure under certain
conditions; while in the second procedure, the program can also jump to step S20 in the first procedure under certain
conditions.
As shown in the preceding figure, the jump is based on a selection branch structure. When the program jumps to another
procedure, all the steps in the original procedure will become invalid. As the example shows, if the program jumps to step S23
in the second procedure from step S20 in the first procedure, step S20 and all the other steps in the first procedure will become
invalid.
On the other hand, their difference lies in that in a SFC program, the steps’ validity will change according to certain conditions,
and only valid steps can be executed. While in a LAD main program, the whole program will be scanned and executed in each
scan cycle.
As shown in the following figure, the program on the right is the LAD counterpart of the SFC program on the left. When step
S20 is valid, the T2 timer will be scanned and start timing. Steps S21 and S22 will not be executed before T2 counter reaches
the preset value, and S23 will not be executed when M13 is OFF.
The S elements state will switch between ON and OFF according to the transfer conditions, thus making the program transfer
from one step to another. When a S element changes from ON to OFF, the output elements of the corresponding step will be
cleared or reset. For details, see 错误!未找到引用源。错误!未找到引用源。.
Note
1. The SFC program of IVC series PLC usually contains LAD program blocks that are used to handle operations besides the
flow, including starting the SFC. The LAD program blocks are not controlled by the S elements and will be executed in every
scan cycle.
2. Because the state change of the S element will affect the embedded instructions of the corresponding step, and the
switch-over between two steps takes some time, it is necessary to observe certain rules during the SFC programming. For
details, see 7.4Points to note in SFC programming.
As shown in the LAD program, the S2 step starts with a STL instruction, and the following TON instruction is the internal
instruction of S2. A step can be made up of multiple instructions. A SFC step is actually a relatively complete program section,
almost consistent with the LAD counterpart.
The difference between an initial step and a normal step is that they use different S elements.
For detailed information about the STL instruction, see 错误!未找到引用源。错误!未找到引用源。. Note that when the step
changes from ON to OFF, the destination operands of its internal instructions will be cleared. Such instructions include OUT,
TON, TOF, PWM, HCNT, PLSY, PLSR, DHSCS, SPD, DHSCI, DHSCR, DHSZ, DHST, DHSP and BOUT.
Note
Because the PLC runs in continuous scan cycles, after a step transition, the instructions of the original step will not be affected
by the change of ON to OFF until the next scan cycle. See 7.4.1Common programming errors.
See 错误!未找到引用源。 in 7.1.5SFC program structure for the LAD counterpart of SFC selection branches.
See 错误!未找到引用源。in 7.1.5SFC program structure for the LAD counterpart of SFC parallel branches.
2. Determine the major procedures and transfer conditions to draw a draft flow chart
After determining the strucuture, you need to figure out the major procedures and transfer conditions. By deviding the work flow
into smaller operation stages, you can get the procedures. End each procedure with a transfer condition, and you can get the
draft of the work flow.
4. Make a list of input and output points, and determine the objects of each procedure and the transfer conditions
Generally, the input points are transfer conditions, while the output points are the operation objects. In addition, with the list, you
can further modify the SFC.
Note
The start and stop operations are crucial for personal and equipment safety. Considering the special features of SFC program,
make sure that all outputs that should be stopped are shut down when the PLC is stopped.
1. Reusing steps
In the same PLC program, each step corresponds to a unique S element and cannot be reused.
Note this when editing a SFC program using the LAD editor.
As shown in the following figure, the two neighboring steps use the same timer: T2. When the S0-S20 transfer occurs, the T2
will retain its value and state, rendering the step S20 unable to perform as it is designed. The program will jump directly to S21
and S22. Therefore, it should be noted that, although reusing elements in a program is not prohibited, you should avoid reusing
them in neighboring steps, or accidents may occur.
Therefore, you need to add an interlock to the program by adding a Y0 NC contact before the Y1 output coil, as shown in the
following figure.
Programming manual of IVC series small PLC Chapter 7 SFC tutor 245
Flow 1 Flow 2
Modify
Empty step
Flow 1 cannot end due to the
parallel structure.
As shown in the right part, to correct it, you need to add a step S42 whose function is the same as S41. Then add an empty
step S43 that serves as a structural block without actual function. Design the transfer conditions for S38, S41 and S43
according to the actual situation.
Modify
Inexecutable
parallel structure Add an empty step
Programming manual of IVC series small PLC Chapter 7 SFC tutor 246
In the left figure below, the selection merge is connected immediately with a parallel branch structure. That is prohibited too.
You can also change it as the right figure shows: add an empty step.
Modify
You can address other structures, such as parallel merge connected with parallel branches, or parallel branches connected
with selection branches, by adding an empty step.
Mergeable conditions
Merge the mergeable
conditions
Modify
Height OK In lift 2
After the machine is started, the object tray will be conveyed to the entrance of the machine at the left side and trigger the “Tray
in” limit switch. If no other tray is occupying the machine, the “Baffle plate” will lower down to let the object tray enter the
machine. When the tray is completely into the lift when it triggers the “In lift 1” limit switch, the lift will raise the tray until the
“Height OK” limit switch is triggered. The rollers will then act to convey the tray to the lift on the right side until the “In lift 2” limit
switch is triggered. The lift will then lower to put the tray to the conveying belt on the right. When the “Convey complete” limit
switch is reset, a complete lift and convey process is over and the machine is ready for the next round.
The input and output points are listed in the following table.
SN Address Monitored object SN Address Monitored object
1 X0 Tray in limit switch 8 Y0 Cylinder solenoid valve for the baffle plate
2 X1 In lift 1 limit switch 9 Y1 Cylinder solenoid valve for the left lift
3 X2 Height OK limit switch 10 Y2 Cylinder solenoid valve for the right lift
4 X3 In lift 2 limit switch 11 Y3 Roller motor contactor
5 X4 Convey complete 12 Y4 Motor contactor for the left conveying belt
6 X5 Start switch 13 Y5 Motor contactor for the right conveying belt
7 X6 Auxiliary signal of emergency switch
This is a simple sequential flow. The procedures are linear, without any selection or parallel procedures. Writing the program
with SFC would be faster and clearer than the conventional logic design method.
See the following figure for the SFC program and its LAD counterpart.
Start & stop control program section
A minor
ingredient pipe
Deionized water B minor ingredient pipe
Major ingredient pipe
Y0 valve Y2 valve
Y1 major ingredient valve
Mixing pot
Stirring paddle
Y4 evacuation valve
To start the operation, the operator should select through the touch screen the product type, A or B, for the next batch of
product. As the second step, the major ingredient wil be added until the added ingredient reaches 2000kg. As the third step,
minor ingredient, A for type A product or B for type B product, will be added until the added minor ingredient reaches 500kg. As
the forth step, the ingredients will be mixed round for 20 minutes. As the fifth step, the material will be evacuated until the left
material is less than 20kg and the delay is over. Then the machine is ready for the next round.
If the machine is brand new, or the product type produced last time is different from what is going to be produced, you need to
open the deionized water valve and evacuation valve to rinse the machine for 5 minutes before the operation.
The input and output points are listed in the following table.
SN Address Monitored object SN Address Monitored object
1 X0 Deionized water valve open 10 X11 Evacuation valve open
2 X1 Deionized water valve closed 11 X12 Evacuation valve closed
3 X2 Major ingredient valve open 12 Y0 Solenoid valve for deionized water
4 X3 Major ingredient valve closed 13 Y1 Solenoid valve for major ingredient
5 X4 Minor ingredient A valve open 14 Y2 Solenoid valve for minor ingredient A
6 X5 Minor ingredient A valve closed 15 Y3 Solenoid valve for minor ingredient B
7 X6 Minor ingredient B valve open 16 Y4 Solenoid valve for evacuation
8 X7 Minor ingredient B valve closed 17 Y5 Mixing motor contactor
9 X10 Mixing motor running
Obviously this is a selection branch structured flow. You can select only one type of product , A or B, in a round. Meanwhile, the
flow has a selection and jump structure: the rinsing procedure.
The following figures are the corresponding SFC program and its LAD counterpart.
Programming manual of IVC series small PLC Chapter 7 SFC tutor 250
Time (20min) is up
The evacuation step
Evacuation complete
Mark the product type this time
for the next round
Capping cylinder
Labelling cylinder Eliminating cylinder
rod OUT X7
rod OUT X6 rod OUT X5
Cap
Rotary plate of
packing machine
ac of
e
hin
m ate
in pl
ck ry
pa ota
g
pla tion
R
Entrance of
ary rec
rotary plate
rot di
limit switch X0
El lind
of ing
im e
cy
nn
in r Y
at 3
Ru
in
g
Rotatary plate
Cap in position motor Y0
detection switch X2 Labelling Exit of disqualified
switc tection
cylinder Y2 products
h X3
l de
Bottle in position
Ca
Labe
p detection switch X1
pi
ng
cy
lind
er
Y1
During the operation, the rotary plate rotates one step each time, which is detected by the X0 limit switch. The rotary plate will
stay at each step long enough for all the three procedures, driven by cylinders, are finished. The cylinder rod OUT signal and
cylinder rod BACK signal are monitored respectively.
The input and output points arel isted in the following table.
SN Address Monitored object SN Address Monitored object
1 X0 Rotary plate step limit switch 8 X10 Capping cylinder rod BACK
2 X1 Bottle in position detection switch 9 X11 Labelling cylinder rod BACK
3 X2 Cap in position detection switch 10 X12 Eliminatiing cylinder rod BACK
4 X3 Label detection switch 11 Y0 Rotary plate motor
5 X5 Eliminating cylinder rod OUT 12 Y1 Capping cylinder
6 X6 Labelling cylinder rod OUT 13 Y2 Labelling cylinder
7 X7 Capping cylinder rod OUT 14 Y3 Eliminating cylinder
It is obvious that this is a parallel branch structured flow. With every step that the rotary plate makes, all the tree procedures are
carried out at the same time. Then, when the three procedures are finished, the rotary plate will rotate one step again. See the
following figure for the corresponding SFC program and its LAD counterpart.
In the program, M1~M3 are the qualification flags for the procedures of capping, labeling and eliminating respectively.
When the capping procedure runs to S22, X2 will check whether the capping is qualified or not. If yes, the corresponding
qualification flag M1 will be set. When the labelling procedure runs to S25, X3 will check whether the labelling is qualified or not.
If not, M2 will be reset. After all the procedures are complete, at step S29, the M2 state will be transferred to M3, and M1 state
will be transferred to M2.
The capping procedure will act according to X1 state. If X1 indicates no bottle is in position, the capping will not proceed. The
labelling procedure will act according to M2 state. If M2 is OFF, it indicates that the bottle in position is disqualified, and the
Programming manual of IVC series small PLC Chapter 7 SFC tutor 253
labelling will not proceed. The eliminating procedure will act according to M3. The elimination will not be conducted when M3 is
ON, which indicates that the bottle is qualified, or the elimination will be conducted otherwise. In both cases, M3 will be reset in
S32 to prepare for the next procedure.
Start & stop control program section
When a X0 rising edge is detected The labelling procedures The eliminating procedures
Transfer conditions
Parallel merge
Transfer the
qualification flag
states from M1 to M2
and from M2 to M3
Programming manual of IVC series small PLC Chapter 7 SFC tutor 254
Programming manual of IVC series small PLC Chapter 7 SFC tutor 255
Programming manual of IVC series small PLC Chapter 8 Using high-speed input functions 256
This chapter presents the usage and notes about the high-speed input functions, including high-speed counter and external
pulse capture function.
8.1.1 Configuration
The built-in high-speed counter for IVC series small PLCs are configured as follows:
Table 8-1 High-speed counter configuration
Max. frequency(kHz)
Input point
X0 X1 X2 X3 X4 X5 X6 X7 IVC1
Counter IVC2H IVC2L IVC1
L
C236 Up/down
50
C237 Up/down
C238 Up/down
Single C239 Up/down
10
phase C240 Up/down
single C241 Up/down
100
point C301 Up/down
/
input C302 Up/down
mode C242 Up/down Reset
C243 Up/down Reset
10
C244 Up/down Reset Start
C245 Up/down Reset Start
Single C246 Up Down 50
phase C247 Up Down Reset 10
up/ C303 Up Down /
100
down C248 Up Down Reset
input C249 Up Down Reset Start 10
mode C250 Up Down Reset Start
C251 Ph A Ph B 30
C304 Ph A Ph B
Double C305 Ph A Ph B /
phase C306 Ph A Ph B
50
input C252 Ph A Ph B Reset
mode C253 Ph A Ph B Reset
5
C254 Ph A Ph B Reset Start
C255 Ph A Ph B Reset Start
Input Input Input Input Input Input Input Input
SPD instruction 100 10
point point point point point point point point
Input Input Input Input Input Input Input Input
Pulse capture function / /
point point point point point point point point
External interrupt No.
0/10 1/11 2/12 3/13 4/14 5/15 6/16 7/17 / /
(rising/falling edge)
In the modes listed in the preceding table, the high-speed counters will act according to certain input and handle high-speed
action according to interrupts. The counting practice is unrelated to the PLC scan cycle.
All the high-speed counters are of the 32-bit up/down type. According to their different up/down switchover methods, they fall
into the following four categories:
Counting method Action
Single phase single point C236~C245 and C301~C302 are down counters when SM236~SM245 and SM301~SM302 are ON, and
input up counters when SM236~SM245 and SM301~SM302 are OFF
Programming manual of IVC series small PLC Chapter 8 Using high-speed input functions 257
ON
B
OFF
When SM100~SM104 are set ON, C251~C255 C304~C306 will conduct fourfold frequency up/down
counting according to double phase input. SM251~SM255 and SM304~SM306 determine the current
direction of corresponding counters, up input when SM elements are OFF and down input when SM
elements are ON
The counting directions are shown as follows:
+1 +1 +1 +1 -1 -1 -1 -1
Double phase fourfold
frequency input ON
A
OFF
ON
B
OFF
+1 +1 +1 +1 -1 -1 -1 -1
Special auxiliary relay for controlling counting direction Special auxiliary relay for controlling fourfold frequency
Type Counter SN Up/down control Fourfold frequency
Type Counter SN
C236 SM236 control
C237 SM237 C251 SM100
C238 SM238 C252 SM100
C239 SM239 C253 SM102
C240 SM240 Double phase C254 SM100
Single phase C241 SM241 input C255 SM102
single point input C242 SM242 C304 SM101
C243 SM243 C305 SM103
C244 SM244 C306 SM104
C245 SM245
C301 SM301
C302 SM302
Type Counter SN Up/down monitor
Special auxiliary relay for monitoring counting direction
C304 SM304
Type Counter SN Up/down monitor
C305 SM305
C246 SM246
C306 SM306
C247 SM247
Single phase C248 SM248
up/down input C249 SM249
C250 SM250
C303 SM303
C251 SM251
C252 SM252
Double phase
C253 SM253
input
C254 SM254
C255 SM255
Programming manual of IVC series small PLC Chapter 8 Using high-speed input functions 258
The time sequence chart of the contacts action in the program is shown in the following figure:
X11 & X6 are ON, C244 starts to count.
X10 is ON, C244 is cleared
X12 & SM244 are OFF, C244 counts up.
X12 & SM244 are ON, C244 counts down
C244 counts 3, and C244 contact state changes
When X11 & X6 are ON, and X2 changes to ON,
C244 data and contact are cleared
X12
SM244
X2
X11
X6
X10
X0
5
4 4
3 3 3
2 2
1 1
C244 0 0 0
-1
-2
-3
-4 -4
-5
C244 contact
Note:
1. Counter input point: X0.
2. High speed counters, when used in instructions DHSCS, DHSCR, DHSZ, DHSP and DHST,
can trigger operations free from the scan cycle.
The time sequence chart of the contacts action in the program is shown in the following figure:
X10 is ON, C250 is cleared regardless of X11 and X7
X11 & X7: ON, C250 starts to count. X3 changes from OFF to ON
C250 counts up. SM250 is not being driven
C250 value reaches 3, C250 contact changes X11 & X7: ON. If X5 is ON, C250 is
cleared, and the contact is reset
X4 changes from OFF to ON, C250
X5 counts down. SM250 is being driven
X11
X7
X10
X3
X4
SM250
5
4 4
3 3 3
2 2
C250 1 1
0 0 0
-1
-2
-3
-4 -4
-5
C250 contact
Note:
1. Counter input points: X3 & X4.
2. High speed counters, when used in instructions DHSCS, DHSCR, DHSZ, DHSP and DHST,
can trigger operations free from the scan cycle.
The time sequence chart of the contacts action in the program is shown in the following figure:
X11
X6
X10
X0
X1
SM254
5
4 4
3 3 3
2 2
C254 1 1
0 0 0
-1
-2
-3
-4 -4
-5
C254 contact
Note:
1. Counter input points: X0 & X1.
2. High-speed counters, when used in instructions DHSCS, DHSCR, DHSZ, DHSP and DHST,
can trigger operations free from the scan cycle.
The time sequence chart of the contacts action in the program is shown in the following figure:
X11
X6
X10
X0
X1
SM254
5
4 4
3 3 3
2 2
C254 1 1
0 0 0
-1
-2
-3
-4 -4
-5
C254 contact
Note:
1. Counter input points: X0 & X1.
2. High-speed counters, when used in instructions DHSCS, DHSCR, DHSZ, DHSP and DHST,
can trigger operations free from the scan cycle.
8.1.4 Points to note about high-speed counters in IVC2L and IVC1 series
Classification
C236, C237, C246 and C251 can be used as both hardware counters and software counters, depending on the modes in which
they are used. All the other high-speed counters are software counters.
Maximum combined frequency
1. The maximum combined frequency, or the sum of frequencies of all signals input at any time, should not exceed 80kHz on
the following two occasions:
When multiple high-speed counters (hardware counting mode) are used simultaneously.
When the high-speed counters (hardware counting mode) and the SPD instruction are used at the same time.
2. The maximum combined frequency when multiple software high-speed counters, or when high-speed counters and the SPD
instruction are used at the same time, is shown in the following table:
Conditions Maximum combined frequency
Instructions DHSCS, DHSCR, DHSCI, DHSZ, DHSP and DHST are not
≤80kHz
used
Instructions DHSCS, DHSCR, DHSCI, DHSP and DHST are used ≤30kHz
Instruction DHSZ is used ≤20kHz
Note
1. When the output input point changes from OFF to ON, the SM element of the corresponding terminal will be set to ON.
2. SM90~SM97 will be cleared when the user program starts.
3. When using pulse capture, satisfy the maximum combined frequency of PLC series or abnormalities may occur.
4. If high-speed counters or SPD instructions are used on the same input point, the pulse capture function will become invalid
after the first scan cycle, regardless of the validity of the instructions.
This chapter details the mechanism, processing procedures and usage of various interrupts.
Event Event
Interrupt event Enabling SM Interrupt event Enabling SM
No. No.
Interpolation completion interrupt 3
21 High-speed counter interrupt 1 SM65 52 SM79
(Y6,Y7)
High-speed output passed position
22 High-speed counter interrupt 2 SM65 53 SM61
interrupt 1
High-speed output passed position
23 High-speed counter interrupt 3 SM65 54 SM62
interrupt 2
High-speed output passed position
24 High-speed counter interrupt 4 SM65 55 SM105
interrupt 3
High-speed output passed position
25 High-speed counter interrupt 5 SM65 56 SM106
interrupt 4
Setting: SD66 High-speed output passed position
26 Timer interrupt 0 57 SM107
Enabling: SM66 interrupt 5
Setting: SD67 High-speed output passed position
27 Timer interrupt 1 58 SM108
Enabling: SM67 interrupt 6
Note
1. The interrupts should be brief, or abnormalities may occur, including the mask of other interrupt events (missing of interrupt
requests), system scan overtime and low execution efficiency of main program.
2. It is prohibited to call other subprograms in the interrupt program.
3. If you want to refresh I/O immediately during the interrupt, use the REF instruction. Note that the execution time of REF is
related to the number of the I/Os to be refreshed.
4. An interrupt event can generate an interrupt request only when the corresponding interrupt event is enabled (which requires
setting the corresponding SM element ON), and the global interrupt enable flag shall be on.
5. When an interrupt request with no corresponding interrupt program in the user program is generated, the request will be
responded to, but the response is empty.
The timer interrupt program is applicable to the situation that requires timing and immediate processing by the system, such as
the timing sampling of analog signals, and timing updating analog output according to certain waveform.
You can set the intervals (unit: ms) for the timer interrupts by setting the corresponding SD elements. The system will generate
the interrupt event when the set time interval is reached (recommended minimum interval: > 4ms).
The ON/OFF status of certain SM elements can enable/disable the corresponding timer interrupts.
The system provides 3 kinds of timer interrupt resources.
Table 9-1 Timer interrupt resource list
Timer interrupt Interrupt event No. Intervals of timer interrupt (SD) Enable control (SM)
0 26 SD66 SM66
1 27 SD67 SM67
2 28 SD68 SM68
Note
1. Setting of enable control elements cannot affect the exection of the timed interrupts in the interrupt request queue.
2. The timing for a re-enabled interrupt will start from zero.
To change the interval of the timer interrupt when the program is running, it is recommended to follow the following procedures:
disable the timer interrupt, change the interval and enable the timer interrupt.
Example
This example uses timer interrupt 0 to flip the Y0 output once a second, which makes Y0 flash.
1. Compile an interrupt program for the interrupt event.
3. Set the interval for the timer interrupt and enable the timer interrupt in the main program.
Programming manual of IVC series small PLC Chapter 9 Using interrupts 267
2. Write EI instruction in the main program, and set SM40, the interrupt enabling flag of X0 input rising edge interrupt, valid.
2. Write EI instruction in the main program, and set SM65, the interrupt enabling flag of high-speed counter interrupt, valid.
Drive the high-speed counter C236 and high-speed counter interrupt instruction.
2. Code function in main program: Enable the global interrupt of the system and the enable flag SM63 of PTO output interrupt.
Use PLS instruction.
Set the ON/OFF status of SM component and the serial port interrupt can be enabled or disabled. When the serial port interrupt
is disabled, the ones that have been added to the interrupt queue will continue to be executed.
Do not call the XMT instruction of serial port in the processing subprogram of character sending interrupt when the power flow
is normally on. Otherwise, it may lead to interrupt subprogram nesting which blocks the execution of user program.
Interrupt of frame receiving and sending refers to the interrupt event that is delivered after the XMT and RCV instructions of the
serial port are executed.
Serial port interrupt resource list:
Event No. Corresponding interrupt event Interrupt enabling SM
30 Character sending interrupt of communication port 0 SM48
31 Character receiving interrupt of communication port 0 SM49
32 Frame sending interrupt of communication port 0 SM50
33 Frame receiving interrupt of communication port 0 SM51
34 Character sending interrupt of communication port 1 SM52
35 Character receiving interrupt of communication port 1 SM53
36 Frame sending interrupt of communication port 1 SM54
37 Frame receiving interrupt of communication port 1 SM55
8 Character sending interrupt of communication port 2 SM59
9 Character receiving interrupt of communication port 2 SM60
38 Frame sending interrupt of communication port 2 SM57
39 Frame receiving interrupt of communication port 2 SM58
Example
In the example, with the sending interrupt function of serial port frame, the system will flip Y3 output once when a frame is sent
out and generate flashing effect based on the frequency of the character sending frame.
1. Compile interrupt program and the processing code when the serial port sending frame is completed and the interrupt is
triggered.
3. Compile the code of the sending frame interrupt of enable serial port in the main program.
For the detailed example of serial port interrupt, please refer to Chapter 10 Using communication function.
This chapter introduces the communication function of IVC series small PLC, including the communication resources and
communication protocols, and uses examples to illustrate.
10.3.1 Introduction
The free port protocol is a communication mode with user-defined data file format. It supports two data formats: ASCII&binary.
The free port protocol realizes data communication through instructions and can only be used when PLC is in RUN state.
The free port communication instructions include XMT (sending instruction) and RCV (receiving instruction).
10.4.1 Introduction
For the serial port communication of IVC series small PLC, Modbus communication protocol is available. Two communication
modes: ASCII and RTU (IVC1 only supports RTU mode) are supported. The PLC can be set as the master or slave station.
Protocol Available
Element Type Physical element Remark
address function code
SD256~SD511 12000-12255
Z Word Z0~Z15 8500~8515 03, 06, 16
T0~T255 9000~9255
T Word 03, 06, 16 Current value of T element
T256~T511 11000-11255
C Word C0~C199 9500~9699 03, 06, 16 Current value of C element (WORD)
Double
C C200~C255 9700~9811 03, 16 Current value of C element (DWORD)
word
Double
C C256~C306 10000-10101 03, 16 Current value of C element (DWORD)
word
R Word R0~R32767 13000-45767 03, 06, 16
Note:
The protocol address is the address used on data transfer and corresponds with the logic address of Modicon data. The protocol
address starts from 0 and the logic address of Modicon data begins with 1, that is, protocol address+1=logic address of Modicon
data. For example, if M0 protocol address is 2000, and its corresponding logic address of Modicon data will be 0:2001. In practice,
the read and write of M0 is completed through the protocol address, e.g.: read M0 element frame (sent from the master station):
01 01 07 D0 00 01 FD 47
CRC check code
Number of elements to read
Starting address. The decimal value of 07D0 is 2000
Function code
Station No.
The slave station responds with illegal function code. 04 is not supported by IVC2L.
Note
1. Element X does not support write operation (that is, the write of element X is invalid). For the writable properties of elements
SM and SD, refer to Appendix 1Special auxiliary relay and Appendix 2Special data register (if the element is un-writable, the
write operation is invalid).
2. The address of the slave station is 01, the last two bytes are CRC check code and the second byte is function code.
In the returned data, 9700 and 9701 are two addresses for the content of C200. 9700 is the high 16 bits and 9701 is the low 16
bits.
When reading the double word, if the starting address read is not even number, then the system will respond with error code of
illegal address; if the read number of registers is not an even number, the system will respond with error code of illegal data.
For example:
XMT from master station: 01 03 25 E5 00 04 5E F2
The starting address for the reading of master station : 4 word elements of 25 E5 (decimal 9701)
Response of slave station: 01 83 02 C0 F1
Response of slave station: illegal data address
XTM from slave station: 01 03 25 E4 00 05 CE F2
The starting address for master station read: 5 word elements of 25 E5
Response of slave station: 01 83 03 01 31
The data sent back from slave station is illegal.
Note
Read station is equipped with compulsory element. What is read is the value run by the program, which may be inconsistent
with the compulsory value.
42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27
X X X 0 0 1 1 0 0 0 0 1 0 1 1 0
D106 D105
26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11
1 1 0 0 0 1 1 0 1 1 1 0 0 0 0 1
D104 D103
If the read number of the registers is not the times of 8, add 0 to the high bits. In the above example, it has added 0 to 3 high
bits (40, 41 and 42) in D106.
Note
1. When logic address is used for addressing the bit element of IVC2L PLC, the logic address 1 is the protocol address 0. In the
above example, reading the value of 11~39 bits (protocol address) in the slave station, the logic address shall start from 12.
2. The failure of this communication will not affect the next communication, that is, if there are two Modbus XMT instructions in
one user program, the first communication fails and has error code, it will not influence the data sending of the second Modbus
instruction. Thus, in the example, we placed the error code of SD139 in D202, which can be observed through D202.
3. For the message sending of the slave station, if the master station is in listen-only mode, there will be no data to be returned
and the system will display error flag. Therefore, when using Modbus of IVC2L, if IVC2L is the master station, the user shall
clearly know which PLC slave station is under listen-only mode, so as to ensure that the failure of the communication is not
caused by the listen-only mode of the slave station.
Example 2: IVC2L is the Modbus master station, the slave station is also an IVC2L. Read the status of bit elements (protocol
address: 2000~2017) in No.5 station.
The read data are as follows:
The received frame starts from D100.
D100 is for saving address
D101 is for saving function code
D102 is for saving the number of registers
Units beginning with D103 are for saving the read value of bit element
Programming manual of IVC series small PLC Chapter 10 Using communication function 283
Example 3: IVC2L is the Modbus master station as well as the slave station. Read the status of the bit element with the protocol
address ranging from 40 to 43 of No.5 station.
The read data are as follows:
The received frame starts from D100.
D100 is for saving address
D101 is for saving function code
D102 is for saving the number of registers
Units beginning with D103 are for saving the read value of bit element
40 element 40 element 41 element 41 element 42 element 42 element 43 element 43 element
MSB LSB MSB LSB MSB LSB MSB LSB
D103 D104 D105 D106 D107 D108 D109 D110
10.5.1 Introduction
N:N bus is a small PLC network developed by INVT Auto-Control Technology Co., Ltd. The physical layer of N:N bus uses
RS485, so the PLC can be directly connected through communication port 1 or connected through communication port 0 by
RS232/RS485 converter. The connected PLC of N:N bus can automatically exchange the values between D elements and M
elements , which makes the access to the other PLC elements on the network as convenient as accessing its own element. In
N:N bus, the data access between PLCs is completely equivalent (N:N communication network).
It is convenient to configure N:N bus. Most parameters of N:N bus only need to be configured on No.0 PLC. In addition, N:N
bus supports online modification of the network parameters, and is able to detect the newly added PLC automatically. If any
PLC is disconnected from the network, the other PLCs will continue to exchange the data. It is also able to monitor the
communication status of the whole network through the relevant SM element of any PLC in N:N bus.
Token
1#data 1#data 1#data
Token
2 #data 2#data
Slave station (2#) Slave station (3#) Slave station (N#)
RS 485
RS485
Master station sends token to 3#slave station
3#data
Master station (1#)
Figure 10-6 shows the sequence in which the token flows. The bold solid lines indicate the process of sending the token and
the dotted lines indicate the sequence of holding the token and broadcasting. It is necessary to note that the token is not sent
from one slave station (2#PLC) to another slave station (3#PLC) but from the master station to 2#PLC and then the master
station to 3#PLC.
...
RS 485
...
RS 485
RS485/232 converter
(Connecting node)
...
RS 485
In the single-layer network, each PLC only connects to N:N bus through 1 communication port. In the multiple-layer network,
the layer-to-layer PLC (intermediate node) shall be connected, and the two communication ports of PLC shall be connected to
different layers. The single-layer network can support up to 32 PLCs , while each layer of multiple-layer network can support 16
PLCs at most.
PLC uses N:N bus, the value of the Elements Sharing Area will keep refreshing automatically, so as to keep the value
consistency of the Elements Sharing Area for each PLC in the network.
0#SND area (W) 0# RCV area (R) 0# RCV area (R) 0# RCV area (R)
1#RCV area (R) 1#SND area (W) 1# RCV area (R) 1# RCV area (R)
2# RCV area (R) 2# RCV area (R) 2#SND area (W) 2# RCV area (R)
3# RCV area (R) 3# RCV area (R) 3# RCV area (R) 3# RCV area (R)
4# RCV area (R) 4# RCV area (R) 4# RCV area (R) 4# RCV area (R)
5# RCV area (R) 5# RCV area (R) 5# RCV area (R) 5# RCV area (R) Note:
6# RCV area (R) 6# RCV area (R) 6# RCV area (R) 6# RCV area (R) SND area: sending area
RCV area: receiving area
7# RCV area (R) 7# RCV area (R) 7# RCV area (R) 7# SND area (W) W: write
R: read
As shown in the above figure, each PLC with N:N bus connected has a writable sending area in the Elements Sharing Area.
N:N bus will automatically send the information (values of designated elements D and M) of the writable sending area to other
PLCs, receive the information from other PLCs and save it to the read-only sending area.
The element number in the Elements Sharing Area is fixed (64 D elements and 512 M elements can be shared) and these
elements are distributed to more than one PLC. Therefore, the less PLCs are connected to the network, the more elements can
be distributed to each PLC. The relationship is defined by N:N bus refresh mode:
Distribution of D element on N:N bus single-layer network:
Distribution of D element
Mode 1 Mode 2 Mode 3 Mode 4 Mode 5
in sending area
D7700~D7701 #0
#0
D7702~D7703 #1
#0
D7704~D7705 #2
#1
D7706~D7707 #3
#0
D7708~D7709 #4
#2
D7710~D7711 #5
#1
D7712~D7713 #6
#3
D7714~D7715 #7
#0
D7716~D7717 #8
#4
D7718~D7719 #9
#2
D7720~D7721 #10
#5
D7722~D7723 #11
#1
D7724~D7725 #12
#6
D7726~D7727 #13
#3
D7728~D7729 #14
#7
D7730~D7731 #15
D7732~D7733 #16
#8
D7734~D7735 #17
#4
D7736~D7737 #18
#9
D7738~D7739 #19
#2
D7740~D7741 #20
#10
D7742~D7743 #21
#5
D7744~D7745 #22
#11
D7746~D7747 #23
#1
D7748~D7749 #24
#12
D7750~D7751 #25
#6
D7752~D7753 #26
#13
D7754~D7755 #27
#3
D7756~D7757 #28
#14
D7758~D7759 #29
#7
D7760~D7761 #30
#15
D7762~D7763 #31
Explanation:
1) In mode 1, the D elements distributed to the sending area by 0# station are D7700 and D7701. D7700 and D7701 can be
written by the PLC of 0# station, and directly read by other stations (1#--31#).
Programming manual of IVC series small PLC Chapter 10 Using communication function 287
2) In mode 2, the D elements distributed to the sending area by 0# station are D7700, D7701, D7701 and D7703. The elements
can be written by the PLC of 0# station and directly read by other stations (1#--15#).
Distribution of M element on N:N bus single-layer network:
Distribution of M element
Mode 1 Mode 2 Mode 3 Mode 4 Mode 5
in sending area
M1400~M1415 #0
#0
M1416~M1431 #1
#0
M1432~M1447 #2
#1
M1448~M1463 #3
#0
M1464~M1479 #4
#2
M1480~M1495 #5
#1 #0
M1496~M1511 #6
#3
M1512~M1527 #7
M1528~M1543 #8
#4
M1544~M1559 #9
#2
M1560~M1575 #10
#5
M1576~M1591 #11
#1
M1592~M1607 #12
#6
M1608~M1623 #13
#3 #0
M1624~M1639 #14
#7
M1640~M1655 #15
M1656~M1671 #16
#8
M1672~M1687 #17
#4
M1688~M1703 #18
#9
M1704~M1719 #19
#2
M1720~M1735 #20
#10
M1736~M1751 #21
#5
M1752~M1767 #22
#11
M1768~M1783 #23
#1
M1784~M1799 #24
#12
M1800~M1815 #25
#6
M1816~M1831 #26
#13
M1832~M1847 #27
#3
M1848~M1863 #28
#14
M1864~M1879 #29
#7
M1880~M1895 #30
#15
M1896~M1911 #31
Explanation:
1) In mode 1, the M elements distributed to the sending area by 0# station range from M1400 to M1415. The elements can be
written by the PLC of 0# station and directly read by other stations (1#--31#).
2) In mode 2, the M elements distributed to the sending area by 0# station range from M1400 to M1431. The elements can be
written by the PLC of 0# station and directly read by other stations (1#--31#).
Distribution of D element on N:N bus multiple-layer network (layer 0):
Distribution of D element in
Mode 6 Mode 7 Mode 8 Mode 9
sending area
D7700~D7701 #0
#0
D7702~D7703 #1
#0
D7704~D7705 #2
#1
D7706~D7707 #3
#0
D7708~D7709 #4
#2
D7710~D7711 #5
#1
D7712~D7713 #6
#3
D7714~D7715 #7
D7716~D7717 #8
#4
D7718~D7719 #9
#2 #1
D7720~D7721 #10
#5
D7722~D7723 #11
Programming manual of IVC series small PLC Chapter 10 Using communication function 288
Distribution of D element in
Mode 6 Mode 7 Mode 8 Mode 9
sending area
D7724~D7725 #12
#6
D7726~D7727 #13
#3
D7728~D7729 #14
#7
D7730~D7731 #15
Explanation:
In mode 6, D7700 and D7701 are distributed to the sending area by 0# station (layer 0). They can be written by the PLC of 0#
station and directly read by the other stations (1#--15#).
Distribution of D element on N:N bus multiple-layer network (layer 1):
Distribution of D element in
Mode 10 Mode 11 Mode 12 Mode 13
sending area
D7732~D7733 #0
#0
D7734~D7735 #1
#0
D7736~D7737 #2
#1
D7738~D7739 #3
#0
D7740~D7741 #4
#2
D7742~D7743 #5
#1
D7744~D7745 #6
#3
D7746~D7747 #7
D7748~D7749 #8
#4
D7750~D7751 #9
#2
D7752~D7753 #10
#5
D7754~D7755 #11
#1
D7756~D7757 #12
#6
D7758~D7759 #13
#3
D7760~D7761 #14
#7
D7762~D7763 #15
Explanation:
In mode 10, D7732 and D7733 are distributed to the sending area by 0# station (layer 0). They can be written by the PLC of 0#
station and directly read by the other stations (1#--15#).
Distribution of M element on N:N bus multiple-layer network (layer 0):
Distribution of M element in
Mode 6 Mode 7 Mode 8 Mode 9
sending area
M1400~M1415 #0
#0
M1416~M1431 #1
#0
M1432~M1447 #2
#1
M1448~M1463 #3
#0
M1464~M1479 #4
#2
M1480~M1495 #5
#1
M1496~M1511 #6
#3
M1512~M1527 #7
M1528~M1543 #8
#4
M1544~M1559 #9
#2
M1560~M1575 #10
#5
M1576~M1591 #11
#1
M1592~M1607 #12
#6
M1608~M1623 #13
#3
M1624~M1639 #14
#7
M1640~M1655 #15
Explanation:
In mode 6, the M elements distributed to the sending area by 0# station (layer 0) range from M1400 to M1415. The elements
can be written by the PLC of 0# station and directly read by other stations (1#--15#).
Programming manual of IVC series small PLC Chapter 10 Using communication function 289
Note
Once PLC is configured with N:N bus communication protocol, D7700~D7763 and M1400~M1911 will become the public
resource for data exchange on the network. Please pay attention to these elements when using them in the program.
M1800-M1815 #25
M1816-M1831 #26
#13
M1832-M1847 #27
M1848-M1863 #28
#14
M1864-M1879 #29
#7
M1880-M1895 #30
#15
M1896-M1911 #31
Click the N:N bus setting button to enter the N:N bus protocol setting dialogue box as shown below:
As shown in the preceding figure, the N:N bus parameters are set through the system block. The Station No. shall begin with
0#. Several PLCs cannot share the same station number. 0# station is used for starting and setting the whole network. The
setting of Max number of sites, Additional delay time, Retry times and Mode can be realized through 0# station. For the
stations with other station numbers, except that the Baud rate and Parity check shall be consistent with those of 0# station,
they only need to set their own Station No., as shown in the following figure:
The Max number of sites refers to the total number of PLCs used in the network. If 6 PLCs are used in total, the value shall be
set to 6 and the station number of the 6 PLCs ranges from 0 to 5. If you want to add another two PLCs to the network later
without any interruption of the network, you can set the Max number of sites to 8. The numbers of the newly added PLCs are
6# and 7#. When 6# and 7# are connected to the network, they will be automatically detected by N:N bus within one second
and included into the data exchange with 0#-5#.
station modifies the relevant configuration online and downloads system block, the standby master station will control the
network. After finishing system block downloading, No. 0 station will become the master station instead of the standby one.
The strategy of master station in network: The station with the minimum No. will be the master station.
Backup battery
Store absolute - + Absolute position detection
position data
In above figure, unlike the common incremental encoder, the current encoding position and the total number of running coils for
the absolute position system can be maintained by power supply of a backup battery. Even if the power is off, the servo drive
can power on again and achieve the current absolute position data.
After PLC powers on, by communication or other special methods, the absolute position data will be obtained to confirm travel
coordinate position. PLC can control servo drive and motor through locating instruction, realize accurate positioning on travel,
and conduct automatic increasing/decreasing and refresh on absolute position data. Therefore, a work system can be
structured on basis of the absolute position coordinate.
The following is a mechanical simple diagram of absolute position system based on IVC series PLC locating instruction.
Programming manual of IVC series small PLC Chapter 11 Using positioning function 294
Speed
Origin return speed
Front End
Servo motor
Lead screw
ON ON
Near-point signal state
OFF
OFF
Console position
In the system, the servo motor drives lead screw to control the operation of console. The console’s position in travel is detected
by absolute encoder. The servo motor will decelerate to crawling speed when the near-point signal device detects the front of
console (set) to be origin return signal; PLC will stop high-speed pulse output when the near-point signal device detects the end
of console (reset) to be origin arrival signal. The forward limit switch and backward limit switch must be set. When using ZRN
instruction, without automatic near-point signal searching, you must operate at the distance farther than the near-point signal
device. By design and programming, you can adopt jogging operation and adjust the position manually.
Drive Motor
Console
Controller
The close loop control system is the automatic control system made up of signal positive channel and feedback channel, also
called feedback control system. The system consists of controller, servo drive, servo motor and detector. It performs automatic
detection on the actual displacement of the console and feedbacks to the controller for close loop control. The system has high
positioning accuracy, but it is complicated, hard to debug and maintain and expensive. Therefore, it is mainly applicable to the
cases requiring high accuracy and large numerical control machine tools.
Programming manual of IVC series small PLC Chapter 11 Using positioning function 295
Drive Motor
The working principle of half close control system is similar to the close control system. However, its detector is not installed on
the console but on the axis of the servo motor. The system is more excellent than open loop control system in accuracy, speed
and dynamic property, less complicated and expensive than close loop control system, and it is mainly applicable to the cases
requiring medium accuracy and medium or small numerical control machine tools.
Drive Motor
Detector Console
Controller
Start
11.5 Examples
Refer to 11.6 PLS envelope instruction
User programming configuration
11.7 POS trace interpolation
instruction configuration
End
Running speed
Act according to the set running
Speed
speed. If the interrupt input is ON,
DVIT ●
decelerate to stop after running the set
pulses.
Interrupt input
Start Displacement
ON
Running speed
Speed When operating a certain positioning,
STOPDV if the instruction starts, decelerate to ●
stop after running the set pulses.
Start Displacement
Total amount of
movement
Amount of Amount of
movement movement
before after
synchronizing synchronizing
Amount of
movement of
secondary axis The secondary axis follows the
Total amount movement of the primary axis and
of movement keeps synchronous speed with the
MOVELINK primary axis in a designated range. ●
Amount of Support ACC/DEC control in the
Speed of movement of
secondary primary axis transient process before and after
axis
synchronizing.
Speed Synchronization
Start End
synchronized completed
the program, executing different locating instructions or high-speed instructions according to different output ports can output
independent high-speed pulses.
Output
Available mode Definition of output point Definition of output mode
axis
Direction Y3 Pulse+direction
FWD OFF
Y2 Pulse
Forward rotation rotation
ON
+reverse rotation REV
Y3
rotation OFF
Direction
Pulse Y4 ON
2 Pulse+direction
Direction Unlimited except Y4 FWD REV
Pulse Y5 rotation rotation
3 Pulse+direction
Direction Unlimited except Y5
Pulse Y6
4 Pulse+direction
Direction Unlimited except Y6
Pulse Y7 Forward rotation+reverse rotation
FWD
OFF
rotation
ON
REV
OFF
5 Pulse+direction rotation
Direction Unlimited except Y7 ON
FWD REV
rotation rotation
Note
When using any output axis to connect servo, it is necessary to consider matching the output points. All output axes can adopt
“pulse+direction” mode; the output axis 0 and 1 can adopt “forward rotation+reverse rotation” mode. In the mode of
“pulse+direction”, the corresponding output points of the pulse and direction of the output axis 0 and 1 are fixed. You can
choose direction signals for the output axis 2-5, but note that the output points cannot be used in other ways at the same time.
For example, the pulse or direction signals of the output axis 2-5 and other axes cannot be defined on the same output point. In
the mode of “forward rotation+reverse rotation”, the corresponding output points of FWD rotation and REV rotation signals are
fixed. As for the output axis 0 and 1, whichever mode they are set, as long as the axis uses the locating instruction or
high-speed I/O instruction, its corresponding two output points cannot be used in other ways.
Pulse Y0 Pulse+direction
0 Pulse+direction OFF
Pulse
Direction Unlimited except Y0 ON
OFF
Pulse Y1 Direction
ON
Pulse Y0 Pulse+direction
0 Pulse+direction OFF
Pulse
Direction Unlimited except Y0 ON
OFF
Pulse Y1 Direction
1 Pulse+direction ON
Direction Unlimited except Y1 FWD REV
Pulse Y2 rotation rotation
2 Pulse+direction
Direction Unlimited except Y2
Pulse Y3
3 Pulse+direction
Direction Unlimited except Y3
Programming manual of IVC series small PLC Chapter 11 Using positioning function 309
Note:
1. SD202~SD205 can be changed by users according to needs. Please ensure to assign the value before driving the locating
instruction. Changing above parameters when executing the locating instruction may affect correct execution.
2. The base speed must be smaller than 1/10 of the Max. speed; otherwise, no pulse output. If the speed of the locating instruction
is lower than the base speed or higher than the Max. speed, no pulse output, either.
Pulse Y0 Pulse+direction
0 Pulse+direction OFF
Pulse
Direction Unlimited except Y0 ON
OFF
Pulse Y1 Direction
ON
11.5 Examples
Wiring diagram
220Vac
HC-MFS13
L N
Note9
QF KM
L1 U U
220Vac
L2 V V Servo
L3 W W motor
L11 PE E
PLC L21 PE
COM3
EC10-1614BTA Note7 MR-J2S-10A Note8
Note1: When ABSM is set to ON, it is ABS bit1 data line; when ABSM is set to OFF, it is positioning complete signal.
Note2: When ABSM is set to ON, it is ABS bit2 data line; when ABSM is set to OFF, it is zero speed signal.
Note3: When ABSM is set to ON, it is transfer data ready signal; when ABSM is set to OFF, it is torque limit signal.
Note4: Servo enabling signal, set before ABS is executed.
Note5: ABS transfer mode signal.
Note6: ABS transfer request signal.
Note7: PLC main module which must adopt transistor output.
Note8: Please install according to installation instructions of servo amplifier in relevant models; the plugs of multiple ports are totally the
same in shape,, so be careful not to plug improperly.
Note9: In alarm or emergency situations, need program to control KM and disconnect the power supply.
Note10: In the example, PLC adopts sink input, short circuit +24V and S/S terminals.
Program examples
The program realizes the following functions:
1. When PLC enters the running state, read abosute position data of servo drive via ABS instruction or communication mode
(servo drive is required to power on before or at the same time PLC runs).
2. Enter the running state, set SM85 and clear output function. Each time origin returns, Y2 will output clear pulse.
3. Operate the JOG+ button for jogging in forward direction.
4. Operate the JOG- button for jogging in reverse direction.
5. When the console locates farther than the front of near-point signal, operate the origin return button for origin return action in
backward direction.
6. Press the stop button when the console is running and the console will stop running.
7. Operate the forward position control and reverse position control buttons for console positioning.
Programming manual of IVC series small PLC Chapter 11 Using positioning function 316
Programming manual of IVC series small PLC Chapter 11 Using positioning function 317
Programming manual of IVC series small PLC Chapter 11 Using positioning function 318
Click Next to enter the interface of high-speed pulse output point, Max. and Min. frequency of high-speed pulse output, and
ACC/DEC time, as shown below:
The accelerated speed for all stages of envelope in acceleration/deceleration is definite. For example, if the setting goes as
Programming manual of IVC series small PLC Chapter 11 Using positioning function 319
above figure, thus the ACC time required by the motor accelerating from 20000Hz to 50000Hz is:
1000×(50000-20000)÷(100000-5000)=316(ms)=0.316(s)
During ACC time, the total output pulse number can be achieved by trapezoid area calculation formula:
(20000+50000)×0.316÷2=11060(total pulse number)
Therefore, if the ACC/DEC time or pulse number is required, please make relevant calcultation and then set the Max. speed,
Min. speed and ACC/DEC time.
Click Next in above figure and then enter Motion Contour Definition in below figure. Input the target speed and move
distance of the first step and click Add Step. Input the target speed and move distance of the second step and click Add Step,
and so on. Finally, click Finish.
The above configuration will be stored in D elements. You can choose which D elements are used to store the settings.
Set up two subprograms for envelope output wizard, one is parameter setting subprogram and the other is PLS execution
subprogram, as shown below. When programming the main program, ensure to call the PLS execution subprogram after
properly calling and executing the parameter setting subprogram (relevant D elements will be assigned).
Programming manual of IVC series small PLC Chapter 11 Using positioning function 320
So far, all configuration is completed, as shown below, click Finish to end PTO configuration.
Backward direction
Console
Servo X axis origin
motor
Y axis origin
Y axis
Forward direction
Servo
motor
Programming manual of IVC series small PLC Chapter 11 Using positioning function 321
Wiring diagram
Instruction pulse
+24V Y0 PP EMG Emergency stop
button
RES
Instruction direction signal Servo
COM Y1 NP LSP FWD limit switch
drive
LSN REV limit switch
COM
S/S SG SG
0
X axis
EC20H-1616BTA4
Program examples
The program realizes the following functions:
1. Operate the origin return button, the console will perform origin automatic search and stop running when reaching the origin.
2. Enter the running state, operate the start button and run continuously in the trace shown in the diagram.
3. Press the stop button when the console is running and the console will stop running.
-200 B
A
H -100 C
X
-100 0 100 200 300 400 500 600 700
100
G 200 D
300
F E
Y
Programming manual of IVC series small PLC Chapter 11 Using positioning function 322
Programming manual of IVC series small PLC Chapter 11 Using positioning function 323
Programming manual of IVC series small PLC Chapter 11 Using positioning function 324
Programming manual of IVC series small PLC Chapter 11 Using positioning function 325
Programming manual of IVC series small PLC Appendix 1 Special auxiliary relay 326
All the special auxiliary relays are initialized when the PLC changes from STOP to RUN. Those that have been set in system
setting will be set to the preset value after that initialization.
Note
The reserved SD and SM elements are not listed in the table. The reserved SM elements are by default read only (R).
4. Interrupt control
Addr. Name Action and function R/W IVC2L IVC1 IVC2H IVC1L
SM40 X0 input rising/falling edge interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM41 X1 input rising/falling edge interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM42 X2 input rising/falling edge interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM43 X3 input rising/falling edge interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM44 X4 input rising/falling edge interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM45 X5 input rising/falling edge interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM46 X6 input rising/falling edge interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM47 X7 input rising/falling edge interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM48 COM 0 character transmission interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM49 COM 0 character reception interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM50 COM 0 frame transmission interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM51 COM 0 frame reception interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM52 COM 1 character transmission interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM53 COM 1 character reception interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM54 COM 1 frame transmission interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM55 COM 1 frame reception interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM56 Power failure interrupt Enable when set as 1 R/W √ √ √ √
SM57 COM 2 character transmission interrupt enabling flag bit Enable when set as 1 R/W √ √ √
SM58 COM 2 character reception interrupt enabling flag bit Enable when set as 1 R/W √ √ √
SM59 COM 2 frame transmission interrupt enabling flag bit Enable when set as 1 R/W √ √ √
SM60 COM 2 frame reception interrupt enabling flag bit Enable when set as 1 R/W √ √ √
Positioning instruction passed position interrupt 1
SM61 Enable when set as 1 R/W √
enabling flag bit
Positioning instruction passed position interrupt 2
SM62 Enable when set as 1 R/W √
enabling flag bit
SM63 High-speed output 0 complete interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM64 High-speed output 1 complete interrupt enabling flag bit Enable when set as 1 R/W √ √ √
SM65 High-speed counter interrupt enabling flag bit Enable when set as 1 R/W √ √ √ √
SM66 Timed interrupt 0 enabling flag bit Enable when set as 1 R/W √ √ √ √
SM67 Timed interrupt 1 enabling flag bit Enable when set as 1 R/W √ √ √ √
SM68 Timed interrupt 2 enabling flag bit Enable when set as 1 R/W √ √ √ √
SM69 Interpolation complete interrupt 1 enabling flag bit Enable when set as 1 R/W √
SM72 High-speed output 2 complete interrupt enabling flag bit Enable when set as 1 R/W √ √
SM73 High-speed output 3 complete interrupt enabling flag bit Enable when set as 1 R/W √
SM74 High-speed output 4 complete interrupt enabling flag bit Enable when set as 1 R/W √
SM75 High-speed output 5 complete interrupt enabling flag bit Enable when set as 1 R/W √
SM76 High-speed output 6 complete interrupt enabling flag bit Enable when set as 1 R/W √
SM77 High-speed output 7 complete interrupt enabling flag bit Enable when set as 1 R/W √
SM78 Interpolation complete interrupt 2 enabling flag bit Enable when set as 1 R/W √
SM79 Interpolation complete interrupt 3 enabling flag bit Enable when set as 1 R/W √
SM105 Positioning instruction passed position interrupt 3 Enable when set as 1 R/W √
Programming manual of IVC series small PLC Appendix 1 Special auxiliary relay 328
Addr. Name Action and function R/W IVC2L IVC1 IVC2H IVC1L
enabling flag bit
Positioning instruction passed position interrupt 4
SM106 Enable when set as 1 R/W √
enabling flag bit
Positioning instruction passed position interrupt 5
SM107 Enable when set as 1 R/W √
enabling flag bit
Positioning instruction passed position interrupt 6
SM108 Enable when set as 1 R/W √
enabling flag bit
5. External instruction
Addr. Name Action and function R/W IVC2L IVC1 IVC2H IVC1L
1-16 characters when set as 1, 8 characters
SM70 Print mode selection R/W √ √
when set as 0
SM71 Print in progress In printing when set as 1 R √ √
错误!未找到引用源。.
2. For hardware counters, the total pulse frequency input through X0~X7 (using pulse capture, SPD instruction or HCNT instructions, but not
high-speed compare instructions) is ≤80k. For software counters, that frequency (using instructions DHSCS, DHSCI, DHSZ, DHSP or DHST for
driven high-speed counters) is ≤30k.
8. Fourfold frequency
Addr. Name function R/W IVC2L IVC1 IVC2H IVC1L
AB ph of X0 and X1 input
SM100 Clear when STOP->RUN R/W √ √ √ √
once/fourfold switching
AB ph of X2 and X3 input
SM101 R/W √
once/fourfold switching
AB ph of X3 and X4 input
SM102 R/W √ √ √ √
once/fourfold switching
AB ph of X4 and X5 input
SM103 R/W √
once/fourfold switching
AB ph of X6 and X7 input
SM104 R/W √
once/fourfold switching
Note
SM112~SM114 are the flags for the reception, complete and idle states in all communication protocols that are supported by
PORT 0. For example, the PORT 0 of IVC1 PLC supports N:N bus, Modbus and Freeport. No matter which protocol is used,
the functions of SM112~SM114 remain the same.
Addr. Name Action and function R/W IVC2L IVC1 IVC2H IVC1L
complete flag bit
SM124 Port 1 idle flag bit This bit is set when the port is idle R √ √ √ √
Note
SM122~SM124 are the flags for the reception, complete and idle states in all communication protocols that are supported by
Port 1 . For example, the Port 1 of IVC1 PLC supports N:N bus, Modbus and Freeport. No matter which protocol is used, the
functions of SM122~SM124 remain the same.
Note
SM132~SM134 are the flags for the reception, complete and idle states in all communication protocols that are supported by
Port 2 . For example, the Port 2 of IVC1 PLC supports N:N bus, Modbus and Freeport. No matter which protocol is used, the
functions of SM132~SM134 remain the same.
Addr. Name Action and function R/W IVC2L IVC1 IVC2H IVC1L
SM149 Station 9 communication error flag R √ √ √ √
SM150 Station 10 communication error flag R √ √ √ √
SM151 Station 11 communication error flag R √ √ √ √
SM152 Station 12 communication error flag R √ √ √ √
SM153 Station 13 communication error flag R √ √ √ √
SM154 Station 14 communication error flag R √ √ √ √
SM155 Station 15 communication error flag R √ √ √ √
SM156 Station 16 communication error flag R √ √ √ √
SM157 Station 17 communication error flag R √ √ √ √
SM158 Station 18 communication error flag R √ √ √ √
SM159 Station 19 communication error flag R √ √ √ √
SM160 Station 20 communication error flag R √ √ √ √
SM161 Station 21 communication error flag R √ √ √ √
SM162 Station 22 communication error flag R √ √ √ √
SM163 Station 23 communication error flag R √ √ √ √
SM164 Station 24 communication error flag R √ √ √ √
SM165 Station 25 communication error flag R √ √ √ √
SM166 Station 26 communication error flag R √ √ √ √
SM167 Station 27 communication error flag R √ √ √ √
SM168 Station 28 communication error flag R √ √ √ √
SM169 Station 29 communication error flag R √ √ √ √
SM170 Station 30 communication error flag R √ √ √ √
SM171 Station 31 communication error flag R √ √ √ √
channel 0 1
Type Addr. Name Register content R/W IVC2L IVC1 IVC2H IVC1L
input SM248 C248 counting mode, the corresponding SM2 _ _ R/W √ √ √ √
SM249 C249 becomes low level R/W √ √ √ √
SM250 C250 R/W √ √ √ √
SM251 C251 R/W √ √ √ √
SM304 C304 R/W √
AB phase SM305 C305 R/W √
counting SM306 C306 R/W √
input SM252 C252 R/W √ √ √ √
SM253 C253 R/W √ √ √ √
SM254 C254 R/W √ √ √ √
SM255 C255 R/W √ √ √ √
Addr. Name Action and function R/W IVC2L IVC1 IVC2H IVC1L
Positioning instruction
SM288 Y0 is applicable to DSZR/DVIT R/W √ √ √
in drive
User interrupt input
SM289 Y0 is applicable to DVIT R/W √ √
instruction
Applicable to DSZR/ZRN, CLR signal output function
SM290 Clear function valid valid (Y1) when positioning instruction origin return R/W √ √
(ZRN)
Clear signal Applicable to DSZR, the corresponding Y(N) in SD230
SM291 designated element is clear signal; Y11 is clear signal of Y1 when no R/W √ √
valid designation
SM292 Origin return direction Y1 is applicable to DSZR R/W √ √
SM293 Forward rotation limit Y1 is applicable to DSZR/DVIT R/W √ √
SM294 Reverse rotation limit Y1 is applicable to DSZR/DVIT R/W √ √
Logic reverse rotation
SM295 Y1 is applicable to DSZR R/W √ √
of near-point signal
Logic reverse rotation
SM296 Y1 is applicable to DSZR R/W √ √
of zero-point signal
Logic reverse rotation
SM297 Y1 is applicable to DVIT R/W √ √
of interrupt signal
Positioning instruction
SM298 Y1 is applicable to DSZR/DVIT R/W √ √
in drive
User interrupt input
SM299 Y1 is applicable to DVIT R/W √
instruction
SM320 Clear function valid Y2 is applicable to DSZR/ZRN R/W √ √
Clear signal Applicable to DSZR, the corresponding Y(N) in SD230
SM321 designated element is clear signal; Y2 is Y12 when no designation (IVC2L R/W √ √
valid is Y3)
SM322 Origin return direction Y2 is applicable to DSZR R/W √ √
SM323 Forward rotation limit Y2 is applicable to DSZR/DVIT R/W √ √
SM324 Reverse rotation limit Y2 is applicable to DSZR/DVIT R/W √ √
Logic reverse rotation
SM325 Y2 is applicable to DSZR R/W √ √
of near-point signal
Logic reverse rotation
SM326 Y2 is applicable to DSZR R/W √ √
of zero-point signal
Logic reverse rotation
SM327 Y2 is applicable to DVIT R/W √
of interrupt signal
Positioning instruction
SM328 Y2 is applicable to DSZR/DVIT R/W √ √
in drive
User interrupt input √
SM329 Y2 is applicable to DVIT R/W
instruction
SM330 Clear function valid Y3 is applicable to DSZR/ZRN R/W √
Clear signal Applicable to DSZR, the corresponding Y(N) in SD230 √
SM331 designated element is clear signal; Y2 is Y12 when no designation (IVC2L R/W
valid is Y3)
SM332 Origin return direction Y3 is applicable to DSZR R/W √
SM333 Forward rotation limit Y3 is applicable to DSZR/DVIT R/W √
SM334 Reverse rotation limit Y3 is applicable to DSZR/DVIT R/W √
Logic reverse rotation √
SM335 Y3 is applicable to DSZR R/W
of near-point signal
Logic reverse rotation √
SM336 Y3 is applicable to DSZR R/W
of zero-point signal
Logic reverse rotation √
SM337 Y3 is applicable to DVIT R/W
of interrupt signal
Positioning instruction
SM338 Y3 is applicable to DSZR/DVIT R/W
in drive
User interrupt input √
SM339 Y3 is applicable to DVIT R/W
instruction
Clear signal Applicable to DSZR, the corresponding Y(N) in SD230
SM341 R/W √
designated element is clear signal; Y4 is Y14 when no designation
Programming manual of IVC series small PLC Appendix 1 Special auxiliary relay 336
Addr. Name Action and function R/W IVC2L IVC1 IVC2H IVC1L
valid
SM342 Origin return direction Y4 is applicable to DSZR R/W √
SM343 Forward rotation limit Y4 is applicable to DSZR/DVIT R/W √
SM344 Reverse rotation limit Y4 is applicable to DSZR/DVIT R/W √
Logic reverse rotation
SM345 Y4 is applicable to DSZR R/W √
of near-point signal
Logic reverse rotation
SM346 Y4 is applicable to DSZR R/W √
of zero-point signal
Logic reverse rotation
SM347 Y4 is applicable to DVIT R/W √
of interrupt signal
Positioning instruction
SM348 Y4 is applicable to DSZR/DVIT R/W √
in drive
SM350 Clear function valid Y5 is applicable to DSZR/ZRN R/W √
Clear signal
Applicable to DSZR, the corresponding Y(N) in SD is
SM351 designated element R/W √
clear signal; Y5 is Y15 when no designation
valid
SM352 Origin return direction Y5 is applicable to DSZR R/W √
SM353 Forward rotation limit Y5 is applicable to DSZR/DVIT R/W √
SM354 Reverse rotation limit Y5 is applicable to DSZR/DVIT R/W √
Logic reverse rotation
SM355 Y5 is applicable to DSZR R/W √
of near-point signal
Logic reverse rotation
SM356 Y5 is applicable to DSZR R/W √
of zero-point signal
Logic reverse rotation
SM357 Y5 is applicable to DVIT R/W
of interrupt signal
Positioning instruction
SM358 Y5 is applicable to DSZR/DVIT R/W √
in drive
SM360 Clear function valid Y6 is applicable to DSZR/ZRN R/W √
Clear signal
Applicable to DSZR, the corresponding Y(N) in SD230
SM361 designated element R/W √
is clear signal; Y6 is Y16 when no designation
valid
SM362 Origin return direction Y6 is applicable to DSZR R/W √
SM363 Forward rotation limit Y6 is applicable to DSZR/DVIT R/W √
SM364 Reverse rotation limit Y6 is applicable to DSZR/DVIT R/W √
Logic reverse rotation
SM365 Y6 is applicable to DSZR R/W √
of near-point signal
Logic reverse rotation
SM366 Y6 is applicable to DSZR R/W √
of zero-point signal
SM370 Clear function valid Y7 is applicable to DSZR/ZRN R/W √
Clear signal Applicable to DSZR, the corresponding Y(N) in SD230
SM371 designated element is clear signal; Y7 is Y17 when no designation (IVC2L R/W √
valid is Y3)
SM372 Origin return direction Y7 is applicable to DSZR R/W √
SM373 Forward rotation limit Y7 is applicable to DSZR/DVIT R/W √
SM374 Reverse rotation limit Y7 is applicable to DSZR/DVIT R/W √
Logic reverse rotation
SM375 Y7 is applicable to DSZR R/W √
of near-point signal
Logic reverse rotation
SM376 Y7 is applicable to DSZR R/W √
of zero-point signal
Note
1. All special data registers except SD50~SD55 will be initialized when the PLC changes from STOP to RUN.
2. The reserved SD and SM elements are not listed in the table. The reserved SD elements are by default read only.
3. FROM/TO error
Addr. Name R/W IVC2L IVC1L IVC1 IVC2H Range
Special modules’ numbering is wrong (starting with 0) when
SD25 R √ √ √ √ Initial value: 255
using FROM/TO instruction
The I/O chips’ numbering is wrong (starting with 0) when
SD26 R √ √ √ √ Initial value: 255
refreshing I/O
Programming manual of IVC series small PLC Appendix 2 Special data register 339
4. Scan time
Addr. Name Action and function R/W IVC2L IVC1 IVC2H IVC1L Range
Current scan
SD30 Current scan time (unit: ms) R √ √ √ √
value
SD31 Min. scan time Min. scan time (uint: ms) R √ √ √ √
SD32 Max. scan time Max. scan time (unit: ms) R √ √ √ √
Default: 0ms. Unit: 1ms. When the constant scan
time is longer than the user monitoring overtime
setting, user program overtime alarm will be
raised. When a scan cycle of user program is
Constant scan longer than the constant scan time, the cycle
SD33 R √ √ √ √ 0~1000ms
time constant scan mode is invalid automatically and
no alarm will be raised.
SD33 is regarded as 1000ms when it is set
bigger than 1000ms (configurable only through
the system block)
Default: 100ms. Unit: 1ms. Any setting smaller
User program than 100 or bigger than 1000 will be regarded as 100~1000
SD34 R √ √ √ √
overtime 100 or 1000 respectively. Configurable only ms
through system block
Note
1. The error tolerance of SD30, SD31 and SD32 is 1ms.
2. It is recommended to set the user program overtime (SD34) at least 5ms bigger than the constant scan time (SD33).
Otherwise, due to the influence of system operation and user program, the system is apt to report user program overtime error.
Note
1. IVC2L has only one group of filtering SD35, available input X0~X17.
2. IVC1 and IVC1S have two groups of filtering: SD35, available input X0~X3; SD36, available input X4~X7. Range: 0, 2, 4, 8,
16, 32, 64ms.
3. IVC1 and IVC1S have two groups of filtering: SD35, available input X0~X3; SD36, available input X4~X7. Range: 0~64ms.
8. Positioning instruction
Addr. Name Initial value Function R/W IVC2L IVC1 IVC2H IVC1L
The current
value of Y0
output
SD80 R/W √
positioning
instruction
As the current values of Y000 output
(MSB)
0 positioning instruction for data
The current
register
value of Y0
output
SD81 R/W √
positioning
instruction
(LSB)
The current
value of Y1
output
SD82 R/W √
positioning
instruction
As the current values of Y001 output
(MSB)
0 positioning instruction for data
The current
register
value of Y1
output
SD83 R/W √
positioning
instruction
(LSB)
Programming manual of IVC series small PLC Appendix 2 Special data register 341
Addr. Name Initial value Function R/W IVC2L IVC1 IVC2H IVC1L
Base speed of
Base speed when executing
executing
instructions ZRN, PLSV, DRVI and
SD84 instructions 5000 R/W √
DRVA (below 1/10 of the Max.
ZRN, DRVI and
speed)
DRVA
Max. speed of
executing
SD85 instructions R/W √
ZRN, DRVI and
Max. speed when executing
DRVA (MSB)
100000 instructions ZRN, PLSV, DRVI and
Max. speed of
DRVA (10-100000)
executing
SD86 instructions R/W √
ZRN, DRVI and
DRVA (LSB)
ACC/DEC time ACC/DEC time when raising from
of executing the base speed (SD84) to the Max.
SD87 instructions 1000 speed (SD85, SD86) at executing R/W √
ZRN, DRVI and instructions ZRN, DRVI and DRV
DRVA (50ms-5000ms)
Interrupt input
SD240 0 Interrupt input designation R/W √ √
designation
9. Real-time clock
Addr. Name Register content R/W IVC2L IVC1 IVC2H IVC1L Range
SD100 Year For real-time clock R √ √ √ √ 2000~2099
SD101 Month For real-time clock R √ √ √ √ 1~12 months
SD102 Day For real-time clock R √ √ √ √ 1~31 days
SD103 Hour For real-time clock R √ √ √ √ 0~23 hours
SD104 Minute For real-time clock R √ √ √ √ 0~59 minutes
SD105 Second For real-time clock R √ √ √ √ 0~59 seconds
0 (Sunday)~6
SD106 Week For real-time clock R √ √ √ √
(Saturday)
Note: You can set these elements only with the TWR instruction or through the upper computer.
Addr. Name Register content R/W IVC2L IVC1 IVC2H IVC1L Range
unspecified
SD110.8 free port receiving 1=end character specified
end character mode 0=end character unspecified
SD110.9 free port word 1: word overtime enabled
overtime enabling 0: word overtime disabled
SD110.10 free port frame 1=frame overtime enabled
overtime enabling 0=frame overtime disabled
SD110.11 Reserved
0: word element valid at low
SD110.12 high/low byte byte
valid 1: word element valid at
high/ low byte
SD110.13~SD110.15 Reserved
SD111 Start character R/W √ √ √ √
SD112 End character R/W √ √ √ √
Default: 0ms (word overtime
SD113 Word overtime setting R/W √ √ √ √ 1~32767ms
omitted)
Default: 0ms (frame
SD114 Frame overtime setting R/W √ √ √ √ 1~32767ms
overtime omitted)
Bit 0: set when receiving
ends
Bit 1: set when specified end
character is received
Bit 2: set when Max.
character number is
received
SD115 Receiving completion message code R √ √ √ √
Bit 3: set upon word
overtime
Bit 4: set upon frame
overtime
Bit 5: set upon parity check
error
Bits 6~15: reserved
SD116 Current received characters R √ √ √ √
Total number of current received
SD117 R √ √ √ √
characters
SD118 Current sent characters R √ √ √
Addr. Name Register content R/W IVC2L IVC1 IVC2H IVC1L Range
receiving start 0: start character unspecified
character mode
SD120.8 free port
1: end character specified
receiving end
0: end character unspecified
character mode
SD120.9 free port
1: word overtime enabled
word overtime
0: word overtime disabled
enabling
SD120.10 free port
1: frame overtime enabled
frame overtime
0: frame overtime disabled
enabling
SD120.11 Reserved
0: word element valid at low
SD120.12 high/low byte
byte valid 1: word element valid at high/
low byte
SD120.13~SD120.15 Reserved
SD121 Start character R/W √ √ √ √
SD122 End character R/W √ √ √ √
Default: 0ms (word overtime
SD123 Word overtime setting R/W √ √ √ √ 0~32767ms
omitted)
Default: 0ms (frame overtime
SD124 Frame overtime setting R/W √ √ √ √ 0~32767ms
omitted)
Bit 0: set when receiving
ends
Bit 1: set when specified end
character is received
Bit 2: set when Max.
Receiving completion character number is received
SD125 R √ √ √ √
message code Bit 3: set upon word overtime
Bit 4: set upon frame
overtime
Bit 5: set upon parity check
error
Bits 6~15: reserved
SD126 Current received characters R √ √ √ √
Total number of current
SD127 R √ √ √ √
received characters
SD128 Current sent characters R √ √ √ √
SD348
Y4 origin return speed, applicable to DSZR 50000 R/W √
SD349
01 01 07 D0 00 01 FD 47
CRC check code
Number of elements to read
Starting address. The decimal value of 07D0 is 2000
Function code
Station No.
Notes:
1. Elements X and Y use octal system. There are 256 points in total from X0 to X377, 256 points from Y0 to Y377, with the
combinations of Y0~Y7, Y10~Y17 and Y20~Y27. etc.
2. Two addressing methods are available for element X. One is the protocol address of 1200-1455 with corresponding function
codes of 01, 05 and 15; the other is the protocol address of 0-255 with function code 02.
3. Processing of double-word element: C element is a counter. It has status and current value. C200~C255 are 32-bit elements,
but each C element in the range will get two protocol addresses during the protocol address compiling. For example: The
protocol address of C200 is 9700~9701. When reading the elements though Modbus, both the starting protocol address and
the number of the read elements shall be even number.
4. For most SM, SD elements, the real value cannot be written through Modbus, but PLC salve station will still return “OK“ to
indicate the completion of write operation, which is allowable.
5. In addition, the Modbus communication protocol of IVC2L supports the read and write of double word element, LONG INT
variable and floating point number. In the PLC of IVC2L, 32-bit data are stored with high bits at high address. For example, a
32-bit data is stored in two D elements (D3 and D4), with 16 high bits in D3 and 16 low bits in D4, as shown in the following
figure: (Refer to the description for the specific example)
High
D3
High Low 16-bit
16-bit 16-bit Low
D4
16-bit
32-bit data
2. Response frame
If the read address is not the times of 8, the remaining bits will be filled with 0 (starting with the high bits).
Function code Number of bytes read Read data Read data Check code
Address ......
(01H) (n) No.1 No.n (CRC or LRC
B7 B6 B5 B4 B3 B2 B1 B0
2. Response frame
If the read address is not the times of 8, the remaining bits will be filled with 0 (starting with the high bits).
Function code Number of bytes read Read data Read data Check code
Address ...
(02H) (n) No.1 No.n (CRC or LRC
B7 B6 B5 B4 B3 B2 B1 B0
2. Response frame
Note: The written value of the element is 0xFF00 (ON, 1) or 0x0000 (OFF, 0).
2. Response frame
Response frame is the repeat of request frame.
Starting address Written element value Check code
Address Function code (05H)
H L H L (CRC or LRC)
Programming manual of IVC series small PLC Appendix 7 Modbus communication protocol (IVC1, IVC2L series) 358
2. Response frame
Response frame is the repeat of request frame.
Starting address Written element value Check code
Address Function code (06H)
H L H L (CRC or LRC)
2. Response frame
Return request frame intact.
Function word Any character Check code
Address Function code (0x08H)
(0x00H) (0x00H) H L (CRC or LRC)
2. Response frame
Function word Data field Check code
Address Function code (0x08H)
0x00H 0x01H H L (CRC or LRC)
2. Response frame
No return
Clear counter and diagnostic register (0x0A):
Clear all counters (Broadcast frame is supported).
1. Request frame
Function word Data field Check code
Address Function code (0x08H)
(0x00H) (0x0AH) 0x00H 0x00H (CRC or LRC)
2. Response frame
Function Function word Data field Check code
Address
code (0x08H) (0x00H) (0x0AH) 0x00H 0x00H (CRC or LRC)
2. Response frame
Function word Data field Check code
Address Function code (0x08H)
(0x00H) (0x0BH) H L (CRC or LRC)
2. Response frame
Function word Data field Check code
Address Function code (0x08H)
(0x00H) (0x0CH) H L (CRC or LRC)
2. Response frame
Function word Data field Check code
Address Function code (0x08H)
(0x00H) (0x0DH) H L (CRC or LRC)
2. Response frame
Function word Data field Check code
Address Function code (0x08H)
(0x00H) (0x0EH) H L (CRC or LRC)
2. Response frame
Function word Data field Check code
Address Function code (0x08H)
(0x00H) (0x0FH) H L (CRC or LRC)
2. Response frame
Function Function word Data field Check code
Address
code (0x08H) (0x00H) (0x12H) H L (CRC or LRC)
B7 B6 B5 B4 B3 B2 B1 B0
2. Response frame
Function Starting address Number of elements Check code
Address
code (0FH) H L H L (CRC or LRC)
2. Response frame
Programming manual of IVC series small PLC Appendix 7 Modbus communication protocol (IVC1, IVC2L series) 361
Starting
Number of elements Check code
Address Function code (0x10H) address
(CRC or LRC)
H L H L
Function code refers to the function code of the captured request frame + 0x80
Note
1. The slave station address is 01, the last two bytes are CRC check codes and the second byte is function code.
2. X element does not support write.
01 03 25 E4 00 06 8E F3
CRC check code
Number of elements to read: 6
Starting address: 9700
Function code
Station No.
In the returned data, 9700 and 9701 are the two addresses representing the content of C200. 9700 is the high 16 bits and 9701
is the low 16 bits.
2. When reading the double word element, if the starting address for the reading is not an even number, the error code of
illegal address will be returned. For example:
XMT from master station: 01 03 25 E5 00 04 5E F2
The starting address for the reading sent by the master is 25 E5 (four word elements, decimal 9701).
Slave station response: 01 83 02 C0 F1
Slave station response: illegal data address
3. If the number of the read elements is not an even number, the error code of illegal data will be returned. For example:
XMT from master station: 01 03 25 E4 00 05 CE F2
25 E4: The starting address for master station reading, 5 word elements
Slave response: 01 83 03 01 31
Slave station returns illegal data.
Processing of LONG INT data:
Based on the storage method of PLC in GCM, one LONG INT data can be saved in two D elements. For example: Store one
LONG INT data in D3 and D4, D3 is used for storing high 16 bits, D4 is used for storing low 16 bits in INVT PLC. If master
station reads LONG INT data through Modbus, the 32-bit data shall be regrouped based on the LONG INT storage principle of
INVT PLC after reading the data.
Storage principle of FLOAT is the same as the storage principle of LONG INT.
Programming manual of IVC series small PLC Appendix 7 Modbus communication protocol (IVC1, IVC2L series) 363
5. Description of broadcast
The slave station supports broadcast but not all the function codes. The slave station supports function codes 01, 02, 03, 05, 06,
08, 15 and 16 (decimal). Wherein, 01, 02 and 03 can read element but do not support broadcast, no response will be gotten
after sending out the broadcast; 05, 06, 15 and 16 can write element and support broadcast, no response will be gotten after
sending out the broadcast, but slave station will process the received data; 08 is the diagnostic function code, it does not
support the broadcast except its sub-function codes 0x01, 0x04 and 0x0A (Hexadecimal).
Programming manual of IVC series small PLC Appendix 8 ASCII code table 364
High 3-bit
ASCII HEX
0 1 2 3 4 5 6 7
0 NUL DLE SPACE 0 @ P 、 p
1 SOH DC1 ! 1 A Q a q
2 STX DC2 " 2 B R b r
3 ETX DC3 # 3 C S c s
4 EOT DC4 $ 4 D T d t
5 ENQ NAK % 5 E U e u
6 ACK SYN & 6 F V f v
7 BEL ETB ’ 7 G W g w
Low 4-bit
8 BS CAN ( 8 H X h x
9 HT EM ) 9 I Y i y
A LF SUB * : J Z j z
B VT ESC + ; K [ k {
C FF FS , < L l I
D CR GS - = M ] m }
E SO RS . > N ^ n ~
F SI US / ? O _ o DEL
Programming manual of IVC series small PLC Appendix 9 Instruction index 365
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
Zero, carry, √
ABSD Absolute drum control instruction 9 √
borrow
BAND Word bit contact AND instruction 5 √ √ √ √
BANI Word bit contact ANI instruction 5 √ √ √ √
Zero, carry,
BCD Word to 16-bit BCD instruction 5 √ √ √ √
borrow
Zero, carry,
BIN 16-bit BCD to word instruction 5 √ √ √ √
borrow
BITS Counting ON bit in word instruction 5 √ √ √ √
Zero, carry,
BKADD Add batch data operation 9 √
borrow
BKCMP=,>,<,
B Compare batch data 9 √
<>,<=,>=
Zero, carry,
BKSUB Subtract batch data operation 9 √
borrow
BLD Word bit contact LD instruction 5 √ √ √ √
BLDI Word bit contact LDI instruction 5 √ √ √ √
BMOV Move data block transmission instruction 7 √ √ √ √
BON Judging ON bit in word instruction 7 √
BOR Word bit contact OR instruction 5 √ √ √ √
BORI Word bit contact ORI instruction 5 √ √ √ √
BOUT Word bit coil output instruction 5 √ √ √ √
BRST Word bit coil reset instruction 5 √ √ √ √
BSET Word bit coil set instruction 5 √ √ √ √
B
Zero, carry,
BTOW Data combination instruction for byte unit 7 √
borrow
Depend on
CALL Calling a subprogram the √ √ √ √
program
CCITT CCITT check instruction 7 √ √ √ √
Counterclockwise circular trace Zero, carry,
CCW 12 √
interpolation borrow
CFEND Conditional end from user main program 1 √ √ √ √
Conditional return from user interrupt
CIRET 1 √ √ √ √
subprogram
CJ Conditional jump 3 √ √ √ √
C
Zero, carry,
COS Floating point number COS instruction 7 √ √ √ √
borrow
CRC16 CRC16 check instruction 7 √ √ √ √
CSRET Conditional return from user subprogram 1 √ √ √ √
16-bit counter loop cycle counting
CTR 5 √ √ √ √
instruction
CTU 16-bit counter counting up instruction 5 √ √ √ √
CMP Compare and set integer instruction 7 √* √
Zero, carry, √
CW Clockwise circular trace interpolation 12
borrow
Zero, carry,
DADD Add double integer instruction 10 √ √ √ √
borrow
Zero, carry,
DBAND Dead band control 9 √
borrow
Zero, carry,
DBCD Double word to 32-bit BCD instruction 7 √ √ √ √
borrow
D
DBIN 32-bit BCD to double word instruction 7 √ √ √ √
Counting ON bit in double word
DBITS 6 √ √ √ √
instruction
DCMP< Compare date< instruction 7 √ √ √
DCMP<= Compare date<= instruction 7 √ √ √
DCMP<> Compare date<> instruction 7 √ √ √
Programming manual of IVC series small PLC Appendix 9 Instruction index 367
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
DCMP= Compare date= instruction 7 √ √ √
DCMP> Compare date> instruction 7 √ √ √
DCMP>= Compare date>= instruction 7 √ √ √
DCNT 32-bit counting instruction 7 √ √ √ √
Zero, carry,
DDEC Decrement double integer instruction 4 √ √ √ √
borrow
Zero, carry,
DDIV Divide double integer instruction 10 √ √ √ √
borrow
Zero, carry,
DEC Decrement integer instruction 3 √ √ √ √
borrow
Zero, carry,
DEG Floating point number rad->angle 7 √
borrow
DECO Decode instruction 5 √ √ √ √
Double integer to floating point number Zero, carry,
DFLT 7 √ √ √
instruction borrow
DFMOV Fill data block double word instruction 9 √ √ √ √
Read double word from special module
DFROM 10 √ √
buffer register instruction
32-bit Gray code to double word Zero, carry,
DGBIN 7 √ √ √ √
instruction borrow
Double word to 32-bit Gray code Zero, carry,
DGRY 7 √ √ √ √
instruction borrow
High-speed counting interrupt trigger
DHSCI 10 √ √ √ √
instruction
High-speed counting compare reset
DHSCR 10 √ √ √ √
instruction
High-speed counting compare set
DHSCS 10 √ √ √ √
instruction
High-speed counting table compare
DHSP 10 √ √ √ √
pulse output instruction
High-speed output absolute position
DHSPI 10 √
compare interrupt trigger instruction
High-speed counting table compare
DHST 10 √ √ √ √
instruction
High-speed counting zone compare
DHSZ 13 √ √ √ √
instruction
DI Disable interrupt instruction 1 √ √ √ √
Increment double integer instruction Zero, carry,
DINC 4 √ √ √ √
borrow
Floating point number to double integer Zero, carry,
DINT 7 √ √ √ √
instruction borrow
Zero, carry,
DIS 4bit separation instruction for 16bit data 7 √
borrow
DIV Divide integer instruction 7 √ √ √ √
Move double word data transmission
DMOV 7 √ √ √ √
instruction
Zero, carry,
DMUL Multiply double integer instruction 10 √ √ √ √
borrow
Zero, carry,
DNEG Negative double integer instruction 7 √ √ √ √
D borrow
DRCL 32-bit carry circular shift left instruction 9 Carry √ √ √ √
DRCR 32-bit carry circular shift right instruction 9 Carry √ √ √ √
DROL 32-bit circular shift left instruction 9 Carry √ √ √ √
DROR 32-bit circular shift right instruction 9 Carry √ √ √ √
Zero, carry,
DRVA Absolute position control instruction 11 √* √ √ √
borrow
Zero, carry,
DRVI Relative position control instruction 11 √* √ √ √
borrow
Programming manual of IVC series small PLC Appendix 9 Instruction index 368
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
DSHL 32-bit shift left instruction 9 √ √ √ √
DSHR 32-bit shift right instruction 9 √ √ √ √
Zero, carry,
DSQT Square root double integer instruction 7 √ √ √ √
borrow
Zero, carry,
DSUB Subtract double integer instruction 10 √ √ √ √
borrow
Zero, carry,
DSUM Sum double integer instruction 9 √ √ √ √
borrow
Zero, carry,
DTI Double integer to integer instruction 6 √ √ √ √
borrow
Write double word to special module
DTO 10 √ √
buffer register instruction
DUTY Generate timing pulse instruction 7 √
Zero, carry,
DVABS Double integer absolute value instruction 7 √ √ √ √
borrow
DWAND AND double word instruction 10 √ √ √ √
DWINV NOT double word instruction 10 √ √ √ √
DWOR OR double word instruction 10 √ √ √ √
DWXOR Exclusive-OR double word instruction 10 √ √ √ √
DXCH Exchange double word instruction 7 √ √ √ √
Double word absolute drum control Zero, carry, √
DABSD 11 √
instruction borrow
Regress to origin with DOG search Zero, carry, √
DSZR 9 √ √
instruction borrow
Zero, carry, √
DVIT Interrupt locating 11 √ √
borrow
ED Power flow falling edge detection 1 √ √ √ √
EI Enable interrupt instruction 1 √ √ √ √
ENCO Encode instruction 5 √ √ √ √
EROMWR EEPROM write instruction 7 √ √ √
EU Power flow rising edge detection 2 √ √ √ √
Inverter jogging forward rotation
IVDFWD 6 √* √ √ √
instruction
Inverter jogging reverse rotation
IVDREV 6 √* √ √ √
instruction
IVFRQ Inverter set frequency instruction 8 √* √ √ √
E
IVFWD Inverter forward rotation instruction 6 √* √ √
Inverter read single register value
IVRD 10 √* √ √ √
instruction
IVRDST Inverter read status instruction 10 √* √ √ √
IVREV Inverter reverse rotation instruction 6 √* √ √ √
IVSTOP Inverter stop instruction 8 √* √ √ √
Inverter write single register value
IVWRT 10 √* √ √ √
instruction
Zero, carry,
EXP Floating point number EXP instruction 7 √ √ √ √
borrow
FIFO First-in-first-out instruction 7 √ √ √ √
Integer to floating point number Zero, carry,
FLT 6 √ √ √ √
instruction borrow
F FMOV Fill data block instruction 7 √ √ √ √
FOR Cycle instruction 3 √ √ √ √
Read word from special module buffer
FROM 9 √ √
register instruction
Zero, carry,
GBIN 16-bit Gray code to word instruction 5 √ √ √ √
borrow
G
Zero, carry,
GRY Word to 16-bit Gray code instruction 5 √ √ √ √
borrow
Programming manual of IVC series small PLC Appendix 9 Instruction index 369
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
HACKLE Hackle wave signal output instruction 12 √ √ √ √
HCNT High-speed counter drive instruction 7 √ √ √ √
H HOUR Timing list instruction 8 √ √ √ √
Time (hour, minute and second) to
HTOS 5 √
second instruction
Zero, carry,
INC Increment integer instruction 3 √ √ √ √
borrow
Zero, carry,
INITR Initialize extension register 5 √
borrow
Floating point number to integer Zero, carry,
INT 6 √ √ √ √
I instruction borrow
INV Power flow block inverse 1 √ √ √ √
Hexadecimal number-ASCII code Zero, carry,
ITA 7 √ √ √ √
conversion instruction borrow
Zero, carry,
ITD Integer to double integer instruction 6 √ √ √ √
borrow
LBL Jump label definition 3 √ √ √ √
Zero, carry,
LCNV Engineering conversion instruction 9 √ √
borrow
LD NO contact power-flow loading 1 √ √ √ √
LD< Compare integer LD< instruction 5 √ √ √ √
LD<= Compare integer LD<= instruction 5 √ √ √ √
LD<> Compare integer LD<> instruction 5 √ √ √ √
LD= Compare integer LD= instruction 5 √ √ √ √
LD> Compare integer LD= instruction 5 √ √ √ √
LD>= Compare integer LD>= instruction 5 √ √ √ √
LDD< Compare double integer LD< instruction 7 √ √ √ √
LDD<= Compare double integer LD<= instruction 7 √ √ √ √
LDD<> Compare double integer LD<> instruction 7 √ √ √ √
LDD= Compare double integer LD= instruction 7 √ √ √ √
LDD> Compare double integer LD> instruction 7 √ √ √ √
LDD>= Compare double integer LD>= instruction 7 √ √ √ √
LDI NC contact power-flow loading 1 √ √ √ √
Compare floating point number LD<
LDR< 7 √ √ √ √
instruction
Compare floating point number LD<=
LDR<= 7 √ √ √ √
instruction
L
Compare floating point number LD<>
LDR<> 7 √ √ √ √
instruction
Compare floating point number LD=
LDR= 7 √ √ √ √
instruction
Compare floating point number LD>
LDR> 7 √ √ √ √
instruction
Compare floating point number LD>=
LDR>= 7 √ √ √ √
instruction
LIFO Last-in-first-out instruction 7 √ √ √ √
Zero, carry,
LIMIT Upper/lower limit control 9 √
borrow
Zero, carry,
LIN Linear trace interpolation 12 √
borrow
Zero, carry,
LN Floating point number LN instruction 7 √ √ √ √
borrow
Zero, carry,
LOADR Read extension file register 5 √
borrow
Zero, carry,
LOG Floating point number LOG instruction 7 √
borrow
Zero, carry,
LOGR Log in extension register 11 √
borrow
Programming manual of IVC series small PLC Appendix 9 Instruction index 370
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
LRC LRC check instruction 7 √ √ √ √
MC Main control 3 √ √ √ √
MCR Main control remove 1 √ √ √ √
Zero, carry,
MEAN Mean instruction 7 √
borrow
Modbus Master station communication instruction 8 √ √ √ √
MOV Move word data transmission instruction 5 √ √ √ √
Zero, carry,
M MOVLINK Synchronous control instruction 17 √
borrow
MPP Output power-flow stack pop off 1 √ √ √ √
MPS Output power-flow input stack 1 √ √ √ √
MRD Read output power-flow stack top value 1 √ √ √ √
Zero, carry,
MUL Multiply integer instruction 8 √ √ √ √
borrow
MODRW MODBUS read/write instruction 14 √* √ √ √
Zero, carry,
NEG Negative integer instruction 5 √ √ √ √
borrow
N
NEXT Return from cycle 1 √ √ √ √
NOP No operation 1 √ √ √ √
OR NO contact power-flow or 1 √ √ √ √
OR< Compare integer OR< instruction 5 √ √ √ √
OR<= Compare integer OR<= instruction 5 √ √ √ √
OR<> Compare integer OR<> instruction 5 √ √ √ √
OR= Compare integer OR= instruction 5 √ √ √ √
OR> Compare integer OR> instruction 5 √ √ √ √
OR>= Compare integer OR>= instruction 5 √ √ √ √
ORB Power flow or instruction 1 √ √ √ √
ORD< Compare double integer OR< instruction 7 √ √ √ √
Compare double integer OR<=
ORD<= 7 √ √ √ √
instruction
Compare double integer OR<>
ORD<> 7 √ √ √ √
instruction
ORD= Compare double integer OR= instruction 7 √ √ √ √
ORD> Compare double integer OR> instruction 7 √ √ √ √
Compare double integer OR>=
O ORD>= 7 √ √ √ √
instruction
ORI NC contact power-flow or 1 √ √ √ √
Compare floating point number OR<
ORR< 7 √ √ √ √
instruction
Compare floating point number OR<=
ORR<= 7 √ √ √ √
instruction
Compare floating point number OR<>
ORR<> 7 √ √ √ √
instruction
Compare floating point number OR=
ORR= 7 √ √ √ √
instruction
Compare floating point number OR>
ORR> 7 √ √ √ √
instruction
Compare floating point number OR>=
ORR>= 7 √ √ √ √
instruction
OUT Coil output instruction 1 √ √ √ √
OUT Sxx SFC state jump 3 √ √ √ √
PID PID instruction 9 √ √ √ √
PLS Pulse output instruction of envelope 7 √ √ √ √
Count pulse with ACC/DEC output
PLSR 10 √ √ √ √
P instruction
Zero, carry,
PLSV Variable speed pulse output instruction 8 √ √ √ √
borrow
PLSY High-speed pulse output instruction 9 √ √ √ √
Programming manual of IVC series small PLC Appendix 9 Instruction index 371
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
Floating point number exponentiation Zero, carry,
POWER 10 √ √ √ √
instruction borrow
PUSH Push instruction 7 √ √ √ √
PWM Pulse output instruction 7 √ √ √ √
Count pulse with base frequency and Zero, carry, √
PLSB 12 √
ACC/DEC output instruction borrow
Zero, carry, √
RAD Floating point number angle->rad 7
borrow
Zero, carry,
RADD Add floating point number instruction 10 √ √ √ √
borrow
RAMP Ramp wave signal output instruction 12 √ √ √ √
RCL 16-bit carry circular shift left instruction 7 Carry √ √ √ √
RCR 16-bit carry circular shift right instruction 7 Carry √ √ √ √
RCV Free port receiving instruction 7 √ √ √ √
Zero, carry,
RDIV Divide floating point number instruction 10 √ √ √
borrow
REF Instant refresh I/O instruction 5 √ √ √ √
REFF Set input filtering constant instruction 3 √ √ √ √
RET SFC program end 1 √ √ √ √
R Floating point engineering conversion Zero, carry,
RLCNV 12 √ √
instruction borrow
Move floating point number data
RMOV 7 √ √ √ √
transmission
Zero, carry,
RMUL Multiply floating point number instruction 10 √ √ √ √
borrow
RND Generate random number instruction 3 Zero √
Negative floating point number Zero, carry,
RNEG 7 √ √ √ √
instruction borrow
ROL 16-bit circular shift left instruction 7 Carry √ √ √ √
ROR 16-bit circular shift right instruction 7 Carry √ √ √ √
Square root floating point number Zero, carry,
RSQT 7 √ √ √ √
instruction borrow
RST Coil reset instruction 1 √ √ √ √
RST Sxx SFC state reset 3 √ √ √ √
Substract floating point number Zero, carry,
RSUB 10 √ √ √ √
instruction borrow
Zero, carry,
RSUM Sum floating point number instruction 9 √ √ √ √
R borrow
Floating point number absolute value Zero, carry,
RVABS 7 √ √ √ √
instruction borrow
Compare and set floating point number √
RCMP 9 √*
instruction
Zero, carry, √
SAVER Write extension file register 7
borrow
Zero, carry, √
SCL Locate coordinate 7
borrow
Zero, carry,
SEG Word to 7-segment code instruction 5 √ √ √ √
borrow
Zero, carry,
SER Search data 9 √
borrow
S
SET Coil set instruction 1 √ √ √ √
SET Sxx SFC state transfer 3 √ √ √ √
SFTL Shift left byte instruction 9 √ √ √ √
SFTR Shift right byte instruction 9 √ √ √ √
SHL 16-bit shift left instruction 7 √ √ √ √
SHR 16-bit shift right instruction 7 √ √ √ √
Zero, carry,
SIN Floating point number SIN instruction 7 √ √ √ √
borrow
Programming manual of IVC series small PLC Appendix 9 Instruction index 372
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
SPD Pulse detection instruction 7 √ √ √ √
Zero, carry,
SQT Square root integer instructions 5 √ √ √ √
borrow
STL SFC state load instruction 3 √ √ √ √
Second to time (hour, minute and
STOH 5 √
second) instruction
STOP User program stop 1 √ √ √ √
Zero, carry,
STRADD Add string 7 √
borrow
Zero, carry,
STRINSTR Search string 9 √
borrow
Zero, carry,
STRLEFT Read string from the left 7 √
borrow
Zero, carry,
STRLEN Detect string length 5 √
borrow
Zero, carry,
STRMIDR Read any strings 7 √
borrow
Zero, carry,
STRMIDW Replace any strings 7 √
borrow
Zero, carry,
STRMOV Move string 5 √
borrow
Zero, carry,
STRRIGHT Read string from the right 7 √
borrow
Zero, carry,
SUB Subtract integer instruction 7 √ √ √ √
borrow
Zero, carry,
SUM Sum integer instruction 8 √ √ √ √
borrow
SWAP Swap bytes 3 √ √ √ √
TADD Add clock instruction 7 Zero, carry √ √ √ √
Zero, carry,
TAN Floating point number TAN instruction 7 √ √ √ √
borrow
TCMP< Compare time< instruction 7 √ √ √ √
TCMP<= Compare time<= instruction 7 √ √ √ √
TCMP<> Compare time<> instruction 7 √ √ √ √
TCMP= Compare time= instruction 7 √ √ √ √
TCMP> Compare time> instruction 7 √ √ √ √
TCMP>= Compare time>= instruction 7 √ √ √ √
TKY EEPROM write instruction 7 √
T
TMON Monostable timing instruction 5 √ √ √ √
Write word to special module buffer
TO 9 √ √
register instruction
TOF Off-delay timing instruction 5 √ √ √ √
TON On-delay timing instruction 5 √ √ √ √
TONR On-delay remember timing instruction 5 √ √ √ √
TRD Read real-time clock instruction 3 √ √ √ √
TRIANGLE Triangle wave signal output instruction 12 √ √ √ √
TSUB Subtract clock instruction 7 Zero, borrow √ √ √ √
TWR Write real-time clock instruction 3 √ √ √ √
Zero, carry,
U UNI 4bit combination instruction for 16bit data 7 √
borrow
Zero, carry,
VABS Integer absolute value instruction 5 √ √ √ √
borrow
V
Read analog potentiometer value
VRRD 5 √ √
instruction
Programming manual of IVC series small PLC Appendix 9 Instruction index 373
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
WAND AND word instruction 7 √ √ √ √
WDT User program watchdog reset 1 √ √ √ √
WINV NOT word instruction 5 √ √ √ √
WOR OR word instruction 7 √ √ √ √
Zero, carry,
WSFL Shift left word instruction 9 √ √ √ √
W borrow
Zero, carry,
WSFR Shift right word instruction 9 √ √ √ √
borrow
Zero, carry,
WTOB Data separation instruction for byte unit 7 √
borrow
WXOR Exclusive-OR word instruction 7 √ √ √ √
XCH Exchange word 5 √ √ √ √
X
XMT Free port sending instruction 7 √ √ √ √
Zero, carry,
ZONE Zone control 9 √
borrow
Zero, carry,
Z ZRN Regress to origin instruction 11 √ √ √
borrow
ZRST Batch bit reset instruction 5 √ √ √ √
ZSET Set batch bit instruction 5 √ √ √ √
Note: * only applies to IVC2L.
Programming manual of IVC series small PLC Appendix 10 Classified instruction index 374
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
NO contact power-flow
LD 1 √ √ √ √
loading
NC contact power-flow
LDI 1 √ √ √ √
loading
NO contact power-flow
AND 1 √ √ √ √
and
NC contact power-flow
ANI 1 √ √ √ √
and
NO contact power-flow
OR 1 √ √ √ √
or
NC contact power-flow
ORI 1 √ √ √ √
or
OUT Coil output instruction 1 √ √ √ √
SET Coil set instruction 1 √ √ √ √
RST Coil reset instruction 1 √ √ √ √
Power flow block and
ANB 1 √ √ √ √
instruction
Power flow or
ORB 1 √ √ √ √
instruction
Power flow block
INV 1 √ √ √ √
inverse
NOP No operation 1 √ √ √ √
Output power-flow input
MPS 1 √ √ √ √
stack
Basic
Read output power-flow
instruction MRD 1 √ √ √ √
stack top value
Output power-flow stack
MPP 1 √ √ √ √
pop off
MC Main control 3 √ √ √ √
MCR Main control remove 1 √ √ √ √
Power flow rising edge
EU 2 √ √ √ √
detection
Power flow falling edge
ED 2 √ √ √ √
detection
On-delay timing
TON 5 √ √ √ √
instruction
Off-delay timing
TOF 5 √ √ √ √
instruction
Monostable timing
TMON 5 √ √ √ √
instruction
On-delay remember
TONR 5 √ √ √ √
timing instruction
16-bit counter counting
CTU 5 √ √ √ √
up instruction
16-bit counter loop
CTR cycle counting 5 √ √ √ √
instruction
32-bit counting
DCNT 7 √ √ √ √
instruction
LBL Jump label definition 3 √ √ √ √
Program
CJ Conditional jump 3 √ √ √ √
control
Depend on
instruction CALL Calling a subprogram √ √ √ √
the program
Programming manual of IVC series small PLC Appendix 10 Classified instruction index 375
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
Conditional return from
CSRET 1 √ √ √ √
user subprogram
Conditional end from
CFEND 1 √ √ √ √
user main program
Conditional return from
CIRET user interrupt 1 √ √ √ √
subprogram
FOR Cycle instruction 3 √ √ √ √
NEXT Return from cycle 1 √ √ √ √
User program watchdog
WDT 1 √ √ √ √
reset
STOP User program stop 1 √ √ √ √
Enable interrupt
EI 1 √ √ √ √
instruction
Disable interrupt
DI 1 √ √ √ √
instruction
SFC state load
STL 3 √ √ √ √
instruction
SFC SET Sxx SFC state transfer 3 √ √ √ √
instruction OUT Sxx SFC state jump 3 √ √ √ √
RST Sxx SFC state reset 3 √ √ √ √
RET SFC program end 1 √ √ √ √
Move word data
MOV 5 √ √ √ √
transmission instruction
Move double word data
DMOV 7 √ √ √ √
transmission instruction
Data
Move floating point
transmission
RMOV number data 7 √ √ √
instruction
transmission
Move data block
BMOV 7 √ √ √ √
transmission instruction
SWAP Swap bytes 3 √ √ √ √
XCH Exchange word 5 √ √ √ √
Exchange double word
DXCH 7 √ √ √ √
instruction
Fill data block
FMOV 7 √ √ √ √
instruction
Fill data block double
DFMOV 9 √ √ √ √
word instruction
Data flow Shift right word Zero, carry,
WSFR 9 √ √ √ √
instruction instruction borrow
Shift left word Zero, carry,
WSFL 9 √ √ √ √
instruction borrow
PUSH Push instruction 7 √ √ √ √
First-in-first-out
FIFO 7 √ √ √ √
instruction
Last-in-first-out
LIFO 7 √ √ √ √
instruction
Zero, carry,
ADD Add integer instruction 7 √ √ √ √
borrow
Add double integer Zero, carry,
DADD 10 √ √ √ √
Integer/ instruction borrow
double integer Subtract integer Zero, carry,
SUB 7 √ √ √ √
math instruction borrow
instruction Subtract double integer Zero, carry,
DSUB 10 √ √ √ √
instruction borrow
Increment integer Zero, carry,
INC 3 √ √ √ √
instruction borrow
Programming manual of IVC series small PLC Appendix 10 Classified instruction index 376
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
Increment double Zero, carry,
DINC 4 √ √ √ √
integer instruction borrow
Decrement integer Zero, carry,
DEC 3 √ √ √ √
instruction borrow
Decrement double Zero, carry,
DDEC 4 √ √ √ √
integer instruction borrow
Multiply integer Zero, carry,
MUL 8 √ √ √ √
instruction borrow
Multiply double integer Zero, carry,
DMUL 10 √ √ √ √
instruction borrow
Divide integer
DIV 7 √ √ √ √
instruction
Divide double integer Zero, carry,
DDIV 10 √ √ √ √
instruction borrow
Integer absolute value Zero, carry,
VABS 5 √ √ √ √
instruction borrow
Double integer absolute Zero, carry,
DVABS 7 √ √ √ √
value instruction borrow
Negative integer Zero, carry,
NEG 5 √ √ √ √
instruction borrow
Negative double integer Zero, carry,
DNEG 7 √ √ √ √
instruction borrow
Square root integer Zero, carry,
SQT 5 √ √ √ √
instruction borrow
Square root double Zero, carry,
DSQT 7 √ √ √ √
integer instruction borrow
Zero, carry,
SUM Sum integer instruction 8 √ √ √ √
borrow
Sum double integer Zero, carry,
DSUM 9 √ √ √ √
instruction borrow
Add floating point Zero, carry,
RADD 10 √ √ √ √
number instruction borrow
Substract floating point Zero, carry,
RSUB 10 √ √ √ √
number instruction borrow
Multiply floating point Zero, carry,
RMUL 10 √ √ √ √
number instruction borrow
Divide floating point Zero, carry,
RDIV 10 √ √ √ √
number instruction borrow
Floating point number
Zero, carry,
RVABS absolute value 7 √ √ √ √
borrow
instruction
Negative floating point Zero, carry,
RNEG 7 √ √ √ √
number instruction borrow
Floating point
Square root floating Zero, carry,
number math RSQT 7 √ √ √ √
point number instruction borrow
instruction
Floating point number Zero, carry,
SIN 7 √ √ √ √
SIN instruction borrow
Floating point number Zero, carry,
COS 7 √ √ √ √
COS instruction borrow
Floating point number Zero, carry,
TAN 7 √ √ √ √
TAN instruction borrow
Floating point number Zero, carry,
LN 7 √ √ √ √
LN instruction borrow
Floating point number Zero, carry,
EXP 7 √ √ √ √
EXP instruction borrow
Floating point number
Zero, carry,
POWER exponentiation 10 √ √ √ √
borrow
instruction
Programming manual of IVC series small PLC Appendix 10 Classified instruction index 377
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
Sum floating point Zero, carry,
RSUM 9 √ √ √ √
number instruction borrow
Floating point number Zero, carry,
ASIN 7 √
ASIN instruction borrow
Floating point number Zero, carry,
ACOS 7 √
ACOS instruction borrow
Floating point
Floating point number Zero, carry,
math ATAN 7 √
ATAN instruction borrow
instruction
Floating point number Zero, carry,
RAD 7 √
angle->rad borrow
Floating point number Zero, carry,
DEG 7 √
rad->angle borrow
Floating point number Zero, carry,
LOG 7 √
LOG instruction borrow
WAND AND word instruction 7 √ √ √ √
AND double word
DWAND 10 √ √ √ √
instruction
WOR OR word instruction 7 √ √ √ √
OR double word
Word/ DWOR 10 √ √ √ √
instruction
double word
Exclusive-OR word
logic WXOR 7 √ √ √ √
instruction
instruction
Exclusive-OR double
DWXOR 10 √ √ √ √
word instruction
WINV NOT word instruction 5 √ √ √ √
NOT double word
DWINV 7 √ √ √ √
instruction
16-bit circular shift right
ROR 7 Carry √ √ √ √
instruction
32-bit circular shift right
DROR 9 Carry √ √ √ √
instruction
16-bit circular shift left
ROL 7 Carry √ √ √ √
instruction
32-bit circular shift left
DROL 9 Carry √ √ √ √
instruction
16-bit carry circular shift
RCR 7 Carry √ √ √ √
right instruction
32-bit carry circular shift
DRCR 9 Carry √ √ √ √
right instruction
Shift/ 16-bit carry circular shift
RCL 7 Carry √ √ √ √
rotate left instruction
instruction 32-bit carry circular shift
DRCL 9 Carry √ √ √ √
left instruction
16-bit shift right
SHR 7 √ √ √ √
instruction
32-bit shift right
DSHR 9 √ √ √ √
instruction
16-bit shift left
SHL 7 √ √ √ √
instruction
32-bit shift left
DSHL 9 √ √ √ √
instruction
SFTL Shift left byte instruction 9 √ √ √ √
Shift right byte
SFTR 9 √ √ √ √
instruction
DECO Decode instruction 5 √ √ √ √
Enhanced bit
ENCO Encode instruction 5 √ √ √ √
logic
Counting ON bit in word
instruction BITS 5 √ √ √ √
instruction
Programming manual of IVC series small PLC Appendix 10 Classified instruction index 378
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
Counting ON bit in
DBITS 6 √ √ √ √
double word instruction
Batch bit reset
ZRST 5 √ √ √ √
instruction
ZSET Set batch bit instruction 5 √ √ √ √
Judging ON bit in word
BON 7 √
instruction
High-speed counter
HCNT 7 √ √ √ √
drive instruction
High-speed counting
DHSCS 10 √ √ √ √
compare set instruction
High-speed counting
DHSCR compare reset 10 √ √ √ √
instruction
High-speed counting
DHSCI interrupt trigger 10 √ √ √ √
instruction
High-speed counting
DHSZ zone compare 13 √ √ √ √
instruction
High-speed counting
DHST table compare 10 √ √ √ √
High- instruction
speed I/O High-speed counting
instruction DHSP table compare pulse 10 √ √ √ √
output instruction
Pulse detection
SPD 7 √ √ √ √
instruction
High-speed pulse
PLSY 9 √ √ √ √
output instruction
Count pulse with
PLSR ACC/DEC output 10 √ √ √ √
instruction
Count pulse with base
frequency and Zero, carry,
PLSB 12 √ √
ACC/DEC output borrow
instruction
PWM Pulse output instruction 7 √ √ √ √
Pulse output instruction
PLS 7 √ √ √ √
of envelope
PID PID instruction 9 √ √ √ √
Ramp wave signal
RAMP 12 √ √ √ √
output instruction
Triangle wave signal
TRIANGLE 12 √ √ √ √
output instruction
Control Hackle wave signal
HACKLE 12 √ √ √ √
calculation output instruction
instruction Absolute drum control Zero, carry,
ABSD 9 √ √
instruction borrow
Double word absolute Zero, carry,
DABSD 11 √ √
drum control instruction borrow
Alternate output Zero, carry,
ALT 3 √ √ √
instruction borrow
Read word from special
FROM module buffer register 9 √ √
External
instruction
equipment
Read double word from
instruction
DFROM special module buffer 10 √ √
register instruction
Programming manual of IVC series small PLC Appendix 10 Classified instruction index 379
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
Write word to special
TO module buffer register 9 √ √
instruction
Write double word to
DTO special module buffer 10 √ √
register instruction
Read analog
VRRD potentiometer value 5 √ √
instruction
Set input filtering
REFF 3 √ √ √ √
constant instruction
Instant refresh I/O
REF 5 √ √ √ √
instruction
EEPROM write
EROMWR 7 √ √ √
instruction
PR Print instruction 5 √* √
Numeric key input
TKY 7 √
instruction
Read current value Zero, carry,
ABS 8 √ √ √
instruction borrow
Regress to origin Zero, carry,
ZRN 11 √ √ √ √
instruction borrow
Variable speed pulse Zero, carry,
PLSV 8 √ √ √ √
output instruction borrow
Relative position control Zero, carry,
DRVI 11 √* √ √ √
instruction borrow
Absolute position Zero, carry,
DRVA 11 √* √ √ √
control instruction borrow
Regress to origin with Zero, carry,
Locating DSZR 9 √ √ √
DOG search instruction borrow
instruction
Zero, carry,
DVIT Interrupt locating 11 √ √ √
borrow
Linear trace Zero, carry,
LIN 12 √
interpolation borrow
Clockwise circular trace Zero, carry,
CW 12 √
interpolation borrow
Counterclockwise
Zero, carry,
CCW circular trace 12 √
borrow
interpolation
Synchronous control Zero, carry,
MOVLINK 17 √
instruction borrow
Read real-time clock
TRD 3 √ √ √ √
instruction
Write real-time clock
TWR 3 √ √ √ √
instruction
TADD Add clock instruction 7 Zero, carry √ √ √ √
Subtract clock
Real-time TSUB 7 Zero, borrow √ √ √ √
instruction
clock
HOUR Timing list instruction 8 √ √ √ √
instruction
Time (hour, minute and
HTOS second) to second 5 √
instruction
Second to time (hour,
STOH minute and second) 5 √
instruction
Compare integer LD=
Compare LD= 5 √ √ √ √
instruction
contact
Compare double integer
instruction LDD= 7 √ √ √ √
LD= instruction
Programming manual of IVC series small PLC Appendix 10 Classified instruction index 380
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
Compare floating point
LDR= 7 √ √ √ √
number LD= instruction
Compare integer LD>
LD> 5 √ √ √ √
instruction
Compare double integer
LDD> 7 √ √ √ √
LD> instruction
Compare floating point
LDR> 7 √ √ √ √
number LD> instruction
Compare integer LD>=
LD>= 5 √ √ √ √
instruction
Compare double integer
LDD>= 7 √ √ √ √
LD>= instruction
Compare integer LD<
LD< 5 √ √ √ √
instruction
Compare double integer
LDD< 7 √ √ √ √
LD< instruction
Compare floating point
LDR< 7 √ √ √ √
number LD< instruction
Compare integer LD<=
LD<= 5 √ √ √ √
instruction
Compare double integer
LDD<= 7 √ √ √ √
LD<= instruction
Compare floating point
LDR<= number LD<= 7 √ √ √ √
instruction
Compare integer LD<>
LD<> 5 √ √ √ √
instruction
Compare double integer
LDD<> 7 √ √ √ √
LD<> instruction
Compare floating point
LDR<> number LD<> 7 √ √ √ √
instruction
Compare integer AND=
AND= 5 √ √ √ √
Compare instruction
contact Compare double integer
ANDD= 7 √ √ √ √
instruction AND= instruction
Compare floating point
ANDR= number AND= 7 √ √ √ √
instruction
Compare integer AND>
AND> 5 √ √ √ √
instruction
Compare double integer
ANDD> 7 √ √ √ √
AND> instruction
Compare floating point
ANDR> number AND> 7 √ √ √ √
instruction
Compare integer
AND>= 5 √ √ √ √
AND>= instruction
Compare double integer
ANDD>= 7 √ √ √ √
AND>= instruction
Compare floating point
ANDR>= number AND>= 7 √ √ √ √
instruction
Compare integer AND<
AND< 5 √ √ √ √
instruction
Compare double integer
ANDD< 7 √ √ √ √
AND< instruction
Programming manual of IVC series small PLC Appendix 10 Classified instruction index 381
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
Compare floating point
ANDR< number AND< 7 √ √ √ √
instruction
Compare integer
AND<= 5 √ √ √ √
AND<= instruction
Compare double integer
ANDD<= 7 √ √ √ √
AND<= instruction
Compare floating point
ANDR<= number AND<= 7 √ √ √ √
instruction
Compare integer
AND<> 5 √ √ √ √
AND<> instruction
Compare double integer
ANDD<> 7 √ √ √ √
AND<> instruction
Compare floating point
ANDR<> number AND<> 7 √ √ √ √
instruction
Compare integer OR=
OR= 5 √ √ √ √
instruction
Compare double integer
ORD= 7 √ √ √ √
OR= instruction
Compare floating point
ORR= 7 √ √ √ √
number OR= instruction
Compare integer OR>
OR> 5 √ √ √ √
instruction
Compare double integer
ORD> 7 √ √ √ √
OR> instruction
Compare floating point
ORR> 7 √ √ √ √
number OR> instruction
Compare integer OR>=
OR>= 5 √ √ √ √
instruction
Compare double integer
ORD>= 7 √ √ √ √
OR>= instruction
Compare
Compare floating point
contact
ORR>= number OR>= 7 √ √ √
instruction
instruction
Compare integer OR<
OR< 5 √ √ √ √
instruction
Compare double integer
ORD< 7 √ √ √ √
OR< instruction
Compare floating point
ORR< 7 √ √ √ √
number OR< instruction
Compare integer OR<=
OR<= 5 √ √ √ √
instruction
Compare double integer
ORD<= 7 √ √ √ √
OR<= instruction
Compare floating point
ORR<= number OR<= 7 √ √ √
instruction
Compare integer OR<>
OR<> 5 √ √ √ √
instruction
Compare double integer
ORD<> 7 √ √ √ √
OR<> instruction
Compare floating point
ORR<> number OR<> 7 √ √ √ √
instruction
Compare and set
CMP 7 √* √
integer instruction
Programming manual of IVC series small PLC Appendix 10 Classified instruction index 382
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
Compare and set
LCMP double integer 9 √* √
instruction
Compare and set
RCMP floating point number 9 √* √
instruction
Integer to double integer Zero, carry,
ITD 6 √ √ √ √
instruction borrow
Double integer to Zero, carry,
DTI 6 √ √ √ √
integer instruction borrow
Integer to floating point Zero, carry,
FLT 6 √ √ √ √
number instruction borrow
Double integer to
Zero, carry,
DFLT floating point number 7 √ √ √ √
borrow
instruction
Floating point number to Zero, carry,
INT 6 √ √ √ √
integer instruction borrow
Floating point number to
Zero, carry,
DINT double integer 7 √ √ √ √
borrow
instruction
Word to 16-bit BCD Zero, carry,
BCD 5 √ √ √ √
instruction borrow
Double word to 32-bit Zero, carry,
DBCD 7 √ √ √ √
BCD instruction borrow
16-bit BCD to word Zero, carry,
BIN 5 √ √ √ √
instruction borrow
32-bit BCD to double Zero, carry,
DBIN 7 √ √ √ √
word instruction borrow
Data converting Word to 16-bit Gray Zero, carry,
GRY 5 √ √ √ √
instruction code instruction borrow
Double word to 32-bit Zero, carry,
DGRY 7 √ √ √ √
Gray code instruction borrow
16-bit Gray code to Zero, carry,
GBIN 5 √ √ √ √
word instruction borrow
32-bit Gray code to Zero, carry,
DGBIN 7 √ √ √ √
double word instruction borrow
Word to 7-segment Zero, carry,
SEG 5 √ √ √ √
code instruction borrow
ASCII code conversion Zero, carry,
ASC 19 √ √ √ √
instruction borrow
Hexadecimal
Zero, carry,
ITA number-ASCII code 7 √ √ √ √
borrow
conversion instruction
ASCII
code-hexadecimal Zero, carry,
ATI 7 √ √ √ √
number conversion borrow
instruction
Engineering conversion Zero, carry,
LCNV 9 √ √
instruction borrow
Floating point
Zero, carry,
RLCNV engineering conversion 12 √ √
borrow
instruction
Word contact Word bit contact LD
BLD 5 √ √ √ √
instruction instruction
Programming manual of IVC series small PLC Appendix 10 Classified instruction index 383
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
Word bit contact LDI
BLDI 5 √ √ √ √
instruction
Word bit contact AND
BAND 5 √ √ √ √
instruction
Word bit contact ANI
BANI 5 √ √ √ √
instruction
Word bit contact OR
BOR 5 √ √ √ √
instruction
Word bit contact ORI
BORI 5 √ √ √ √
instruction
Word bit coil set
BSET 5 √ √ √ √
instruction
Word bit coil reset
BRST 5 √ √ √ √
instruction
Word bit coil output
BOUT 5 √ √ √ √
instruction
Master station
Modbus communication 8 √ √ √ √
instruction
Free port sending
XMT 7 √ √ √ √
instruction
Free port receiving
RCV 7 √ √ √ √
instruction
Inverter forward rotation
IVFWD 6 √* √ √ √
instruction
Inverter reverse rotation
IVREV 6 √* √ √ √
instruction
Inverter jogging forward
IVDFWD 6 √* √ √ √
rotation instruction
Communicatio Inverter jogging reverse
IVDREV 6 √* √ √ √
n instruction rotation instruction
IVSTOP Inverter stop instruction 8 √* √ √ √
Inverter set frequency
IVFRQ 8 √* √ √ √
instruction
Inverter write single
IVWRT register value 10 √* √ √ √
instruction
Inverter read status
IVRDST 10 √* √ √ √
instruction
Inverter read single
IVRD register value 10 √* √ √ √
instruction
MODBUS read/write
MODRW 14 √* √ √ √
instruction
CCITT CCITT check instruction 7 √ √ √ √
Data check CRC16 check
CRC16 7 √ √ √ √
instruction instruction
LRC LRC check instruction 7 √ √ √ √
Compare date=
DCMP= 7 √ √ √ √
instruction
Compare date>
DCMP> 7 √ √ √ √
instruction
Compare date Compare date<
DCMP< 7 √ √ √ √
instruction instruction
Compare date>=
DCMP>= 7 √ √ √ √
instruction
Compare date<=
DCMP<= 7 √ √ √ √
instruction
Programming manual of IVC series small PLC Appendix 10 Classified instruction index 384
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
Compare date<>
DCMP<> 7 √ √ √ √
instruction
Compare time=
TCMP= 7 √ √ √ √
instruction
Compare time>
TCMP> 7 √ √ √ √
instruction
Compare time<
TCMP< 7 √ √ √ √
Compare time instruction
instruction Compare time>=
TCMP>= 7 √ √ √ √
instruction
Compare time<=
TCMP<= 7 √ √ √ √
instruction
Compare time<>
TCMP<> 7 √ √ √ √
instruction
Zero, carry,
MEAN Mean instruction 7 √
borrow
Data separation Zero, carry,
WTOB 7 √
instruction for byte unit borrow
Data combination Zero, carry,
BTOW 7 √
instruction for byte unit borrow
Data
4bit combination Zero, carry,
processing UNI 7 √
instruction for 16bit data borrow
instruction
4bit separation Zero, carry,
DIS 7 √
instruction for 16bit data borrow
Signal alarm set Zero, carry,
ANS 7 √
instruction borrow
Signal alarm reset Zero, carry,
ANR 1 √
instruction borrow
Zero, carry,
BKADD Add batch data operation 9 √
borrow
Data block
Subtract batch data Zero, carry,
processing BKSUB 9 √
operation borrow
instruction
BKCMP=,>,<, Zero, carry,
Compare batch data 9 √
<>,<=,>= borrow
Zero, carry,
LIMIT Upper/lower limit control 9 √
borrow
Zero, carry,
DBAND Dead band control 9 √
borrow
Data table
Zero, carry,
processing ZONE Zone control 9 √
borrow
instruction
Zero, carry,
SCL Locate coordinate 7 √
borrow
Zero, carry,
SER Search data 9 √
borrow
Zero, carry,
STRADD Add string 7 √
borrow
Zero, carry,
STRLEN Detect string length 5 √
borrow
Zero, carry,
STRRIGHT Read string from the right 7 √
borrow
String
Zero, carry,
processing STRLEFT Read string from the left 7 √
borrow
instruction
Zero, carry,
STRMIDR Read any strings 7 √
borrow
Zero, carry,
STRMIDW Replace any strings 7 √
borrow
Zero, carry,
STRINSTR Search string 9 √
borrow
Programming manual of IVC series small PLC Appendix 10 Classified instruction index 385
Program
Instruction Instruction function Influenced flag bit IVC2L IVC1 IVC1L IVC2H
steps
Zero, carry,
STRMOV Move string 5 √
borrow
Read extension file Zero, carry,
LOADR 5 √
register borrow
Write extension file Zero, carry,
SAVER 7 √
register borrow
Extension file
Initialize extension Zero, carry,
register INITR 5 √
register borrow
instruction
Log in extension Zero, carry,
LOGR 11 √
register borrow
Initialize extension file Zero, carry,
INITER 5 √
register borrow
Generate random
RND 3 Zero √
number instruction
Others
Generate timing pulse
DUTY 7 √
instruction
Note: * only applies to IVC2L.