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

The text of a manual · part 23 of 37

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

Pages 186 to 195 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 186

Fc215 MUL Symbol

Multiply register by constant in binary (8 bits × 8 bits) (MULtiply) Fc215 MUL n

S1

〔Example for use〕

D

Function

The contents of the register S are multiplied by the octal constant "n" in binary and its results are stored in the registers D and D+1.

Operation

S1×n→D, D+1

Range of S1

コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777

01000

Fc215 09100 MUL

123

Condition

09100 11011000

コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776

× Octal constant 123 01010011 1

2

3

Rising edge of input signal (OFF to ON) 19001

Contents Unchanged of S1 Contents Lower digits of result of D After operation Contents Upper digits of result of D+1

Flag

19000

When the input condition 01000 changes from OFF to ON, the contents of the register 09100 are multiplied by the octal constant 123 in binary and its results are stored in the registers 19000 and 19001.

Range of "n" 000 to 377 (8)

Range of D

Instruction 01000 STR Fc215 09100 123 19000

19000

0100011000001000

9

Zero 07357

Carry 07356

Error 07355

Non-carry 07354

0

0

0

0

Similarity insturctions: F-215, F-215w, Fc215w

9・ 111

Page 187

Fc215w MUL

Multiply register by constant in binary (16 bits × 16 bits) (MULtiply) Fc215w MUL

Symbol n

S1

〔Example for use〕

D

Function

The 16 bits contents of the registers S1 and S1 +1 are multiplied by an octal content "n" in binary and its results are stored in the registers D, D+1, D+2 and D+3.

Operation

(S1, S1+1)×n→D, D+1, D+2, D+3

Range of S1

コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776

01000

Fc215w 09100 006430 19000 MUL

When the input condition 01000 changes from OFF to ON, the 16 bits contents of the registers 09100 and 09101 are multiplied by the octal constant 006430 in binary and its results are stored in the registers 19000 to 19003. 09101

Range of "n" 000000 to 177777 (8)

Range of D

Condition

× Octal constant 006430 0000110100011000 0

0

6

4

3

0

Rising edge of input signal (OFF to ON)

Contents of D Contents of D+1 After operation Contents of D+2 Contents of D+3

Flag

09100

0000010111000110

コ0000 to コ1574 b0000 to b0774 09000 to 09774 19000 to 19776 29000 to 29774 39000 to 39774

Contents of S1, S1+1

9

Instruction 01000 STR Fc215w 09100 006430 19000

Unchanged 19003

Lower digits of result

19002

19001

19000

00000000010010111001100010010000

Result Result Upper digits of result Zero 07357

Carry 07356

Error 07355

Non-carry 07354

0

0

0

0

Note 1: Be sure to use even addresses for registers S1 and D. Similarity insturctions: F-215, F-215w, Fc215

9・ 112

Page 188

F-216 DIV

Divide register by register in binary (8 bits ÷ 8 bits) (DIVide) F-216 DIV

Symbol

S1

S2

〔Example for use〕

D

Function

The 8 bits contents of the register S1 are divided by the 8 bits contents of the register S2 in binary and its quotient is stored in the register D and remainder in the register D+1.

Operation

S1÷S2→D, D+1

Range of S1

Range of S2

Range of D

Condition

F-216 09000 09001 09002 DIV

When the input condition 10000 changes from OFF to ON, the contents of the register 09000 are divided by the contents of the register 09001 in binary and its quotient is stored in the registers are 09002 and remainder in the register 09003.

コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777 コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777 コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776

Before operation

After operation

09000 1 1 0 0 0 1 1 1

Quotient 0 0 0 0 1 0 0 1 09002

09001 0 0 0 1 0 1 0 1

Remainder 0 0 0 0 1 0 1 0 09003

9

Rising edge of input signal (OFF to ON)

Contents of S1 Contents of S2 Contents After of D operation Contents of D+1

1 0 1 0 1

Unchanged Unchanged Quotient

Unchanged if the contents of the registers, S2 is 000 (8).

Remainder Contents of S2

Flag

10000

Instruction 10000 STR F-216 09000 09001 09002

000 (8) Other than above

