Toshiba CD332 user manual Programming

Page 29

5. Programming

The interrupt operation can be controlled by the user program instructions, DI (disable interrupt) and EI (enable interrupt). If a part of program is required to be executed under interrupt disable state, these instructions can be used.

When using these instructions, note the following precautions.

On the T3 program, interrupt enable/disable can be controlled by using EI instruction (FUN140) and DI instruction (FUN141). These instructions should be used in a pair in the sequence of DI first and followed by EI.

(Main program)

A

[ DI ]

Interrupt is disabled (interrupt signal is held)

A

[ EI ]

EI and DI instructions should not be used in interrupt program. Also, these instructions should not be executed in the first scan.

When using the interrupt function, the following general precautions should be considered.

The high frequency of the interrupt generation will cause T3 inoperative. Because, in such case, the T3 becomes busy to execute the interrupt program, and cannot execute the main program.

When the CD332 is used, pay attention to the external noise environment. Especially, when using the high speed response mode, check this point carefully.

User’s Manual 25

Image 29
Contents CD332 Page Important Information Page Safety Precautions Safety SymbolsInside This Manual About This ManualAbout This Manual Related Manuals Contents Section CD332 Overview Introduction CD332 OverviewCD332 External featuresStatus LEDs Interrupt timing setting DIP switchesInput terminals Jumper plugsSection Specifications Functional specifications SpecificationsGeneral specifications Input circuit Input signal connectionsChange Detect DC Input Module CD332 Section Mode Setting Input delay setting Mode SettingOFF Interrupt generation timing settingChange Detect DC Input Module CD332 Section Allocation I/O allocation and I/O register O AllocationIN1 Interrupt assignment Section Programming T3 sample program ProgrammingMain Program Interrupt Program #1 I/O#1Programming Interrupt operation Programming Change Detect DC Input Module CD332 Page Toshiba Corporation