Wecon LX Series Operating instructions

WECON Technology Co., Ltd.
1
WECON
Programming
WECON Technology Co., Ltd.
Website: http://www.we-con.com.cn/en
Technical Support: cheng[email protected].cn
Skype: Jason.chen842
Phone: 86-591-87868869

WECON Technology Co., Ltd.
2
Basic Program Instructions
1. What is a Program?
A program is a connected series of instructions written in a language that the PLC can
understand. There are two forms of program format; instruction, ladder.
panels only work with instruction format while most graphic programming tools will
work with both instruction and ladder format.
2. Outline of Basic Devices Used in Programming
There are six basic programming devices. Each device has its own unique use. To
enable quick and easy identification each device is assigned a single reference letter;
- X: This is used to identify all direct, physical inputs to the PLC.
- Y: This is used to identify all direct, physical outputs from the PLC.
- T: This is used to identify a timing device which is contained within the PLC.
- C: This is used to identify a counting device which is contained within the PLC.
- M and S: These are used as internal operation flags within the PLC.
All of the devices mentioned above are known as ‘bit devices’. This is a descriptive
title telling the user that these devices only have two states; ON or OFF, 1 or 0.
3. How to Read Ladder Logic
Ladder logic is very closely associated to basic relay logic. There are both contacts
and coils that can be loaded and driven in different configurations. However, the basic
principle remains the same.
A coil drives direct outputs of the PLC (ex. a Y device) or drives internal timers,
counters orflags (ex. T, C, M and S devices). Each coil has associated contacts.
These contacts are available in both “normally open” (NO) and “normally closed” (NC)
configurations.
The term “normal(ly)” refers to the status of the contacts when the coil is not
energized.
Using a relay analogy, when the coil is OFF, a NO contact would have no current flow,
that is, a load being supplied through a NO contact would not operate. However, a NC
contact would allow current to flow, hence the connected load would be active.
Activating the coil reverses the contact status, that is, the current would flow in a NO

WECON Technology Co., Ltd.
3
contact and a NC contact would inhibit the flow.
Physical inputs to the PLC (X devices) have no programmable coil. These devices
may only be used in a contact format (NO and NC types are available).
Example:
Because of the close relay association, ladder logic programs can be read as current
flowing from the left vertical line to the right vertical line. This current must pass
through a series of contact representations such as X0 and X1 in order to switch the
output coil Y0 ON. Therefore,in the example shown, switching X0 ON causes the
output Y0 to also switch ON. If however,the limit switch X1 is activates, the output Y0
turns OFF. This is because the connection between the left and the right vertical lines
breaks so there is no current flow.
4.Load, Load Inverse
Program example:

WECON Technology Co., Ltd.
4
Basic points to remember:
- Connect the LD and LDI instructions directly to the left hand bus bar.
- Or use LD and LDI instructions to define a new block of program when using the
ORB
5.Out
Basic points to remember:
- Connect the OUT instruction directly to the right hand bus bar.
- It is not possible to use the OUT instruction to drive ‘X’ type input devices.
- It is possible to connect multiple OUT instructions in parallel (for example see the
previous page; M100/T0 configuration)
5.1 Timer and Counter Variations
When configuring the OUT instruction for use as either a timer (T) or counter (C) a
constant must also be entered. The constant is identified by the letter “K” (for example
see previous page; T0 K19).
In the case of a timer, the constant “K” holds the duration data for the timer to operate,
i.e. if a 100 msec timer has a constant of “K100” it will be (1005 100 msec) 10 seconds
before the timer coil activates.
With counters, the constant identifies how many times the counter must be pulsed or
triggered before the counter coil activates. For example, a counter with a constant of
“8” must be triggered 8 times before the counter coil finally energizes.
The following table identifies some basic parameter data for various timers and
counters;

WECON Technology Co., Ltd.
5
5.2 Double Coil Designation
Double or dual coiling is not a recommended practice. Using multiple output coils of
thesame device can cause the program operation to become unreliable. The example
program shown opposite identifies a double coil situation; there are two Y3 outputs.
The following sequence of events will occur when inputs X1 = ON and X2 = OFF;
1.The first Y3 tuns ON because X1 is ON. The contacts associated with Y3 also
energize when the coil of output Y3 energizes. Hence,output Y4 turns ON.
2.The last and most important line in this program looks at the status of input X2.
If this is NOT ON then the second Y3 coil does NOT activate. Therefore the status of
the Y3 coil updates to reflect this new situation, i.e. it turns OFF. The final outputs are
then Y3 = OFF and Y4 = ON.
Use of dual coils:
• Always check programs for incidents of dual coiling. If there are dual coils the
program will not operate as expected - possibly resulting in unforeseen physical
The last coil effect:
• In a dual coil designation, the coil operation designated last is the effective coil. That
is, it is the status of the previous coil that dictates the behavior at the current point in
the program.
6. And, And Inverse