Zero 07357

Carry 07356

0

0

Error Non-carry 07354 07355

1 0

0

Similarity insturctions: F-216w, Fc216, Fc216w

9・ 113

1 0 0 1 1 1 0 0 0 1 1 1 1 0 1 0 1 1 1 1 1 1 1 0 1 0 1 1 0 1 0

Page 189

Divide register by register in binary (15 bits ÷ 15 bits) (DIVide)

F-216w DIV

F-216w DIV

Symbol

S2

〔Example for use〕

D

Function

The 15 bits contents of the registers S1 and S1+1 are divided by the 15 bits contents of the registers S2 and S2+1 in binary and its quotient is stored in the registers D and D+1 and the remainder in the registers D+2 and D+3.

Operation

(S1, S1+1) ÷ (S2, S2+1) →D, D+1, D+2, D+3

Range of S1

Range of S2

Range of D

9

S1

Condition

F-216w 19000 19002 19004 DIV

When the input condition 10000 changes from OFF to ON, the 15 bits contents of the registers 19000 and 19001 are divided by the 15 bits contents of the registers 19002 and 19003 in binary and its quotient is stored in the registers 19004 and 19005 and the remainder in 19006 and 19007.

コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776 コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776 コ0000 to コ1574 b0000 to b0774 09000 to 09774 19000 to 19774 29000 to 29774 39000 to 39774

19001

19000

110110011100100

÷ 19003

19002

000010000101100

Rising edge of input signal (OFF to ON)

Contents of S1, S1+1 Contents of S2, S2+1

19005

19004

0000000000011010

Unchanged

Quotient

Unchanged

Contents Lower digits of quotient of D Contents Upper digits of After quotient of D+1 operation Contents Lower digits of remainder of D+2 Contents Upper digits of remainder of D+3

Flag

10000

Instruction 10000 STR F-216w 19000 19002 19004

Contents of S2, S2+1 000000 (8) Other than above

19007

Unchanged if the contents of the registers S2 and S2+1 are 000000 (8).

Zero 07357

Carry 07356

0

0

Remaider

MSB (bit 7) of the registers 19001 and 19003 will be disregarded.

Error Non-carry 07354 07355

1 0

19006

0000000001101100

0

Note 1: Be sure to use even addresses for registers S1, S2 and D. Similarity instructions: F-216, Fc216, Fc216w

9・ 114

Page 190

Fc216 DIV Symbol

Divide register by constant in binary (8 bits ÷ 8 bits) (DIVide) Fc216 DIV

S1 n

〔Example for use〕

D

Function

Contents of the register S1 are divided by an octal constant "n" in binary and its quotient is stored in the register D and the remainder in D+1.

Operation

S1÷n→D, D+1

Range of S1

コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777

02000

Fc216 コ0000 DIV

123

Condition

コ0000 11111111

÷

コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776

Octal constant 123 01010011

1

2

3

Rising edge of input signal (OFF to ON)

Contents Unchanged of S Contents Quotient of D After Contents Remainder operation of D+1 Contents of S2

Flag

09000

When the input condition 02000 changes from OFF to ON, the contents of the register コ0000 are divided by the octal constant 123 and its quotient is stored in the register 09000 and the remainder in 09001.

Range of "n" 000 to 377 (8)

Range of D

Instruction 02000 STR Fc216 コ0000 123 09000

000 (8) Other than above

09001

09000

0000011000000011

Unchanged if "n" =000.

Zero 07357

Carry 07356

0

0

Error Non-carry 07354 07355

1 0

0

Similarity insturctions: F-216, F-216w, Fc216w

9・ 115

Remainder

Quotient

9

Page 191

Fc216w DIV

Divide register by constant in binary (15 bits ÷ 15 bits) (DIVide) Fc216w DIV

Symbol

S1 n

〔Example for use〕

D

Function

The 15 bits contents of the registers S1 and S1+1 are divided by an octal constant "n" in binary and its quotient is stored in the registers D and D+1 and the remainder in D+2 and D+3.

Operation

(S1, S1+1) ÷ n→D, D+1, D+2, D+3

Range of S1

コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776

02000

