You are on page 1of 34

EN.

MUHAMAD NABIL BIN MANSOR

Pengenalan

Membolehkan pelatih-pelatih menguasai kemahiran membina ladder diagram dengan software CXProgrammer dengan menggunakan Advanced Command yang boleh memudahkan program. Selain dapat meringkaskan penyambungan. Untuk ini pelatih-pelatih perlu mempelajari arahan yang tertentu untuk merekabenruk program tertentu.

Program Control Instruction


Program Control Instruction adalah arahan khusus dalam litar yang diprogramkan itu sendiri contohnya menamatkan program. Melompat dari arahan ke arahan yang lain atau memberhentikan operasi sebelum operasi lain tamat.

Instruction END (01) IL (02) ILC (03) JME (05) JMP (04) NOT (00) STEP (08) SNTX (09) STOP (99)

Description End Interlock Interlock Clear Jump End Jump No Operation Step Define Step Start Run Stop

Bit Control Instruction


Arahan khusus untuk kawalan bit / signal. Sebagi contoh untuk meneruskan signal dalam masa menerima signal yang sekejap. Begitu juga sebaliknya.

Instruction DIFU (13) DIFD (14) KEEP (11) RSET SET

Description Differentiate Up Differentiate Down Keep Reset Set

Timer / Counter Instruction


Selain dari Timer dan Counter yang biasa digunakan dalam mnjarakkan masa serta pengiraan bit, terdapat juga Timer dan Counter lain yang juga berfungsi sama seperti biasa tetapi dengan cara yang berbeza.

Instruction CNT CNTR CTBL HDM INI PRV SDM STIM TIM TIML TIMH TMHH TTIM

Description (12) (--) (61) (--) (--) (60) (--)


(--) (15) (--) (87) Counter Reversible Counter Register Comparison Table High-Speed Counter Mode Control High Speed Counter PV Read Reversible Drum Counter Interval Timer Timer Long Timer High-Speed Timer Very High-Speed Timer Totalizing Timer

Data Shifting Instruction

Instruction ASFT ASL ASR ROL ROR SFT SFTR SLD SRD WSFT RWS

(--) (25) (26) (27) (28) (10) (84) (74) (75) (16) (17)

Description Asynchronous Shift Register Arithmetic Shift Left Arithmetic Shift Right Rotate Left Rotate Left Shift Register Reversible Shift Register One Digit Shift Left One Digit Shift Right Word Shift Reversible Word Shift

Data Movement Instruction

Instruction BSET BXF2 COLL DIST IEMS MOV MOVB MOVD MVN XCHG XDMR XFER XFRB XFR2

Description (71) (--) (81) (80) (--) (21) (82) (83) (22) (73) (--) (70) (--) (--) Block Set Block Transfer to Other EM Bank Data Collect Single Word Distribute Set EM Indirect Number Move Move Bit Move Digit Move Not Data Exchange Expansion DM Read Block Transfer Transfer Bit Block Transfer by Constant Value

Data Comparison Instructions

Instruction BCMP CMP CMPL CPS CPSL MCMP SRCH TCMP ZCP ZCPL

(68) (20) (60) (--) (--) (19) (--) (85) (--) (--)

Description Block Compare Compare Double Compare Single Binary Compare Double Single Binary Compare Multi-Word Compare Data Search Table Compare Area Range Compare Double Area Range Compare

BCD Calculation Instruction

Instruction ADD ADDL DEC DIV DIVL INC MUL MULL SUB SUBL

Description

(50) (54) (39) (33) (57) (38) (32) (56) (31) (55)

BCD Add Double BCD Add Decrement BCD Divide Double BCD Divide Increment BCD Multiply Double BCD Multiply BCD Subtract Double BCD Subtract

Special Relay (SR)


Address 252.15 253.00 253.08 253.09 253.10 253.12 253.13 253.14 253.15 254.00 254.01 254.07 254.15 255.00 255.01 255.02 255.03 255.04 255.05 255.06 255.07 AR18 AR19 AR20 AR21 AR25 AR26 AR27 Symbol OUTPUT_OFF FAL_NUMBER LOW_BATTERY SCAN_TIME_ERROR IO_VERIFY_ERROR REMOTE_IO_ERROR ON OFF FIRST_SCAN 1_MIN_PULSE 0-02_SEC_PULSE STEP SIOU_ERROR 0-1_SEC_PULSE 0-2_SEC_PULSE 1_SEC_PULSE ERROR CARRY GREATER_THAN EQUALS LESS_THAN SEC+MIN HOUR+SATE MONTH+YEAR DAY FALS_ADDRESS MAX_SCAN_TIME SCAN_TIME Comment System Output OFF Bit System FAL number output area (00 to 07) System Low Battery Flag System Scan Time Error Flag System I/O Verification Error Flag System Remote I/O Error Flag System Normally On Flag System Normally Off flag System First Scan Flag System 1 minute clock pulse bit System 0.02 second clock pulse bit System Step Flag System Special Unit Error Flag System 0.1 second clock pulse bit System 0.2 second clock pulse bit System 1.0 second clock pulse bit System Instruction Execution Error (ER) Flag System Carry (CY) Flag System Greater Than (GE) Flag System Equals (EQ) Flag System Less than (LE) Flag System Seconds (00-07) & Minutes (08-15) System Hour (00-07) & Date (08-15) System Month (00-07) & Year (08-15) System Day of Week (00-07) System FALS-generating Address System Maximum Scan Time System Present Scan Time

SET instruction

SET instruction

Used momentary switches to latch and reset output.

SET
00

1000 RSET

01

1000

RESET instruction

SET and RSET instruction

KEEP instruction

KEEP instruction

Used momentary switches to latch and reset output. Operates like a latching relay that is set by S and reset by R. Remains ON or OFF state of a bit until one of its two inputs sets or reset.

00

00 LD
KEEP (11) S

000.00 000.01

01 LD

01

10.02

02 KEEP (11) 010.02 03 END (01)

KEEP instruction

MOV instruction

MOV instruction

Channel 100 - Source Word 15 14 13 12 11 10 9 8 7 6 5 4 3 0 1 1 1 1 0 1 0 1 0 1 0 1 Channel 101 - Destination Word 15 14 13 12 11 10 9 8 7 6 5 4 3 0 1 1 1 1 0 1 0 1 0 1 0 1

2 1 2 1

1 0 1 0

0 0 0 0

MOV instruction

DIFU instruction

DIFU instruction

DIFU turns its output ON when it detects an OFF > ON transition in its input signal. DIFD turns its output ON when it detects an ON > OFF transition in its input signal.

DIFU instruction

000.00 SW1 200.00

DIFU

200.00
010.00
000.00 DIFU

000.00 SW2 200.01

DIFD 200.01 010.01

DIFD

DIFU and DIFD only turns an output ON for only one scan/pulse.

DIFU instruction

DIFD instruction

DIFD instruction

ADD instruction

ADD instruction

SUB instruction

SUB instruction

CMP instruction

CMP instruction

CMP is used to compare the data in a specific channel, with the data in another channel, or a 4-digit, hexadecimal constant. 00000
CMP(20) CP1 First compare word CP2 Second compare word

25505
Greater Than

1000 1001 1002

25506
Equal To

25507
Less Than

CMP instruction

You might also like