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

The text of a manual · part 11 of 37

Sharp Programmable Controller New Satellite JW10 User's Manual: Chapter 8 Operation of the JW10

Pages 64 to 75 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 64

Chapter 8. Operation of the JW10 8-1

Operation cycle

[1] Operation flow chart Input power ▼

Power ON process

• Initialize data memory • Check hardware • Transfer data from ROM to RAM

▼ ▼

Operation or stop mode?

Stop mode

Operation mode ▼

▼

• System memory check • User program check ▼

Hardware check

8

▼

Reset operation flag (07354 to 07357) ▼

Input/output process (I/O refresh) ▼

Analog input module (JW-14AD)process ▼

▼

Analog output module (JW-12DA)process ▼

Remote I/O process (in case of #234 = 02) ▼

Interrupt processing by support tool, computer link (MMI port, communication port) ▼

Data link process (in case of #234 = 01) ▼

User program operation process

▼

▼

High-speed counter process (In case of #203 = 01 or 02) ▼

Reset watchdog timer ▼

▼

Scan cycle

Operation or stop mode? Stop mode Operation mode

8-1

Page 65

[2] Power ON processing • When power is input, the JW10 executes the following processes: (1) Initialize data memory • The JW10 initializes its data memory. After the initialization, the data memory is arranged as follows:

Data memory

Address

Input relay

00000 to 00377

Output relay

00400 to 00777

Auxiliary relay

01000 to15777

Status after initialization Start address of latch function can be assigned by setting system memory #230 and #231. Addresses before the latch function assigned address: All OFF Addresses after the latch function assigned address: Latch ON or OFF status before power failure Status at power input can be assigned by setting value of system memory #201. 00(H): The current value is applied with setting value. TMR contact is reset. 01(H): Status before the power failure is kept as current value. TMR contact is kept at ON or OFF status before the power failure.

Timer (TMR)

000 to 377

Counter (CNT)

000 to 377

Keeps current value as the status before the power failure. CNT contact is kept at ON or OFF status before the power failure.

Register

09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777

Keeps current value as the status before the power failure.

8

Note 1: When the power is input, the data memory is initialized as shown above. However, input and output relay area of the data memory change as below by input/output process of the first scan cycle. 1) Input relay used area Changes to ON or OFF in accordance with ON/OFF status of the input device (such as limit switches) connected to the input port. 2) Output relay area and input relay non-used area These areas do not change from the initialized status until entering operation of user program. (2) Hardware check • The JW10 diagnoses its own hardware (such as system ROM, I/O bus, and power supply). • For self diagnosis function, see "8-3 Self diagnosis." (3) Transfer data from ROM to RAM • If JW-1424K, JW-1442K, JW-1624K or JW-1642K is used as basic module, the JW10 can perform ROM operation. • In case of ROM operation (set system memory #255 = 44(H) or 45 (H)) , the JW10 transfers data from ROM to RAM, and operates according to user program of the ROM. • For ROM operation, see "Chapter 11: ROM Operation."

8-2

Page 66

[3] Scan cycle • After JW10 has completed power ON process, and if it is in operation mode, the JW10 checks its system memory and user program (see "8-3 Self diagnosis"), and enters scan cycle. • Scan cycle consists of a sequence from hardware check to operation process of user program (execute until a step where F-40 END instruction is written). After processing operation of user program, the JW10 again returns to hardware check. It repeats this cycle. If the JW10 is using high-speed counter, it processes high-speed counter before returning to hardware check. • Time taken for this one cycle is referred to "scan time." (1) Hardware check • The JW10 diagnoses its own hardware (such as memory, and I/O bus). • For self diagnosis, see "8-3 Self diagnosis." (2) Reset of operation flag (07354 to 07357) • Some application instructions affect operation flags as results of operation. Therefore, flags are cleared before operation process of user program at each scan cycle. • For operation flag, see "operation flag" on page 9・24. (3) Input/output process (I/O refresh) • The JW10 exchanges data between its input/output port and data memory. This is referred to as "I/O refresh." • In case of the input port, ON/OFF data of input device (such as limit switches) connected to the input port are written into address of data memory corresponding to this input port. • In case of output port, contents of address of data memory corresponding to the output port are written into the output port so that the output port changes to ON or OFF. Note 1: At first cycle after inputting the power, contents of the data memory initialized by "power ON process" is written into the output port. In the following cycles, operation result of the previous cycle is written in the output port. Note 2: Module-not-mounted area of input relay (00000 to 00377) and output relay (00400 to 00777) can be used as auxiliary relays. However, we recommend not to use these areas for future addition purpose of input/output devices. (4) Analog input module (JW-14AD) process • The JW10 will exchange data between its data memory (コ0200 to コ0207) and the JW-14AD. • When the averaging function is enabled (#211 = 01(H)), the JW10 will also average the incoming data. • For JW-14AD, see "15-5 How to use JW-14AD". (5) Analog output module (JW-12DA) process • The JW10 will exchange data between the JW-12DA and its data memory (コ0240 to コ0243). • For JW-12DA, see "15-5 How to use JW-12DA". (6) Remote I/O process • When the communication port is used with the remote I/O (set system memory #234 = 02), the JW10 exchanges data between the input/output port of the remote I/O slave station and special register (コ0100 to コ0172) for remote I/O. • For remote I/O, see "13-4 Remote I/O."

8-3

8

Page 67

(7) Interrupt process by support tool or computer link • The JW10 exchanges data between a support tool (JW-13PG, JW-50PG etc.) connected to the MMI port and connected devices via computer link. • When the communication port is used with computer link (set system memory #234 = 00), the JW 10 exchanges data with the connected device. (8) Data link process • When the communication port is used as data link (set system memory #234 = 01), the JW10 exchanges data with communication opposite station through data link. • For data link, see "13-3 Data link."Data link process (9) Operation process of user program • The JW10 reads user program in order from its top, and executes operation in accordance with programmed contents. This operation terminates with END instruction (F-40). • Each instruction of STR, STR NOT, AND, AND NOT, OR, OR NOT, AND STR, and OR STR stores operational result to an accumulator or stack register. • OUT, TMR, CNT, and most of application instructions (F-xx) write operation results to the data memory. • For details of each instruction, see "Chapter 9: Description of Instructions."

8

(10) High-speed counter process • When the high-speed counter is used (set system memory #203 = 01 or 02), the JW10 exchanges data between special relay for high-speed counter (07320 to 07337) or special register (コ0740 to コ0767) and internal high-speed counter processing hardware section. • For high-speed counter, see "Chapter 12: How to Use the High-Speed Counter." (11) Watchdog timer • Using a hardware watchdog timer, the JW10 checks if its CPU functions normally in accordance with inside processing flow. • If the JW10 processes normally the scan cycle, its CPU resets the watchdog timer so that the watchdog timer does not time up. • If the CPU has an error or enters limitless loop program, the CPU cannot reset the watchdog timer so it times up and stops operation. • This watchdog timer is set to 200 ms.

8-4

Page 68

(12) Scan time • Interval time of operation from hardware check to END instruction (F-40) is referred to as "scan time." Scan time is roughly given by the equations below: One scan time (T) = t1 + t2 + t3 + t4 + t5 + t6 + t7 t1: Fixed processing time (hardware check, reset of watchdog timer etc.) t1 = 560 µs t2: Input/output process time t2 = 120 + 8 × number of input points + 6 × number of output points µs t3: Analog input module (JW-14AD) process time In case of averaging disable (#211=00) t3= 1170 µs In case of averaging enable (#211=01) t3= 1200 µs t4: Analog output module (JW-12DA) process time t4 = 240 µs t5: Communication process time In case where data link is applied, t3 = 200 µs In case where remote I/O is applied t3 = 1200 + 2600 × number of slave stations µs [in case of 76800 bits/s] t3 = 2400 + 5200 × number of slave stations µs [in case of 38400 bits/s] t6: User program processing time (total of all instruction processing time from program address 0000 to END instruction) For processing time of each instruction, see "9-1 Table of instructions." t7: Interrupted processing time by support tool and computer link t5 = 100 µs each Note 1: If the program memory is cleared, the JW10 writes NOP instruction to all the program memories and END instruction (F-40) on the last address. If instructions are written at intermediate of the program memory, processing time of NOP instruction should be added to scan time. (JW-1324K/1342K: 1.63 µs × number of NOP instructions, JW-1424K/1442K/1624K/1642K: 0.81 µs × number of NOP instructions) Lastly, write END instruction next to end of program address, the JW10 terminates user program at this address so that scan time can be shortened.

8-5

8

Page 69

■ Response time of whole of PC Response time of the whole range of PC modules including response time of input port and output port of basic and expansion modules are as follows: 00000

00400

The below shows time from where external contact point 00000 is converted until output element (relay) of output relay 00400 changes in the above ladder program. (b) In case of the longest time

(a) In case of the shortest time Scan cycle

I/O

8

I/O tb

I/O tb

00000 Logic side of

Logic side of input port Data memory

Latch of output port Output element of output port

I/O ta input port ta

Data memory Data memory

Data memory 00400

Scan cycle

I/O

External contact

External contact 00000

I/O tb tc tc

00400 Latch of T=ta+tb+tc ta: OFF to ON response time of input port tb: One scan time te: OFF to ON response time of output port output port Output element of output port

T=ta+2tb+tc

In case of ON to OFF, delay by response time of input port and output port also affects total time.

■ON/OFF time of input device

In order to securely store ON/OFF status of external contact points into the data memory, scan time of longer than one is required to turn ON or OFF logic side of the input port. Scan cycle a b c d e

I/O

I/O

I/O

I/O

I/O

①

External contact Logic side of input port tON

② tOFF

③ tON

④ tOFF

⑤ tON

Data memory tON: OFF to ON response time of input port tOFF: ON to OFF response time of input port

• In case of ON external contact point at ①, when logic side of the input port turns ON, input/output process of the corresponding input is already completed. Therefore, logic side of the input port turns OFF just before input/output process of "b" so that data memory is kept OFF. • In case of ON external contact point at ③, logic side of the input port turns ON just before input/output process of "c" so that ON is written on the data memory. • In case of OFF external contact point at ④, logic side of the input port is still ON at input/output process of "d," so that data memory is kept ON. In case of input/output processing of "e," input port again turns ON so that the data memory is kept ON. As such, if ON/OFF time of input port logic side is shorter than one scan time, it may be taken or not be taken, sometimes. In order to surely reflect ON/OFF status of input devices (such as limit switches), ON or OFF time of these devices should meet the following conditions. ON time of input device > One scan time + (OFF to ON response time of input port) OFF time of input device > One scan time + (ON to OFF response time of input port)

8-6

Page 70

8-2

Interruption function • On the JW10, both timer interruption and high-speed counter interruption are available. • Using the interruption function, the JW10 realizes high-speed process not restricted by scan cycle.

[1] Timer interruption • If timer interruption is used, the JW10 shifts program execution to subroutine of LB177 label (F140) 10 ms each, and returns the program to the address before the interruption by return instruction (F-143). A

Main program A

00000

▼

F-40 END

▼ ▼

10ms

▼

▼

Interruption program B

▼ F-140 LB177 LABL

F-143 RET

B

B

▼

10ms

▼

▼

B

8

▼ ▼

• Interruption can be carried out not only PC operation but also during input/output process. • Set interruption program within 10 ms operation. • To set timer interruption, use system memory #244. Value of #244 Contents 00(H) Disable timer interruption Enable timer interruption 01(H) An example of timer interruption • By combined use of timer interruption and I/O refresh instruction (F-81), high-speed response of input/output is possible. (1) An example of not using timer interruption 00400

00000

F-40 END

▼

I/O

I/O

I/O

I/O

▼

▼ Recognizes OFF status

Recognizes ON status ・・・・・・・・

Delay

▼

▼

Output (00400)

・・・・・・・・・・・・・・・・・・

Input (00000)

▼

One scan time

8-7

I/O

Page 71

(2) An example of using timer interruption F-40 END F-140 LABL LB177 07366

F-81 IORF

0

• 10 ms timer interruption label

• Refresh of input relay 00000

コ0000 00400

00000

07366 0

コ0040

• Refresh of output relay 00400

F-143 RET

▼

▼

One scan time I/O

I/O

▼

▼

▼

▼

▼

▼

10 ms interruption

・・・・・・・・・

Output (00400)

▼

8

・・・・・・・・・・・・・・・・・・

Input (00000)

▼

F-81 IORF

Delay

[2] Interruption of high-speed counter • If count value of the high-speed counter (16 bit binary: 0 to 65535) matches with count comparison value, the JW10 executes interruption program.

Mode 1 Mode 2

CH1

CH2

Count comparison Lower digits

コ0742

コ0752

コ0762

Upper digits

コ0743

コ0753

コ0763

LB170

LB171

LB172 value

Interruption label

• For details, see “Chapter 12: How to Use High-Speed Counter.”

8-8

Page 72

8-3

Self diagnosis • JW10 diagnoses its own hardware. If an error occurs, the JW10 treats as the following status. Find the cause with the table below, and treat accordingly. For troubleshooting using self diagnosis, see "16-2 Trouble shooting."

Normal

Item

PC LED indicater opera- Halt tion out- Power RUN ERR state put (green) (green) (red)

Contents

Error code Special (BCD) relay #160 to 167

Operation mode

Monitor/change mode

Run

Close (ON)

ON ●

ON ●

OFF ○

−

−

Stop mode

Program mode

Stop

Open (OFF)

ON ●

Blink ◎

OFF ○

−

−

System ROM error

20

RAM error

27 OFF ○

User ROM error 1 Memory error

ON ●

User program error 1 (Instruction code check)

26 07370

(*1)

User program error 2 (Parity check)

Error

(Endless program check)

System memory error CPU error

Watchdog timer error

I/O error

I/O bus error

(*6)

8

21

(*1)

User program error 3

24

Stop Open (OFF)

ON ●

OFF ○

(*2)

25

Not fixed Not fixed ON ●

Not fixed Not fixed

OFF ○

23 07371

31

07373

44

07374

53

ON ●

Communication error

Remote I/O error

Battery error

Battery voltage drop

Run

Close (ON)

ON ●

ON ●

ON ●

07372

22

Power error

Power failure or voltage drop

Stop

Open (OFF)

OFF ○

OFF ○

OFF ○

07377

13

(*3)

Note: *1 Program addresses where errors were detected are stored in #052 to #053. *2 System memory addresses where errors were detected are stored in #054. *3 Error code "13" is always stored when power is turned ON.(except JW10 detected WDT error or user program error 3) *4 JW-1324K/1342K do not have halt output. *5 In case of stop mode (program mode), RUN lamp blinks. In this case, ERR lamp goes OFF even an error is not recovered. (Only battery error keeps lighting.) *6 In case of user program error 3, the table above shows the case of reinputting the power.

8-9

Page 73

[1] Contents of self diagnosis

8

(1) System ROM error • Checks sum of system ROM. • This is checked at power input. (2) RAM error • Checks whether reading from and writing to RAM is possible. • This is checked at each scan cycle. (3) User ROM error • Checks sum of ROM at transfer data from ROM to RAM with ROM operation. • Verifies contents of ROM and RAM after transferring data from ROM to RAM and vice versa. (4) User program error 1 (instruction code check) • Checks instruction code of user program. • If there is grammatical error on program (such as doubled use of OUT instruction), this error also occurs. For grammatical error, check with "program check" function of a support tool such as JW-13PG. (See page 9・121 "Program check.") Note 1: If 55(H) is stored in register #055 in the system memory, the JW10 will continue operation without halting in a "user program error 1" status when it detects an error while checking the program.(The option is available in version 1.4 or later ROM code.) • Program address of error instruction codes are stored in system memory #052 and #053. • This is checked at changeover from stop to operation mode. (5) User program error 2 (parity check) • Checks parity of program memory. • Program address having parity errors are stored in system memory #052 and #053. • This is checked at changeover from stop to operation mode. (6) User program error 3 (endless program check) • If jump destination of jump instruction (F-141) is inadequate on user program, and operation enters limitless loop, or operation time of loop instruction (F-144/F-145) is too long, the watchdog timer is not reset so the JW10 stops operation. • To recover from this error condition, reinput the power and enter stop mode (program mode) so that you can revise the program. (7) System memory error • If setting value of system memory is out of setting range, this error occurs. • Error occurred system memory addresses are stored in system memory #054. • JW10 calculates BCC codes from #200 to #256, and if this is different from value of #257, this error occurs. • This is checked at changeover from stop to operation mode. (8) Watchdog timer error • If operation cycle is abnormal, the CPU does not reset and the watchdog timer times up. Then the CPU is reset. • If the JW10 does not recover from this error after reinputting the power or loading program again, the module has hardware error and must be replaced. (9) I/O bus error • Checks fault of I/O data bus. • Also checks connection condition of an expansion module, analog input module, and analog output module. • If a termination connector is not inserted, this error also occurs. • This is checked at inputting the power, and each scan cycle. (10) Remote I/O error • Checks communication condition with slave stations when a remove I/O is used (system memory #234 = 02). • If the JW10 cannot communicate normally with any slave station, this error occurs. • This is checked at every scan cycle. 8-10

Page 74

(11) Battery voltage drop • If battery voltage for memory backup drops below 2.5 V, this error occurs. 07372 Battery error lamp • This is checked every scan cycle. • Even if this error occurs, JW10 does not stop ON at Error operation. Therefore, make a circuit to light a lamp or emit buzzer sound at battery error using special relay 07372. Note 1: Battery error of remote I/O slave station can be checked by slave station battery error flag of master station. For details, see page 13・32. (12) Power failure or voltage drop of power supply • If JW-13PG is not connected, the JW10 does not respond to instantaneous power failure of less than 20 ms, and continues operation. In case of power failure longer than this interval, the CPU stops operation, and halt output is opened. (JW-1324K/1342K do not have halt output.) • When the power failure is recovered, the JW10 automatically restores operation. • This is checked at inputting power and each scan cycle.

[2] Halt output • The halt outputs opens when the JW10 determines error by its self diagnosis function (relay output 250 VAC, 30 VDC 1A). It closes at normal operation. • During the time that power is OFF and stop mode (program mode), this output is opened. • If emergency stop circuit of a system is connected to halt output of JW10, the system can be stopped at PC error. Note 1: JW-1324K/1342K do not have halt output. Note 2: Do not use halt output of remote I/O slave station.

[3] Special relay • If the JW10 determines error by its self diagnosis function, it writes self diagnosis results to special relay area (07370 to 07377) of the data memory. • When the error is recovered, the special relays for self diagnoses are also reset. However, they are kept ON at first one scan time soon after the recovery. • Only battery error (07372) can be taken out from the output port of PC operation among the special relays. Read out other relays through a support tool such as JW-13PG or computer link. • Power error relay (07377) turns ON only one scan interval after inputting the power.

[4] Error code • After self diagnosis, if JW10 determines an error has occurred, it writes error code to system memory (#160 to #167). • #160 to #167 functions as shift register and stores eight errors. If number of errors exceeds eight, the first written error is erased. • Error codes on the system memory are not cleared after recovery from the error. To clear the written error codes, write "00" to #160 to #167 using a support tool such as JW-13PG. • If the same error occurs repeatedly, the JW10 does not write error code of this error. #167 #166 #165 #164 #163 #162 #161 #160

Cleared status

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 27 <-- RAM error 00 00 00 00 00 00 27 44 <-- I/O bus error

27<--

44

**

**

**

**

**

** 22 <-- Battery error

(Erase)

8-11

8

Page 75

[5] ON/OFF status of the output port at error • ON/OFF status of the output port when the JW10 stops operation by self diagnosis result is determined by setting of system memory #206. • In some error contents, the output port may not be turned OFF. If you want to turn OFF some outputs when JW10 has an error, connect halt output in series. (JW-1324K/1342K do not have halt output function.) • In case of CPU error or user program error 3, the output port turns OFF regardless of setting contents of #206. #206

Output port

00(H)

OFF

55(H)

Latch ON/OFF status just before stop

• When the JW10 stops operation, it latches the output value of the JW-12DA analog output module just before stopping. (Holds in case of #206=00).

8

8-12