WECON Technology Co., Ltd.
6
Program example:
Basic points to remember:
- Use the AND and ANI instructions for serial connection of contacts. As many
contacts as required can be connected in series (see following point headed
“Peripheral limitations”).
- The output processing to a coil, through a contact, after writing the initial OUT
instruction is called a “follow-on” output (for an example see the program above; OUT
Y4). Followon outputs are permitted repeatedly as long as the output order is correct.
Peripheral limitations:
• The PLC has no limit to the number of contacts connected in series or in parallel.
However, some programming panels, screens and printers will not be able to display
or print the program if it exceeds the limit of the hardware. It is preferable for each
line or rung of ladder program to contain up to a maximum of 10 contacts and 1 coil.
Also, keep the number of follow-on outputs to a maximum of 24.
7. Or, Or Inverse

WECON Technology Co., Ltd.
7
Program example:
Basic points to remember:
- Use the OR and ORI instructions for parallel connection of contacts. To connect a
block that contains more than one contact connected in series to another circuit block
in parallel, use an ORB instruction.
- Connect one side of the OR/ORI instruction to the left hand bus bar.
Peripheral limitations:
• The PLC has no limit to the number of contacts connected in series or in parallel.
However, some programming panels, screens and printers will not be able to display
or print the program if it exceeds the limit of the hardware. It is preferable for each
line or rung of ladder program to contain up to a maximum of 10 contacts and 1 coil.
Also keep number of follow-on outputs to a maximum of 24.
8. Load Pulse, Load Trailing Pulse

WECON Technology Co., Ltd.
8
Program example:
Basic points to remember:
- Connect the LDP and LDF instructions directly to the left hand bus bar.
- Or use LDP and LDF instructions to define a new block of program when using the
ORB and ANB instructions (see later sections).
- LDP is active for one program scan after the associated device switches from OFF
to ON.
- LDF is active for one program scan after the associated device switches from ON to
OFF.
9. And Pulse, And Trailing Pulse
Program example:
Basic points to remember:

WECON Technology Co., Ltd.
9
- Use the ANDP and ANDF instructions for the serial connection of pulse contacts.
- Usage is the same as for AND and ANI; see earlier.
- ANP is active for one program scan after the associated device switches from OFF
to ON.
- ANF is active for one program scan after the associated device switches from ON to
OFF.
10. Or Pulse, Or Trailing Pulse
Program example:
Basic points to remember:
- Use the ORP and ORF instructions for the parallel connection of pulse contacts.
- Usage is the same as for OR and ORI; see earlier.
- ORP is active for one program scan after the associated device switches from OFF
to ON.
- ORF is active for one program scan after the associated device switches from ON to
OFF.
2.11 Or Block
Program example:

WECON Technology Co., Ltd.
10
Basic points to remember:
- An ORB instruction is an independent instruction and is not associated with any
device number.
- Use the ORB instruction to connect multi-contact circuits (usually serial circuit blocks)
to the preceding circuit in parallel. Serial circuit blocks are those in which more than
one contact connects in series or the ANB instruction is used.
- To declare the starting point of the circuit block use a LD or LDI instruction. After
completing the serial circuit block, connect it to the preceding block in parallel using
the ORB instruction.
Batch processing limitations:
• When using ORB instructions in a batch, use no more than 8 LD and LDI instructions
in the definition of the program blocks (to be connected in parallel). Ignoring this will
result in a program error (see the right most program listing).
Sequential processing limitations:
• There are no limitations to the number of parallel circuits when using an ORB
instruction in the sequential processing configuration (see the left most program
listing).
12. And Block
Program example:

WECON Technology Co., Ltd.
11
Basic points to remember:
- An ANB instruction is an independent instruction and is not associated with any
device number
- Use the ANB instruction to connect multi-contact circuits (usually parallel circuit
blocks) to the preceding circuit in series. Parallel circuit blocks are those in which
more than one contact connects in parallel or the ORB instruction is used.
- To declare the starting point of the circuit block, use a LD or LDI instruction. After
completing the parallel circuit block, connect it to the preceding block in series using
the ANB instruction.
Batch processing limitations:
• When using ANB instructions in a batch, use no more than 8 LD and LDI instructions
in the definition of the program blocks (to be connected in parallel). Ignoring this will
result in a program error (see ORB explanation for example).
Sequential processing limitations:
• It is possible to use as many ANB instructions as necessary to connect a number of
parallel circuit blocks to the preceding block in series (see the program listing).
FX Series Programmable Controllers Basic Program Instructions 2
2-13
13. MPS, MRD and MPP
Basic points to remember:
- Use these instructions to connect output coils to the left hand side of a contact.

