Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 13 of 37

Sharp Programmable Controller New Satellite JW10 User's Manual: Chapter 9 Description of Instructions, pages 86 to 95

Pages 86 to 95 of 307, from Sharp Programmable Controller New Satellite JW10 User's Manual

The original document is the PDF (5.0 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

Filed in the catalog under the Sharp jW-10CM

Page 86

AND R

[ Example for use ]

Symbol Function

00000 00001 00404

Use when serial contact point is "a" contact. AND operates data memory contents of relay number R (ON/OFF data) and contents of accumulator (ACC). Then, stores the result in the ACC.

AND

ACC S1 S2

S7 S8

00000

(Latch)

After operation

00000 to 15777 Range of R T000 to T377 C000 to C377 Contents of R

ACC S1 to S8

00000 00001 00404

When input relay 00000 and 00001 are both ON, output relay 00404 turns ON.

Operation R

Instruction STR AND OUT

00001

Latch AND operated value of R contents and contents in the ACC before operation.

00404

Latch

9

AND NOT R

[ Example for use ]

Symbol

00000 00001 00405

Function

Use when serial contact point is "b" contact.

Operation

Reverses data memory contents (ON/OFF data) of relay number R and AND operates with contents of accumulator (ACC). Then, stores the result in the ACC.

R

AND

ACC S1 S2

After operation

00000 to 15777 Range of R T000 to T377 C000 to C377 Contents of R

Latch

ACC

AND operated reversed value of R contents and contents in the ACC before operation.

S1 to S8

When input relay 00000 is ON and 00001 is OFF, output relay 00405 turns ON.

S7 S8

(Latch)

Instruction 00000 STR AND NOT 00001 00405 OUT

00000 00001 00405

Latch

9-11

Page 87

OR R

Symbol

[ Example for use ]

Function

Use when parallel contact point is "a" contact.

Operation

OR operates data memory contents of relay number R (ON/OFF data) and contents of accumulator (ACC). Then, stores the result in the ACC. R

OR

ACC S1 S2

00000 00001

Instruction STR 00000 OR 00001 OUT 00406

When input relay 00000 or 00001 is ON, output relay 00406 turns ON.

S7 S8

(Latch)

00000

00000 to 15777 Range of R T000 to T377 C000 to C377

After operation

00406

00001 00406

Contents of R

Latch

ACC

OR operated value of R contents and contents in the ACC before operation.

S1 to S8

Latch

9

OR NOT R

Symbol

[ Example for use ]

Function

Use when parallel contact point is "b" contact.

Operation

Reverses data memory contents of relay number R (ON/OFF data), and operates OR with contents of accumulator (ACC). Then, stores the result in the ACC. R

OR

ACC S1 S2

00000 00001

S7 S8

00000

00000 to 15777 Range of R T000 to T377 C000 to C377

After operation

Instruction STR 00000 OR NOT 00001 OUT 00407

When input relay 00000 is ON, or 00001 is OFF, output relay 00407 turns ON.

(Latch)

00001

Contents of R

Latch

ACC

OR operated reversed value of R contents and contents in the before operation

S1 to S8

00407

00407

Latch

9-12

Page 88

AND STR Use to serially connect between circuit blocks.

Function

Operation

AND operates stack register S1 and accumulator (ACC) contents (ON/OFF data). Then, stores data in the ACC. Previously stored ON/OFF data in S2 is transferred to S1. Data in S3 is transferred to S2. Thereafter data is shifted to S4 to S3, S5 to S4, S6 to S5, S7 to S6, S8 to S7. In S8, OFF data is stored.

ACC

AND

After operation

[ Example for use 1 ]

AND operated value of S1 contents before operation and ACC contents.

S1

Contents of S2 before operation

S2

Contents of S3 before operation

S3

Contents of S4 before operation

S4

Contents of S5 before operation

S5

Contents of S6 before operation

S6

Contents of S7 before operation

S7

Contents of S8 before operation

S8

OFF (0)

00001

00003

00004

00003

Block A

Block B

00002 00003

Note 2: Operation contents of both (a) and (b) below are the same. (a) 00000 00001 00400 00002

00005

(b)

STR 00000 OR 00001 STR 00002 OR 00003 AND STR STR 00004 OR 00005 AND STR OUT 00400

STR 00000 OR 00001 STR 00002 OR 00003 STR 00004 OR 00005 AND STR AND STR OUT 00400

9

00410

00400

(a)

Instruction 00000 STR 00001 OR 00002 STR 00003 OR AND STR 00410 OUT

00001 available to program the ladder chart below. 00002

00001

00410

00000

Note 1: The following two methods (a) and (b) are

00000

00002

Connect block A and block B in series. If input relay 00000 or 00001 is ON, and input relay 00002 or 00003 is ON, output relay 00410 turns ON.

S1 S2 S3 S4 S5 S6 S7 S8 OFF

ACC

00000

STR 00000 STR 00001 OR 00002 AND STR OUT 00400

(b) 00001 00000 00400 00002

STR OR AND OUT

00001 00002 00000 00400

Case (b) is one step smaller than case (a).

Both (a) and (b) give the same result. However, (a) uses only S1 stack, and (b) uses stacks S1 and S2. The JW10 has eight stacks so programming like (b) can only be connected at a maximum nine of blocks.

9-13

Page 89

OR STR Function

Operation

Use to parallel connect between circuit blocks.

After operation

Block A

OR operates stack register S1 and accumulator (ACC) contents (ON/OFF data). Then, stores data in the ACC. Previously stored ON/OFF data in S2 is transferred to S1. Data in S3 is transferred to S2. Thereafter data is shifted to S4 to S3, S5 to S4, S6 to S5, S7 to S6, S8 to S7. In S8, OFF data is stored.

OR

9

[ Example for use ]

ACC

S1 S2 S3 S4 S5 S6 S7 S8

00000 00001

00411

00002 00003 Block B

Instruction 00000 STR AND 00001 00002 STR 00003 AND OR STR 00411 OUT

Connect block A and block B in parallel. When both input relays 00000 and 00001, or both input relays 00002 and 00003 are ON, output relay 00411 turns ON.

OFF

ACC

OR operated value of S1 contents before operation and ACC contents.

00000

S1

Contents of S2 before operation

00001

S2

Contents of S3 before operation

S3

Contents of S4 before operation

S4

Contents of S5 before operation

S5

Contents of S6 before operation

S6

Contents of S7 before operation

S7

Contents of S8 before operation

S8

OFF (0)

00002 00003 00411

Note 1: The following two methods (a) and (b) are

Note 2: Operation contents of both (a) and (b) below available to program the ladder chart below.

are the same. (a)

00000

00001

00002

00003

00004

00005

00400

00000

00400

00001 00002

(a)

(b)

STR 00000 AND 00001 STR 00002 AND 00003 OR STR STR 00004 AND 00005 OR STR OUT 00400

STR 00000 AND 00001 STR 00002 AND 00003 STR 00004 AND 00005 OR STR OR STR OUT 00400

STR 00000 STR 00001 AND 00002 OR STR OUT 00400

(b) 00001 00002 00000

00400 STR AND OR OUT

00001 00002 00000 00400

Case (b) is one step smaller than case (a).

Both (a) and (b) give the same result. However, (a) uses only S1 stack, and (b) uses stacks S1 and S2. The JW10 has eight stacks so programming like (b) can only be connected at a maximum nine of blocks.

9-14

Page 90

OUT R

[ Example for use ]

Symbol

00000 Function

Use for output of operation result.

Operation

Write contents of the accumulator (ACC) into data memory of relay number R. R

After operation

Range of R Contents of R

00413

ACC

ACC S1 to S8

Latch

00414

Instruction STR 00000 OUT 00412 OUT 00413 OUT 00414

When input relay 00000 is ON, the JW10 turns ON output relay 00412, 00413, and 00414. (OUT instruction does not change ACC contents so that sequential use of OUT instruction is possible.)

00400 to 15777 (Note 1) (Note 2) Contents ofACC Latch

00412

Note 1: Module-not-mouted input relay area (00000 to Note 5: As the contents of the ACC do not change 00377) are also used for OUT instruction as after operating OUT instruction, the following ladder program is effective. auxiliary relay. Note 2: Be careful because some special relays and special registers cannot be used for OUT 00412 00000 STR 00000 instruction. (See "Special relay" on page 7・3 OUT 00412 AND 00001 and "special register" on page 7・5.) 00413 00001 OUT 00413 Note 3: OUT instruction cannot be started directly from AND 00002 00002 00414 OUT 00414 10000

× For relays are normally to be kept ON, use normally OFF contact (07366). 07366

10000

Note 4: If the same relay number OUT instruction is used twice, the connected support tool such as JW-13PG displays error at program check. 00000

00400

00001

00400

×

If the JW10 is changed to operation mode after inputting the program above, it detects "user program error 1" by self diagnosis function and cannot operate. However, if a 55(H) is stored in register #055 in the system memory, the JW10 can continue the operation.(The option is available in version 1.4 or later ROM code.) In this case, the result of the last step in the program ("b" in this example) will be sent to the output section.

9-15

9

Page 91

TMR Timer instruction Symbol

Function

Operation

Condition

TMR ③ ②

①

Timer contact

[ Example for use ]

Instruction STR 00000 TMR 000 0015 STR T000 OUT 00415 STR NOT T000 OUT 00416

T② 00000

When start input① is turned ON, current value is decrement by one from the setting value ③ every 0.1 second (TMR number ② = 000 to 277) or 0.01 second (TMR number ② = 300 to 377). When current value becomes 0, the timer contact turns Start input

Current value

TMR contact

OFF

Setting value

OFF

ON Decrement by 1 every (Current value>0) 0.1 sec. or 0.01 sec. ON 0 (Current value = 0)

OFF

T000

00415

T000

00416

After start input 00000 turns from OFF to ON, timer contact T000 turns ON after 1.5 sec., and output relay 00415 turns ON and 00416 turns OFF.

00000

ON

Start when stat input ① is ON

TMR 000 0015

1.5 sec.

1.5 sec.

T000

Range of TMR 000 to 277 (8)[0.1 sec. timer](Note 1) 00415 300 to 377 (8)[0.01 sec. timer] number ②

0001 to 1999 (BCD) Range of setting value ③

0.1 to 199.9sec. :TMR000 to TMR277 0.01 to 19.99sec.:TMR300 to TMR377 コ 0000 to コ1576, b0000 to b0376 09000 to 09776, 19000 to 19776 29000 to 29776, 39000 to 39776 (Note 4)

00416 When start input 00000 is turned OFF, TMR000 is reset.

Setting

Precision value +0 - 0.01 + scan time (0.1 sec. timer) (unit : sec.) Setting +0 + scan time (0.01 sec. timer) value

After operation

9

- 0.01

ACC

Latch (Start input ① )

S1 to S8

Latch

Note 1: TMR number is used commonly with CNT so that numbers used for CNT cannot be used for TMR. The same TMR number also cannot be used twice. If the same number is used, "user program error 1" occurs by self diagnosis and cannot run. However, if a 55(H) is stored in register #055 in the system memory, the JW10 can continue the operation.(The option is available in version 1.4 or later ROM code.) To check assigned condition of the same number, use "program check" function of a support tool such as JW-13PG. Note 2: Assign timer contact with the same number of timer numbers. Settable for any number of "a"

9-16

Note 4: When resister number is used for setting value, the setting value can be changed by program operation. Make sure to assign even number address for register. (Example) 00000 TMR 000

09000

09001

09000

0 0 0 1 0 1 0 0 0 1 0 0 0 1 1 0 Set value:1446 1

4

4

6

Be careful not to enter other than BCD values or over 2000, as these may cause malfunction.

Page 92

……

……

• Timer's current value storage area of timer (1) An example of program to output timer current value to an external device. Current value of the timer is stored in 512 bytes from b0000 to b0777 as follow. 00000 Using this area, current value of the timer can be Setting value TMR 1500 output to an external device, and setting value can 150 sec. 000 be changed from outside. Set level operation F-47 TMR number Data storage area condition in order ONLS 000 b0000, b0001 to output normally. 001 b0002, b0003 07366 b0000→コ0040 F-00w 002 b0004, b0005 b0000 コ0040 b0001→コ0041 XFER Normally ON 003 b0006, b0007

376 377 b0774, b0755 b0776, b0777

Note 5: Area from b0000 to b0777 are commonly used with the counter (CNT). 7 TMR000 to TMR277 TMR300 to TMR377

8 0 8 0

6

5

4

3

2

1

( × 1 0 0)

( × 1 0-1)

4 0

4

2 1 8 2 0 (×10 ) 1 8

2

( × 1 0 1)

4

2

( × 1 0-1)

( × 1 0-2)

4 0

( × 1 00 )

2 1 8 1 0 (×110 ) 8

4 4

Reset level operation condition.

F-48 ONLR

2 2

(2) An example of program to input timer setting value from an external device.

0

00020

1 n

Setting switch

1 n+1

F-00w コ0000 09000 XFER

Reading setting value (BCD 4 digits)

F-00w 09000 b0002 XFER

09000→b0002 09001→b0003

TMR 001

TMR001

00021

1 n

Start input

1 n+1

Note 6: Address b0000 to b0777 are handled numerical values with BCD. Note 7: "n" and "n + 1" express address order. For example, in case of TMR001, n = b0002 and n + 1 = b0003.

1999

(When コ0000 = 1500) 00021 Current value of TMR001

1999

1500

1499

0.1 sec.

If register number is assigned to setting number, the JW10 runs with the same pattern of the program example above. 00020

F-00w コ0000 09000 XFER

00021 TMR 001

9-17

09000

9

Page 93

CNT Counter instruction Symbol

Function

Operation

Condition

CNT ③

④

[ Example for use ]

C③

00000

When reset input ② is OFF, current value is decrement by one from the setting value ④ at each change of calculation input ① from OFF to ON. When current value reaches 0, the counter contact turns ON. When reset input ② is ON, the JW10 does not calculate and keeps current value as setting value, and counter contact is Start input

Current value

TMR contact

OFF

Setting value

OFF

ON (Current value>0)

Decrement by 1 at each turn ON from OFF of calculation input

OFF

ON 0 ON (Current value = 0) When reset input ② is OFF (Note 6) and calculation input ① changes from OFF to ON.

Range of setting value ④

0001 to 1999 (BCD) コ 0000 to コ1576, b0000 to b0376 09000 to 09776, 19000 to 19776 29000 to 29776, 39000 to 39776 (Note 7) Latch (Reset input ② ) Latch (Calcultaion input ① )

S2 to S8

Latch

CNT 0003 001

C001

00417

C001

00420

00001 1

00000 Current value

000 to 377 (8)

ACC S1

00001

Instruction STR 00000 STR 00001 CNT 001 0003 STR C001 OUT 00417 STR NOT C001 OUT 00420

When the reset input 0001 is OFF and calculation input 00000 switches ON from OFF three times repeatedly, counter contact C001 turns ON and output relay 00417 turns ON and 00420 turns OFF.

Range of CNT number ③

After operation

9

① ②

Counter contact

3

2 2

3 1

0

4

5

0

3

C001 00417 00420

Note 1: CNT number is used commonly with TMR Note 5: At power failure, the counter stores current so that numbers used for TMR cannot be value. However, if reset input turns ON at used for CNT. The same CNT number also reinputting power, it resets current value. If cannot be used twice. If the same number you want to store current value, add reset is used, "user program error 1" occurs by input that turns OFF at inputting power. self diagnosis and cannot run. Note 6: Reset input also can be set as "reset by OFF" However, if a 55(H) is stored in register by setting reset condition (001) on system #055 in the system memory, the JW10 can memory #202. continue the operation.(The option is Nore 7: When register number is used for setting available in version 1.4 or later ROM code.) value, the setting value can be changed by To check assigned condition of the same program operation. Make sure to assign even number, use "program check" function of a number address for register number. (Example) support tool such as JW-13PG. 00000 Note 2: Assign counter contact with the same number of counter numbers. Settable for CNT 09000 00001 001 any number of "a" contact and "b" contact. Note 3: When the JW10 counts up, it ignores 09001 09000 further input. To restart calculation, turn 0 0 0 1 0 1 0 1 0 1 1 1 0 0 1 0 Set value:1572 reset input ON and then OFF. Or, forcibly 1 5 7 2 reset using a support tool, and then start Be careful not to enter other than calculation. BCD values or over 2000, as these may cause malfunction.

9-18

Page 94

001 002 003 b0002, b0003 b0004, b0005 b0006, b0007

……

……

• Counter's current value storage area of counter (1) An example of program to output counter current value to an external device. Current value of the counter is stored in 512 bytes from b0000 to b0777 as follow. 00000 Using this area, current value of the counter can be Setting value CNT output to an external device, and setting value can 1000 1000 00001 002 be changed from outside. Set level operation F-47 condition in order CNT number Data storage area ONLS to output normally. 000 b0000, b0001

376 377 b0774, b0775 b0776, b0777

07366 F-00w Normally ON

7

6

5

4 b0004 コ0042

3

2

1

( × 101 )

( × 100 )

4 0

4

2 1 8 3 0 (×10 ) 1 8

2

(2) An example of program to input counter setting value from an external device.

0 1

( × 10 2)

4

2 b0004→コ0 0 4 2 b0005→コ0 0 4 3 Reset level operation condition.

F-48 ONLR

Note 8: Area from b0000 to b0777 are commonly used with the timer (TMR).

CNT000 8 to 0 CNT377

XFER

1

00020 n

Setting switch n+1

F-00w コ0000 09100 XFER

Reading setting value (BCD 4 digits)

F-00w 09100 b0006 XFER

09100→b0006 09101→b0007

00022

Note 9: Address b0000 to b0777 are handled numerical values with BCD. Note 10: "n" and "n + 1" express address order. For example, in case of CNT001, n = b0002 and n + 1 = b0003.

Reset intput 00021 Calculation input 00022

CNT 003

CNT003 0500

Reset intput

When system memory #202 is 00(H) (reset by turning ON reset input), current value is changed at down edge of 00022. (when コ0000 = 1500)

00022 Current value of CNT003

0500

1500

If register number is assigned to set number, the JW10 runs with the same pattern of the program example above. 00020 00021 00022

9-19

F-00w XFER

CNT 003

コ0000 09100

09100

9

Page 95

9-3

Application Instruction

[1] Function number • All application instructions are expressed by function numbers. • In addition, among transfer instruction, arithmetic operation instruction, logical operation instruction, comparison instruction etc., instructions for handling word unit or constants lower case "w" and "c" are added to each function number. Instruction to operate between registers (byte unit) Instruction to operate between registers (word unit) Instruction to operate between register and constants (byte unit) Instruction to operate between register and constants (word unit)

F00, F-10, F-12, F-13 etc. F-00w, F-10w, F-12w, F-13w etc. Fc10, Fc12, Fc13 etc. Fc10w, Fc12w, Fc13w etc.

[2] Source and destination • Data processing instructions such as transfer instruction and arithmetic operation instruction handle data memory with byte unit or word unit. • A register having data before operation is called source (S). A register to store operation result is referred to as destination (D). Ex. 1:

9

S

D

Transfer contents of コ1010(S) to 09200(D).

F-00 XFER コ1010 09200

Ex. 2:

S1

S2

D

F-10 コ1001 コ1002 19100 ADD

Ex. 3:

S

Adds contents of コ1001(S1) and コ1002(S2), and stores the result in 19100(D).

D

F-00W 09000 19000 XFER

Store contents of 09000(S) and 09001(S+1) to 19000(D) and 19001 (D+1).

Note 1: Make sure to set even number address for source and destination of word processing instruction (instruction having "w"). Note 2: Register contents of source side do not change after operation. Use of the same register both for source and destination is available. However, in this case, source contents may change for some instruction (that is contents of destination). Ex. 4: F-03 →BIN

S

D

09110 09110

Converts contents of 09110(S) (2 digits of BCD) into binary code and stores in 09110 (D).

Note 3: Among special relay and special register area, do not assign destination to area where CPU writes (such as コ0734 to コ0737). Note 4: If source and destination are assigned which cross over blocks of data memory for block process instruction (F-70, F-70w, F-71, F-71w, F-74, F-74w), these instructions will be as shown in the table at right. Especially, be careful not to write data in timer/ counter contact area and CPU internal processing area. 9-20

S, D

S+1, D+1

コ1577

Timer/counter contact area b0777

CPU internal processing area

09777

19000

19777

29000

29777

39000

39777

CPU internal processing area