Instruction 02000 STR Fc216w コ0000 073064 09000

Fc216w コ0000 073064 09000 DIV

When the input condition 02000 changes from OFF to ON, the 15 bits contents of the registers コ0000 and コ 0001 are divided by the octal constant 073064 in binary and its quotient is stored in the registers 09000 and 09001 and the remainder in 09002 and 09003.

コ0001

Range of "n" 000000 to 077777 (8)

コ0000

111111111111111

Range of D

Condition

9

コ0000 to コ1574 b0000 to b0774 09000 to 09774 19000 to 19774 29000 to 29774 39000 to 39774

0111011000110100

0

Rising edge of input signal (OFF to ON)

Contents of S1, S1+1

Contents of D Contents of D+1 After Contents operation of D+2 Contents of D+3

Flag

÷ Octal constant 073064

Unchanged

3

0

09001

6

4

09000

0000000000000001

Lower digits of quotient Upper digits of quotient Lower digits of remainder Upper digits of remainder Octal constant "n" 000000 Other than above

7

Quotient

Unchanged if "n" =000000.

09003

09002

0000100111001011 Remainder

Zero 07357

0

Carry 07356

0

Error Non-carry 07354 07355

1 0

MSB of the register コ0001 will be disregarded.

0

Note 1: Be sure to use even addresses for registers S1 and D. Similarity insturctions: F-216, F-216w, Fc216

9・ 116

Page 192

9-4

Ladder design precautions Since the programmable controller operates in the serial sequence, the ladder chart designed for the relay board may not be directly executed by the programmable controller. Also, it may not require the use of the relay board one-way control diode for the programmable controller, but it allows the use of unlimited number of auxiliary contact points. Difference in ladder design between the relay board and the programmable controller should be well understood to comprise more effective ladder chart.

[1] Relay circuit that needs revision Example 1: 00000

00002

00400

(a)−1 (a)

00001

00003

00401 00000

The programmable controller can not execute the ladder chart (a) without revising it. 00000

00002

00002

00400

00003

00401

00001

00000

00400 00001

(b)

00001

STR OR AND OUT STR OR AND OUT

00000 00001 00002 00400 00000 00001 00003 00401

Instruction STR OR AND OUT

9

00000 00001 00002 00400

(a)−2 00000 F-30 MCS 00001

The part (b) can be executed with the program shown.

00002

00400

00003

00401

Figure below shows transition in the accumulator contents, when the program (b) is executed. F-31 MCR

Instruction

00000

STR OR OUT STR AND OUT STR AND OUT

00000 00001 04000 04000 00002 00400 04000 00003 00401

00002 00400 00003 00401

(a)−3

00000

00001

Result of

AND 00002

Result of

00000

04000

00001 00001

00000 00002 00001

04000

00002

00400

04000

00003

00401

00000 00002

OUT 00100

00000 00001

Accumulator contents

STR 00000 OR

STR OR F-30 STR OUT STR OUT F-31

Result of

00001

As the result represented by 0 or 1 is stored every time one programmable step is executed in the accumulator, execution up to AND 00002 deletes the result of so that it could not be reflected on 00003. So, it has to be revised in the following was for a programmable controller ladder chart.

(Use as auxiliary relay for 04000.)

00000 00001

9・117

Page 193

Example 2: As current flows to 00002 from both 00000 and 00001 with the relay board ladder chart of (a), it does the action identical to the ladder chart that revised for the programmable controller program (b). (a)

(b)

Instruction 00400

00000 00400

00000

00001

00001 00002 00002

00000 00002

00401

00401

00001

STR 00000 STR 00001 AND 00002 OR STR OUT 00400 STR 00000 AND 00002 OR 00001 OUT 00401

There is no concept applicable for the programmable controller that the current flows to one contact symbol from both lines as in 00002 of (a) above. Because execution takes place serial from the address 00000 to the END instruction for the programmable controller, it is not possible to go through the same contact symbol once again on the ladder chart. Example 3: On account of the one-way control diode D1 in the relay board circuit (a), the current does not flow from 00001 through 00002, but it performs the same action as the programmable controller ladder chart that revised for the programmable controller program (b). (a)