WECON Technology Co., Ltd.
12
Without these instructions connections can only be made to the right hand side of the
last contact.
- MPS stores the connection point of the ladder circuit so that further coil branches
can recall the value later.
- MRD recalls or reads the previously stored connection point data and forces the next
contact to connect to it.
- MPP pops (recalls and removes) the stored connection point. First, it connects the
next contact, then it removes the point from the temporary storage area.
- For every MPS instruction there MUST be a corresponding MPP instruction.
- The last contact or coil circuit must connect to an MPP instruction.
- At any programming step, the number of active MPS-MPP pairs must be no greater
than 11.
MPS, MRD and MPP usage:
• When writing a program in ladder format, programming tools automatically add all
MPS, MRD and MPP instructions at the program conversion stage. If the generated
instruction program is viewed, the MPS, MRD and MPP instructions are present.
• When writing a program in instruction format, it is entirely down to the user to enter
all relevant MPS, MRD and MPP instructions as required.
Multiple program examples:

WECON Technology Co., Ltd.
13
14. Master Control and Reset
Program example:
Basic points to remember:
- After the execution of an MC instruction, the bus line (LD, LDI point) shifts to a point
after the MC instruction. An MCR instruction returns this to the original bus line.
- The MC instruction also includes a nest level pointer N. Nest levels are from the
range N0 to N7 (8 points). The top nest level is ‘0’ and the deepest is ‘7’.
- The MCR instruction resets each nest level. When a nest level is reset, it also resets
ALL deeper nest levels. For example, MCR N5 resets nest levels 5 to 7.
- When input X0=ON, all instructions between the MC and the MCR instruction
execute.
- When input X0=OFF, none of the instruction between the MC and MCR instruction

WECON Technology Co., Ltd.
14
execute; this resets all devices except for retentive timers, counters and devices
driven by SET/RST instructions.
- The MC instruction can be used as many times as necessary, by changing the
device number Y and M. Using the same device number twice is processed as a
double coil (see section 2.5.2). Nest levels can be duplicated but when the nest level
resets, ALL occurrences of that level reset and not just the one specified in the local
MC.
Nested MC program example:
15. Set and Reset

WECON Technology Co., Ltd.
15
Program example:
16. Timer, Counter (Out & Reset)

WECON Technology Co., Ltd.
16
Program example:
16.2 Normal 32 bit Counters
The 32 bit counter C200 counts (up-count, down-count) according to the ON/OFF
state of M8200. In the example program shown on the previous page C200 is being
used to count the number of OFF ~ ON cycles of input X4.
The output contact is set or reset depending on the direction of the count, upon
reaching a value equal (in this example) to the contents of data registers D1,D0 (32 bit
setting data is required for a 32 bit counter).
The output contact is reset and the current value of the counter is reset to ‘0’ when
input X3 is turned ON.
16.3 High Speed Counters

WECON Technology Co., Ltd.
17
• Not all devices identified here are available on all programmable controllers. Ranges
of active devices may vary from PLC to PLC. Please check the specific availability of
these devices on the selected PLC before use. For more information on high speed
counters please see page 4-22. For PLC device ranges please see chapter 8.
2.17 Leading and Trailing Pulse
Program example:

WECON Technology Co., Ltd.
18
18. Inverse
Program example:
Basic points to remember:
- The INV instruction is used to change (invert) the logical state of the current ladder
network at the inserted position.
- Usage is the same as for AND and ANI; see earlier.
Usages for INV
• Use the invert instruction to quickly change the logic of a complex circuit.
It is also useful as an inverse operation for the pulse contact instructions LDP, LDF,
ANP, etc.
19. No Operation

WECON Technology Co., Ltd.
19
Basic points to remember:
- Writing NOP instructions in the middle of a program minimizes step number changes
when changing or editing a program.
- It is possible to change the operation of a circuit by replacing programmed
instructions with NOP instructions.
- Changing a LD, LDI, ANB or an ORB instruction with a NOP instruction will change
the circuit considerably; quite possibly resulting in an error being generated.
- After the program ‘all clear operation’ is executed, all of the instructions currently in
the program are over written with NOP’s.
20. End
Basic points to remember:
- Placing an END instruction in a program forces that program to end the current scan
and carry out the updating processes for both inputs and outputs.
- Inserting END instructions in the middle of the program helps program debugging as
the section after the END instruction is disabled and isolated from the area that is
being checked. Remember to delete the END instructions from the blocks which have
already been checked.
- When the END instruction is processed the PCs watchdog timer is automatically
refreshed.
A program scan:
• A program scan is a single processing of the loaded program from start to finish,
This includes updating all inputs, outputs and watchdog timers. The time period for
one such process to occur is called the scan time. This will be dependent upon
program length and complexity. Immediately the current scan is completed the next
scan begins. The whole process is a continuous cycle. Updating of inputs takes place
at the beginning of each scan while all outputs are updated at the end of the scan.
Table of contents
Other Wecon Controllers manuals