(b) 00000

00002 D1 00003

00002

00400

00000

00003

00401

00400

9 00001

Instruction 00000

00401

00001

STR AND OUT STR OR AND OUT

00000 00002 00400 00000 00001 00003 00401

It is not possible for the programmable controller to program the one-way control diode D1 as in (a). Three examples given are often used for the relay board to permit use of the relay with less contacts and simple wiring. On the other hand, with the programmable controller, there is no need of paying attention for number of contacts used as it has the data memory that offers unlimited number of contacts. It is preferable to have the ladder chart designed for recognition at a glance.

With the relay method, the following is required every time a contact is added. ① Addition of a relay

Unlimited

Space, cost, reliability ② Addition of wirings

9・118

The data memory of the programmable controller does not affect space, costs, and reliability even if more contacts are used because it can be a relay that have unlimited number of contacts.

Page 194

[2] Input and output batch processing • As already discussed in "8-1 Operational cycle," the JW10 performs data exchange between the data memory and the I/O port at every scan cycle. • The I/O processing is scanned from a younger number first of relay number. ① For the input port, the ON/OFF state of the external contact connected to the input port is read into the data memory. ② For the output port, the ON/OFF state of the respective data memory is transferred to the output port. • After completing the above operation to the all I/O module, it enters the user program execution. • Because the programmable controller executed I/O processing in the batch mode, it will be necessary to pay attention to the following points designing the ladder. (1) As ON/OFF transition of the external contact is read into the data memory one at a time of every scan cycle during the I/O processing, a change in the ON/OFF state of the external device during that scan cycle may not affect the data memory contents (assigned to the input). Therefore, the "Input racing phenomenon" discussed in the following passage does not occur. (2) For the resultant ON/OFF state is written from the data memory to the output port once in each scan cycle of the I/O processing, the result is therefore sent to the output port during the I/O processing of a next scan cycle.

Input racing phenomenon The following phenomenon may occur in the program controller that the input port ON/OFF state is read every time an instruction is executed. B

①

C

②

B

③

D

④

Scanning order

The program that sets the coil C ON when the input B is ON and the coil D ON when the input B is OFF. In the above program, C=D should be established. But, assume now that B was ON (C=ON) when the state of the input B is read from the input port to the accumulator at step ① . If the state of the input B has changed to OFF before the operation at ③ , B is handled OFF during the operation at ③ . This will establish a contradiction that the coil D is ON, while both C and D are ON. It may result in the trouble whose cause is unknown as malfunction may or may not be evoked depending on the input timing. However, such a problem may not occur with the batch I/O processing programmable controller.

9・119

9

Page 195

[3] Influence by programmed sequence The programmable controller performs operation in serial sequence from the top to the end of the program step, and the same operation is repeated (cyclic scan method). (1) Swapping orders programmed

(a)

00000

00400

00400

00401

I/O

User program execution

I/O

User program execution

(b)

00401

00000

00400

I/O

I/O

User program execution

I/O

User program execution

I/O

Contact

Contact

00000

00000 Data memory

Data memory

Data memory

Data memory

00400

00400

9

00400

Output port

Output port

Data memory

Data memory

00401

00401

1 scan time Output port

Output port

When the input 00000 turns ON for the program of (a), the outputs 00400 and 00401 turn ON in the same scan cycle, but 00401 turns ON with a delay of 1 scan cycle for with (b). To use a coil auxiliary contact, consideration must be given when programming that "a change in the state of the auxiliary contact before the coil, comes effective in a next scan cycle that the change took place for the coil." (2) Multiple use of the coil If a 55(H) is stored in the register #055 in the system memory, multiple use of the coil (OUT instruction) will be possible. (The option is available in version 1.4 or later ROM code.) If the same relay number is used more than once as a coil, the contents of data memory will change according to the program's contents. In this case, the JW10 will read the operation results of the program step that was written from data memory to the output section. ①

00000

00400

I/O Contact

00400

00000 Data memory

②

OFF Contact OFF

00001

00002

Data memory

00400

③

Contact

00002 Data memory

Data memory

00400 Output port

9・120

③

User program process

① 00001

②

I/O