Common description of the hardware
7.6 7.6 Error codes, cou ntermeasures and and maintenance: 7.6.1 Error messages: On the front of the CPU is an error indicating LED. On H300-H2002 there is a display, which shows the error code. Using Actsip-H, Actgraph+ (or the hand programmers) you can read the error code. In Actsip you can get the reason for the error in clear text. (Go to the menu "Communication-Show "Communication-Show status"). Otherwise you can go to the table below and read out the reason for the error.
The error code is presented in the word WRF000 Following error codes are valid for HB/H200. For error code 14, 15, 21, 22, 24, 25, 26, 28, 29, 2A, 2C, 41, 43, 47, 51-59, 72, 72, 88, - -, Ff and All lamps, see separate description. rror ode
Error type
Priority
Reason for the error
Counter measure etc..
Error lamp
RUN/ Stop
Memory indication
1
System ROM error
High
Check sum showed error. The CPU can not read correct.
The CPU hardware is wrong. If this is discovered again, you must change the CPU.
light
Stop
-
2
System RAM error Micro processor error Undefined instruction Data memory error Program memory error
High
Check sum showed error. The CPU can not read correct. Tried to read an undefined instruction Tried to read an undefined instruction Error detection discovered at memory check Discovered at check sum control.
light
Stop
-
light
Stop
R7C8
light
Stop
R7C9
light
Stop
-
light
Stop
R7CA
3
Memory size error
Medium
Memory is of a smaller size than told in the setup.
light
Stop
R7CC
4
Syntax error
Medium
light
Stop
R7D4 and WRF001
4
Time error during normal scan Time error, periodic scan
Low
User program contains an error. (Detailed information is in memory word WRF001) The execution time in the normal program > max. max. time in setup.
Try to transfer the program again. The battery can be bad. If it is a ROM , check the mounting. It could be bad ROM programming. Initiate the system with correct information. If this is not enough , change CPU. See table of user program errors.
light
Stop
R7D1
Low
The periodic interrupt routine is called during its own execution
light
Stop
R7D2
Time error, interrupt scan Communication error
Low
The interrupt routine is called during its own execution Error during communication with PC (parity error)
Change the program so it will take shorter time or prolong the max. time. Change the program in the periodical interrupt routine so the time decreases It must be longer intervals between the interrupts. -Check cables. -Check communication parameters -Shield possible external noise
light
Stop
R7D3
no light
RUN
no light no light no light no light flashes
RUN
3 3 7 1
5
6 1
2 3 4 5 1
Communication error Communication error Communication error Communication error Battery error
High Medium Medium Medium
Warning
Warning Warning Warning Warning Warning
Error during communication with PC (handshake error) Error during communication with PC (time out) Error during communication with PC (protocol error) Error during communication with PC (data receive error) The charge of the Battery is below specified level.
Check if there is a bad noise in the surrounding.
Change battery
RUN RUN RUN RUN
R7D9
Copyright Actron AB 1994, 2009
How to read this manual.
THIS PAGE INTENTIONALLY LEFT BLANK
2
Copyright Actron AB 1994, 2009
How to read this manual.
THIS PAGE INTENTIONALLY LEFT BLANK
2
Copyright Actron AB 1994, 2009
TABLE OF CONTENTS: AUTHORED BY:
............................ .......................................... ............................ ............................ ............................ ............................ ............................ ............................ ................ .. 1
1 HOW TO READ THIS MANUAL : ............................ .......................................... ............................ ............................ ............................ ..................... ....... 1 ......................................... ............................ ............................ ............................ ............................ ................ .. 3 2 HISTORY, BA CKGROUND: ...........................
2.1 SHORT HISTORY ABOUT LIGHTHOUSE PLCS, INC.: .......................... ........................................ ............................ .......................... ............ 3 2.2 SHORT HISTORY ABOUT ABO UT HITACHI :........................... ......................................... ............................ ............................ ............................ ................... ..... 3 ...................................... ............................ ............................ ............................ ............................ ................... ..... 4 2.3 SHORT HISTORY ABOUT PLC: ........................ ......................................... ........................... ............................ ........................ .......... 6 3.1 SYMBOLIC PICTURE PICTURE OF AN H SERIES PLC: ............................ 3.2 ABBREVIATIONS : .................... .................................. ............................ ............................ ............................ ............................ ........................... ........................... ................. ... 7 3.3 PROGRAM SYMBOLS SYMBOLS: ........................... ......................................... ............................ ............................ ............................ ........................... ........................... ................. ... 8 3.4 ADDRESSING: ............................ .......................................... ............................ ............................ ............................ ............................ ............................ .......................... ............ 9 3.4.1 In-/ and Outputs: ........................... ......................................... ............................ ............................ ............................ ............................ ............................. ............... 9 3.4.2 Internal memories: .......................... ........................................ ........................... ........................... ............................ ............................ .......................... ............ 12 3.4.3 Link memories: ........................... ......................................... ............................ ........................... ........................... ............................ ............................ ................. ... 12 3.4.4 Edge memories:........................ memories:...................................... ............................ ............................ ............................ ............................ ........................... .................. ..... 14 3.4.5 Timers and Counters: .......................... ........................................ ............................ ........................... ........................... ............................ ...................... ........ 14 3.4.6 Master Control:......................... Control:...................................... ........................... ............................ ............................ ........................... ........................... ................... ..... 15 3.4.7 Constant values: ............................ ......................................... ........................... ............................ ............................ ........................... ............................ ............... 15 3.4.8 Battery backup (retentive areas) of memories: ........................ ...................................... ........................... ......................... ............ 15 3.5 SPECIAL MEMORIES: ............................ .......................................... ............................ ............................ ............................ ........................... ........................... ................ 16 3.5.1 Special memories, Words: ........................... ......................................... ............................ ........................... ........................... ............................ .............. 16 3.5.2 Special memories Bits: ............................ ......................................... ........................... ........................... ........................... ........................... ................ .. 17 4.1 B ASIC LADDER LADDER PROGRAMMING:........................... ......................................... ............................ ............................ ............................ .......................... ............ 20 4.2 SYMBOLS: ........................... ......................................... ............................ ............................ ............................ ............................ ............................ ............................ ................. ... 20 4.2.1 Block...................................... Block.................................................... ............................ ............................ ............................ ............................ ............................ ..................... ....... 20 4.2.2 Branch ........................... ......................................... ............................ ............................ ............................ ............................ ............................ ............................. ............... 21 4.2.3 Contact symbols ........................... ......................................... ............................ ............................ ........................... ........................... ............................. ............... 22 4.2.4 Inverting: ........................... ......................................... ............................ ............................ ............................ ............................ ........................... ......................... ............ 24 4.2.5 Set, Reset ....................................... ..................................................... ............................ ............................ ............................ ............................ ........................... ............. 26 4.2.6 Master Control Set (MCS) (MCS) and Reset (MCR) (MCR) .......................... ........................................ ........................... ........................... .............. 26 4.2.7 Master Control Set. ............................... ............................................. ............................ ............................ ........................... ........................... .................... ...... 27 4.2.8 Master Control Reset........................... Reset......................................... ........................... ........................... ........................... ........................... ....................... ......... 27 4.2.9 Edge detection (DIF and DFN-Contacts) ............................... ............................................ ........................... ............................ .............. 29 4.2.10 Comparison contacts ............................ .......................................... ............................ ............................ ............................ ............................ .................. .... 31 4.2.11 Arithmetic box: .......................... ........................................ ............................ ........................... ........................... ............................ ........................... ................ ... 31 4.2.12 Timer programming: .......................... ........................................ ............................ ............................ ............................ ............................ .................... ...... 32 4.2.13 Counter programming:....................... programming:..................................... ............................ ............................ ............................ ............................ .................... ...... 32 4.2.14 Complex logic.................................... logic.................................................. ............................ ........................... ........................... ............................ ...................... ........ 32 4.2.15 Self hold: ........................... ......................................... ............................ ............................ ............................ ............................ ........................... ....................... .......... 33 4.2.16 Sequence programming with self hold: hold: ........................... ........................................ ........................... ........................... .................... ....... 33 4.2.17 Output control in sequence programming: .......................... ........................................ ............................ ............................ .............. 33 4.2.18 Timers : .......................... ........................................ ............................ ............................ ............................ ............................ ............................ .......................... ............ 34 4.2.19 Counters: ........................... ......................................... ............................ ............................ ............................ ............................ ........................... ....................... .......... 40 4.2.20 Set value (The preset value) of Timers /Counters................. /Counters.............................. ........................... ........................... ............... .. 43 4.2.21 Variable preset value of timers/counters....................... timers/counters..................................... ............................ ........................... ..................... ........ 43 4.2.22 Timer/Counter read of current value: .......................... ........................................ ........................... ........................... ....................... ......... 43 4.2.23 Comparison instructions: .............. ............................ ............................ ............................ ........................... ........................... .......................... ............ 44 ......................................... ............................ ............................ ........................ .......... 46 4.3 ARITHMETIC INSTRUCTIONS REFERENCE : ........................... 4.3.1 Array variables and indexed addressing addressing ............................ .......................................... ............................ ............................ .................. .... 46 4.3.2 Summary of arithmetic instructions,................................ instructions,.............................................. ........................... ........................... ...................... ........ 48 4.3.3 Arithmetics.................... Arithmetics.................................. ............................ ............................ ........................... ........................... ............................ ........................... .................. ..... 48 4.3.4 Logic expressions ............................ .......................................... ........................... ........................... ............................ ............................ .......................... ............ 49 Copyright Actron AB 1994-2009
i
Table of contents 4.3.5 Comparison expressions ........................... ......................................... ............................ ............................ ............................ ............................ ................50 ..50 4.3.6 Bit operations.............. operations ........................... ........................... ............................ ............................ ........................... ........................... ............................. ....................50 .....50 4.3.7 Shift and rotation expressions ........................... ......................................... ........................... ........................... ............................ .......................51 .........51 4.3.8 Moving data .......................... ........................................ ............................ ............................ ............................ ............................ ............................ ......................52 ........52 4.3.9 Negations, absolute value etc................................. etc.............................................. ........................... ........................... ........................... ...................52 .....52 4.3.10 Conversions................ Conversions.............................. ............................ ............................ ............................ ............................ ............................ ............................ .................52 ...52 4.3.11 Application commands ........................... ......................................... ............................ ............................ ............................ ............................ .................54 ...54 4.3.12 Control commands (jump etc.) ........................... ......................................... ............................ ............................ ............................ ...................54 .....54 4.3.13 FUN-instructions for series HB: ........................... ......................................... ........................... ........................... ........................... .................54 ....54 4.3.14 FUN-instructions for H252, H302-H2002:........... H302-H2002:........................ ........................... ............................ ............................ .................55 ...55 4.4 DETAILED DESCRIPTION OF ARITHMETIC INSTRUCTIONS: ............................ .......................................... ............................57 ..............57 4.4.1 Copy ........................... ......................................... ............................ ............................ ............................. ............................. ............................ ........................... ..................57 .....57 4.4.2 Indexed (relative) addressing .......................... ........................................ ........................... ........................... ........................... .........................57 ............57 4.4.3 Arithmetics .......................... ........................................ ........................... ........................... ............................ ............................ ........................... .........................59 ............59 4.4.4 Logic expressions ...................... ................................... ........................... ............................ ............................ ........................... ........................... ....................69 ......69 EXPRESSIONS : ............................ .......................................... ............................ ............................ ............................ ............................ ...............70 .70 4.5 COMPARISON EXPRESSIONS .......................................... ............................ ............................ ............................ ............................ ............................ ...................73 .....73 4.6 4.6 BIT OPERATIONS: ............................ 4.6.1 Shift and rotation expressions............. expressions ........................... ............................ ........................... ........................... ............................ .......................76 .........76 4.7 4.7 MOVING DATA: ............................ .......................................... ............................ ............................ ............................ ............................ ............................ ........................83 ..........83 4.7.1 Negations, absolute value etc................................. etc.............................................. ........................... ........................... ........................... ...................89 .....89 4.7.2 Converting............................ Converting................ .......................... ............................ ............................ ............................ ............................ ........................... .......................91 ..........91 .......................................... ............................ ............................ ............................ ............................ ...................96 .....96 4.8 APPLICATION COMMANDS COMMANDS: ............................ 4.9 FIFO (QUEUE REGISTER): ......................... ....................................... ............................ ............................ ............................ ............................ ......................97 ........97 4.10 CONTROL COMMANDS (JUMP ETC.): ........................... .......................................... ............................. ............................ ............................101 ..............101 .......................................... ............................ ............................ ..........................109 ............109 4.11 LOGIC INSTRUCTION PROGRAMMING: ............................ Start Contact symbol .......................... ................................... ....................... ........................... ........................... ............................ ............................ .......................109 .........109 ........................................... ............................ ............................ ...................114 .....114 5.1 TO RUN THROUGH A COMPLETE PROJECT: ............................. 5.1.1 Choice of PLC ............................ ......................................... ........................... ............................ ............................ ........................... ............................ ..................114 ...114 5.2 COMPUTER PROGRAMMING.: ............................ .......................................... ............................ ............................ ............................ ...........................116 .............116 5.2.1 Actsip-H .......................... ........................................ ............................ ............................ ............................ ............................ ............................ ..........................116 ............116 5.2.2 Change of an existing block:................................... block:................................................. ........................... ........................... ........................... ..............123 .123 5.2.3 Comparison contacts: .......................... ........................................ ............................ ............................ ............................ ............................ ...................124 .....124 5.2.4 Arithmetic expressions:............. expressions: ........................... ........................... ........................... ........................... ........................... ........................... ..................125 .....125 5.2.5 Syntax check:............................ check:.......................................... ............................ ............................ ........................... ........................... ............................. ..................127 ...127 5.2.6 ON-Line programming................. programming............................... ............................ ............................ ............................ ............................ ...........................129 .............129 5.2.7 Store the program: ............................ .......................................... ............................ ............................ ............................ ............................ ......................130 ........130 5.2.8 Documentation:............... Documentation:............................. ............................ ............................ ............................ ............................ ............................ ..........................130 ............130 5.2.9 Printout: .......................... ........................................ ............................ ............................ ............................ ............................ ............................ ..........................131 ............131 5.2.10 End of project: ................... ................................. ............................ ............................ ............................ ............................ ............................ .....................131 .......131 ......................................... ............................ ............................ ............................ ....................132 ......132 5.3 PROGRAMMING WITH ACTGRAPH: ........................... 5.3.1 Programming:....................... Programming:..................................... ............................ ............................. ............................. ............................ ............................ ...................132 .....132 5.3.2 Start step: .......................... ........................................ ............................ ............................ ........................... ........................... ............................. .........................134 ..........134 5.3.3 Actions: ........................... ......................................... ............................ ............................ ............................ ............................ ............................ ..........................134 ............134 5.3.4 Transitions: ............................ .......................................... ............................ ............................ ............................ ............................ ........................... ...................135 ......135 5.3.5 Detailed Actions:.......................... Actions:........................................ ............................ ............................ ........................... ........................... ........................... ..............136 .136 5.3.6 Alternative branch: ........................... ........................................ ........................... ............................ ............................ ........................... .......................137 ..........137 5.3.7 Parallel branch: ............................ .......................................... ........................... ........................... ............................ ............................ ...........................137 .............137 5.3.8 Return branch: ........................... ......................................... ............................ ............................ ............................ ............................ ............................ ...............138 .138 5.3.9 Super conditions: ........................... ......................................... ............................ ............................ ............................ ............................ ........................138 ..........138 5.3.10 Logic boxes: ........................... ......................................... ............................ ............................ ............................ ............................ ............................ .................140 ...140 5.3.11 Macro boxes:............................ boxes:.......................................... ............................ ............................ ............................ ............................ ............................ ...............140 .140 5.3.12 Action boxes:...................................... boxes:.................................................... ............................ ............................ ............................ ........................... ...................141 ......141 5.3.13 Mathematical expressions:.......................... expressions:........................................ ............................ ........................... ........................... .........................143 ...........143 5.3.14 Comparison expressions: ........................... ......................................... ............................ ............................ ............................ .........................143 ...........143 5.3.15 Zoom: ............................. ........................................... ............................ ............................ ............................. ............................. ............................ ........................144 ..........144 ........................................ ............................ ............................ ............................ ....................146 ......146 6 HAND PROGRAMMING PROGRAMMING UNITS: UNITS: ..........................
7.1 GENERAL SPECIFICATION SPECIFICATION : .......................... ........................................ ............................ ............................ ............................ ............................ ....................149 ......149 ......................................... ............................ ............................ ............................ ............................ ........................149 ..........149 7.2 B ASIC SPECIFICATION SPECIFICATION: ........................... ii
Copyright Actron AB 1994, 2009
Table of contents 7.3 PROCESS SYSTEM : ........................... ......................................... ............................ ............................ ............................ ............................ ............................ ................ 150 7.3.1 In- and output and output update. ............................. ........................................... ............................ ............................ ............................. ............................ ............... 150 ............................. ............................ ............................ ............................ ............................ ............................ ............................ ........................ .......... 151 7.4 INTERRUPT : ............... ......................................... ............................ ............................ ............................ ............................ ............................ ...................... ........ 154 7.5 INSTALLATION: ........................... 7.5.1 Mounting in general:.................................... general:.................................................. ............................ ........................... ........................... ......................... ........... 154 7.5.2 Power connection: ........................... ......................................... ............................ ........................... ........................... ............................ ........................ .......... 156 7.5.3 24V DC.............. DC ............................. ............................. ............................ ............................ ............................ ............................. ............................. ....................... ......... 156 7.5.4 Cable connection:.......................... connection:....................................... ........................... ............................ ............................ ........................... .......................... ............. 156 7.5.5 Input connections: .......................... ........................................ ............................ ............................ ............................ ............................ ........................ .......... 156 7.5.6 Output connections: .......................... ........................................ ............................ ............................ ............................ ............................ ..................... ....... 157 7.5.7 The CPU-port:.................................... CPU-port:.................................................. ........................ .......... ........................... ........................................ ......................... ............ 157 .......................................... ........................ ......... 158 7.6 ERROR CODES, COUNTERMEASURES AND MAINTENANCE : ........................... 7.6.1 Error messages: .................................. ................................................ ............................ ............................ ............................ ............................ ................... ..... 158 7.6.2 Error messages for for syntax errors (program errors): ........................... ......................................... .......................... ............ 159 7.6.3 Error during program program execution:............................ execution:.......................................... ............................ ............................ ........................... ............. 159 ......................................... ............................ ............................ ............................ ............................ ................... ..... 161 8.1 8.1 TYPES OF COMPONENTS: ........................... 8.1.1 HB, link model (HL) .......................... ........................................ ............................ ........................... ........................... ............................ ...................... ........ 162 8.1.2 Series HB HB in in remote version (HR- expansion racks) ........................... ......................................... ........................... ............. 162 8.2 COMPONENT LIST: ............................ .......................................... ............................ ............................ ............................ ............................ ............................ ................ 164 8.2.1 Base units and expansion modules:...................................... modules:.................................................... ............................ ............................ .............. 164 8.2.2 H200 ex pansion units ............................ ......................................... ........................... ............................ ............................ ............................ .................. .... 165 .................................................... ............................ ............................ ............................ ............................ .......................... ............ 167 8.3 ADDRESSING: ...................................... 8.4 EXPLANATIONS OF THE COMPONENTS : ................. ............................... ............................ ............................ ............................ ..................... ....... 170 8.5 SETTING OF JUMPERS AND SWITCHES OF HB: ........................... ......................................... ............................ ............................ .............. 171 8.5.1 The function of the RUN/ERROR RUN/ERROR contact: ........................... ......................................... ............................ ........................... ............... 171 8.5.2 Mounting of series HB............................... HB............................................ ........................... ............................ ........................... ........................... ................ 171 ................................................... ............................ ............................ ........................... .......................... ............. 172 8.6 INPUT SPECIFICATIONS : ..................................... 8.7 HIGH SPEED COUNTER SPECIFICATION : ................... ................................. ............................ ............................. ............................. .................. .... 174 8.8 OUTPUT SPECIFICATIONS - RELAY OUTPUT OUTPUT: ........................... .......................................... ............................. ............................ ................ .. 176 .......................................... ............................ ............................. ................... .... 177 8.9 OUTPUT SPECIFICATIONS - TRANSISTOR: ............................. ......................................... ............................ ............................. ................... .... 178 8.10 SPECIFICATION OF EXPANSION MODULES :........................... 8.11 WIRING: ............................ .......................................... ............................ ............................ ............................ ............................ ............................ ............................ ................ 178 8.11.1 Power wiring:................................... wiring:................................................ ........................... ............................ ............................ ........................... ..................... ........ 178 8.1 8.11.2 Input connection:................... connection:...................... ................ ........................... ............................ ............................ ............................ ............................. ............... 179 ......................................... ............................ ............................ ..................... ....... 182 8.12 FUN-INSTRUCTIONS FOR SERIES SERIE S HB: ........................... ........................................... ............................ ............................ ............................ .............. 188 9.1 DESCRIPTION OF EXTERNAL PARTS: ............................. 9.2 START ADDRESSES IN SLOTS : ........................... ......................................... ............................ ............................ ............................ .......................... ............ 190 9.3 CONFIGURATION ONFIGURATION: ............................ .......................................... ............................ ............................ ............................ ............................ ............................ ................. ... 190 ................................. ............................ ............................ ............................ ............................ ........................... ................... ...... 191 9.4 MOUNTING OF H200: ................... ......................................... ............................. ............................. ......................... ........... 193 9.5 MODULE SPECIFICATION H200-H252: H200-H252: ........................... 9.6 SPECIFICATION OF THE MODULES : ........................... ......................................... ............................ ............................ ........................... ................... ...... 194 9.6.1 Voltage supply: ........................... ......................................... ............................ ............................ ............................ ............................ ............................ .............. 194 9.6.2 Input modules: ........................... ......................................... ............................ ............................ ............................ ............................ ............................. ............... 194 9.6.3 Output modules: ........................... ......................................... ............................ ............................ ............................ ............................ .......................... ............ 196 9.6.4 Analog modules Current: ............................ .......................................... ............................ ............................ ............................ ......................... ........... 197 9.6.5 Analog modules Voltage: ........................... ......................................... ............................ ............................ ............................ .......................... ............ 197 9.6.6 Isolated mixed Analog modules: .................................. ................................................ ............................ ............................ ...................... ........ 199 9.6.6.1 ACTANA-S modules mixed mixed voltage and current............................... current............................................................ ..................................... ........ 199 9.6.6.1.1 Digital inputs /outputs using mode 1.................................................................... 1............................................................................... ........... 201 9.6.6.1.2 Programming and addresses:................................................. addresses:............................................................................... .......................................... ............ 203 9.6.6.1.4 Filter time:....................................... time:.................................................................... .......................................................... ................................................... ...................... 203 9.6.6.1.4 Conversion factor: ........................................................ ..................................................................................... ................................................... ...................... 203 9.6.6.1.5 Error information: ......................................................... ...................................................................................... .................................................. ..................... 203 9.6.6.2 ACTANA-F module............................ module......................................................... .......................................................... ....................................................... .......................... 206 9.6.6.2.1 Quick update logic. ....................................................... .................................................................................... .................................................. ..................... 206 9.6.6.2.2 Analog inputs inputs sample and hold: ...................................................... ................................................................................... ................................ ... 219 9.6.6.2.3 Repeated sampling sampling control with high precision: (Mode 3)..................................... 3).............................................. ......... 219 9.6.6.2.4 Repeated sampling control without stopping other functions: (Mode 3)........................ 3)........................ 221 9.6.6.2.5 Filter time: time: (Mode (Mode 2 and 3) .................................................... ................................................................................. ......................................... ............ 224 9.6.6.2.6 Sampling interval: interval: (mode 3)................................................... 3)............................................................................... ......................................... ............. 224 9.6.6.2.7 Conversion factor: (mode 2 and 3).......................................................................... 3).................................................................................. ........ 224 Copyright Actron AB 1994
iii
Table of contents 9.7 OPERATOR TERMINALS: .........................................................................................................226 9.7.1 Actterm-H........................................................................................................................226 9.7.1.1 Start up.....................................................................................................................................228 9.7.1.1.1 Start the program..............................................................................................................228 9.7.1.1.2 Connecting (adding) Actterm-H to an existing project. ...................................................228 9.7.1.1.3 How to configure the System...........................................................................................229 9.7.3.3 Programming ...........................................................................................................................230 9.7.3.3.1 How to use the function keys...........................................................................................230 9.7.3.3.2 How to use the LEDs ......................................................................................................232 9.7.3.3.3 How to use the Buzzer ....................................................................................................232 9.7.3.3.4 How to use the DISPLAY................................................................................................232 9.7.3.3.5 How to type the texts and transfer the texts to the terminal.............................................232 9.7.3.3.6 Transfer the texts.............................................................................................................234 9.7.3.3.7 Documentation:...............................................................................................................234 9.7.3.3.8 Display with only Text.....................................................................................................234 9.7.3.3.9 Text typing ......................................................................................................................234 9.7.3.3.10 How to program a pure text Display .............................................................................234 9.7.3.4 Display with text and values...................................................................................................235 9.7.3.4.1 How to make a display with text and values...................................................................236 9.7.3.4.2 How to program a display with text and values ..............................................................236 9.7.3.4.3 How to show values with separation characters..............................................................238 9.7.3.4.4 Rolling text: (Scroll) .......................................................................................................239 9.7.3.5 How to preset a value .............................................................................................................241 9.7.3.5.1 Texts that move and change............................................................................................241 9.7.3.5.2 How to write in the expansion memory ...........................................................................244 9.7.3.5.3 How to read in the expansion memory.............................................................................244
9.7.4 ActTerm-H with printer port ..........................................................................................246 9.7.4.1 Start the program ....................................................................................................................246 9.7.4.1.1 Typing printer text ..........................................................................................................246 9.7.4.1.2 Text print out ..................................................................................................................246 9.7.4.1.3 Programming of a text printout.......................................................................................248 9.7.4.1.4 Programming of mixed text and value ............................................................................248 9.7.4.1.5 Connection of a printer ...................................................................................................249 9.7.4.2 Mounting ................................................................................................................................250 9.7.4.2.1 Typical mounting of the PLC in a housing .....................................................................250 9.7.4.2.2 Power supply of ActTerm-H..........................................................................................250 9.7.4.2.3 Measurements .................................................................................................................251 9.7.4.2.4 Hints when using ACTTERM-H.....................................................................................252
9.8 COMMUNICATION MODULES: ................................................................................................253 9.8.1 Remote communication (Remote modules): ...................................................................253 9.8.2 Current consumption RIOH and IOLH-T ......................................................................253 9.8.3 General specification RIOH and IOLH-T.....................................................................253 9.8.4 Link communication......................................................................................................255 9.8.5 CTH High speed counter module:.................................................................................257 10.1.1 Differences between H300-H2000 and H302-H2002 ..................................................264 10.1.2 Expansion of I/O-modules............................................................................................265 10.2 COMMUNICATION: ...............................................................................................................265 10.2.1 Link modules: ...............................................................................................................265 10.2.2 COMM2-H ...................................................................................................................265 10.2.3 Modules to H300-H2002..............................................................................................267 10.2.4 H300-H2002 Circuit diagram input modules:.............................................................269 10.2.5 Circuit diagram output modules ..................................................................................269 11.1 PID-INSTRUCTIONS: ............................................................................................................271 11.2 TRIGONOMETRIC FUNCTIONS: .............................................................................................272 11.3 SEARCH INSTRUCTIONS: ....................................................................................................274 11.4 ASCII-CONVERSION INSTRUCTIONS : .................................................................................274 11.5 DIVERSE INSTRUCTIONS : ...................................................................................................274 11.6 S AMPLING (TROUBLE SHOOTING) INSTRUCTIONS: .............................................................274 11.7 OTHER INSTRUCTIONS : ......................................................................................................274 11.8 SERIAL COMMUNICATION INSTRUCTIONS: ..........................................................................274 12.1 SPECIAL MEMORIES (DETAILED ): ......................................................................................277 12.2 INSTRUCTION TIME: ...............................................................................................................279 iv
Copyright Actron AB 1994, 2009
Table of contents INDEX: ......................................................................................................................................... 282
Copyright Actron AB 1994
v
Table of contents THIS PAGE INTENTIONALLY LEFT BLANK
vi
Copyright Actron AB 1994, 2009
1 How to read this manual:
AL MANU
H serie
This manual contains information which is common for all PLC types in the H family.
- History, Background (page 3) A short history and presentation of Actron, Lighthouse PLCs, and Hitachi PLC’s in general is described here. - Symbols, abbreviations, etc. (page 6) The basic contents of a PLC, the common abbreviations and principles of addressing and the memory areas (e.g. Special memories) are described here. X002
TD15
TD15
Y102
3.5 S
- Programming (page 20) The basic ladder programming is described first. Thereafter Timers, Counters and comparing is described. The arithmetic instructions are first given in a comprehensive way together with page references to the more detailed description. Thereafter the instructions are described , which are in common for the different system types. This is followed by logic instruction programming. This is needed if the small hand held programming unit is used. The chapter ends with mixed program examples. - Handling in practice (page 114) Here is a description of how to plan a project, choice of PLC type, configuration, installation, computer programming, start up and documentation
Copyright Actron AB 1994-2009
1
Table of contents
- Common hardware description (page 149) Here are common specifications, the common installation principles, common error codes and trouble shooting principles are described The processing system is also described.
The differences between the different PLC types are described in separate parts. INPUT
0
1
2 3
4
5
6 7
8 9 1 1 0 1
POW RUN ERR
8
9 1 0 1 1 8
INPUT
R.CL
0 1
9 1 0 1 1
2 3
4
8 9
56 7
1 0 11
8
9 01 1 1
POW RUN ERR
8
9 1 0 11
INPUT
0
R.CL
OUTPUT
100
101
102
103
10405 1
106
107
108
109
110
111 106
107
108109
110
8
1
9 1 0 11
2 3
4
POW RUN ERR
111
8
5
9 1 0 11
6 7
INPUT
R.CL OUTPUT
100
101102
103
104
105
106
107
108
109
110
111 106
107
108109
110
8
9 1 0 11
0
1
2 3
4
5 6
7
8
9 0 1 1 1
POW RUN ERR
111
R.CL OUTPUT
100
101
102
10304 1
105
OUTPUT
106
107
100
108
101
109
102
110
103
111
10405 1
106
107
108
109
110
111
- Addition to H20-H64 (page 161) The different hardware units that belong to H20-H64 are described here as well as the specific programming instructions for H20-H64 and the addressing in detail. - Addition to H200-H252 (page 188) The different hardware units that belong to H200-H252 are described here as well as the specific programming instructions for H200-H252. - Addition to H300-H2002 (page 264) The different hardware units that belong to H300-H2002 are described here as well as the specific programming instructions for H300-H2002 and the addressing in detail.
FUN1 PID control . FUN15 ARC TAN function .
- Extra programming instructions for H252, H302-H2002: (page 271) The special programming instructions, which are implemented in the most powerful PLCs are described here, e.g. PID-instructions and trigonometric function. - Appendix (page 276) The basic definitions such as Hexadecimal, binary etc. are described here. Complete tables of the special memories, error codes etc. are also given here.
General: For programming procedure, start with the common parts of the manual and refer to the additional part when references are given. For description of the special modules (hardware, connection, addressing and programming) go directly to the special additional chapter.
References to the different PLC types are often made, e.g. H302-H2002. (which refers to the CPUs H302, H702, H1002 and H2002) or e.g. HB-H250 (which refers to the CPU:s H20, H28, H40, H64, H200 and H250) as the following order is valid: H20, H28, H40, H64, H200, H250, H252, H300, H700, H2000, H302, H702, H1002, H2002. H20-H64 are also called HB (for H Board type) Example The grey field in the bottom of the table says that it is only valid for some CPUs, while the instructions in the white field are common for all PLC-types in the H-family and it is described on page 20 in the common part of the manual. d=S1 == S2
Comparison equal
If S1 = S2
then d=1 else d=0
d=S1 S == S2
-"- with +/- sign
If S1 = S2
then d=1 else d=0
2
66 Not valid for HB-H200
66
Copyright Actron AB 1994, 2009
2 History, background: 2.1 Short histo ry abou t Light hous e PLCs, Inc.: Lighthouse PLCs, Inc. was formalized and incorporated in January 2000 in Eugene, Oregon. The President/Owner has 40 years in the electrical business. His experience began first with an electrical apprenticeship and then an apprenticeship in instrumentation. He was able to utilize his experience becoming the Chief Electrical and Instrumentation Inspector for Exxon USA (Midland, TX ) in 1985. He has been a Senior member of the International Society of Automation (ISA) for over 25 years, and likewise an Active member of the International Association of Electrical Inspectors for over 25 years. Currently, he hold s Master Electrican Licenses in two states, and a General Journeyman’s License in a third. In addition to qualifying as a Senior Instrumentation Tech, he also passed certification as an Inspector by the American Society for Testing and Inspection (ASTI, Tulsa, OK). In 1988 he was granted a Diploma in Business Management from Trend College (Salem, OR). A dynamic leader is important, but a company is only as good as the people it employs (and empowers). Lighthouse PLCs, Inc. is fortunate to be able to draw on the resoures of some very talented people, essential to meeting customer needs. One important thing has always remained a constant; the company's committment to people and conviction to provide extraordinary service and quality products through knowledge and teamwork. Lighthouse PLCs, Inc. is proud to be the sole authorized distributor for Hitachi programmable logic controllers and Actron programming software for North America.
2.2 Short histor y about Hitachi: Hitachi Ltd was started in 1910. The original business was based on electro-mechanical products. Today Hitachi is the largest company in Japan manufacturing electronic and electro-mechanical products. It also belongs to the largest companies world wide, all categories. Today Hitachi is known for a number of products (all the way from manufacture of integrated circuits, consumer electronics to nuclear power generators). In common for all product ranges is the quality approach, which been Hitachi’s priority for many years. The PLC product range from Hitachi is a good example of this. Thanks to the availability of Hitachi’s own integrated circuit development Hitachi is in the front line of PLC development.
Copyright Actron AB 1994-2009
3
Table of contents
2.3 Short histor y about PLCs: “PLC” stands for “Programmable Logic Controller”. The PLCs have today almost completely replaced the older generations of control systems. The relay systems belong to this group. The relays were connected in order to form a logic combination between inputs and outputs. When the micro processor was invented this technique was used in products to replace the relays. These products were different from other micro processor solutions as the user programming structure was designed to be similar to the logic relay combinations and the way of running through the program was made such that all logic circuits seem to run simultaneously. To replace the relays in hard physical environment these product also had to be better prepared to withstand noise, vibrations etc. In the beginning these products only took care of logic combinations, as the relay technique. Therefore the word ”Logic” was placed in-between "Programmable" and "Controller". As the micro processor technique itself offered more possibilities than to handle pure logic it was natural to introduce arithmetic instructions. Many countries decided therefore to delete the word ”Logic” in the name. (this happened in the beginning of the 1980s). The abbreviation ”PC” very soon came into a conflict with another abbreviation. That was ”PC” for personal computer. Therefore most countries returned to ”PLC” even if this abbreviation is not perfect. The PLC systems are built around standardised modules. These are manufactured in very large quantities. Often it is an advantage economically to use this technique instead of special designed products even if it is possible to optimise the amount of components in the special solution. The units are well tested and the failure frequency is low. The documentation is standardised and it can be understood by many people. There are also spare parts available in most countries.
4
Copyright Actron AB 1994, 2009
Symbols, abbreviations, etc.
Copyright Actron AB 1994-2009
5
Symbols, Abbreviations, Etc.
3 Symbols, abbreviations, etc.:
3.1 Symbolic pi ctur e of an H series PLC: Inputs/ Outputs memories etc.
PROGRAM X00 2 X0 13 R034 Y102
Y102
M002
16 outputs in a row 16 inputs in a row M-memories/ WM-memories
e.g. an analog input
e.g. an analog output WR-memories
R-memories
INPUTS OUTPUTS
Mixed Bit- and Word memories L-memories/ WL-memories
Separate Word memories DIFmemories
DFNmemories
Memories for positive edge
Memories for negative edge
Separate Bit memories
MCS/MCR-memories
Link-memories (common for othere linked units)
TC-memories
Memories for master control start
Memories for master control stop
Bit memories for counters and timers
Timer/Counter current values
Copyright Actron AB 1994, 2009
Symbols, Abbreviations, Etc.
3.2 Abbreviations: b
bit In-/Output or memory ("1" or "0")
X
Input (The inputs can be treated as WX- Words, see below)
Y
Output (The outputs can be treated as WY- Words, see below)
W
Word (16 bits in a row) *1
D
Double words (32 bits in a row). Not valid for HB-H200
M
Bit memory, which is inside the area shared between Bits and Words
*2
(M-memories and WM-memories are in the same memory area.) R
Memory bit in an area with only bit memories.
WR
Memory word in an area with only word memories
L
Memory area, which are shared between two or more Link connected CPUs. (L-memories and WL-memories are in the same memory area.)
TC
Timers and Counters current values.
TD,CU etc
Different types of Timers and Counters
*1 16 bits in a row gives a decimal value 0-65,535. The value in Hexadecimal is 0-FFFF *2 32 bits in a row gives a decimal value 0-4,294,967,295. The value in Hexadecimal is 0-FFFFFFFF
Copyright Actron, A.B. 1994
7
Symbols, Abbreviations, Etc.
3.3 Program symbols: (for more information, see under Programming page 20)
Type
in function (contact)
Input
out function ( coil) not possible
Note Input, which is physically connected to the system, e.g. a Photo switch
Output
Output, which is physically connected to the system, e.g. a. Contactor. The status of the output can be detected.
Internal memory
Memories, which keep the status ”On/Off” or "1/0".
Special internal memory
Memories with decided functions, e.g. time periods.
some
Timer timer output
timer activation
counter out
counter activation
Counter
Comparison
not possible
Arithmetic box
not possible
Box in which a comparison between two values is done. The comparison gives a contact function with "On/Off"-status. Box in which calculations etc. is done, which can not done by logic.
Other definitions (like hexadecimal, binary etc., see appendix page 276)
Copyright Actron AB 1994, 2009
Symbols, Abbreviations, Etc.
3.4 Addressing: 3.4.1 In-/ and Outputs: Type of address External input
External output
External input remote control
External output remote control
HB/H20 0
H250-H2002
Bit
X 0 U S b b
X= input
U =Unit no.
0-1
Word
W X 0 U S W
Y=output
S =Slot no.
0-7
H250: 0-1 H252: 0-2 H300: 0 H700 : 0-1 H2000: 0-5 0-A (hex)
Double word Bit
D X 0 U S W
b b=bit nr.
0-15
0-95 (dec)
Y0USbb
W=Word (16 bits)
W =Word no.
0-7
0-9
Word
W Y 0 U S W
WX=Word input
Double word Bit
D Y 0 U S W
WY=Word output
X R St S b b
R=remote host station no
1-4
1-4
Word
W X R St S W
D=Double Word (32 bits)
Double word Bit
D X R St S W
(valid for H250-H2002)
St =Sub Station no
0-7
0-9
Y R St S b b
Word
W Y R St S W
b b=bit no
0-15
0-95
Double word
D Y R St S W
W =Word no
0-1
0-9
Principal overview of the addressing of in-/outputs: U S
Unit no. 0 0 1 2 etc.
Copyright Actron, A.B. 1994
U Unit no. 1 S 0 1 2 etc.
U Unit no. 2 S 0 1 2 etc.
9
Symbols, Abbreviations, Etc.
etc. CPU
R Remote Unit no. 1 St Station no. 0 S slot 0 1 2 etc.
R Remote Unit no. 2 St Station no. 0 S 0 1 2 etc.
etc. bb bit no.
W word no.
R Remote Unit no. 1 St Station no. 1 S 0 1 2 etc.
etc.
etc.
Copyright Actron AB 1994, 2009
Symbols, Abbreviations, Etc.
Example: The start addresses on a HB type with expansion are described below. The inputs on the base unit corresponds to slot 0 (X0 - X39) and the outputs correspond to slot 1 (Y100 -Y123). An expansion unit corresponds to Unit no. 1. The inputs on the expansion unit get the slot no. 0 on unit 1 and become therefore number X1000 -X1039. The outputs on the expansion unit get the slot no. 1 on unit 1 and become therefore number Y1100 -Y1123.
X0- correspond to slot no. 0
X1000- correspond to slot no. 0 on unit 1
Y100- correspond to slot no. 1
Y1100- correspond to slot no. 1 on unit 1
When expansion units are used these slots get no. 3 and upwards.
X0- correspond to slot no. 0
X300- or Y300- X400- or Y400correspond to correspond to slot no 4 slot no 3
(Slot no. 2 is reserved on the basic unit for usage on the Link version of the HB called HL)
Y100- correspond to slot no. 1
Example: The start addresses on a H200 are shown below. The bit addresses give the connection on the board. The third digit from the end gives the slot no. and the forth from the end gives the unit no. (0 for the base unit, 1 for the first expansion etc.). For a word address, e.g. an analog input the word no. is given as the last digit and the slot no. as number two from the end etc.
Input Unit no. Slot no. Input no.
Copyright Actron, A.B. 1994
Output Unit no. Slot no. Output no.
11
Symbols, Abbreviations, Etc.
3.4.2 Internal memories: Memory address HB/H200
H250-H252, H300-H2000
Bits /Words
Bit
M
0-FFF
0-3FFF
common
Word
WM
0-FF
0-3FF
Hexa-
memory
Doubleword
DM
-
0-3FE
deci-
Bits /Words
Bit
R
0-7BF
0-7BF
mal
Separate memory
Word
WR
0-3FF
0-3FF (1024 ) RAM-04H, RAM-08H 0-43FF (17408 ) RAM-16H, ROM-16H 0-C3FF (50176 ) RAM-48H, ROM-48H
Doubleword
DR
-
0-3FE (512 ) RAM-04H, RAM-08H 0-43FE (8704 ) RAM-16H, ROM-16H 0-C3FE (25088 ) RAM-48H, ROM-48H
Bit
R
7C0-7FF
7C0-7FF (64 )
Special
memory Word WR F000-F1FF F000-F1FF (512 ) DR0-DR3FE and DR400-DR43FE are different areas. Therefor DR3FF is not possible.
3.4.3 Link memories: Bit/ Word Link memory (shared by other CPUs) Bits /Words common memory
Link area no. 1 Link area no. 2
Bit Word Double word Bit Word Double word
Memory address HB/H200 H250-H2002 L WL DL L WL DL
0-7F 0-7 10000-1007F 1000-1007 -
0-3FFF (16384) 0-3FF (1024) 0-3FE (512) 0-13FFF (16384) 0-13FF (1024) 0-3FE (512)
Memory areas where the CPU reads information, which can be overwritten other CPUs
Hexadecimal
Link memory area: Bit (L) or Word (WL)
Memory areas where the CPU writes information, which can be read by other CPUs
Link connected CPUs CPU 0
CPU 1
CPU 2
CPU 3
Copyright Actron AB 1994, 2009
Symbols, Abbreviations, Etc. Start and end addresses for the write area of the PLCs are defined during the programming. You will do this definition under
, see page 94 ,. See also under the additional part for HB page 161, H200 page 188, H300-H2002 page 264.
Copyright Actron, A.B. 1994
13
Symbols, Abbreviations, Etc.
3.4.4 Edge memories: Memory address HB/H200 H250-H2002
Page
Edge
Positive edge
DIF
0-127
0-511
29
Decimal
memories
Negative edge
DFN
0-127
0-511
29
addressing
3.4.5 Timers and Counters: Word/ /bit
Memory address HB/H200 H250-H2002
Page
On Delay Timers
Bit
TD
0-255
0-255
34
Timers
Off Delay Timers, Single Shot timer
Bit
SS
0-255
0-255
36 36
can be addressed up to
Monostable timer
Bit
MS
-
0-255
36
255
Integrating timer
Bit
TMR
-
0-255
38
Watch Dog timer
Bit
WTD
-
0-255
38
Up Counters
Bit
CU
0-511
0-511
40
Up-/Down Counters (Up)
Bit
CTU
0-511
0-511
41
Up-/Down Counters (Down)
Bit
CTD
0-511
0-511
41
Up-/Down Counters (Output)
Bit
CT
0-511
0-511
41
Decimal
Ring Counter
Bit
RCU
-
0-511
42
addressing
Reset of Counter and integrating timer
Bit
CL
0-511
0-511
38
Current value timers/counters
Word
TC
0-511
0-511
43
Copyright Actron AB 1994, 2009
Counters can be addressed up to 511
Symbols, Abbreviations, Etc.
3.4.6 Master Control: HB/H200
H250-H2002
Page
Master
Start
MCS
0-49
0-49
27
decimal
Control
End
MCR
0-49
0-49
27
addressing
3.4.7 Constant values:
Constant values
Word/b it
HB/H200
H250-H2002
Decimal
Word
0-65,535
0-4,294,967,295
Hexadecimal
Word
H0-HFFFF
H0-HFFFFFFFF
Bit
Bit
0, 1
0, 1
3.4.8 Battery backup (retentive areas) of memories: When the system is started or when it starts after power down, all memories are reset if they are not defined as ”retentive memories”. During the programming you can specify any area of R-,WR-,WM-,TD-,DIF,DFN-memories. These areas will then keep the old status when the PLC is turned On. This is defined under the menu "Setup-PLC" in Actsip or ActGraph. (See Short description of Actsip-H page 116 or ActGraph page 132)
Copyright Actron, A.B. 1994
15
Symbols, Abbreviations, Etc.
3.5 Special memories: 3.5.1 Special memories, Words: The most important special words (Complete list of special memory words, see page 277) WRF00B Year Real time Clock WRF00C Month, Day
Real time Clock
WRF00D
Valid for HB, H200-H252, H302H2002 (not H300,H700,H2000)
Weekday Real time Clock WRF00E Hour, Minute Real time Clock WRF00F Second WRF010
Real time Clock
Max.
Maximum measured cycle time WRF011
Time
WRF012
Min.
Current cycle time
Minimum measured cycle time WRF013
CPU
CPU Status WRF015 Calculation error code WRF016
Remainder
Calculation expansion register (remainder ) WRF017
Remainder
-"- during 32-bit calculations WRF01B
Year Real time Clock , Preset WRF01C
Valid for HB, H200, H302-H2002
Month, Day
Real time Clock, Preset
WRF01D
(not H300, H700, H2000)
Weekday Real time Clock, Preset WRF01E
Hour, Minute Real time Clock, Preset WRF01F
To activate the preset, use the f lag R7F9, see next page. see also separate program example
Second
Real time Clock, Preset
Copyright Actron AB 1994, 2009
Symbols, Abbreviations, Etc.
3.5.2 Special memories Bits: The most important special memories (Complete list, see appendix page 278) Normal scan
R7C0
Periodic scan
R7C1
Interrupt scan
R7C2
R7C8
Stop of RUN when maximum time is exceeded in a normal program scan Stop of RUN when maximum time is exceeded in a periodic program scan Stop of RUN when maximum time is exceeded in an interrupt program scan Severe error on the processor
!!
R7CA
Memory error
Normal scan
R7D1
Periodic scan
R7D2
Interrupt scan
R7D3
Normal program scan exceeded the maximum time. Periodic program scan exceeded the maximum time. Interrupt program scan exceeded the maximum time. Battery error
R7D9
-
+
R7DA
Power supply error
R7E3
ON during the first program scan after start
R7E4
"1" →Stop if the maximum time is exceeded "0"→ No stop if the maximum time is exceeded "1" →Stop if the maximum time is exceeded "0"→ No stop if the maximum time is exceeded "1" →Stop if the maximum time is exceeded "0"→ No stop if the maximum time is exceeded
Valid H300-H2002
Always ON
=1
R7E5
0.02 sec clock pulse
R7E6
0.1 sec clock pulse
R7E7
1.0 sec clock pulse
R7E8
CPU occupied
CPU is occupied e.g. of communication with another equipment
R7E9
STOP or RUN
"1" stops the CPU, "0" makes RUN possible Used in arithmetic instructions
R7F0
C
Carry
R7F1
Oflw C
Overflow
R7F2
Copyright Actron, A.B. 1994
0
Shift data
0.01 s ON and 0.01 s OFF
-"Used in shift instructions
17
Symbols, Abbreviations, Etc.
R7F3
Error in calculation during RUN
See detailed information in the word WRF015
Data Error Register (DER)
R7F8
Transfer of the clock to the preset registers
Discovered during execution of arithmetic instructions. When the flag goes high, the clock values are transferred to WRF01B-WRF01F
R7F9
Flag, which presets the real time clock
When the flag goes high, the values in WRF01BWRF01F are transferred to the real time clock.
R7FA
30 s adjustment of the real time clock.
When the flag goes high the clock is adjusted forward 30 s
R7FB
Error during preset of the Real time clock
R7F4
100110101 100011101
Copyright Actron AB 1994, 2009
Programming
Copyright Actron AB 1994-2009
19
Programming
4 Programming :
X002
X 020
R034
Y102
4.1 Basic ladder pro grammin g:
R304
Series H is internally built to interpret the ladder symbols in an optimal way. The most natural way of programming therefore is to draw ladder diagram in Actsip-H (or on the graphic hand programmer). The other main alternative is Grafcet programming with ActGraph. This generates ladder diagram automatically, which is interpreted by the PLC. It is also possible to symbolise the logic with instruction code. But as the internal storage in the PLC is ladder code the instruction code causes limitations as in other PLC brands, which utilise instruction code as the internal program storage. Therefore ladder- or grafcet programming is recommended.
X 0 0 2 X 0 1 3 Y102
R034
Y102
M002
When programming in ladder it is enough to draw closing or breaking contacts and to connect these with lines.
4.2 Symbols: 4.2.1 Block With "block" is meant a Ladder Block, which is a complete unit and ended by one or more output functions or an arithmetic box. The program consists of a number of such blocks. Normally you can regard these blocks as they are working in parallel with each other. There are of course exceptions to this rule. There are two examples of blocks below.
Block 1
Block 2
Inverted contact
Closing contact
Output (coil)
Copyright Actron AB 1994, 2009
Programming
4.2.2 Branch A block can consist of one or more branches.
Branch 1
Branch 2
Branch 3
Branch 4
Serial connection:
Parallel connection:
Contacts or branches connected after each other. It can also be symbolised by AND or as below.
Contacts or branches connected in parallel with each other. It can also be symbolised by OR or as below.
AND
OR
For further comparisons with Logic boxes and Boolean algebra, see appendix.
Copyright Actron, A.B. 1994
21
Programming
4.2.3 Contact symbols Closing contact. Logic active when the contact is ON
X,Y,R,L.M TD,SS,CU
Inverted contact. Logic active when the contact is OFF
WTD,MS,TMR,RCU (Valid for H250-H2002)
Output (coil)
Y,R,L,M TD,SS,CU,CT CTU,CTD,CL WDT,MS,TMR,RCU (Valid for H250-H2002)
Example: (Highlighted contacts symbolise "logic flow" ON.)
X002
X013
Y102
Contact
X002 X013 R034 Y102 M002
Logic flow before ON ON ON ON OFF
R034
Y102
M002
Memories status ON ON ON ON OFF
Function: (Inverted/ Closing) Closing Closing Inverted Closing Closing
Status: (ON/ OFF) ON ON OFF ON OFF
Logic flow after ON ON OFF ON OFF
Output
Status
Y102
OFF
Example: (Marked contacts symbolise a ”logic flow”, which is TRUE)
X002
Y102
X013
R034
Y102
M002
Copyright Actron AB 1994, 2009
Programming
Contact
X002 X013 R034 Y102 M002
Logic flow before ON ON ON ON ON
Memories status ON OFF OFF ON OFF
Copyright Actron, A.B. 1994
Function: (Inverted/ Closing) Closing Closing Inverted Closing Closing
Status: (ON/ OFF) ON OFF ON ON OFF
Logic flow after ON OFF ON ON OFF
Output
Status
Y102
ON
23
Programming
4.2.4 Inverting: Inverting. Changes the logic condition. ON becomes OFF / OFF becomes ON
Contact
X002 X013 R034 Y102 After Y102 M002
Logic flow before ON ON OFF ON ON OFF OFF
Memories status
NOT
ON OFF ON ON
Function: (Inverted/ Closing) Closing Closing Inverted Closing
Status: (ON/ OFF) ON OFF OFF ON
Logic flow after ON OFF OFF ON OFF
OFF
Closing
OFF
OFF ON
Output
Status
Y102
ON
After R034
X002 Y102
X013
R034
Y102
M002
Copyright Actron AB 1994, 2009
Programming
Contact
Logic flow before
Memories status
X002 X013 R034 Y102
ON ON ON ON OFF
ON OFF OFF OFF OFF
ON ON
OFF
After Y102 M002
Function: (Inverted/ Closing) Closing Closing Inverted Closing
Status: (ON/ OFF) ON OFF ON OFF
Logic flow after ON OFF ON OFF ON
Closing
OFF
OFF OFF
Output
Status
Y102
OFF
After R034
Copyright Actron, A.B. 1994
25
Programming
4.2.5 Set, Reset Sets Output/Memory ON when the logic in the block is TRUE. Keeps the ON-status also when the logic in the block is OFF.
Y,R,L,M
Resets Output/Memory to OFF when the logic in the block is TRUE
Y,R,L,M
The memory, which is addressed as the SET output is OFF as long as the condition is OFF. When the condition is TRUE the memory is set ON and remains ON until the corresponding RST- output is active.
A
B
C
M066 is OFF and the condition (or SET-input) X002 is OFF.
The SET-input (X002) goes ON and M066 is set ON.
The SET- input (X002) goes OFF but M066 remains ON.
A
B
C
M066 is ON and the condition (or RESET-input) X003 is OFF.
The RESET-input (X002) goes ON and M066 is reset to OFF.
The RESET-input (X002) goes OFF but M066 remains OFF.
X002
M066
SET
X003
X003
M066
X003
M066 RST
RST
If both SET and RESET are active, then the last executed instruction decides the status.
4.2.6 Master Control Set (MCS) and Reset (MCR) MCS
Master Control Set
Start of Common control of the following ladder blocks.
MCR
Master Control Reset
End of Common control of the following ladder blocks.
Instead of repeating the same condition, which is in common for several blocks you can create the common condition and let it end with a MCS-output. the condition will be valid as a super condition for all following blocks until a MCR-output is found.
Copyright Actron AB 1994, 2009
Programming
4.2.7 Master Control Set. X002
X003
MCS4
4.2.8 Master Control Reset. MCR4
The common logic condition for a part of a program is written before the MCS-output. Every MCR has to correspond to a MCS with the same number. The MCR-output shall be given without logic condition. A part of a program with a super condition
This is transformed as described below, where MCS2 corresponds to MCR2.
MCS and MCR are identified:
MCS and MCR can be programmed in up to 8 levels (a MCS-MCR pair within another MCS-MCR pair). Copyright Actron, A.B. 1994
27
Programming
The same number of MCS-MCR can be used again later in the program (when the previous usage is ended with a MCR)
Copyright Actron AB 1994, 2009
Programming
4.2.9 Edge detection (DIF and DFN-Contacts) Positive edge makes the condition ON during one program scan Negative edge makes the condition ON during one program scan
Negative edge
Positive edge DIF contact ON
DFN contact ON
Example
X002
DIF10 X013
Y102
X002
DIF10 X013
Y102
1 Y102
X002
DIF10 X013
Y102
X002
2
Y102
X002
4 Y102
DIF10 X013
Y102
Copyright Actron, A.B. 1994
Y102
Y102
5
Y102
X002
3
DIF10 X013
Y102
DIF10 X013
Y102
6
29
Programming
X002 X013 DIF10 Y102 1
23
4
5
6
The address on the DIF- (DFN-) function is unique and it must not be used more than once.
Copyright Actron AB 1994, 2009
Programming
4.2.10 Comparison contacts Comparisons can be a part of the block in the same way as contact symbols. The result of a comparison will always be true (ON) or false (OFF). (see also Comparison instructions page 44.)
X002
Contact X002 S1=S2 R034
Logic flow before ON ON OFF
The memory status ON OFF OFF
X002
Contact X002 S1=S2 R034
Logic flow before ON ON ON
R034
S1 = S2
Inverted/ Closing Closing (Closing) Inverted
Logic flow
Output
ON OFF OFF
Y102
R034
S1 = S2
The memory status ON OFF OFF
ON/ OFF ON OFF ON
Y102
Inverted/ Closing Closing (Closing) Inverted
ON/ OFF ON ON OFF
OFF
Y102
Logic flow
Output
ON ON ON
Y102
ON
4.2.11 Arithmetic box: The instructions in the box are executed when the logic flow is ON. Otherwise the instructions are not executed. (see also under arithmetic instructions below)
X002
Contact
S1 = S2
R034
WR010 = WM000 + 45 WM000 = WR100 (WM001) SHL ( WM20 , 4 )
The memory status ON
Inverted/ Closing Closing
ON/ OFF ON
Logic flow
Output
X002
Logic flow before ON
ON
Arithmeti c box
S1=S2 R034
ON ON
ON OFF
(Closing) Inverted
ON ON
ON ON
Copyright Actron, A.B. 1994
Executed
31
Programming
4.2.12 Timer programming: Example of usage of a timer (ON Delay timer) Output Y102 goes ON 3.5 s after input X002 goes ON. See also under "Timers" page 34.
X002
TD15 3.5 S
TD15
Y102
4.2.13 Counter programming: Example of usage of a counter (up counter). Output Y102 goes ON when input X002 has counted 25 pulses and the counter is reset by input X014. See also under "Counter" page 40.
X002
CU16 25
X014
CL16
CU16
Y102
4.2.14 Complex logic
Series H allows logic, which can not be symbolised with instruction code. e.g.
Copyright Actron AB 1994, 2009
Programming
4.2.15 Self hold: Self hold of memories can be created in different ways: Partly through "traditional self hold", which consists of a block with a Set condition and a Breaking condition as described below.
Set Condition
X002
Breaking Condition
X003
R014
R014 Self hold memory Self hold contact The self hold can also be generated with a SET and a RESET function, see page 26.
4.2.16 Sequence programming with self hold:
4.2.17 Output control in sequence programming: Graphic sequence
Sequence part in ladder
Output control in ladder continuing
Copyright Actron, A.B. 1994
33
Programming
4.2.18 Timers : page
TD
ON Delay Timer (Off Delay timer, see page 36)
0-255
34
SS
Single Shot timer
0-255
36
MS
Monostable timer
Not valid for
0-255
36
TMR
Integrating timer
HB/ H200
0-255
38
WTD
Watch Dog timer
-
0-255
38
When you are programming a timer you have to decide the preset time. You type this as a decimal number. If you type 1.23 it is shown as 123 x 0.01, (12.3 is shown as 123 x 0.1) etc. For H300-H2000 (not for HB-H252 and H302-H2002) the time base 0.01 can only be used on timer 063.
ON Delay Timer TD
When the input of the timer is activated the timer begins to run. When the timer has reached its preset value the timer output goes High. This output can be used as a contact function by other circuits. When the timer input goes off the timer returns to its original status.
Copyright Actron AB 1994, 2009
Programming
Above, time chart. On the right, the actions according to the time chart. (The time continues to run in the timer after the timer has reached its preset value and the value is reset to zero when the timer input goes low.)
Copyright Actron, A.B. 1994
35
Programming
Off delay timer:
To generate an Off Delay timer you can use an On Delay timer in the following way::
Single Shot Timer SS
When the timer input is activated the preset time starts to run. If the timer already runs in this moment it starts from the beginning. The activation occurs only in a short moment when the timer input goes high. It does not matter if the timer input goes low directly after. The timer output goes ON directly and goes Off when the preset time is reached.
X002
SS12 3.5 S
SS12
Y102
X002 Y102 3.5 s
0 s
0 s
0 s
Monostable timer MS
Copyright Actron AB 1994, 2009
Programming Not valid for: HB/ H200
When the timer input is activated the preset time starts to run. If the time already has run out in this moment the timer continues to run as nothing happened. Activation comes only in the moment when the timer input goes high. Therefore it does not matter if the timer goes low directly after. The timer output goes high directly and goes Off when the timer has reached the preset value.
Copyright Actron, A.B. 1994
X002
MS15
MS15
Y102
X002 Y102 3.5 s
0 s
3.5 s
0 s
37
Programming
Not valid for: HB/ H200
This timer runs when the input is activated and freezes the timer value when it is not activated. When the accumulated time has reached its preset value the output is activated. The timer is reset and returns to zero when the CLEAR (CL with the same number as the timer itself) input of the timer is activated.
X002
TMR16 45753 S
TMR16
Y102
X004
CL16
X002 Y102 X004 65535 S 45753 S 0 S
Integrating Timer TMR
Watch Dog Timer (WTD)
Copyright Actron AB 1994, 2009
Programming Not valid for: HB/ H200
The purpose of a Watch Dog timer is to watch that actions, which shall come in a certain time interval. The time is measured from the timer input is activated and the CL pulse (with the corresponding number) is activated. The timer has two preset values. If the CL pulse comes before the lower preset time is out the output of the timer is activated. This is also activated when the CL pulse comes after the higher preset is out or if it does not come at all.
Copyright Actron, A.B. 1994
20,000 s (Min value)
X002
40,000 s (Max value) WDT12
WDT12
Y102
X004
CL12
X002 X004 (CL12) WTD12 (Y102)
39
Programming
4.2.19 Counters: Page
CU
Up counters
0-511
40
CTU
Up-/Down counters
0-511
41
(Up)
CTD
Up-/Down counters (Down)
-0-511
41
CT
Up-/Down counters (Output)
-0-511
41
RCU
Ring counter
0-511
42
CL
Reset of Counter
-0-511
38
Up Counter CU The up counter counts up on the positive edge of the input pulse and it is reset with a CL pulse with the corresponding number. As long as the CL pulse is ON the counter remains on zero. When it has reached its preset value the counter output goes high.
(The counter continues to count after the activation and it is reset when the CL input goes high.)
Not valid for HB/H200
X002
CU11 4
X005
CL11
CU11
Y102
X002 X005 (CL11) CU11 (Y102) 6 5 4 3 2 1 0
The counter is reset and stopped
The counter is equal to its preset and the output goes high
The counter is reset and stopped and the counter output goes low.
Copyright Actron AB 1994, 2009
Programming
Up-/Down Counter An Up-/Down Counter consists of a up counting input, a down counting input and a reset input. When the counter reaches its preset value the output goes high. The output is called CT with the same number as the counter. As long as the reset input is high the counter remains reset.
Up counting and down counting at the same time . This means no counting
Preset value=4
The counter has reached its preset value and goes high
Copyright Actron, A.B. 1994
The counter has been reset and stopped and the counter output is reset.
41
Programming
Not valid for HB/ H200
A Ring counter counts up to its preset value. But instead of becoming this value it returns to zero. In the same moment it gives a short pulse on the output. This pulse stays only one program scan.
X002
RCU9
X005
CL9
RCU9
Y102
As long as the reset input is high the counter stays on zero. X002 X005 (CL11) RCU9 (Y102) 4 3 2 1 0
The counter reaches its preset value and returns to zero. The counter output goes high during one ro ram scan
The counter is reset and stopped and the counter output goes low.
Ring counter
Copyright Actron AB 1994, 2009
Programming
4.2.20 Set value (The preset value) of Timers /Counters When the timer or the counter is programmed the programming software asks for the preset value ( the value it will run to before the time or counting has expired) of the timer or counter. The preset of a timer is from 0.01 s to 65535 s and for a counter from 0 to 65535 pulses. This can be written as a constant value, e.g. ”123.5 s” for a timer or 12312 for a counter. When a timer is written with decimals it is shown in the following way: 1235 x 0.1 s in stead of 123.5 s or 1235 x 0.01 s in stead of 12.35 s If a higher preset value is wanted. use cascade connection. See program example
4.2.21 Variable preset value of timers/counters. To vary the preset value during run you must write a word instead of a constant as the preset value. Here you can use WX, WY, WR, WM or WL.
The input word WX001 (16 inputs ) is connected to a binary coded thumb wheel or similar
When the counting starts the preset is ”4”, but it is changed during run to ”2”, which causes the counter output to be active earlier.
The preset value is changed from 4 to 2 because the input word WX1 is changed.
4.2.22 Timer/Counter read of current value: TC
Current value of Timers/Counters The current value (the running value) of a timer or a counter can always be detected and used in a comparison box or in an arithmetic box during run if you are using a type of word, called TC. The number of the TC corresponds to the number of the timer or counter. (See also under separate program examples.)
Copyright Actron, A.B. 1994
43
Programming
4.2.23 Comparison instructions: Create the "comparison contact" in ladder diagram and type the comparison expression The comparison contact can be inserted and used in a ladder diagram in the same way as contact symbols. The comparison box compares integers. In H250-H2002 there is also a possibility to compare " Signed" integers, which means that the comparison can be done with signs (+ or -). ("Signed" is only possible on double words)
Result of Comparison
Word/Bit
=
S1=S2
ON if S1=S2 OFF if S1 not = S2
16-bit words: WX,WY,WR,WM,T C and constants
<>
S1<>S2
ON if S1 not =S2 OFF if S1 = S2
0-65535 H0-HFFFF
<
S1
ON if S1 < S2 OFF if S1 >or = S2
32-bit words: DX,DY,DR,DM, TC and constants
<=
S1<=S2
ON if S1< or =S2 OFF if S1 >S2
0-429496729565535 H0-HFFFFFFFF
S=
S1 S=S2
ON if S1=S2 OFF if S1 not = S2
S<>
S1 S<>S2
ON if S1=S2 OFF if S1 not = S2
S<
S1 S
ON if S1=S2 OFF if S1 not = S2
S<=
S1 S<=S2
ON if S1=S2 OFF if S1 not = S2
Not valid for HB/H200
32-bit words: DX,DY,DR,DM, TC and constants 0-429496729565535 H0-HFFFFFFFF
Example: (Status when e.g. WX11=1702, WM200=1234, WR22=1235, WR223=2000)
X013
X002
WX11 = 1802
2000 <= WR223
Y102
WM200 < WR22
Copyright Actron AB 1994, 2009
Programming
Contact
X013 WX11=1802 X002 WM200
Logic flow before ON ON ON ON
Memory ON/ OFF ON OFF ON ON
Closing (Closing) Closing (Closing)
2000<=WR223
ON
ON
(Closing)
Copyright Actron, A.B. 1994
Inverted/ Closing
Value of the words
WX11 1702 WM200: 1234 WR22: 1235 WR223: 2000
ON/ OFF ON OFF ON ON
Logic flow after ON OFF ON ON
ON
ON
Output
Y102
ON
45
Programming
4.3 Arit hmetic inst ruc tion s reference: application instructions, control instructions (instructions in the arithmetic boxes.)
"d" "S" "P"
means ”destination” or where the result is stored. means "source" or where the calculation is made from. (S1 and S2 are Source value 1 and Source value 2) stands for ”pointer”.
4.3.1 Array variables and indexed addressing Instruction
Name
Explanation
Bit/Word
Possible type
Page
d=S
Copy
the content of ”S” is copied to ”d”
Bit
d: Y,R,L,M *1 S: X,Y,R,L, M, Constant
57
d=S(P)
Indexed addressing
The content of ”S” + ”P” is copied to ”d”
Word
d:
57
Double Word Not valid for HB/H200
d: DY,DR,DL, DM *1 S: DX,DY,DR,DL, DM, Constant.
d(P)=S
The content of ”S” is copied to the address ”d” + ”P”
d(P1)=S(P2)
The content of ”S”+ ”P2” is copied to the address ”d” + ”P1”
WY,WR,WL, WM,TC *1 S,P: WX,WY,WR, WL,WM,TC, Constants
*1 External I/O are not valid for HB-H252
Copyright Actron AB 1994, 2009
Programming
Indexed addressing is used to address relative in an address area of words or bits.
BASE ADDRESS(INDEX ADDRESS)
If the addressing is outside the allowed area the error bit DER (address R7E4) ”1” and the operation will not occur.
Copyright Actron, A.B. 1994
WR1FF WR1FE WR107 WR106 WR105 WR104 WR103 WR102 WR101 WR100
WR100(WX10)
WX10=6 WX10
47
Programming
4.3.2 Summary of arithmetic instructions, and application instructions, control instructions (instructions in the arithmetic boxes.) (See also under the detailed explanation of these instructions)
4.3.3 Arithmetics Symbol
Instruction name
Explanation
Bit/ Word * 1
d=S1 + S2
Binary addition
d is the binary sum of S1 and S2
W
d=S1 B + S2
BCD addition
d is the BCD sum of the BCD values S1 and S2
d=S1 - S2
Binary subtraction
d is the binary difference between S1 and S2
S1, S2: WX,WY,W R,
63
d=S1 B - S2
BCD subtraction
d is the BCD difference between the BCD values S1 and S2
WL,WM,TC , Constant
64
d=S1 * S2
Binary multiplication
d is the binary product of S1 and S2
d=S1 S* S2
-"- with +/signs
-"- with +/- signs S = "Sign"
d=S1 B * S2
BCD multiplication
Page d: WY,WR,WL ,WM
60
62
64 D
:
66
d is the BCD product of the BCD values S1 and S2
Not valid for
d: DY,DR,DL, DM
65
HB/ H200
S1, S2: DX,DY,DR,
66
DL,DM, Constant
68
d=S1 / S2
Binary division
d is the binary quotation between S1 and S2
d=S1 S/ S2
-"- with +/signs
-"- with +/- signs S = "Sign"
d=S1 B / S2
BCD division
d is the BCD quotation between the BCD values S1 and S2
not HB /H200
Not valid for HB/ H200
67
Copyright Actron AB 1994, 2009
Programming
4.3.4 Logic expressions Instruction
Instruction name
Explanation
Bit/ Word
Page
d= S1 OR S2
OR
d =S1 + S2
b
69
d=S1 AND S2
AND
d = S1 * S2
W
69
d=S1 R S2
EXCLUSIVE OR
d = S1 exclusive or S2
D not valid for HB/ H200
69
*1
b = bit W=Word (16 bits) D=Double Word (32 bits)
Copyright Actron, A.B. 1994
49
Programming
4.3.5 Comparison expressions Instruction
Instruction name
Explanation
Bit/ Word
d=S1 == S2
Comparison equal
If S1 = S2
then d=1 else d=0
d=S1 S == S2
-"- with +/- signs
If S1 = S2
then d=1 else d=0
d=S1 <> S2
Comparison not equal
If S1 < > S2
then d=1 else d=0
d=S1 S <> S2
-"- with +/- signs
If S1 < > S2
then d=1 else d=0
d=S1 < S2
Comparison less than
If S1 < S2
then d=1 else d=0
d=S1 S < S2
-"- with +/- signs
If S1 < S2
then d=1 else d=0
d=S1 <= S2
Comparison less than or equal
If S1 < = S2
then d=1 else d=0
not for
d=S1 S <= S2
-"- with +/- signs
If S1 < = S2
then d=1 else d=0
HB/ H200
Page 70 Not valid for HB/H200
72 70
W
Not valid for HB/H200
72
D
70 Not valid for HB/H200
72 70
Not valid for HB/H200
72
4.3.6 Bit operations Instruction
Instruction name
Explanation
Bit/Word
Page
BSET (d,n)
Bit set
"1" is set in bit no "n" in the word "d"
W
73
BRES (d,n)
Bit Reset
"0" is set in bit no "n" in the word "d"
D
74
BTS (d,n)
Bit test
The value ("1" or "0" in bit no "n" in the word "d" is copied to C (Carry bit)
not for HB H200/
75
Copyright Actron AB 1994, 2009
Programming
4.3.7 Shift and rotation expressions Instruction
Instruction name
Explanation
SHR (d,n)
Shift Right
The word d is shifted n bits to the right
76
SHL (d,n)
Shift Left
The word d is shifted n bits to the Left
77
ROR (d,n)
Rotate Left
d rotates n bits right with C-flag
ROL (d,n)
Rotate Right
d rotates n bits left with C-flag
LSR (d,n)
Logic Right shift
d is shifted n bits right "0" is shifted in
LSL (d,n)
Logic Left shift
d is shifted n bits left "0" is shifted in
BSR (d,n)
BCD shift Right
Shifts d n times 4 bits to the right
not HB/
81
BSL (d,n)
BCD shift Left
Shifts d n times 4 bits to the left
H200
81
Copyright Actron, A.B. 1994
Bit/Word
W
Page
78 78
D-
80 80
51
Programming
4.3.8 Moving data Instruction
Instruction name
Explanation
Bit/ Word
WSHR (d,n)
Block shift right
Shifts n words or bits one position
WSHL (d,n)
Block shift left
Shifts n words or bits one position
WBSR (d,n)
BCD shift right
Shifts n BCD-digits one position
WBSL (d,n)
BCD shift left
Shifts n BCD-digits one position
MOV (d,S,n)
Move data
n words or bits from S to d
86
COPY (d,S,n)
Copy data
The content in S to n words or bits from d and upwards
87
XCG (d1,d2,n)
Exchange
The content in n bits or words from d1 is exchanged to d2 and n bits up
88
b
Page Not valid
83
for HB/
84
H200
85
W
85
4.3.9 Negations, absolute value etc. Instruction
Instruction name
Explanation
Bit/ Word
Page
NOT (d)
Inverting of words
every bit in the word d is inverted
b/W/D
89
NEG (d)
make negative
d becomes negative (+ to -, - to +)
W/D
89
ABS (d,S)
Absolute value
Absolute value of S is put in d
SGET (d,S)
"Sign Get"
Make negative if C=1
EXT (d,S)
"Extent"
Extend the sign to double word
90
D
Not valid for
90
HB/H200
91
Copyright Actron AB 1994, 2009
4.3.10 Conve rsions
Programming
Instruction
Instruction name
Explanation
BCD (d,S)
BIN
BCD
Coverts a binary word to BCD
91
BIN (d,S)
BCD
BIN
Coverts a BCD word to binary
93
DECO (d,S,n)
Decode
Decoding of S (with n bits)
ENCO (d,S,n)
Encode
Coding of n bits to word
SEG (d,S)
7-Segment
Decoding to a 7-segment display
Copyright Actron, A.B. 1994
Bit/ Word
Page
W
93 94 Not valid for HB/H200
95
53
Programming
4.3.11 Application commands Instruction
Instruction name
Explanation
Bit/ Word
Page
SQR (d,S)
Square root
The square root of d to S
W
BCU (d,S)
Bit count
The amount of "1"-bits in S to d
W/D
SWAP (d)
Exchange bytes
8 highest and lowest bits exchange place.
FIFIT (P,n)
FIFO Init.
Defines the size ”n” of the FIFO from start ”P”
FIFWR (P,S)
FIFO Write
S is written in the FIFO with start on P
FIFRD (P,d)
FIFO Read
d is read from the FIFO with start on P
UNIT (d,S,n)
Unit
4-bit data from n words starting from S to d
100
DIST (d,S,n)
Distribute
n 4-bit data to words starting from d from S
100
not HB/ H200
96
96 96
W
not
97
HB/
97
H200
98
4.3.12 Control commands (jump etc.) Instruction
Instruction name
Explanation
Page
END
End
End of normal program cycle
101
CEND (S)
Condition END
Conditional program end with condition S
101
JMP n
Jump
Unconditional jump to Label
102
CJMP n(S)
Condition Jump
Conditional jump to Label
102
LBL(n)
Label
End address of jump
102
RSRV n
Reserve
Command to the BASICH-module
Not valid
104
FREE
Command to the BASICH-module
for
104
START n
Command to the BASICH-module
HB-H252
104
Repeating of program loop n times. Start
Not
104
Repeating of program loop n times. Stop
HB/H200
104
FOR n (S)
For-loop
NEXT n CAL n
CALL
Subroutine call to routine no. n
106
SB n
Subroutine
Subroutine no. n Start
106
RTS
Return
Subroutine no. n End
106
INT n
Interrupt
Interrupt routine type n Start
107
RTI
Return
Interrupt routine End
107
Copyright Actron AB 1994, 2009
4.3.13 FUNinstru ctions for series HB:
Programming
Instruction
Instruction name
Explanation
Page
FUN 70 (S)
Mode set
Specifies the function on the inputs
Only
182
FUN 71 (d)
Reads the current value of the High speed counter
for
184
FUN 72 (S)
Sets the current value of the High speed counter
HB
184
FUN 73 (d)
Reads the preset value of the High speed counter
184
FUN 74 (S)
Sets the preset value of the High speed counter
185
4.3.14 FUN-instructions for H252, H302-H2002: Instruction
Instruction name
Explanation
Page
FUN 0 FUN 1 FUN 2 FUN 10 FUN 11 FUN 12 FUN 13 FUN 14 FUN 15 FUN 20 FUN 21 FUN 30 FUN 31 FUN 32 FUN 33 FUN 34 FUN 35 FUN 36 FUN 37 FUN 38 FUN 39 FUN 40 FUN 41 FUN 42 FUN 43 FUN 44 FUN 45 FUN 46 FUN 47 FUN 48 FUN 49 FUN 50 FUN 51 FUN 52 FUN 60 FUN 61
PID-init PID Check PID calculation Sin function Cos function Tan Function Arc Sin function Arc Cos function Arc Tan function Data search Table search ASCII conversion ASCII conversion ASCII conversion ASCII conversion ASCII conversion ASCII conversion ASCII conversion ASCII conversion ASCII conversion ASCII conversion ASCII conversion ASCII conversion ASCII conversion ASCII conversion Combine characters Compare characters Convert Word -Byte Convert Byte-Word Shift one byte right Shift one byte left Sets the sampling Sampling Resets sampling Binary square root Pulse generating
Decides the addresses of the PID-functions Checks the execution of the PID-functions Executes the PID function
271
Copyright Actron, A.B. 1994
271 271 271 271 271 271 271 271
Search number and address for specified data Search the value of block data from specified table. 16 bit binary data to decimal ASCII data 32 bit binary data to decimal ASCII data 16 bit binary data to hexadecimal ASCII data 32 bit binary data to hexadecimal ASCII data 16 bit BCD data to decimal ASCII data 32 bit BCD data to decimal ASCII data Decimal ASCII data to 16 bit binary data Decimal ASCII data to N 32 bit binary data Hexadecimal ASCII data to 16 bit binary data Hexadecimal ASCII data to 32 bit binary data Decimal ASCII data to 16 bit BCD data Decimal ASCII data to 32 bit BCD data Specifies 16 bit binary data to decimal ASCII data Specifies ASCII data to 16 bit binary data
274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274 274
Enables trace with sampling Execution of sampling Disables trace with sampling
274 274 274 274 274
55
Programming
TRNS RECV QTRNS QRECV ADRPR ADRIO
Transmit and receive data 10 ms . (Is used for ASCII, SIO, POSIT,CLOCK) Receive data 10 ms . (Is used for ASCII, SIO, POSIT,CLOCK) Transmit and receive data 1 scan . (Is used for ASCII, SIO, POSIT,CLOCK) Receive data 1 scan . (Is used for ASCII, SIO, POSIT,CLOCK) Address program Address I/O
274 274 274 274 274 274
Copyright Actron AB 1994, 2009
Programming
4.4 Detailed description o f arithmetic instruct ions: 4.4.1 Copy
d=S
Copy
The content of S is copied to d
d and S can be Bits, Word or for H250-H2002 double words. Example: When X100 goes high the value of WX000 is copied to WR010 and the status of input X101 is copied to the bit M10
X100
DIF10
WR010 = WX000 M10 = X101
4.4.2 Indexed (relative) addressing
d=S(P)
Indexed
d(P)=S
addressing The content of the address S is copied to d+P
d(P1)=S(P2)
The content of the address S+P is copied to d
The content of S+P2 is copied to d+P1
(not valid for H200 CPUs manufactured before May 1992) Indexed addressing is used to perform relative addressing in an area of Words or Bits. Indexed addressing can only be used in Copy instructions. BASE ADDRESS(INDEX ADDRESS) If the addressing is outside the allowed address area DER (Data Error Register address R7F4) goes High and the operation is not performed. . Example: WR1FF when input X200 goes WR1FE high the content of input 6 WX10 word WX000 shall be WX0F copied to the WR address WR107 100 + the content of input WR106 54132 word WX10. WR105 WX05 WR104 WX04 If the content of WX10 is WR103 WX03 WR102 WX02 ”6” the value of WX00 is WR101 WX01 copied to WR106. 54132 WR100 WX00 X200
DIF10
WR100(WX10) = WX000
HB-H252 can not use external I/O as base address. Copyright Actron, A.B. 1994
57
Programming
Example: When input X200 goes high the input word WX address 0 + the content of WR101 is copied to WR100. If WR101 is ”4” then the content of WX04 is copied to WR100.
WR1FF WR1FE WX10 WX0F WR107 WR106 WR105 WR104 WR103 WR102 WR101 WR100
54132
4 54132 X200
Example: When input X200 goes high the input word WX address 0 + the content of WR1FF is copied to the WR address 100 + the content of WR1FE. If WR1FF is ”3” and WR1FE is ”5” then the content of WX03 is copied to WR105.
DIF10
WX05 WX04 WX03 WX02 WX01 WX00
WR100 = WX000(WR101)
3 5
WR1FF WR1FE
WX10 WX0F WR107 WR106 WR105 WR104 WR103 WR102 WR101 WR100
54132 54132
X200
DIF10
WX05 WX04 WX03 WX02 WX01 WX00
WR100(WR1FE) = WX000(WR1FF)
Copyright Actron AB 1994, 2009
Programming
4.4.3 Arithmetics Series H works normally binary. This means that a normal Word gets a value 0-65535. decimal, (0-FFFF hexadecimal or 0-1111 1111 1111 1111 binary). This is more effective than BCD arithmetics as it is only possible to represent the BCD values as 0-9999 and the instruction time will be longer. If e.g. you are reading from a BCD coded thumb wheel or if you are connecting BCD coded display segments on the outputs, it is practical to use BCD arithmetics to avoid two conversions. There are three flags, which give information about how the operations went: "C" (address R7F0) Carry flag gives information about an extra bit in the calculation which e.g. can be used to count up or down a significant digit. "Of" (address R7F1) Overflow gives information about that the operation is wrong. "DER"(address R7F4) Data Error Register .
Signed (or arithmetics with +/-sign) means that instead of interpreting 0000 - FFFF as 065535, 0000-7FFF means 0- +32767 and 8000-FFFF means -32768- -1 Not In this way it is possible to count with both valid positive and negative values. In double word for HB / handling this means that: H200 0000 0000 -7FFF FFFF corresponds to
0 - +2147483647 and 8000 0000- FFFF FFFF corresponds to - 2147483648 - -1.
Example of binary arithmetics: The addition is internally made binary and the result will be a binary number.
Example of BCD arithmetics: The addition is internally made as BCD and the result will be a BCD number.
F F F F F F F E
-2
0 0 0 0 0 0 1 0
+10 (16 dec)
F 0 0 0 0 0 0 0 E
+ E (14 dec)
+ =
(-2 dec)
X200 WX00 0
0
0
0
X200
F
DIF10 WR10 0 =
WR1 00
0
+WX 001
001E
WX00 1
0
WX 000
0
F
c
1 5
00000000000001111
W X 0 0 1
0
1 5
+ 00000000000001111
W X 0 0 0
3 0
=
W R 1 0 0
00000000000011110
X200 WX 00 0
0
0
1
X200
5
DIF10 WR100 = WX000 B +WX001
WR 10 0
0030
WX 00 1
Copyright Actron, A.B. 1994
0
0
1
5
c
15
00000000000010101
W X 0 0 1
0
1 5 + 00000000000010101
W X 0 0 0
3 0 = 00000000000110000
W R 1 0 0
59
Programming
d=S1 + S2
Binary addition
d is the binary sum of S1 and S2
If the sum S1 +S2 >FFFF hexadecimal or S1+S2 > 65535 decimal, the carry flag "C" is set. This bit is on address R7F0. This can later on be used in the program to indicate if the addition went well or not. Example of binary addition: WR100 = WX000 +WX001
If the sum of WX000 and WX001 > 65535 the carry flag (R7F0) goes High. Then output Y201 also goes High and indicates that the addition went wrong.
Y201
WX0=0999 and WX1=2345 WR100 becomes 2CDE , C becomes 0 WX0=FFFF and WX1=0002 WR100 becomes 0001 , C becomes 1
C=R7F0
+
WX001 WX000
C
=
WR100 WX 00 0
WX0 00
0
9
9
F
9
F
F
F WR1 00
WR 10 0
2CDE
WX0 01
2
Not valid for HB / H200
= R7F0
3
4
5
c 0
0001
WX 00 1
c
0
0
0
2
1
For double word addition, "C" goes High if S1+S2 >FFFFFFFF or decimal S1+S2> 4294967295. If Signed addition is used and S1+S2 gives a significant result another flag called "Of" (Overflow, on the address R7F1 ), goes High. If double word addition is made without using the +/-, the Of flag is insignificant.If S1m is the most significant bit in S1, S2m is the most significant bit in S2 and dm is the most significant bit in d, following Boolean expression is valid: C
(R7F0) =S1m*S2m+S1m*dm+S2m*dm
Of (R7F1) =S1m*S2m*dm+S1m*S2m*dm
Copyright Actron AB 1994, 2009
Programming
DR100 = DX000 + DX002 Y201 = R7F0 Y202 = R7F1
Example of binary double word addition: If the sum of DX000 and DX002 > FFFFFFFF hexadecimal the carry flag (R7F0) goes High. Then output Y201 goes High and indicates that the sum is > the maximum capacity of DR100. If DX0 and DX2 are positive values and DR100 becomes negative or if DX0 and DX2 are negative numbers and DR100 becomes positive the Of-flag will indicate. Then the output Y202 goes High. 7FFF FFF is the highest positive value. When this is added to ”1” the result is 80000000, which is the lowest negative value. The Overflow flag indicates that the addition when wrong.
Copyright Actron, A.B. 1994
Of=R7F1 C=R7F0 + Of = C
WX001 WX000 WR100
DX000
7
F
F
F
F
F
F
F DR100
80000000
DX002
0
0
0
0
0
0
0
1
c
Of
0
1
61
Programming
d=S1 B + S2 BCD addition
d is the BCD sum of S1 and S2
If the sum S1 +S2 >9999 decimal the carry flag "C" is set. This bit is on address R7F0. This can later on be used in the program to indicate if the addition went well or not. If the content in S1 or S2 is outside the BCD area the DER flag (R7E4) goes High and the operation is not executed. This happens e.g. if S1 is ”9A55” hexadecimal. ”A” or ”1010” binary is not allowed as BCD value. Example of BCD addition: If the sum of WX000 and WX001 > 9999 the carry flag (R7F0) goes High. Then output Y201 also goes High and indicates that the addition went wrong.
WR100 = WX000 B + WX001
WX0=1111 and WX1=2345 WR100 becomes 3456 , C becomes 0
C=R7F0
+
WX001 WX000
C
=
WR100
WX0=9999 and WX1=0001 WR100 becomes 0000 , C becomes 1
Y201
= R7F0
WX 00 0
1
1
WX 00 0
1
1
9
9
9
9 WR 10 0
WR1 00
3456
WX 00 1
0000
WX 00 1
c
2
3
4
5
0
0
0
0
1
c 1
Copyright Actron AB 1994, 2009
Programming
d=S1 - S2
Binary subtraction
d is the binary difference between S1 and S2
When the difference S1 - S2 < 0 the carry flag ”C” is set. This is found on address R7F0. This can be used later in program to decide if the subtraction went well. Example of a binary subtraction: WR100 = WX000 - WX001
If the difference between WX001 and WX000 difference >0 ( WX000 is greater than WX001) the carry flag (R7F0) goes High. Then output Y201 goes High and indicates that the subtraction has gone wrong.
Y201
= R7F0
C=R7F0
-
WX001 WX000
C
=
WR100
WX 00 0
9
9
WX 00 0
9
A WR1 00
4444
WX 00 1
c
5
Not valid for HB / H200
5
5
6
0
0
0
0
1 WR 10 0
FFFF
WX 00 1
c
0
0
0
2
1
If Signed subtraction is executed and S1-S2 gives a non significant result another flag called "Of" (Overflow, on the address R7F1) is goes High. (If S1m is the most significant bit in S1, S2m is the most significant bit in S2 and dm is the most significant bit in d, following Boolean expression is valid: C
(R7F0) =S1m*S2m+S1m*dm+S2m*dm
Of (R7F1) =S1m*S2m*dm+S1m*S2m*dm
Copyright Actron, A.B. 1994
63
Programming
d=S1 B - S2
BCD subtraction
d is the BCD difference between S1 and S2
If the difference S1 - S2 < 0 decimal the carry flag "C" is set. This bit is on address R7F0. This can later on be used in the program to indicate if the subtraction went well. If the content in S1 or S2 is outside the BCD area the DER flag (R7E4) goes High and the operation is not executed. This happens e.g. if S1 is ”9A55” hexadecimal. ”A” or ”1010” binary is not allowed as BCD value. WX 00 0
E.g. if S1 is "999A" hexadecimal. "A" or "1010" is not allowed as a BCD value. C will be high if the sum is greater than 9999
d=S1 * S2
9
9
9
A WR1 00
xxxx
WX 00 1
5
5
5
6
Binary multiplication
c
DF
0
1
d is the binary product of S1 and S2
S1 and S2 are multiplied binary and the result will go to two words , where d1 (the least significant part of the result) is identical to the word, which is specified and d2, which is the next higher word (d+1). Therefore d cannot be the highest word in any memory area. It can not e.g. be WM3FF as d2 then will be outside the memory area. If so DER (address R7FE) will indicate error.
S1
WR100 = WX000 * WX001 S2
=
d2
d1
The product of 999A and 5556 in binary multiplication will be 3333BBBC. When the result will be placed in the highest word the DER flag goes High.
DER = R7F4
DER
WX 00 0
WX 00 0
9
9
9
A
WR1 01
3333
9
9
9
A WM 3FF
WR1 00
BBBC
WX 00 1
5
5
5
6
DF 0
BBBC
WX 00 1
5
5
5
6
DF 1
Copyright Actron AB 1994, 2009
Programming
No valid for HB / H200
If double words are used, the result will be disposed in the following way: DX0 WX1
WX0
DX2 WX3 DR12 DR10 = DX000
d=S1 B* S2
* DX002
= WR13
BCD multiplication
WX2 DR10
WR12
WR11 WR10
d is BCD product of S1 and S2
S1 and S2 are BCD multiplied and the result will go to two words , where d1 (the least significant part of the result) is identical to the word, which is specified and d2, which is the next higher word (d+1). Therefore d cannot be the highest word in any memory area. It can not e.g. be WM3FF as d2 then will be outside the memory area. If so DER (address R7FE) will indicate error unless d2 is not equal to 0. If the content in S1 or S2 is outside the BCD area the DER flag (R7E4) goes High and the operation is not executed.
S1
WR100 = WX0 00 B * WX001 S2
=
d2
DER If S1 is "999A" hexadecimal. "A" or "1010" is not allowed as a BCD value or when the result is placed in the highest word, the DER flag goes High.
X
=
WR101
WR100 WX 00 0
WX0 00
9
9
9
A
WR1 01
0
xxxx
9
9
9 WM3FF
WR1 00
xxxx
WX0 01
5
Not valid for HB / H200
WX001 WX000
DER = R7F4
d1
5
5
6
6666
WX 00 1
DF 1
5
5
5
6
DF 1
If double words are used, the result will be disposed in the following way: DX0 WX1
WX0
DX2 WX3 DR12 DR10 = DX000 B * DX002
Copyright Actron, A.B. 1994
= WR13
WR12
WX2
DR10 WR11 WR10
65
Programming
Not HB / H200
d=S1 S * S2
Binary multiplication with +/- signs
d is the binary product of S1 and S2
This is only valid for double words. Two words where the content is interpreted as Signed (+/- sign) are multiplied and the result is written as a Signed value. See also binary multiplication.
Binary division
d=S1 / S2
d is the binary quotient between S1 and S2
S1 is divided binary with S2 and the quotient is written to d. The remainder is written to WRF016. If the divisor S2 is 0, the DER (address R7FE) is set to "1" and no operation is performed.
S1 =d
WR100 = WX000
WRF016
/ WX001
S2 DER=R7F4 The quotient of 9999 and 2222 in binary division will be 0004 and the remainder will be 1111. When the division is done by zero the operation is not performed and the DER flag is set High.
DER
WX 00 0
WR F0 16
9
9
9
1111
9
W X0 00
WR F0 1 6
9
9
9
9
WR 10 0
2
2
WR 10 0
0004
WX 00 1
2
0
2
xx x x
X0 01 W
0
0
0
0
1 DER
DER
Not valid for HB / H200
xx x x
If double words are used, the result will be disposed in the following way: DER
DER=R7F4
DRF016 DX000
WX001
WRF017 WRF016
WX000 = WR101
WX003 DR100 = DX000
/ DX002
WX002
WR100
DR100
DX002
Copyright Actron AB 1994, 2009
Programming
d=S1 B / S2
BCD division
d is the BCD quotient between S1 and S2
S1 is BCD divided BCD with S2 and the quotient is written to d. The remainder is written to the address WRF016. If the divisor S2 is 0 the DER flag (address R7FE) is set to "1" and no operation is performed. If the content in S1 or S2 is outside the BCD area the DER flag (R7E4) goes High and the operation is not executed. This happens e.g. if S1 is ”9A55” hexadecimal. ”A” or ”1010” binary is not allowed as BCD value.
Copyright Actron, A.B. 1994
67
Programming
S1 =d
WR100 = WX000 B
WRF016
/ WX001
Quotient
S2
WRF016
DER= R7F4 If S1 is "9999" and S2 is 32 the quotient will be 312 and the remainder will be 15. If S2 is 0 or if a digit in the operation is no real BCD digit, the DER flag goes High and the operation is not performed.
WX000
DER
= WR100
WX001 W X 000
WR F0 16
9
9
9
9
00 1 5
WX00 0
9
9
RF 01 6 W
9
9
WR 10 0
03 1 2
W X 001
0
0
3
2
0
d=S1 S / S2
x xxx
WX 0 0 0
9
A
WR F0 1 6 9
E
R1 00 W
x xxx
WX00 1
0
0
DER
Not HB/ H200
Remainder
Binary division with +/- sign
0
0
1
DER
xx xx WR 10 0
xx xx
WX 0 0 1
0
0
1
0
1
DER
d is the binary quotient between S1 and S2
This is only valid for double words. Two words, where the content is interpreted as Signed (+/- sign) are divided and the result is written as a Signed value. See also Binary division.
Copyright Actron AB 1994, 2009
Programming
4.4.4 Logic expressions S1, S2 and d can either be bits or words. Not valid for HB / H200
S1, S2 and d can also be double words
d=S1 OR S2
Logic OR on Word
d is the logic sum of S1 and S2
A logic "or" is done between S1 and S2 on each bit in the words. This means that "1" and "1", "1" and "0" , "0" and "1" gives "1" while "0" and "0" gives "0"
S1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 OR S2 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
.
d 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1
d=S1 AND S2 Logic AND on Word d is the logic product of S1 and S2 A logic "and" is done between S1 and S2 on each bit in the words. This means that "1" and "1" gives ”1” while "1" and "0" , "0" and "1" , "0" and "0" gives "0"
S1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
AND S2 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 d 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
d=S1 R S2
Logic R on Word
d is Exclusive Or on S1 and S2
A logic "exclusive or" is done between S1 and S2 on each bit in the words. This means "1" and "1", "0" and "0" gives ”0” while "0" and "1" , "1" and "0" gives "1"
S1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 XOR S2 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 d 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
Copyright Actron, A.B. 1994
69
Programming
4.5 Comparison expressions: d is a bit Not valid for HB / H200
S1 and S2 are words
S1 and S2 can be double words. In comparisons with +/-signs S1 and S2 are always double words.
d=S1 == S2
Compare equal
If S1 = S2
then d=1 else d=0
d=S1 <> S2
Compare not equal
If S1 < > S2
d=S1 < S2
Compare less than
If S1 < S2
d=S1 <= S2
Compare less than or equal
If S1 < = S2
then d=1 else d=0 then d=1 else d=0 then d=1 else d=0
Copyright Actron AB 1994, 2009
Programming WX200
Example: A counter value is compared with a preset value on a thumb wheel When the value is < the preset value, the flag R100 is High.
0
6
5
9
X002
When the value is <= the preset value, the flag R101 is High.
X002
CU11
X005
CL11
R100 R101 R102 R103
= = = =
TC11 TC11 TC11 TC11
< <= <> ==
WX200 WX200 WX200 WX200
RESET
X005 X002
When the value is < > the preset value, the flag R102 is High. When the value is equal to the preset value, the flag R103 is High.
TC11
661 660 659 658 657 656 655 654 653 652 651 650
R100 R101 R102 R103
Copyright Actron, A.B. 1994
71
Programming
Not HB / 200
Not HB / 200
Not HB / 200
Not HB / 200
d=S1 S == S2
Compare equal to with +/- sign
If S1 = S2
d=S1 S <> S2
Compare not equal to with +/- sign
If S1 < > S2
d=S1 S < S2
Compare less than with +/- sign
If S1 < S2
d=S1 S <= S2
Compare less than or equal to with +/- sign
Example. A 32 bit up and down counter is created in an arithmetic box. This will count Not for HB / 200 with + and signs and compares its position to the preset of the thumb wheel on the inputs DX200.
then d=1 else d=0 then d=1 else d=0
then d=1 else d=0
If S1 < = S2
then d=1 else d=0
DX200
0
0
0
0
X002
DIF10 DR100 = DR100 + 1
0
0
2
0
X003
DIF11 DR100 = DR100 - 1
X005 X003 X002
DR100 = 0 R100 R101 R102 R103
= = = =
DR100 DR100 DR100 DR100
S S S S
< <= <> ==
DX200 DX200 DX200 DX200
RESET
X005
X003
DR100 Hexadec. 00000005 00000004 00000003 00000002 00000001 00000000 FFFFFFFF FFFFFFFE FFFFFFFD FFFFFFFC
Dec. 5 4 3 2 1 0 -1 -2 -3 -4
X002
R100 R101 R102 R103
Copyright Actron AB 1994, 2009
Programming
4.6 Bit operations: d is a word (WY, WR, WL, WM, TC) n is specified by the 4 least significant bits (0-15) in a word (WY,WX,WR,WL, WM, TC) or a constant. S is a word (WY,WR,WL, WM, TC)
BSET (d,n)
Bit set
"1" is set in bit no. "n" in the word "d"
d is a word (WY, WR, WL, WM, TC) n is specified by the 4 least significant bits (0-15) in a word (WY,WX,WR,WL, WM, TC) or a constant.
d
1 Not valid for HB/H200
d can be a double word (DY, DR, DL, DM) n is specified by the 5 least significant bits (0-31) in a word (WY,WX,WR,WL, WM, TC) or a constant.
Example: The four least significant bits in WM000 is ”9”. With other words, bit no. 9 in the word WY100 is set. (Output Y1009 is set High).
Copyright Actron, A.B. 1994
BSET(WY100,WM000)
0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1
WY100
1 9 (1001) 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 1 WM 000
73
Programming
BRES (d,n)
Bit Reset
"0" is set in bit no. "n" in the word "d"
d is a word (WY, WR, WL, WM, TC) n is specified by the 4 least significant bits (0-15) in a word (WY,WX,WR,WL, WM, TC) or a constant. d
0 Not valid for HB/H200
d can be a double word (DY, DR, DL, DM) n is specified by the 5 least significant bits (0-31) in a word (WY,WX,WR,WL, WM, TC) or a constant.
Copyright Actron AB 1994, 2009
Programming
Bit test
BTS (s,n)
The value ("1" or "0") in bit no "n" in the word "d" is copied to C (R7F0)
S is a word (WY, WR, WL, WM, TC) n is specified by the 4 least significant bits (0-15) in a word (WY,WX,WR,WL, WM, TC) or a constant.
S
C Example: Input no n on the input word WX200 is tested and the result copied to the output Y100 (n =13, so Y100 =X2013.
BTS(WX200,WM000) Y100 = R7F0
C
0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1
WX200
0
13 (1101)
0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 1 WM000
Not valid for HB/H200
S can be a double word (DY, DR, DL, DM) n is specified by the 5 least significant bits (0-31) in a word (WY,WX,WR,WL, WM, TC) or a constant.
Copyright Actron, A.B. 1994
75
Programming
4.6.1 Shift and rotation expressions
SHR (d,n)
Shift Right
The word d is shifted n bits to the right
d is a word (WY, WR, WL, WM, TC) n is specified by the 4 least significant bits (0-15) in a word (WY,WX,WR,WL, WM, TC) or a constant. The C-flag (R7F0) becomes the content of the shifted bit. The content of the SD-flag "Shift Data" (R7F2) is copied to all bits, which are shifted in.
SD SD
XXXXXXXXXXYZZZZZ
C Z
XXXXXXXXXX
C Y
SD SD
SD SD SDSDSDSD
Example: The output word WY10 is shifted the amount of bits to the right as the content of register WM000 specifies. WM 000 specifies 1 position. The content of WY10 before the shift then is 5A1F and after AD0F (hexadecimal)
Not valid for HB/H200
SHR(WY10,WM000)
SD
WY10
C
1
0101101000011111
0
1
1010110100001111
1
n=1
osition 0001
0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1
WM000
d can be a double word (DY, DR, DL, DM) n is specified by the 5 least significant bits (0-31) in a word (WY,WX,WR,WL, WM, TC) or a constant.
Copyright Actron AB 1994, 2009
Programming
SHL (d,n)
Shift Left
The word d is shifted n bits to the left
d is a word (WY, WR, WL, WM, TC) n is specified by the 4 least significant bits (0-15) in a word (WY,WX,WR,WL, WM, TC) or a constant. The C-flag (R7F0) becomes the content of the shifted bit. The content of the SD-flag "Shift Data" (R7F2) is copied to all bits, which are shifted in.
C X C Y
SD XXXXYZZZZZZZZZZZ
SD
SD Z Z Z Z Z Z Z Z Z Z Z SDSDSDSDSD
Example: The output word WY10 is shifted the amount of bits to the left as the content of register WM000 specifies. WM000 specifies 6 positions. The content of WY10 before the shift then is 5A1F and after 87C0 (hexadecimal)
Not valid for HB/H200
d n
SD
SHL(WY10,WM000)
C
WY 10
SD
1
0101101000011111
0
0
1000011111000000
0
0 0 0 0 0 0 0 0 1 1 1 1 0 1 1 0
WM000
can be a double word (DY, DR, DL, DM) is specified by the 5 least significant bits (0-31) in a word (WY,WX,WR,WL, WM, TC) or a constant.
Copyright Actron, A.B. 1994
77
Programming
Rotate Right
ROR (d,n) d n
d rotates n bits to the right together with the C flag
is a word (WY, WR, WL, WM, TC) is specified by the 4 least significant bits (0-15) in a word (WY,WX,WR,WL, WM, TC) or a constant.
The C-flag (R7F0) is a part of the rotation. It becomes the status of the last bit shifted out and delivers this bit in the next shift to the most significant bit.
Z Z Z Z Z Z Z Z Z Z Z Y X1X2X3X4
C C
C Z Z Z Z Z Z Z Z Z Z Z
C Y
X1X2X3X4
Not valid for HB/H200
d n
can be a double word (DY, DR, DL, DM) is specified by the 5 least significant bits (0-31) in a word (WY,WX,WR,WL, WM, TC) or a constant.
Rotate Left
ROL (d,n) d n
d rotates n bits to the left together with the C flag
is a word (WY, WR, WL, WM, TC) is specified by the 4 least significant bits (0-15) in a word (WY,WX,WR,WL, WM, TC) or a constant.
The C-flag (R7F0) is a part of the rotation. It becomes the status of the last bit shifted out and delivers this bit in the next shift to the least significant bit.
C C
X1X2X3X4
C Y
Z Z Z Z Z Z Z Z Z Z Z C X1X2X3X4
YZZZZZZZZZZZ
Copyright Actron AB 1994, 2009
Programming
Not valid for HB/H200
d n
can be a double word (DY, DR, DL, DM) is specified by the 5 least significant bits (0-31) in a word (WY,WX,WR,WL, WM, TC) or a constant.
Copyright Actron, A.B. 1994
79
Programming
LSR (d,n) Logic shift Right d n
d is shifted n bits to the right. "0" is shifted in
is a word (WY, WR, WL, WM, TC) is specified by the 4 least significant bits (0-15) in a word (WY,WX,WR,WL, WM, TC) or a constant.
The C-flag (R7F0) becomes the status of the last bit shifted out. ”0” is shifted in to the most significant bit.
0
0 Not valid for HB/H200
d n
XXXX XXXXXXYZZZZZ
C Z
000000XXXXXXXXXX
C Y
can be a double word (DY, DR, DL, DM) is specified by the 5 least significant bits (0-31) in a word (WY,WX,WR,WL, WM, TC) or a constant.
LSL (d,n) Logic shift left d n
d is shifted n bits left. "0" is shifted in
is a word (WY, WR, WL, WM, TC) is specified by the 4 least significant bits (0-15) in a word (WY,WX,WR,WL, WM, TC) or a constant.
The C-flag (R7F0) becomes the status of the last bit shifted out. ”0” is shifted in to the least significant bit.
C X
XXXXYZZZZZZZZZZZ
0
C Y
ZZZZZZZZZZZ 0 0 0 0 0
0
Not valid for HB/H200
d n
can be a double word (DY, DR, DL, DM) is specified by the 5 least significant bits (0-31) in a word (WY,WX,WR,WL, WM, TC) or a constant.
Copyright Actron AB 1994, 2009
Programming
BSR (d,n) d n
BCD shift right
Shifts d n times 4 bits
is a word (WY, WR, WL, WM, TC) is specified by the 2 least significant bits (0-3) in a word (WY,WX,WR,WL, WM, TC) or a constant.
0
X1X2 X3 X4
0
0 0 X1 X2
Example: WR110 is BCDshifted to the right. WM000 specifies the amount of positions to ON 2. WR110 Before the shift the content of the register WR110 =7382 and after =0073.
BSR(WR110,WM000)
7 0
3 0
8
2
7
3
WM000 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 0
Not valid for HB/H200
d n
can be a double word (DY, DR, DL, DM) is specified by the 3 least significant bits (0-7) in a word (WY,WX,WR,WL, WM, TC) or a constant.
BSL (d,n) d n
BCD shift left
Shift d n times 4 bits
is a word (WY, WR, WL, WM, TC) is specified by the 2 least significant bits (0-3) in a word (WY,WX,WR,WL, WM, TC) or a constant.
X1X2 X3 X4 X3X4 0 0
Copyright Actron, A.B. 1994
0 0
81
Programming
Not valid for HB/H200
d n
can be a double word (DY, DR, DL, DM) is specified by the 3 least significant bits (0-7) in a word (WY,WX,WR,WL, WM, TC) or a constant.
Copyright Actron AB 1994, 2009
Programming
4.7 Moving data: Not HB/H200
WSHR (d,n)
Block shift right
Shifts n words or bits one position
d can be a word (WR, WL, WM). Then the words d+1 to d+n-1 are shifted to the right. "0000" is written into the word d+n-1 and the content of d is overwritten. d can also be a bit (R, L, M). Then the bits d+1 to d+n-1 are shifted to the right. "0" is written into the bit d+n-1 and the content of d is overwritten. n is specified by the 8 least significant bits (0-255) in a word (WY, WX, WR, WL, WM, TC) or a constant. d+n-1
d
0
If d+n-1 points at a word outside the area, the flag DER (R7F4) is set to ”1”. Otherwise it is ”0” after the operation. Example:: The word WM3F0 to WM3F7 is shifted to the right. 0 is written into WM3F7 and the content in WM3F0 disappears.
WSHR (W M3 F0,WR 000)
WM3F7
WM3F5
WM3F0
12AFEEF36721
2AD3456A10EF 17F0
000012AFEEF3
xxxx2AD3456A10EF
0 The word d+n-1 is inside the memory area. DER remains therefore ”0”.
d+n-1
WR 00 0 0 0 0 0 0 0 0 0 0000 1 0 0 0
DER Otherwise DER goes High. Here d+n-1 will be WM400, which is outside the memory area. DER goes high.
d
0
WM3FF
WM3F0
16F012AFEEF36721
2AD3456A10EF17F0
000016F012AFEEF3
xxxx2AD3456A10EF
0 d+n-2
d
WR00 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1
DER
Copyright Actron, A.B. 1994
1
83
Programming
Not HB/H200
WSHL (d,n) Block shift Left
Shifts n words or bits one position
d can be a word (WR, WL, WM). Then the words d+1 to d+n-1 are shifted to the left. "0000" is written into the word d and the content of d+n-1 is overwritten. d can also be a bit (R, L, M). Then the bits d+1 to d+n-1 are shifted to the left. "0" is written into the bit d and the content of d+n-1 is overwritten. n is specified by the 8 least significant bits (0-255) in a word (WY, WX, WR, WL, WM, TC) or a constant.
d+n-1
d
0
If d+n-1 points at a word outside the area, the flag DER (R7F4) is set to ”1”. Otherwise it is ”0” after the operation. Example:: The word WM3F0 to WM3F7 are shifted to the left. 0 is written into WM3F0 and the content in WM3F7 disappears. The word d+n-1 is inside the memory area. DER remains therefore ”0”. Otherwise DER goes High.
WSHL( WM 3F 0, WR00 0)
WM3F7
WM3F5
12AFEEF36721
WM3F0 2AD3456A10EF17F0
0 EEF36721xxxx d+n-1
456A10EF17F00000 d
WR 00 0 0 0 0 0 0 0 0 0 0 0 0 0 1 00 0
DER
0
Copyright Actron AB 1994, 2009
Programming
Not HB/H200
WBSR (d,n)
BCD shift right
Shifts n BCD-digits one position
d can be a word (WR, WL, WM). Then the words d+1 to d+n-1 are shifted to the right 4 bits. (one BCD position) "0" is written into the most significant BCD position d+n-1 and the content of the least significant BCD position d is overwritten. n is specified by the 8 least significant bits (0-255) in a word (WY, WX, WR, WL, WM, TC) or a constant.
d+n-1
d+1
d
0
If d+n-1 points at a word outside the area, the flag DER (R7F4) is set to ”1”. Otherwise it is ”0” after the operation.
Not HB/H200
WBSL (d,n)
BCD shift left
Shifts n BCD-digits one position
d can be a word (WR, WL, WM). Then the words d+1 to d+n-1 are shifted to the left 4 bits. (one BCD position) "0" is written into the least significant BCD position d+n-1 and the content of the most significant BCD position d is overwritten. n is specified by the 8 least significant bits (0-255) in a word (WY, WX, WR, WL, WM, TC) or a constant. d+n-1
d+1
d
0
If d+n-1 points at a word outside the area, the flag DER (R7F4) is set to ”1”. Otherwise it is ”0” after the operation.
Copyright Actron, A.B. 1994
85
Programming
Not HB/H200
MOV (d,s,n)
Move data
n words or bits from s to d
d can be a word (WR, WL, WM) d can also be a bit (R, L, M). n is specified by the 8 least significant bits (0-255) in a word (WY, WX, WR, WL, WM, TC) or a constant. s+n-1
s
d
d+n-1
If d+n-1 or if s+n-1 points at a word outside the area, the flag DER (R7F4) is set to ”1”. Otherwise it is ”0” after the operation. Example: A memory area (the size is specified by WR000) from WM010 and upwards is copied to WR100 WM and upwards. WR000 specifies that 8 words shall be copied.
WR
MOV(WR100,WM010,WR000) WM17
WM11 WM10
FDD6 2AD3456A10EF17F09999 s+n-1
d+n-1
FAD3FAD39999 WR107
222244445555 s
d
22224444 FAD3FAD3FAD3FAD3 WR10 WR100
WR00 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
DF
0
Copyright Actron AB 1994, 2009
Programming
Not HB/H200
Copy data
COPY (d,s,n)
The content of S to n words or bit from d and upwards
d can be a word (WR, WL, WM) d can also be a bit (R, L, M). n is specified by the 8 least significant bits (0-255) in a word (WY, WX, WR, WL, WM, TC) or a constant.
s
d
d+n-1
If d+n-1 points at a word outside the area, the flag DER (R7F4) is set to ”1”. Otherwise it is ”0” after the operation.
Example:: The content of WM10 is copied to the 7 words WR100 to WR106.
COPY(WR100,WM010,7)
0000 s
Here ”0000” is written into the words.
WM10
d+n-1
WR
FAD3FAD3 0000 WR106
DER
Copyright Actron, A.B. 1994
d
00000000FAD3FAD3FAD3FAD3 WR10 1
WR100
0
87
Programming
XCG (d1,d2,n)
Exchange of words
n words or bits from d1 changes place with n words from d2
d1 and d2 can be words. (WR, WL, WM). d1 and d2 can also be bits(R, L, M). n is specified by the 8 lowest bits (0-255) in a word (WY, WX, WR, WL, WM, TC) or a constant. d1+n-1
d2+n-1
d1
d2
If d1+n-1 or d2+n-1 points at a word outside the area, the flag DER (R7F4) is set to ”1”. Otherwise it is ”0” after the operation. The exchange will only take place on the words within the allowed area. If the areas d1 to d1+n-1 and d2 to d2+n-1 are overlapping, only the part of the area, which is not overlapping will change place and the flag DER (R7F4) is set to ”1”. Example: The word WM201 to WM204 change place with the words WM207 to WM20A WR000 specifies that 4 word shall be involved in the exchange.
XCG(WM201,WM207,WR000)
000C000B000A0009000800070006000500040003000200010000
000C000B000400030002000100060005000A0009000800070000
WR000 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
DER
0
Copyright Actron AB 1994, 2009
Programming
4.7.1 Negations, absolute value etc.
NOT (d)
Inverting of words
The word d is inverted bit by bit
Inverting of all bits in a word ("1" becomes "0" and "0" becomes "1"). d can be a bit, word (or double word)
d
1010100001110010 0101011110001101
NEG (d)
Make negative
Two complement of d (+ to -,- to +)
The two complement of the word d is calculated and returned to the word d This mean that H10000 (the hexadecimal value 10000) minus the content of d is returned to d.
NEG(d) 0002
+2
FFFE
-2
FFFE
-2
0002
+2
(for double words H100000000 - the content of d is returned to d)
Copyright Actron, A.B. 1994
89
Programming
ABS (d,S) Absolute value
The absolute value of S to d
If S is negative it will be converted to a positive value and written to d. If S is positive it will be written to d without conversion. The sign of S will go to C (R7F0). If S is negative C will be "1", otherwise "0".
ABS(WY10,WM000) W M000 F F F E -2 WM00 0 0 0 0 2 +2
WY10 0 0 0 2 +2 WY10 0 0 0 2
C 1
Not valid for HB/H200
SGET (d,s)
+2
C 0
Sign Get
Make negative if C =1
If C (R7F0) =1 the two complement of the word S is calculated and written to d. (see NEG(d)) Otherwise S is copied to d.
SGET(d,s) 0002 2
F F F E -2
F F F E -2
0002 2
00022
F F F E -2
00022
F F F E -2
C 1
C 0
Copyright Actron AB 1994, 2009
Programming
Not HB/H200
EXT (d,s)
Extend
Extend sign to double word
S is copied to d and the most significant bit (bit 15) in S is copied to all bits in the word d+1 This is done if you want to convert a word to a double word and keep the sign. s
0 1 1 00 1 1 1 0 1 0 11 10 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 1 1 00 1 1 1 0 1 0 11 10 1 d
d+1
s
1 1 1 00 1 1 1 0 1 0 11 10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 00 1 1 1 0 1 0 11 10 1 d
d+1
4.7.2 Converting. BIN
BCD (d,S)
BCD
Converts a binary word to BCD
If S and d are words. the binary value in S is converted to BCD and written to d. If S > the hexadecimal value H270F the BCD value will be >9999. Then the DER (R7F4) flag goes high and d is left unchanged.
s
1
7
5
9
0 d
5
4
9
7
s
7
9
E
5
1 d
5
4
9
7
DER
DER
Copyright Actron, A.B. 1994
91
Programming
Not valid for HB/H200
If S and d are double words. the binary value in S is converted to BCD and written to d. If S > the hexadecimal value H5F5E0FF the BCD value will be >99999999. Then the DER flag goes high and d is left unchanged.
Copyright Actron AB 1994, 2009
Programming
BCD
BIN (d,S)
BIN
Converts a BCD word to binary.
If S and d are words. the BCD value in S is converted to binary and written to d. If any digits in S are outside the correct BCD area (0-9 the DER (R7F4) flag goes high and d is left unchanged.
s
5
4
9
7
BCD
0 d
1
7
5
9
binary
DER
s
9
5
5
E
1 d
1
7
5
9
only 0 - 9 allowed
DER binary
s and d can also be double words.
DECO(d,s,n)
Decode
Decoding of s (with n bits)
The content of the least significant part of the word s (with the width of n bits) defines which bit shall be set to ”1”. This is calculated from the bit d. Other bits counted from the bit d and up to the bit 2 n -1 are set to "0".
B
s
0 0 0 0 00 0 0 0 0
0 10 0
DECO(M100,WX10,6)
0 0 0 0 0 0 00 0 0 0 0 S=WX10
B=17
1010011101 0100 0 1
00000 00000
1 1 0 0000 000000 00000 0 0
If d+ 2n -1 is > than the highest bit in the memory area the flag DER is set high but the operation will be executed. If d+B in this case is outside the memory area all bits from d and upwards are set to ”0”.
Copyright Actron, A.B. 1994
93
Programming
ENCO (d,S,n)
Encode
Coding of n bits to words.
n bits counted from the bit S are coded to a value. The order in the area of S to S+2n -1 of the most significant bit with the ”1” status is coded to a binary value and written to the word d.
1 -
ENCO(WY100,M100,5)
n
2 + s
0 0 0 00 000 0 0
B=2
B + s
WY100=2
s
1 0 0 0 0 00 0 000 0 0 0 00 1 0 0 0 18
16
14
12
10
8
6
4
2
0
B + s
0 0 0 00 000 0 0
B=14 WY100=14 s 1 0 0 0 1 00 0 0 1 0 0 0 0 00 1 0 0 0 18
16
14
12
10
8
6
4
2
0
If all bits within the area S to S+ 2 n -1 are "0" the C-flag (R7F0) is set high and d becomes the value "0000" If S+ 2n -1 is > the highest bit in the memory area the DER flag is set high but the operation is executed on the bits within the memory area.
Copyright Actron AB 1994, 2009
Programming
Not HB/H200
7-Segment
SEG (d,S)
Decoding to 7-segment display.
The content in the word S is decoded and written to double word d. Each digit in S is decoded to seven bits, (which represent a segment in a seven segment display) according to the following:
0
a f
1
7
F
b g
e
0 0 1 1 1 1 1 1 0 0 0 0 0 1 10 0 0 1 0 0 1 1 1 0 11 1 0 00 1 c
d
0
1
2
3
4
5
6
7
8
9
A
B
In data
Outputs g
f
e
d
c
b
a
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 1 1 1 1 1 1 1 1 1 0 1 1
1 0 1 0 0 0 1 0 1 0 1 1 1 1 1 1
1 0 1 1 0 1 1 0 1 1 0 1 1 1 1 1
1 1 0 1 1 1 1 1 1 1 1 1 0 1 0 0
1 1 1 1 1 0 0 1 1 1 1 0 0 1 0 0
1 0 1 1 0 1 1 1 1 1 1 0 1 0 1 1
Copyright Actron, A.B. 1994
0 0 1 1 1 1 1 0 1 1 1 1 0 1 1 1
C
D
E
F
95
Programming
4.8 Application commands: Not HB / H200
SQR (d,S)
Square root
Square root of d to S.
d is the square root of S. S must be BCD data. If S is not BCD data e.g. 74A6 the flag DER (R7F4) goes high.
s
SQR(WM020,DR030)
d
Bit Count
BCU (d,S)
Counting "1"-bits in S to d
The number of bits in the word S, which are "1" are counted and the result is written to d. 0 - 16 (hexadecimal 0000 - 0010) is written to d
11 ”1”s (hexadecimal 000B)
0111101000011111 000B s can also be a double word (not for HB/H200) Then 0 - 32 (hexadecimal 00000000 - 00000020) is written to d.
SWAP (d)
Swap bytes
The 8 most and the 8 least significant bits exchange place in a word
The 8 most and the 8 least significant bits exchange place in a word. Example: the 8 most si nifi nifica cant nt bits bits
SWAP(WY20)
the 8 least si nifi nifica cant nt bits bits
d=WY20
before
after
0 B1 7
1 70 B
Copyright Actron AB 1994, 2009
Programming
4.9 FIFO FIFO (Queue regis reg ister ter): ): The FIFO-instructions are divided into three instructions. - FIFIT defines the size of the FIFO register. - FIFWR reads data into the queue. - FIFRD reads data from the queue. FIFO is a short form for First In First Out. Not HB/H200
Defines the size of the FIFO in P
FIFIT (P,n)
n is written into P and defines the size of the FIFO the maximum length of the queue. n has a maximum maximum of 256. If n is > 256 the value value 256 will be written into P anyway. The address above P (P+1) contains the counter, which keeps the information about how many data words the FIFO contains for the moment. This is reset to zero when the instruction FIFIT is executed. The FIFO itself starts at address P+2. If P+n+1 points outside the memory area, the DER flag (R7F4) goes high and the highest address, which is not outside the area will be stored instead.
P Size of the FIFO
P+1
A
Counter queue
n 0
P+2 Position 1 Position 2 Maximun size of the FIFO
P+n+1 Position n
Not HB/H200
FIFWR (P,S)
FIFO Write
S is written into FIFO with start on P
Writes data from the word S into the FIFO on the address, which the counter queue keeps track of.. S is written to the address P +2+A, where A is the temporary amount amount of data words in the FIFO. A is automatically increased by 1. If A>= n (the queue is full) S is not stored and the DER flag (R7F4) goes high. If A=0 (the queue is empty) S is not stored and the DER flag (R7F4) goes high.
p Size of the FIFO A Counter queue
A p+A+2
Position 1 Position 2
S
p+n+1
Position n Copyright Actron, A.B. 1994
97
Programming
Not HB/ H200
FIFRD (P,d) FIFO Read
d is read from the FIFO starting on P
Reads the queue register, which starts on the address P. The content of the address P+2 is written to d. A is automatically decreased by 1. The contents of the addresses P+3 to the last address in the shift register are shifted one position. (P+3 → P+2, P+4 → P+3 etc.) If A>= n (the queue is full) S is not stored and the DER flag (R7F4) goes high. If A=0 (the queue is empty) S is not stored and the DER flag (R7F4) goes high.
p
Example: Using the FIFO-instructions. FIFO-instructions. R7E3
Size of the FIFO
FIFIT(WR100,5)
A Counter queue Position 1
A
X200
d
DIF1 FIFWR(WR100,WX010)
Position 2 X201
DIF2 FIFRD(WR100,WY100)
p+n+1
Phase 1
Phase 2
Phase 3
R7E3
X200
X200
WR100
5 0
WR102
Not defined Not defined Not defined Not defined Not defined
WR106
5 WX010 0 WR100 WR100
5
WX010
7EA3
WR100 WR100
1 WR102 WR102
WR106 WR106
Phase 4 (data shifted 2 times between phase 3 and 4)
5556
Phase 5
5556
Not defined Not defined Not defined Not defined
5 2
WR102 WR102
5556 7EA3
WR106 WR106
Not defined Not defined Not defined
Phase 6
Copyright Actron AB 1994, 2009
Programming
X200
R7F4=0
X200
WX010
1111
WX010
WR100
5 5 5556 7EA3 7777 2222 1111
WR100
WR102
WR106
Copyright Actron, A.B. 1994
WR102
WR106
R7F4=1
6666 5 5 5556 7EA3 7777 2222 1111
R7F4=0
X201 WY030
WR100 WR100
5556 5 4
WR102 WR102
7EA3 7777 2222 1111
WR106 WR106
Not defined
99
Programming
UNIT (d,S,n) Unit 4 bit data
4-bit data from n words from S to d
The last 4 bits in n words with start from the word S are copied into the word d according to the picture. n is 0-4. If n < 4 the rest of the word d is filled with "0". If S+n+1 points outside the memory area, the DER flag (R7F4) goes high and the operation is not executed on the words, which are outside the address area, while the other positions are filled with "0". LSD
MSD
L SD
B4 S
B3
B2
B1
d
B1 B2 B3 B4
S+n-1
Example: The last digit in the word s from WR100 and upwards are written to the output word WY20. UNIT(WY20,WR100,4)
UNIT(WY20,WR100,2)
WY20 B 5 F 4 WY20 WR1 WR100
123 1234
WY20 0 0 F 4 WY20
WR1 WR100
A67 A67F 78D 78D5 WR1 WR103
A67 A67F 78D5
998 998B
DIST (d,S,n)
123 1234
WR1 WR103
00
998B
Distribute 4-bit data to d from n words starting from S
The last 4 bits in n words with start from the word d are copied from the word S according to the picture. n is 0-4. If d+n+1 points outside the memory area, the DER flag (R7F4) goes high and the operation is not executed on the words, which are outside the address area, while the other positions are not copied. LSD
MSD
B4 d
d+n-1
000 000 000 000 000 000 000 000
LSD
B3
B2
B1
s
B1
B2 B3 B4
. Example: An Example: An input word shall be read and divided so every digit is stored in a separate word in the memory. DIST(WM100,WX10,4)
DIST(WM100,WX10,3)
B 5 F 4 WX10 WM100
WM103
0004
0 5 F 4 WX10 WM100
0004
000F
000F
0005
0005
000B
WM103
998B Copyright Actron AB 1994, 2009
Programming
4.10 Control com mands (jum p etc.): End
END
End of a normal program cycle.
Ends a normal program cycle (or scan) and causes restart from the beginning of the program. It is only necessary to use this instruction if sub routines or interrupt routines are written after the main program. It should not be used more than once in a program.
END If alternative Ends of the program is wanted, see the instruction CEND.
CEND (S)
Condition END
Conditional program End, on condition S
Ends a normal program cycle (or scan) and causes restart from the beginning of the program if the condition S is true. It is used to create alternative program Ends and therefore shorten down the scan time of the program. CEND must not be used outside the main program (not in sub routines or interrupt routines)
Begining of program
Example: The second part of the main program could e.g. be a debug part of the program, which only shall be executed when X100 is High.
Normal program CEND(X100)
Normal program END
Copyright Actron, A.B. 1994
101
Programming
JMP n
Jump
Unconditional jump to label
CJMP n(S)
Cond. Jump
Conditional jump to label
LBL n
Label
End address of jump
Performs a jump in the program to the corresponding Label. Every JMP n or CJMP n has to correspond to a LBL n where n is identical. n is a number between 0 and 255. JMP n performs an unconditional jump. That means if the condition for the arithmetic box is true. CJMP n performs a conditional jump. That mean that the jump take place if the condition S is true (and if the condition for the arithmetic box is true)
condition
unconditional JMP n
Program LBL n
condition
condition CJMP n (s)
Program LBL n
X201 JMP 10
Program X202 CJMP 10 (X204)
Several jumps to the same label is allowed. Jumps with different labels are independent from each other and they are allowed to nest
Program X203 JMP 11
Program LBL 10
A jump is done directly to the label address and it will shorten the scan time. Jump backwards are allowed but you must be careful so you will not stop in endless loops.
LBL 11
X203 JMP 10
If a jump passes a timer it will run anyway. But the timer can not effect anything before the program part is executed.
Copyright Actron AB 1994, 2009
Programming
Jumps are not allowed outside its own program area. It is not allowed to jump between main program and sub routines or interrupt routines or between sub routines and interrupt routines.
Main program
Sub routin
OK Not OK
Interupt routin
Copyright Actron, A.B. 1994
103
Programming
RSRV n
Reserve
Command for the BASICH-module see
FREE
Command for the BASICH-module separate
STAR n
Command for the BASICH-module description
Not HB/H2 00
FOR n (S)
Repeated program part start
NEXT n
Repeated program part end
Repeated program part between FOR n and NEXT n (where n is identical) S times. When S becomes 0 the loop is interrupted. S must be a word (WM, WR or WL). It will decrease by 1 every loop. (it is possible to change the content of n during the execution of the loop.)
FOR n (s)
Program
n times
n -1 times
NEXT n
n is a number between 0 and 49. Every FOR must correspond to a NEXT with the same number FOR must come before NEXT. FOR or NEXT can only be used once with the same number (n). FOR and NEXT can be used up to 5 levels. (see drawing) This is also valid if one or more subroutines are in a sub routine.
FOR 1 (WR100) FOR 2 (WR101) FOR 3 (WR102)
This kind of programming easily causes very long program scan times, which must not exceed the maximum time in the setup.
FOR 4 (WR103) FOR 5 (WR104)
NEXT 5
E.g. WR100-WR104 all are 10 the program part between FOR 5 and NEXT 5 will be repeated 10 x 10 x 10 x 10 x 10 =100000 times. If this part of the program is 1 ms, the total program scan time will be > 100 s, which is not possible..
NEXT 4 NEXT 3 NEXT 2 NEXT 1
FOR 5 (WR104)
FOR 4 (WR103)
Not allowed
It is not allowed to nestle FORloops.
NEXT 5
NEXT 4
Copyright Actron AB 1994, 2009
Programming It is allowed to jump from a FOR loop without completing the loop. When the loop is entered again it will start from the beginning. It is possible to have a condition for the execution of FOR and NEXT. This condition must be identical as FOR and NEXT otherwise do not correspond to each other. Do e.g. not use an input which can be changes during the scan.
Copyright Actron, A.B. 1994
FOR 5 (WR104) JMP 12 NEXT 5
105
Programming
CAL n
CALL
Subroutine call to routine no. n
SB n
Subroutine
Subroutine no. n start
RTS
Return
Subroutine no. n end and return
CALL n calls a subroutine. SB n defines the start of a subroutine. RTS means that return to the instruction after the CALL n shall take place.
Pro ram X203 CAL n
Pro ram A sub routine is used because it will not be necessary to repeat this program part in the program.
END
SB n
n is a value between 0 and 99 and specifies the number of the sub routine. The sub routines are placed directly after the main program. (after the END-instruction) They can be written before or after the interrupt routines.
Sub routine
RTS
Copyright Actron AB 1994, 2009
Programming
The sub routines can be called in 5 levels. (for HB/H200 only 1 level) This means that the routines can call each other and the system remembers the order of the return jumps.
It is possible to have different start addresses of a sub routine. (the same RTS instruction corresponds to more than one SB n instruction) In this case you have to use JMP to pass the SB instructions, which are not used.
a
b a a a a
a
a a a a
INT n
Interrupt
Interrupt type n start
RTI
Return
Return from Interrupt routine
INT n specifies the start of an interrupt routine. RTI specifies that return to the place where the jump to interrupt occurred, shall take place..
b
Program END
INT n
n is a number between 0 and 31 and specifies the type of interrupt (see page 153)
Interup routine
INT and RTI have to be unconditional. (No logics before the arithmetic box.) RTI
Copyright Actron, A.B. 1994
107
Programming
If one of the possible interrupt reasons occur and an interrupt routine is programmed to take care of this, the normal program scan will be interrupted and the interrupt routine will be executed.
Main program
Main program
Main program
Main program
Main program
Interupt type 2
Interupt type 1 INT 1
INT 1
INT 1
INT 1
INT 1
RTI
RTI
RTI
RTI
RTI
INT 2
INT 2
INT 2
INT 2
INT 2
RTI
RTI
RTI
RTI
RTI
Copyright Actron AB 1994, 2009
Programming
4.11 Logic instruction programming: (not necessary to use if ladder or grafcet programming is used with Actsip/Actgraph) It is also possible to symbolise the logic with instruction code. But as the internal storage in the PLC is ladder code, it means that there are limitations when using instruction code (like in other PLC types). Therefore ladder- and Actgraph programming is recommended.
Start Contact symbol Defines start of block or a branch in a ladder block. Symbol
Instruction
Short from
LD
LoaD
Start of a block or a branch , closing contact
X,Y,R,L,M
LDI
LoaD
Start of a block or a branch , inverted contact
TD,SS,CU,CT
Invert
X002
X013
Description
Address type
Y102
R034
M002
Y102
LD AND OR LDI OR ANB OUT
X002 X013 Y102 R034 M002
Y102
As the two parallel connected contacts (R034 and M002) are alone on the branch it is not necessary to create a new branch. You can instead describe the parallel connection with an ”OR contact”, see below. Symbol
Instruction
Short from
Description
Address type
AND
AND
Serial connection, closing
WDT,MS
ANI
ANd Invert
X002
Serial connection, inverted
OR
OR
Parallel connection, Closing
ORI
OR
Parallel connection, Inverted
Invert
X013
Y102
Copyright Actron, A.B. 1994
R034 M002
TMR (not all CPUs)
R01A
Y102
DIF, DFN
LD AND OR LDI OR ANB ANI
X002 X013 Y102 R034 M002
OUT
Y102
R01A
109
Programming
As the last contact (R01A) is alone on the branch it is not necessary to create a new branch. You can instead describe the serial connection with an ”ANI contact”.
Serial connection and parallel connection of blocks: Symbol
Instruction
Short from
Description
Address type
ANB
AND BLOCK
Serial connection of logic blocks
-
ORB
OR
Parallel connection of logic blocks
-
BLOCK
Combine the branches one by one with ANB (Serial connection) or ORB (Parallel connection) so they will form larger and larger units.. C A
X002 Y102
E
X013
R034
F
R01A
Y102
D
Instruction
NOT
Symbol
X002 X013 Y102 M012
Short from
NOT
Branch A
LDI OR ANB
R034 M002
ANI
R01A
F is serial connected to E
OUT
Y102
Output control
Branch B Parallel connection of A and B to C.
M012 M002
B
Symbol
LD AND LD ANI ORB
Branch D Serial connection of C and D to E.
Description
Address type
Inverting of the logic in the block
-
Instruction
Short from
Description
Address type
OUT
OUT
Output (coil)
Y,R,L,M
TD,SS,CU,CT CTU,CTD,CL
WDT,MS TMR,RCU (not all CPUs) Copyright Actron AB 1994, 2009
Programming
Symbol
Symbol
Symbol
Instruction
Short from
Description
Address type
SET
Sets an output or a memory High
Y,R,L,M
RST
Sets an output or a memory Low (Reset)
Y,R,L,M
MCS
Master Control Set
Master Control of the coming program blocks Start.
MCS
MCR
Master Control Reset
Master Control of the coming program blocks End.
MCR
Instruction
Short from
Description
AND DIF
Serial connected positive edge.
OR DIF
Parallel connected positive edge.
AND DFN
Serial connected negative edge.
OR DFN
Parallel connected negative edge.
Address type
DIF
DFN
Instruction
Short from
Description
Address type
MPS
Push
Stores the current logic result
--
MRD
Read
MPP
Pull
Copyright Actron, A.B. 1994
Reads back the logic result stored by MPS Reads back the logic result stored by MPS and restores the level
111
Programming
Symbol
Symbol
Instruction
Short from
Description
Address type
OUT TD Time base, Time
Time Delay
On delay timer
-
OUT SS Time base, Time
Single Shot
Timer, which starts when it is activated and continues.
-
OUT CU Preset
Count Up
Up counter
-
OUT CTU Preset
CounT Up
Up- and Down Counter Up count input
-
OUT CTD
CounT Down
Up- and Down Counter Down count input
-
OUT CL
CLear
Clear of Counter/Timers
-
Instruction
(
)
Short from
Compare box Start/ End
Description
Address type
The result of the comparison gives On/Off function as a ladder contact
WR, WY, WX, TC, WL, WM, constant
Create the "compare contact" through pressing [AND], [ANI], [OR] or [ORI] and thereafter [ ( ] and [comparison expression]. e.g. AND (S1=S2), ORI (S1S2)
Symbol
Instruction
Name
[
Box start/end
]
Description
Address type
In the box there are programmed arithmetic instruction etc.
WR, WY, WX, TC, WL, WM, constant
Create the arithmetic box through pressing "[" and thereafter the arithmetic instructions in the box and finally "]" to end the box. E.g. [ WR00=WX00 SHL (WM101 , 5) ]
Copyright Actron AB 1994, 2009
Practical Handling
Copyright Actron AB 1994-2009
113
Practical handling
5 Practical Handling :
5.1 To run thro ugh a comp lete pro ject: 5.1.1 Choice of PLC -Start to estimate the distances in the installation. -If they are long: -If the units are going to work more or less independent from each other: -It can be wise to divide the installation into two or more CPUs. In this way you can save installation cost and get working if something happens to another unit..
units
-If the units are going to communicate with lots of information: -then it is recommend to use a link connection. -If the distances are long and the units are going to work like one unit: -Then it is recommendable to plan one central CPU with remote units, which are distributing the In/Outputs.
It is now time to choose the PLC type. Here is given some leading information (see also the list of modules in the additional parts) Suitable for size of installation
Small
Suitable interval/ /Max. amount I/O 0-120/208
Small
Module range
Best advantage (cost effective) for different types of installations.
Limited
Link- and remote communication No
Small with majority digital I/O
0-120/208
Limited
Yes
Small with majority digital I/O and link
Small to medium
0-230/512
Large
Yes
Small/medium with mix of modules
Small to medium
0-230/512
Large
Yes several
Small/medium with mix of modules and more power
Small to medium
0-450/928
Large
Yes several
Small/medium with mix of modules and more power
Medium
0-250/576
Large
Yes several
Medium
0-250/576
Large
Yes several
Medium
0-600/1280
Large
Yes several
2
Large
0-2000/2688
Large
Yes several
2
Large
0-4000/4096
Large
Yes several
Small/medium with mix of modules and module system H300-H2002 is preferred Small/medium with mix of modules and module system H300-H2002 is preferred and more power Medium with mix of modules and module system H300H2002 is preferred and more power Medium/large with mix of modules and module system H300-H2002 is preferred and more power Large with mix of modules and module system H300H2002 is preferred and more power
Estimate the memory size: When you have chosen the type of PLC, you should estimate the memory size. A practical rule is that each digital I/O causes 10 program steps when it is basically a logic program. Above this you should add the program amount caused by calculations etc. (see steps/instruction page 279) Reserve a good spare capacity. If you are close to the maximum memory it is recommendable to select a larger size if available. If it is not available select next PLC size. Select modules: Search in the module list in the additional part of PLC type or in the price list.
Copyright Actron AB 1994, 2009
Practical handling
Configuration of rack system Go to the additional part for each PLC and decide how to connect the base unit (and expansion units) Add the total current consumption per unit (see additional part for the. PLC-type) and select a suitable power supply. If the power supply is not enough, rearrange the modules.
Order: Place the order as early as possible. That is the best guarantee that we can meet the delivery time you want. (Even if you order normal stock equipment it could be temporarily out of stock.)
Receiving the delivery: Check that all units are delivered according to the order and no transport damage has occurred. If that is the case, inform the supplier immediately so the problem can be corrected. Save the package for a time, (at least until the machine is tested and delivered.) Assemble the system as planned and mount the system according to the installation directions on page 154.
Installation, Power and I/O-connection: Install the PLC according to the description in the Common hardware description page 154. Install power supply, expansion cables and I/O cables according to the description in the additional part for the PLC type.
Check that the signals from every sensor reaches the inputs through checking the LED’s on the front of the PLC.
Install your computer software: Unpack the diskettes, turn on the computer and place the first diskette in drive A: (or B:) Type: A: and thereafter Install and answer the questions, which follow. The system will suggest that you install the software in a sub-directory, which is called "ACTSIP". Normally you should press (Which means Yes). Continue with the second diskette and so on.
Connection for computer programming: For Off-line programming you do not need anything more than the loaded software. (We recommend that you bring the special software manual, masks for the key board. When you are going to communicate with the PLC (ON Line programming) you have to use the cable which was designed for the software. Connect this between the computer serial port and the serial port on the PLC CPU.
Copyright Actron, A.B. 1994
115
Practical handling
5.2 Computer programming.: (Short description, You can find a more detailed description in the Actsip-H or ActGraph manual):
5.2.1 Actsip-H Start with the command < H >. (or for Actgraph ) Remember the information in the Welcome window. Press F1 for Help wherever you are in the program and +F1 for Help in ON-LINE programming. Press thereafter and you will see following window.: System
Program
│
Start
Allocation
Printout
Files
╔════════════ No
Communication
project was specified Load project from file ║Load project from PLC New project, go to setup menu
│
Setup
════════════╗
══════════════════════════════════════════════════
│ │
│
│ │ │ DRAW
mode
(0000) OFFLINE
H-200
Intern
7.5 Ks
Choose between the alternatives "New project", "Load project from file" and " Load project from PLC". If the alternative ” new project" is chosen you will get a setup menu for the PLC system. Here you can select CPU-type, Memory type, In- Output configuration etc. If the PLC-system is connected via the serial port, you will press when you get the alternative ” Read PLC- Setup” and these setups will be performed automatically.
Copyright Actron AB 1994, 2009
Practical handling
System
Program
Allocation
Printout
Files
Communication
Setup
╔═══════════════════════════ PLC │ │ │
PLCSetup
│ │
setup ════════════════════════════╗ Read PLC configuration H-250 ║CPU type Memory type Intern 7.5 Ks Capacity HIFLOW (steps) 00000 HILADDER 07552 ║I/O assignment Link parameters 1 Top=* End=* Link parameters 2 Top=* End=* ║Retentive area Project name Run conditions * ║Run control input Password * Max scan time [ms] 100 ║Communication setup ══════════════════════ Press for HELP ═══════════════════════
│ │
DRAW
│
mode
(0000) OFFLINE
H-200
Intern
7.5 Ks
For manual setup the setup of in- /output configuration will look like: E.g. LINK module System
In-/ Outputconfigura tion
Program
Allocation
Printout
Files
Communication
Setup
╔══════════════════════════════════════════════════════════════════════════════╗ ║ Base/exp I/O Assignment ┌─ PgDn=More ─┐║ 208 ║ Points: │0 = W IO 4/4W│║ Slot: 0 1 2 3 4 5 6 7 8 9 A │1 = INTERRUPT│║ ║ ║┌──────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┬────┐│2 = REMOTE │║ ║│Unit 0│ X16│ X16│ Y16│ Y16│ X8W│ X16│LINK│ │ │ │ ││3 = CPU LINK │║ 1│ ║│ │ │ │ │ │ │ │ │ │ │ ││4 = COMM │║ 2│ ║│ │ │ │ │ │ │ │ │ │ │ ││5 = BASIC │║ 3│ ║│ │ │ │ │ │ │ │ │ │ │ ││6 = GPIB │║ 4│ ║│ │ │ │ │ │ │ │ │ │ │ ││7 = I/O 16/16│║ 5│ ║│ │ │ │ │ │ │ │ │ │ │ ││8 = I/O 16/32│║ 6│ ║│ │ │ │ │ │ │ │ │ │ │ ││9 = I/O 32/16│║ 7│ ║│ │ │ │ │ │ │ │ │ │ │ ││Q = I/O 32/32│║ 8│ ║│ │ │ │ │ │ │ │ │ │ │ ││W = FUN0 5/3W│║ 9│ ║│ │ │ │ │ │ │ │ │ │ │ ││E = FUN1 3/5W│║ ║└──────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┴────┘│R = FUN2 6/2W│║ = Toggle Standard/Remot e ║ SPACE │T = FUN3 2/6W│║ ║ Arrows = Move │Y = FUN4 7/1W│║ ║ Numbers = Select module │U = FUN5 1/7W│║ = Copy real assignment ║ INS │I = FUN6 2/2W│║ ║ ESCAPE = Leave └─────────────┘║ ║ ║ ╚════════════════════════════ Press for HELP ═════════════════════════════╝ DRAW
mode
(0000) OFFLINE
H-200
Intern
7.5 Ks
Here you can choose modules for each slot from the list on the right: (Press F1 for Help and you will get information about how all modules will be addressed.) In this example 32-input modules have been chosen on slot 0 and 1, 32-output modules on slot 2 and 3, a 8-word input module (e.g. an analog input module) on slot no. 5 and a link module on slot 6 and 7.
Press F1 for Help. A list over available modules will appear also telling how to define these.
Copyright Actron, A.B. 1994
117
Practical handling
System
│
Allocation
Printout
Files
Communication
Setup
╔═══════════════════════════ PLC
setup ════════════════════════════╗ Read PLC configuration H-250 ║CPU type Memory type Intern 7.5 Ks Capacity HIFLOW (steps) 00000 HILADDER 07552 I/O assignment Link parameters 1 Top=* End=* ║Li╔════════════ Retentive area ════════════╗nd=* Re R Top=0200 End=0300 Pr WR Top=0100 End=0200 Top=* End=* ║Ru║WM Ru T/C Top=0100 End=0511 Pa DIF Top=* End=* Top=* End=* ║Ma║DFN Co ════════════════════════════════════════ ══════════════════════ Press for HELP ═══════════════════════
│
│ │ │
Setup of retentive memories
Program
│ │ DRAW
mode
(0000) OFFLINE
H-200
Intern
7.5 Ks
You can define the link areas (the memory areas, where the CPUs in a network talk to each other.) The setup of retentive memories is also done here. ”Top” stands for Lowest address and ”End” stands for Highest address. When the setup is ready, press and you are ready to program.
The status row at the bottom of the screen gives information about the current setup.
DRAW
mode
(0000)
Edit mode ( line draw) Can be Draw and Erase (and possibly. Move)
H-250
OFFLINE
Amount of program blocks
ON-Line/ OFF-Linestatus
Intern
CPUtype
7.5 Ks
Memory type
You are now in the drawing screen, where the program will be created. From the screen you can always enter the menu bar (pull down menus) at the top of the screen by pressing
System
Program
Allocation
Printout
Files
Communication
Setup
You can also get some options, e.g. Search, as extra choices at the bottom of the screen through pressing . Mark Search ACTTERM
Hor-exp
Ver-exp
Goto
+ comm
- comm
Erase comm
Copyright Actron AB 1994, 2009
Practical handling
System
Other setups
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
DRAW
Program
Allocation
mode
Printout
Files
(0000) OFFLINE
Communication
Setup
┌──────────────────┐ │PC (Computer) │ │PLC │ │Printout │ │Communication │ │Ladder programming│ └──────────────────┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
H-250
Intern
7.5 Ks
If this is the first time Actsip/ActGraph is started it could be necessary to setup the PC and the communication. (In such case, press and go with the arrow keys to ”Setup”. Go down to the choice ”PC (Computer) or ”Communication”. System
Allocatio n of memories
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
DRAW
Program
Allocation
Printout
┌───────────────────┐ │Enter/Change │ │Allocation pointers│ │Move │ │Exchange │ │Print │ │Print packed │ └───────────────────┘
mode
Files
(0000) OFFLINE
Communication
Setup
H-250
Intern
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
7.5 Ks
If some addresses already from the beginning are known (e.g. Inputs and Outputs, which already are connected) you should go to the ”Allocation menu” and under ”Enter/Change” type these on the decided address. In the ”Allocation menu” you can also move and exchange addresses (e.g. if a I/O slot is moved. System
Program
Allocation
Printout
Files
Communication
Setup
┌────────────────────── Allocation ───────────────────────┐ │
Enter comments (symbols)
│ │ │ │ │ │
DRAW
X00000 X00001 X00002 X00003 │ X00004 X00005 X00006 │ X00007 X00008 X00009 │ X00010 X00011 X00012 │ X00013 X00014 X00015
│
PHOTO SW1 IND SENS2 START BUT STOP BUT
Photo Metal Panel Panel
switch before conveyor 1 sensor at input feeder start button stop button
└─────────────────────────────────────────────────────────┘
mode
Copyright Actron, A.B. 1994
(0000) OFFLINE
H-250
Intern
│
7.5 Ks
119
Practical handling
Enter the ”Short comments” or ”Symbols”, maximum 10 characters. These can be used afterwards instead of physical addresses in the programming as it is easier to remember these. A long comment of max. 30 characters can be added to make the final documentation better.
¦
¦ Address
Short com.
¦
¦ X00000
PHOTO
Long comment
¦
¦
SW 1 Photo switch in front of feeder 1 ¦
¦
It is now ready for programming: The function keys have the following meaning, For Actsip-H:
Word Debug monitor Help + ACT Redraw Draw/
Monitor Monitor Start ON OFF PLC Show
Stop PLC
ONLINE
OFFLINE
+
RES SET
ShortCom
Draw a Ladder block, e.g..: Use the Function keys and the arrow keys. You can use the arrow keys for moving, drawing lines (together with or ) You can also use the arrow keys for erasing if you change to Erase mode with the (See the left part of the bottom line) Our first example will be to create a start circuit with self hold, where a photo switch is a condition for start. System START │ BUT
Program PHOTO SW1
Allocation
Printout
Files
Communication
Setup
│ │
── ├────┤ ──── ├─ ─ ├──┤ X00002 X00000 X00000 │X00002 │ │ │
m
│ │ │ │
DRAW
│
mode
(0000) OFFLINE
H-250
Intern
7.5 Ks
Start from the left line, Press the symbol for the first contact and type the address (X2) or the Symbol ”START BUT”. Make a serial connection through repeating the procedure.
Copyright Actron AB 1994, 2009
Practical handling
System START │ BUT
Automatic allocation
Program PHOTO SW1
Allocation
Printout
Files
Communication
Setup
│ ││ ││ ├──┤ ├────┤ ├─┬ ││ │X00002 X00000│ ││ │ │ ││ │START │ ││ │ MEM │ │ ── ── │╔═ Short Comment/Addr. ═╗ │ │║START MEM ║ │ ╔════════════════════════════ Automatic allocation ════════════════════════════╗ ║START MEM ║ DX DY DL DM DR ║M0000 ║ WX WY WL WM WR TC ║ ║ X Y L M M R DIF DFN MCS MCR TD SS WDT MS TMR CU RCU CTU CTD CT CL ║ ║ ║───────────────────────────────────────┬──────────────────────────────────────║ ║ Allocation pointer: M0000 │Data area, Bit ║ ╚══════════════════════════════════════════════════════════════════════════════╝ │ │ │ │ │ │ │ │ │ │ DRAW
mode
(0000) OFFLINE
H-250
Intern
7.5 Ks
Draw a line down through pressing + (or +). Go to the left line and start the parallel connection. If we have not already allocation ”START MEM” to an address, we can write ”START MEM” anyway instead of the address. The system will show the automatic allocation window and ask you what ”START MEM” is. In this window you can choose between the different kinds of memories. The system will always suggest a free address. In this way the double use of addresses can be avoided, which otherwise is one of the most common programming errors.
Let us accept that "START MEM” becomes the address M0, as the system suggests. Press System │START │ BUT
Program Allocation Printout PHOTO STOP START SW1 BUT MEM ├──┤ ├────┤ ├─┬──┤/├────( )─ │X00002 X00000│
Completing the block
Files
Communication
Setup
│ │ │ │ │ │ │ │
│ │ │START │ │ MEM │ ├──┤ ├────────┘ │M0000 │
│ │ │ DRAW
mode
(0000) OFFLINE
H-250
Intern
7.5 Ks
Draw thereafter the rest of the block with the same method as we started.
Copyright Actron, A.B. 1994
121
Practical handling
System START │ BUT
t block
Program Allocation Printout Files Communication Setup PHOTO STOP START SW1 BUT MEM ── ──── ─┬── / ─────────────────────────────────────────────────────( )─ X00002 X00000 X00003 M0000
│
│
START MEM
├──┤ ├────────┘ M0000
│ │ │ │ DRAW
mode
0001 (0001) OFFLINE
H-250
Intern
7.5 Ks
During the drawing the block is inverted to show that it is not yet a part of the program. When the block looks like what you want, press . The block will now be a part of the program. It will be redrawn and it is not inverted anymore. You can also see that the status row shows one more block in the program.
Copyright Actron AB 1994, 2009
Practical handling
5.2.2 Change of an existing block: E.g. an inductive sensor shall be added as a condition in series with the photo switch to activate the start memory. . System START │ BUT
│
Program Allocation Printout Files Communication Setup PHOTO STOP START SW1 BUT MEM ── ──── ─┬── / ─────────────────────────────────────────────────────( )─ X00002 X00000 X00003 M0000 START MEM
├──┤ ├────────┘ M0000
│
Horizontal expansion
│ │ │
│
Mark
Search
Hor-exp
Ver-exp
Goto
+ comm
- comm
Erase comm
ACTTERM
Place the cursor where the expansion shall start.. Press and the status line shows a number of extra alternatives.
System START BUT
Program Allocation Printout Files Communication Setup IND S PHOTO STOP START ENS2 SW1 BUT MEM ── ──── ──── ─┬── / ──────────────────────────────────────────────( )─ M0000 │X00002 X00001 X00000 X00003 START
Modify block
│ MEM │ ── ─────────────── M0000
│ │ │ │
│
│ DRAW
mode
0001 (0001) OFFLINE
H-250
Intern
7.5 Ks
Go to "Hor-Exp" (Horizontal Expansion) using the arrow keys or press only "H", as the first character in the choice. Now there will be a space where the new contact can be written. Observe that when the block is modified the change is still not a part of the program code. You have to press or <*> to update the program.
Copyright Actron, A.B. 1994
123
Practical handling
5.2.3 Comparison contacts: System │START │ BUT
Program Allocation Printout Files Communication Setup IND S PHOTO STOP START │ ENS2 SW1 BUT MEM │ ├──┤ ├────┤ ├────┤ ├─┬──┤/├──────────────────────────────────────────────( )─┤ M0000 │ │X00002 X00001 X00000│X00003
ariso
│ │ │START │ │ MEM │ ├──┤ ├───────────────┘ │M0000 │ START ┌ │START MEM TEMPERATURE │ MEM │TEMPERATURE ├──┤ ├──┤ M0000 │ │M0000 │ └ │ │ │ │ │ │ │ │ DRAW
mode
┐ │ ├ │ ┘
(0001) OFFLINE
H-250
Intern
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
7.5 Ks
Continue with the next block. When the machine is started and the temperature is less than 30 Centigrade, the output ”HEAT” shall go High. Start to connect ”START MEM” in series with a Compare box. Create this through pressing the symbol on ”F7” Write ”TEMPERATURE” and allocate this to the first word input on the analog module (address WX40)
System START BUT
Program Allocation Printout Files Communication Setup IND S PHOTO STOP START ENS2 SW1 BUT MEM ── ──── ──── ─┬── / ──────────────────────────────────────────────( )─ M0000 │X00002 X00001 X00000 X00003 START
│ MEM │ ── ─────────────── │
are
M0000
HEAT ┐ TEMPERATURE WX0040 < ├──┤ ├──┤ ├─────────────────────────────────────────────( )─ M0000 30 Y00200 START MEM
┌
│ │ │
DRAW
│
mode
0002 (0002) OFFLINE
H-250
Intern
7.5 Ks
A box will appear with the comparison alternatives. Choose ”<” (less than) and then type the constant ”30” as a comparison reference. Connect the output ”HEAT” (Y200) in the same way as above.
Copyright Actron AB 1994, 2009
Practical handling
5.2.4 Arithmetic expressions: Let us program a last block, which contains an arithmetic box and an edge condition. When PHOTO SW 1 goes high, a register shall be increased by 7 and the result shall be shown on display segments, which are connected to the first 16 outputs on the first output module. At the same time another register shall be shifted to the right. System │START │ BUT
Program Allocation Printout Files Communication Setup IND S PHOTO STOP START │ ENS2 SW1 BUT MEM │ ├──┤ ├────┤ ├────┤ ├─┬──┤/├──────────────────────────────────────────────( )─┤ M0000 │ │X00002 X00001 X00000│X00003
Arithmetics
│ │ │ │START │ │ │ MEM │ │ ├──┤ ├───────────────┘ │ │M0000 │ │ │ HEAT │ │START ┌ ┐ │ MEM │TEMPERATURE WX0040│ │ < ├──┤ ├──┤ ├─────────────────────────────────────────────( )─┤ Y00200│ │M0000 │30 │ │ └ ┘ │ │PHOTO EDGE1 │ │ SW1 │ ├──┤ ├────┤ ├─ │ │X00000 DIF0 │ │ │ │ │ │ │ │ │ DRAW
mode
(0002) OFFLINE
H-250
Intern
7.5 Ks
The photo switch is serial connected to the edge memory (DIF memory). Press the symbol for arithmetic box ( +F7 ) and an empty box appears.
System
Program
Allocation
│┌────────────────────────┐ ├│ ││ ││ ││ ││
Choice of instruction ││ ││
== + B+ AND == S== SHR LSR WSHR MOV BCD SEG FIFIT BSET ABS JMP END CAL INT UNIT TRNS
S* * BB* OR R <> < S<> S< SHL ROR LSL BSR WSHL WBSR COPY XCG BIN DECO SQR BCU FIFWR FIFRD BRES BTS SGET EXT CJMP LBL CEND FOR SB RTS RTI RSRV DIST ADRIO RECV QTRNS
S/ / B/
│
<= S<= ROL BSL WBSL ENCO SWAP FUN NOT NEG
mode
Files
Communication
Setup
START MEM ──────────────────────────────────────────────( )─ │3 ┌──────────────────────────────────────────────┐
│
│
││
│
│ │ ┐ ─
NEXT START FREE ADRPR QRECV
│└────────────────────────┘ DRAW
Printout
│
(00 ─────────── toggles window
───────────
The most common instructions( =, +, -, etc.) can written directly only through typing the variable name. But if you need a full list of the instructions, press and the complete list will appear on the left side. From this box you can choose the instructions. Choose "+" through moving the cursor to the instruction and pressing or just through typing "+".
Copyright Actron, A.B. 1994
125
Practical handling
System │START │ BUT
Program Allocation Printout Files Communication Setup IND S PHOTO STOP START │ ENS2 SW1 BUT MEM │ ├──┤ ├────┤ ├────┤ ├─┬──┤/├──────────────────────────────────────────────( )─┤ │X00002 X00001 X00000│X00003 ┌──────────────────────────────────────────────┐│ = s + s │ │ │ d ││ │START │ │ ││ │ MEM │ │ ││
metic
├──┤ ├───────────────┘ │ │M0000 │ │ │ │START ┌ ┐ │ │ MEM │TEMPERATURE WX0040│ │ < ├──┤ ├──┤ ├─│ │M0000 │30 │ │ │ └ ┘ │ │PHOTO EDGE1 │ │ SW1 │ ├──┤ ├────┤ ├─ │ │X00000 DIF0 │ │ │ │ │ │ │ │ │ DRAW mode (00└───────────
toggles window
││ ││ ││ ││ ││ │┤ ││ ││ ││ ││ ││ ││ ││ ││ ││ ││ ───────────┘
Type the address for the sum (”d” in the box). The address shall be the first output word (WY20). Lets call this word ”DISPLAY”. Thereafter the address of the first term. Let us call this REGISTER1 and place it on address WR0. The second term is the constant 7. Then return to the box with the list of instructions through pressing . Choose the instruction ”SHR”. Type ”POSITION” as ”d” and let ”n” be 1 (to shift 1 position right every time) Press The box gets its normal shape. But the circuit itself is still not inserted in the program. Therefore press once more.
System │START │ BUT
Program Allocation Printout Files Communication Setup IND S PHOTO STOP START │ ENS2 SW1 BUT MEM │ ├──┤ ├────┤ ├────┤ ├─┬──┤/├──────────────────────────────────────────────( )─┤ M0000 │ │X00002 X00001 X00000│X00003
ing ess
ent
│ │ │ │START │ │ │ MEM │ │ ├──┤ ├───────────────┘ │ │M0000 │ │ │ │START ┌ ┐ HEAT │ │ MEM │TEMPERATURE WX0040│ │ < ├──┤ ├──┤ ├─────────────────────────────────────────────( )─┤ Y00200│ │M0000 │30 │ │ └ ┘ │ │PHOTO EDGE1 ┌──────────────────────────────────────────────┐│ = REGISTER1 + 7 │ SW1 │DISPLAY ││ ) ├──┤ ├────┤ ├────────────────┤SHR (POSITION , 1 ││ │X00000 DIF0 │ ││ │ └──────────────────────────────────────────────┘│ │ │ │ │ │ │ DRAW
mode
0003 (0003) OFFLINE
H-250
Intern
7.5 Ks
We have now made a small program. In normal mode you can not see the addresses in the arithmetic box. Press and toggle between ”Show address” and ”Show Comment”. For the arithmetic box the ”Show Comment” mode will look as below. │PHOTO EDGE1 ┌──────────────────────────────────────────────┐│ = WR0001 + 7 │ SW1 │WR0000 ││ , 1 ) ├──┤ ├────┤ ├────────────────┤SHR (WR0002 ││ │X00000 DIF0 │ ││ │ └──────────────────────────────────────────────┘│ Copyright Actron AB 1994, 2009
Practical handling
5.2.5 Syntax check:
Program menu
System START BUT
┌────────────────────┐
Program
Allocation
Printout
│PHOTO
EDGE1
Files
Communication
Setup
START Ladder MEM ├──┤ ├──│Instruction │───────────────────────────────────────────( )─ M0000 │X00002 │ACTTERM-H text Other module/program START Syntax check Info about project │ MEM ── ── Delete block(s) M0000 Undo │ │New project START HEAT ──────────────────── MEM TEMPERATURE WX0040 < ├──┤ ├──┤ ├─────────────────────────────────────────────( )─ M0000 30 Y00200 SW1
┌──────────────────────────────────────────────┐ DISPLAY
= REGISTER1
+
7
── ──── ──────────────── SHR (POSITION , 1 ) │X00000 DIF0 │ ────────────────────────────────────────────── │ DRAW
mode
0003 (0003) OFFLINE
H-250
Intern
7.5 Ks
The program syntax check can be done under the menu "Program" You should also write here the information about the project which shall be included in the final documentation printout. You can also toggle between ladder- and instruction programming or change to another programming method, like grafcet according to ActGraph. You can also delete a larger program area or start a new project. We have so far been working OFF-Line. Let us go ON-Line, transfer and test the program in the control system. You can now go through following procedure: Start to connect the PLC to the serial port of the computer and check inside the menu ”Setup-Communication” that the setup is correct. (The right serial port, right baud rate etc.) Normally select ”Standard values”.
System START BUT
omm nication enu
Program Allocation Printout Files Communication Setup IND S PHOTO STOP ┌───────────────────────┐START ENS2 SW1 BUT To PLC MEM ── ──── ──── ─┬── / ─────────────────── From PLC ──( )─ Verify against PLC M0000 │X00002 X00001 X00000 X00003 │ │ │ACTTERM-H text to PLC START Monitor PLC Trace/Trigg │ MEM │ PLC status ── ─────────────── M0000 Set PLC clock Data memory transfer │ START ┌ Force free occupation HEAT ┐ MEM TEMPERATURE WX0040 Clear PLC < ├──┤ ├──┤ ├──────────────────│Clean-up Communications ──( )─ M0000 30 (Terminal) Y00200 Setup │PHOTO EDGE1 ┌────────────────└─────────────────────── ─────┐ SW1 DISPLAY = REGISTER1 + 7 ) ── ──── ──────────────── SHR (POSITION , 1 │X00000 DIF0 │ ││
──────────────────────────────────────────────
│
DRAW
mode
0003 (0003) OFFLINE
Copyright Actron, A.B. 1994
H-250
Intern
7.5 Ks
127
Practical handling
Go to the communication menu. (You can here, beside transferring the program to or from the PLC system, create a monitor box, where free choice of memories and registers etc. can be shown and controlled during run. You can also get a status window, showing all information from the PLC to simplify trouble shooting etc. You can also adjust the real time clock. You can also copy the memory content of the PLC (for recipe handling, logging etc.) Transfer the program to the PLC system. The program and all PLC parameters are now transferred.
Copyright Actron AB 1994, 2009
Practical handling
5.2.6 ON-Line programming Go ON-Line through pressing +F9 Start the PLC through pressing +F7 Turn on monitor (show status) through pressing +F5 (There is a short way through. Press only +F5, which takes us through the complete chain (as this choice is ”highest up in the hierarchy”) It is now possible to program ON-Line. The changes are done in the same way as in OFF-Line When a block is changed or inserted, the PLC stops for a very short moment. But it will keep the status of memories and outputs. System START BUT
Program Allocation Printout Files Communication Setup IND S PHOTO STOP START ENS2 SW1 BUT MEM (( )) ──┤//├───────────────────────────────────────────── ── ├──┤ ├──── ──── ─┬── ────────────────────────────────────────────── X00002 X00001 X00000 X00003 M0000
│START MEM
─────────────── ── ─────────────── │M0000
Monitor
START ┌ │ MEM │TEMPERATURE < ── ── M0000
│
PHOTO SW1
└
30
EDGE1
┐ WX0040│
HEAT
─────────────────────────────────────────────(
┘
)─ Y00200
┌──────────────────────────────────────────────┐ DISPLAY = REGISTER1 (POSITION , 1
├──┤ ├────┤ ├────────────────┤SHR X00000 DIF0
+
7 )
──────────────────────────────────────────────
│ DRAW
mode
0003 (0003) ON LINE
RUN
H-250
Intern
7.5 Ks
Now the program can be checked through the function and through showing status on the screen. (the inverted fields are active or true). Monitor: The main monitor function is to show status in the ladder diagram on the screen. Here the true contacts (active lines) are shown through inverted colour. This makes it easy to detect errors etc. Monitor in arithmetic boxes: Monitor of values on the addresses in the arithmetic boxes is shown if you press +. You will first see decimal monitor. Next time you will see hexadecimal monitor and finally ”Short Comment/address” again. PHOTO SW1
EDGE1
┌──────────────────────────────────────────────┐ 332
├──┤ ├────┤ ├────────────────┤SHR X00000 DIF0
│PHOTO SW1
EDGE1
(
=
325 10 , 1
+
7 )
││Decimal
────────────────────────────────────────────── ┌──────────────────────────────────────────────┐ H014C
=
H0145
+ H0007
H000A , H0001 ) ├──┤ ├────┤ ├────────────────┤SHR ( ││Hexa │X00000 DIF0 │ ││decimal ──────────────────────────────────────────────
You can also effect status on each contact through pressing <1> or <0> on a contact or typing a new value of a register. Through pressing +F5 once more a larger monitor box will show on the screen. Here you can define what addresses and bit memories you want to monitor and control. (You can move the box on the screen with the arrow keys.) Copyright Actron, A.B. 1994
129
Practical handling
5.2.7 Store the program: System │START │ BUT
Program Allocation Printout Files Communication Setup IND S PHOTO STOP START │ ┌────────────────────────┐ ENS2 SW1 BUT MEM │ │List projects │ ├──┤ ├────┤ ├────┤ ├─┬──┤/├────────────│Load a project from file│────────( )─┤ M0000 │ │X00002 X00001 X00000│X00003 │Store a project in file │ │ │ │Insert macro from file │ │ │START │ │Save macro in file │ │ │ MEM │ │Delete file │ │ ├──┤ ├───────────────┘ │Rename file │ │ │M0000 │Generate EPROM files │ │
,
│ └────────────────────────┘ │ HEAT │ │START ┌ ┐ │ MEM │TEMPERATURE WX0040│ │ < ├──┤ ├──┤ ├─────────────────────────────────────────────( )─┤ Y00200│ │M0000 │30 │ │ └ ┘ │ │PHOTO EDGE1 ┌──────────────────────────────────────────────┐│ = REGISTER1 + 7 │ SW1 │DISPLAY ││ ) ├──┤ ├────┤ ├────────────────┤SHR (POSITION , 1 ││ │X00000 DIF0 │ ││ │ └──────────────────────────────────────────────┘│ │ │ │ │ │ │ DRAW
mode
0003 (0003) OFFLINE
H-250
Intern
7.5 Ks
It is recommended to save the project repeatedly during the development. Use a project name or a series of names so you can go back to the latest version. You can do this under the menu ”Files”. You can load and save projects. You can also load and save ”Macros”, which is a program part, which can be used multiple times as it is stored under a unique name. Choose ”Save project in file” and specify project name. If you have several projects on your computer you should create a ”user library” and choose this in the menu ”Setup-PC”. It will then be easier to keep track of the projects.
5.2.8 Documentation: System Program Allocation Printout Files Communication Setup │* Start cirquit with self hold │* │* Condition for start: Photo Switch 1 and Inductive sensor 2 │*
ents
│ │ │ │ │ │ START │ │START IND S PHOTO STOP ENS2 SW1 BUT MEM │ │ BUT ├──┤ ├────┤ ├────┤ ├─┬──┤/├──────────────────────────────────────────────( )─┤ M0000 │ │X00002 X00001 X00000│X00003 │ │ │ │START │ │ │ MEM │ │ ├──┤ ├───────────────┘ │ │M0000 │ │ │ │* Check of heating │ │* Analog input 1 senses that the temperature goes on when │ │* the temperature is below 30 Centigardes │ │ │ │ │ HEAT │ │START ┌ ┐ │ MEM │TEMPERATURE WX0040│ │ < ├──┤ ├──┤ ├─────────────────────────────────────────────( )─┤ DRAW
mode
0002 (0003) OFFLINE
H-250
Intern
7.5 Ks
To make the program even more easy to read, you can write a comment belonging to every ladder block. Place the cursor on each block and press . A window will open, where you can write text. The first five lines of this text will always be visible in the program. Press when you are ready.
Copyright Actron AB 1994, 2009
Practical handling
5.2.9 Printout:
Print out
System Program Allocation Printout Files Communication Setup │* Start cirquit with self ho┌──────────────────────┐ │ │* │Ladder │ │ │* Condition for start: Photo│Instruction │sensor 2 │ │* │Ladder and Instruction│ │ │ │Ladder and Allocation │ │ START │ │START IND S PHOTO STOP │Allocation │ │ BUT │Allocation packed │ ENS2 SW1 BUT MEM │ ├──┤ ├────┤ ├────┤ ├─┬──┤/├──│PLC Setup │────────────────────( )─┤ M0000 │ │X00002 X00001 X00000│X00003 │Cross reference │ │ │ │Block comments │ │ │START │ │ACTTERM-H texts │ │ │ MEM │ │Setup │ │
├──┤ ├───────────────┘ └──────────────────────┘ │ │M0000 │ │ │ │* Check of heating │ │* Analog input 1 senses that the temperature goes on when │ │* the temperature is below 30 Centigardes │ │ │ │ │ HEAT │ │START ┌ ┐ │ MEM │TEMPERATURE WX0040│ │ ├──┤ ├──┤ ├─────────────────────────────────────────────( )─┤ < DRAW
mode
0002 (0003) OFFLINE
H-250
Intern
7.5 Ks
When the program is ready you ought to make documentation. This is done under the choice ”Printout” Start to check so the printout setup is correct in ”Setup-Printout”. Thereafter choose the printout types you want.
5.2.10 End of project: When the program works, you have saved the project, you have made documentation and printout, you can leave the programming. System
Exit
Program
Allocation
Printout
Files
Communication
Setup
┌──────────────────┐h self hold │ │DOS command │ │ │Exit from Actsip-H│rt: Photo Switch 1 and Inductive sensor 2 │ │About Actsip-H │ │ └──────────────────┘ │ START │ │START IND S PHOTO STOP ENS2 SW1 BUT MEM │ │ BUT ├──┤ ├────┤ ├────┤ ├─┬──┤/├──────────────────────────────────────────────( )─┤ M0000 │ │X00002 X00001 X00000│X00003 │ │ │ │START │ │ │ MEM │ │ ├──┤ ├───────────────┘ │ │M0000 │ │ │ │* Check of heating │ │* Analog input 1 senses that the temperature goes on when │ │* the temperature is below 30 Centigardes │ │ │ │ │ HEAT │ │START ┌ ┐ │ MEM │TEMPERATURE WX0040│ │ < ├──┤ ├──┤ ├─────────────────────────────────────────────( )─┤ DRAW
mode
0002 (0003) OFFLINE
H-250
Intern
7.5 Ks
You can here also get information about version number etc. and make a temporary exit to DOS (if you want to make DOS commands).
Copyright Actron, A.B. 1994
131
Practical handling
5.3 Programmi ng with ActGraph: For a detailed description of grafcet, see separate description. Start the programming with . You will get a welcome window.
╔════════════════════════ ActGraph ═════════════════════════╗ ║ ║ ║
Welcome to the Actron ActGraph development software for Hitachi series J/E/EM/EB/HB/H200/H300+ PLC systems. is the HELP key.
║
+ is the HELP key for ON-LINE and monitor.
Press
╚═══════════════════════════════════════════════════════════
Press and you will come into a drawing screen. (You can start programming without deciding what type of PLC to connect and decide when the project is ready and the information about size is available. You can also change PLC afterwards and code the project for the new type.) As we in this case know that we are going to use an H series PLC (a H250 CPU) we can decide from the beginning. . Go to "Setup-PLC". The setup menu is identical to the one we saw in Actsip-H (see the previous chapter). Choose "Series H250", 8 k memory and in the I/O configuration we choose two 16 input modules, and two 16 output modules. All other setups are also identical to the setups in Actsip-H.
5.3.1 Programming: + Help
ACT
or Redraw
(Extra) screen
e ug monitor
on tor ON
Branch down
Start step
up
Step
on tor tar OFF PLC
Activity cond. Transition
Resetcond. Altern. branch
top PLC
Parallel
branch
LINE
Return Boxes
LINE +
jump
Copyright Actron AB 1994, 2009
Practical handling
You can also get a number of new choices, e.g. Search, in the bottom of the screen through pressing . Mark Search ACTTERM
Hor-exp
Copyright Actron, A.B. 1994
Ver-exp
Goto
+ comm
- comm
Erase comm
133
Practical handling
5.3.2 Start step: ┌──┐ │╔═╧═╗ │║000║ │╚═█═╝ └──┘
+.
Off-line
Series H
$
Press +F5 and create a start step.
5.3.3 Actions: ┌──┐ │╔═╧═╗ │║000║ │╚═╤═╝ └──┘
+.
╔═══════════════════════════ Actions ═══════════════════════════╗ GREEN LAMP█ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ╚═══════════════════════════════════════════════════════════════╝
Off-line
Series H
$
Press and open an action box.
Copyright Actron AB 1994, 2009
Practical handling
Insert the first action. ┌──┐ │╔═╧═╗ │║000║ │╚═╤═╝ └──┘
╔═══════════════════════════ Actions ═══════════════════════════╗ GREEN LAMP ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ╔═══════════════════════════════ Allocation ═══════════════════════════════╗ ║GREEN LAMP ║ ║[ Y00200 ] ║ ║ ║ ║Word ║ Output Output Marker Timer Counter U/D-Cnt ShiftRg Macro ║Bit ║ ╚══════════════════════════════════════════════════════════════════════════╝
+.
Off-line
Series H
$
If the address is not defined before, the automatic allocation will appear. Choose type of address and address. Press , The allocation window will disappear and the Cursor will go to the left of ”GREEN LAMP”. Here you can write a ”detailed action” (see below).
5.3.4 Transitions: ┌──┐ │╔═╧═╗┌─────────────┐ │║000╟┤ GREEN LAMP │ │╚═╤═╝└─────────────┘ │ ┼ START BUT └──█
+.
Off-line
Series H
$
If you do not want a detailed action, press and the action box will close. Create a transition through pressing . Press and write the transition condition. The transition can be a Boolean expression where "+" stands for a parallel connection and "*" stands for serial connection. E.g. ”START BUT * PHOTO SW * IND SENS2" See more detailed grafcet description. It can also be a comparison, see below.
Copyright Actron, A.B. 1994
135
Practical handling
5.3.5 Detailed Actions: ┌──┐ │╔═╧═╗┌─────────────┐ │║000╟┤ GREEN LAMP │ │╚═╤═╝└─────────────┘ │ ┼ STA╔═══════════════════════════ Actions ═══════════════════════════╗ FEEDER 1 │┌─┴─┐ ║ ║ CYLINDER 2 D=2.5s ││001│ ║ D ║ RUN LAMP =1 │└─┬─┘ ║ S ║ └──┘ ║ █ ║ ║ ║ ║ ║ ║ ║ ║ ║ ╚═══════════════════════════════════════════════════════════════╝
+.
Off-line
Series H
$
Series H
$
Write the new actions in this step. After each completed action, the cursor will go to the left of the action. Here you can define a detailed action. "D" stands for Time delay of the action. "L" stands for limited duration of the action . "C" stands for an extra condition to activate the action "S" stands for SET and RESET. "P" stands for a very short pulse (impulse) Type ”D” and set the time delay to 2.5 s.
┌──┐ │╔═╧═╗┌─────────────┐ │║000╟┤ GREEN LAMP │ │╚═╤═╝└─────────────┘ │ ┼ START BUT │┌─┴─┐┌──────────────────────┐ ││001├┤ FEEDER 1 │ │└─┬─┘│D CYLINDER 2 [D=2.5s]│ │ │ │+ RUN LAMP │ │ │ └──────────────────────┘ │ ┼ CYL 2 OUT │┌─┴─┐┌────────────┐ ││002├┤ LIFT DOWN │ │└─┬─┘└────────────┘ │ ┼ LIFT LOW │┌─┴─┐┌───────────┐ ││003├┤ FEEDER 1 │ │└─┬─┘└───────────┘ │ ┼ PHOTO SW 2 └──█
+.
Off-line
Continue in the same way and build the graph with one step, one transition, one step etc. In this way you can build a straight sequence of any length on the screen.
Copyright Actron AB 1994, 2009
Practical handling
5.3.6 Alternative branch: Normally the sequences are not completely straight. Therefore we have to use branches.. Let us start with an alternative branch, which is an alternative way to pass step 2 and 3 in the graph.
A
B
C
Place the Cursor on step 1 (after which the branch shall start). Press F7.
Place the Cursor on the lower horizontal part of the branch and pull down with the F4 key.
Place the Cursor on the new branch start and create the new steps and transitions as before.
┌──┐ ╔═ ═╗┌─────────────┐
┌──┐ ╔═ ═╗┌─────────────┐
═╤═ ───────────── START BUT │┌─┴─┐┌──────────────────────┐ 001 FEEDER 1 │└─█─ D CYLINDER 2 [D=2.5s]
═╤═ ───────────── │ ┼ START BUT │┌─┴─┐┌──────────────────────┐ 001 FEEDER 1 ─┬─ D CYLINDER 2 [D=2.5s]
┌──┐ ╔═ ═╗┌─────────────┐ │║000╟┤ GREEN LAMP ═╤═ ───────────── START BUT │┌─┴─┐┌──────────────────────┐ 001 FEEDER 1 │└─┬─┘│D CYLINDER 2 [D=2.5s]
────────────────────── │ ├───────────────────────────┐ │ ├───────────────────────────┘ CYL 2 OUT │┌─┴─┐┌────────────┐
────────────────────── ───────────────────────────┐ │ ┼ CYL 2 OUT │ │┌─┴─┐┌────────────┐ │
0 00
G RE EN L AM P
+ RUN LAMP
002
LIFT DOWN
│└─┬─┘└────────────┘ │ ┼ LIFT LOW ┌─ ─┐┌───────────┐ 003 FEEDER 1 ─┬─ ─────────── ──
PHOTO SW 2
0 00
GR EE N L AM P
+ RUN LAMP
002
LIFT DOWN
─┬─ ──────────── LIFT LOW ┌─ ─┐┌───────────┐ ││003├┤ FEEDER 1 │ │ │└─┬─┘└───────────┘ │ PHOTO SW 2 │ █─────────────────────────── ──
+ RUN LAMP
────────────────────── ───────────────────────────┐ │ ┼ CYL 2 OUT ┼ PHOTO SW 2 │┌─┴─┐┌────────────┐ ┌─┴─┐┌────────────┐ ││002├┤ LIFT DOWN │ │004├┤ CYL 3 OUT │ │└─┬─┘└────────────┘ └─┬─┘└────────────┘ │ ┼ LIFT LOW ┼ CYL 3 END │┌─┴─┐┌───────────┐ ┌─┴─┐┌────────────┐ ││003├┤ FEEDER 1 │ │005├┤ LIFT DOWN │ │└─┬─┘└───────────┘ └─┬─┘└────────────┘ PHOTO SW 2 LIFT LOW │ ├───────────────────────────█ └──┘
5.3.7 Parallel branch: We will now create a parallel branch., which shall work in parallel to step 1.
A
B
Place the cursor on the transition between step 0 and step 1, where the branch shall begin. Press F8 and an embryo of a branch will occur.
Pull the lower part of the branch down passed step 1 with F4. Create thereafter the parallel steps in the normal way.
┌──┐ │╔═╧═╗┌─────────────┐ │║000╟┤ GREEN LAMP │ │╚═╤═╝└─────────────┘ │ █ START BUT │ ╪═══════════════════════════╤ │ ╪═══════════════════════════╧ │┌─┴─┐┌──────────────────────┐ ││001├┤ FEEDER 1 │ │└─┬─┘│D CYLINDER 2 [D=2.5s]│ │ │ │+ RUN LAMP │ │ │ └──────────────────────┘ │ ├───────────────────────────┐ │ ┼ CYL 2 OUT ┼ PHOTO SW 2 │┌─┴─┐┌────────────┐ ┌─┴─┐┌────────────┐ ││002├┤ LIFT DOWN │ │004├┤ CYL 3 OUT │ │└─┬─┘└────────────┘ └─┬─┘└────────────┘ │ ┼ LIFT LOW ┼ CYL 3 END │┌─┴─┐┌───────────┐ ┌─┴─┐┌────────────┐ ││003├┤ FEEDER 1 │ │005├┤ LIFT DOWN │ │└─┬─┘└───────────┘ └─┬─┘└────────────┘ │ ┼ PHOTO SW 2 ┼ LIFT LOW │ ├───────────────────────────┘ └──┘
┌──┐ │╔═╧═╗┌─────────────┐ │║000╟┤ GREEN LAMP │ │╚═╤═╝└─────────────┘ │ ┼ START BUT │ ╪═══════════════════════════╤ │┌─┴─┐┌──────────────────────┌─┴─┐┌──────────┐ ││001├┤ FEEDER 1 │006├┤ LIFT UP │ │└─┬─┘│D CYLINDER 2 [D=2.5s]└─┬─┘└──────────┘ │ │ │+ RUN LAMP │ ┼ LIFT HIGH │ │ └──────────────────────┌─┴─┐ │ │ │007│ │ │ └─█─┘ │ ╪═══════════════════════════╧ │ ├───────────────────────────┐ │ ┼ CYL 2 OUT ┼ PHOTO SW 2 │┌─┴─┐┌────────────┐ ┌─┴─┐┌────────────┐ ││002├┤ LIFT DOWN │ │004├┤ CYL 3 OUT │ │└─┬─┘└────────────┘ └─┬─┘└────────────┘ │ ┼ LIFT LOW ┼ CYL 3 END │┌─┴─┐┌───────────┐ ┌─┴─┐┌────────────┐ ││003├┤ FEEDER 1 │ │005├┤ LIFT DOWN │ │└─┬─┘└───────────┘ └─┬─┘└────────────┘ │ ┼ PHOTO SW 2 ┼ LIFT LOW │ ├───────────────────────────┘ └──┘
Copyright Actron, A.B. 1994
137
Practical handling
5.3.8 Return branch: Finally we will create a return branch. When the inductive sensor "IND SENS 2" is effected before ”PHOTO SW 2”, after step 3, a new sequence shall be activated and thereafter step 2 and step 3 shall be repeated.
B Cursor on step 3 and press F9. ═╗┌─────────────┐ 0╟┤ GREEN LAMP │ ═ ───────────── START BUT ═══════════════════════════╤ ─┐┌───────────────────── ┌─ ─┐┌──────────┐ 1├┤ FEEDER 1 ││006├┤ LIFT UP │ ─┘│D CYLINDER 2 [D=2.5s]│└─┬─┘└──────────┘ + RUN LAMP LIFT HIGH ───────────────────── ┌─ ─┐ 007
─┬─ ═══════════════════════════ ───────────────────────────┐ CYL 2 OUT PHOTO SW 2 ─┐┌────────────┐ ┌─ ─┐┌────────────┐ 2
LIFT DOWN
─ ──────────── LIFT LOW ─┐┌───────────┐ 3├┤ FEEDER 1 │ ─ ───────────
004
CYL 3 OUT
─┬─ ──────────── CYL 3 END ┌─┴─┐┌────────────┐ │005├┤ LIFT DOWN │ ─┬─ ──────────── LIFT LOW
PHOTO SW 2
───────────────────────────
Pull up the upper part of the branch with +F4 above step 2. Create the return steps in the normal way. ┌────────────────────┐ │ ╔═╧═╗┌─────────────┐ │ ║000╟┤ GREEN LAMP │ ═╤═ ───────────── START BUT ═══════════════════════════╤ │ ┌─┴─┐┌───────────────────── ┌─ ─┐┌──────────┐ │ │001├┤ FEEDER 1 ││006├┤ LIFT UP │ │ └─┬─┘│D CYLINDER 2 [D=2.5s]│└─┬─┘└──────────┘ + RUN LAMP LIFT HIGH │ │ └───────────────────── ┌─ ─┐ 007
│
─┬─ ═══════════════════════════ ├───────────────────────────┐ CYL 2 OUT
PHOTO SW 2
│ ┌─────────────────┤ ┌─┴─┐┌────────────┐ │ ┼ OUT 4 ┌─┴─┐┌────────────┐ │004├┤ CYL 3 OUT │ │┌─┴─┐┌───────────┐│002├┤ LIFT DOWN │ └─┬─┘└────────────┘ 008 FEEDER 4 CYL 3 END ─┬─ ──────────── │└─┬─┘└───────────┘ ┼ LIFT LOW ┌─┴─┐┌────────────┐ │ ┼ LIFT HIGH ┌─┴─┐┌───────────┐ │005├┤ LIFT DOWN │ │┌─┴─┐┌──────────┐ │003├┤ FEEDER 1 │ └─┬─┘└────────────┘ 009 LIFT UP LIFT LOW ─┬─ ─────────── ─┬─ ────────── │ ┼ IND SENS 2 │ ───────────────── │ ┼ PHOTO SW 2 │ ─────────────────────────── └────────────────────
5.3.9 Super conditions: We are now going to create a super condition for the graph.. There are two types: -"Activity condition", which is a logic condition for the graph to be activated. -"Reset condition", which is a logic condition, which resets the graph and makes the graph return to the start step.
B Shift>+F6 and the window for activity condition will appear. e condition and press . hoose the panel switch ”AUTO” as an activity condition, nables Auto/manual control of the graph.
The condition is now shown above the graph (after "A:") Press +F7 to write the Reset condition. This will also stay above the graph.
Copyright Actron AB 1994, 2009
Practical handling ┌────────────────────┐ │ ╔═╧═╗┌─────────────┐ │
0 00
GR EE N L AM P
001
FEEDER 1
R:RESTART A:AUTO
═╤═ ───────────── START BUT ╪═══════════════════════════╤ ┌─ ─┐┌──────────────────────┌─ ─┐┌──────────┐ 006
LIFT UP
│ └─┬─┘│D CYLINDER 2 [D=2.5s]└─┬─ ────────── + RUN LAMP LIFT HIGH ╔═════════════════════════ Boolean expression ══════════════════════════╗ ║ActivCond: AUTO ║ ╚══════════════════════════════════════════════════════════════════════ ═╝ ═══════════════════════════ ───────────────────────────┐ │ ┼ CYL 2 OUT ┼ PHOTO SW 2 ┌───────────────── ┌─ ─┐┌────────────┐ OUT 4 004 CYL 3 OUT ┌─ ─┐┌────────────┐ │┌─┴─┐┌───────────┐│002├┤ LIFT DOWN │ └─┬─┘└──────────── 008 FEEDER 4 CYL 3 END ─┬─ ──────────── LIFT LOW ─┬─ ─────────── ┌─ ─┐┌────────────┐ │ ┼ LIFT HIGH ┌─┴─┐┌───────────┐ │005├┤ LIFT DOWN │ FEEDER 1 │┌─┴─┐┌──────────┐ 003 ─┬─ ──────────── 009 LIFT UP LIFT LOW ─┬─ ─────────── ─┬─ ────────── │ ┼ IND SENS 2 │ ───────────────── │ ┼ PHOTO SW 2 │ │ ├───────────────────────────┘ ────────────────────
Copyright Actron, A.B. 1994
┌────────────────────┐ ╔═ ═╗┌─────────────┐ 0 00 G RE EN L AM P │ ╚═╤═╝└─────────────┘ START BUT ═════════════════════ ┌─ ─┐┌────────────────── 001 FEEDER 1 ─┬─ D CYLINDER 2 [D=2 │ │ │+ RUN LAMP │ │ └────────────────── │
═════════════════════ ───────────────────── CYL 2 OUT
│ ┌─────────────────┤ OUT 4 ┌─ ─┐┌────────────┐ LIFT DOWN ┌─ ─┐┌───────────┐ 002 ││008├┤ FEEDER 4 │└─┬─┘└──────────── LIFT LOW ─┬─ ─────────── LIFT HIGH ┌─ ─┐┌───────────┐ │┌─┴─┐┌──────────┐ │003├┤ FEEDER 1 │ 009 LIFT UP ─┬─ ─────────── ─┬─ ────────── IND SENS 2 ───────────────── PHOTO SW 2 │ ├───────────────────── └────────────────────┘
139
Practical handling
5.3.10 Logic boxes: It is not natural everywhere to describe all the application with graphs. Specially where it is a question of a pure logic problem it is more natural to place the logic in a ”Logic box”. A logic box is general. Therefore it is described in Boolean expressions.
10 and choose Box”. Press .
─────────────┐ GREEN LAMP ───────────── ART BUT ═══════════════════════ ──────────────────────┌ FEEDER 1 D CYLINDER 2 + RUN LAMP
[D=2.5s]
──────────────────────┌ ═══════════════════════ ─────────────────────── L 2 OUT ┌ ────────────┐ LIFT DOWN ──────────── FT LOW ┌ ────────╔═══════════╗ FEEDER Graph ──────── Logical box Action box Macro box
═══════════ ─────────────────────── OTO SW 2
B
C
Here the output side of the expressions are written on the left side. Thereafter the cursor goes to the right and a Boolean expression can be written. Thereafter a new expression can be written and so on.
When all expressions are written, press once more and the box will be closed with the inputs on the left side and the outputs to the right side of the box. Press +F6 and define the activity condition ”/AUTO”. (which means NOT AUTO (which is the same as ”manual”.
┌────────┐ │ │ └────────┘
════════╤ ─────╔═════════════════════════════ Logical box ═ ║LIFT DOWN =PUSHB 1*/LIFT LOW =2.5s║LIFT UP =PUSHB 2*/LIFT HIGH ║ ─────║ ║ ║ ═════║ ─────║ ╚═══════════════════════════════════════════ ┌─┴─┐┌────────────┐ │004├┤ CYL 3 OUT │ └─┬─┘└────────────┘ ┼ CYL 3 END ┌─┴─┐┌────────────┐ │005├┤ LIFT DOWN │ └─┬─┘└────────────┘ ┼ LIFT LOW │ │ │ │ ────────┘
A:/AUTO
┌────────┐ ├LIFT ├LIFT │ │ └────────┘
PUSHB 1┤ LIFT LOW┤ PUSHB 2┤ LIFT HIGH┤
═══╤ ─┌─┴─┐┌──────────┐ │006├┤ LIFT UP │ ]└─┬─┘└──────────┘ │ ┼ LIFT HIGH ─┌─┴─┐ │007│ └─┬─┘ ═══╧ ───┐ ┼ PHOTO SW 2 ┌─┴─┐┌────────────┐ │004├┤ CYL 3 OUT │ └─┬─┘└────────────┘ ┼ CYL 3 END ┌─┴─┐┌────────────┐ │005├┤ LIFT DOWN │ └─┬─┘└────────────┘ ┼ LIFT LOW │ │ │ │ ───┘
DOWN UP
5.3.11 Macro boxes: In some cases it is necessary to use specific PLC instructions. These can be programmed in another type of box called ”Macro Box”. In this box you can use the special instructions of the H series and the programming is done exactly as in Actsip-H. You can store a macro under a special name and you can use this macro in other projects.
Copyright Actron AB 1994, 2009
Practical handling
A
B Now a drawing screen will open, which looks like in Actsip-H. Make the programming as in Actsip-H. The addresses which are programmed here are different from the addresses in the graph programming. (The programming of the macro boxes is isolated)
Press F10 and choose ”Macro box”. An empty box will occur. Write a name and press
A:/AUTO
======================== CALC2 ============================
┌────────┐ ├LIFT
PUSHB 1┤
DOWN
LIFT LOW PUSHB 2┤ LIFT HIGH
════════╤ ──────┌─┴─┐┌──────────┐ 006 LIFT UP =2.5s]└─┬─┘└──────────┘ LIFT HIGH
│ ────────
LIFT UP
╒════════╕ ▒CALC1▒▒ └────────┘
──────┌─ ─┐ │007│ ─┬─ ════════ ────────┐ ┼ PHOTO SW 2 ┌─┴─┐┌────────────┐ 004 CYL 3 OUT ─┬─ ──────────── CYL 3 END
┌─ ─┐┌────────────┐ │005├┤ LIFT DOWN │ ─┬─ ──────────── LIFT LOW
│ │ ────────┘
│ ┌───────────────────────────────────────┐│ = FACT1 * │ │PROD ││ , 2 ├────────────────┤WSHR (PROD ││ , PROD │ │SGET (RESULT ││ │ └───────────────────────────────────────┘│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ DRAW
C
mode
) )
0001 (0001) OFFLINE
A:/AUTO
When the Macro is ready, press Approve (or change) the new addresses, which are suggested. Thereafter the new macro is shown.
FACT2
┌────────┐ LIFT ├LIFT
PUSHB 1 LIFT LOW┤ P US HB 2 LIFT HIGH
DOWN UP
──────── ╒════════╕ FACT1╡▒CALC2▒▒╞PROD FACT2╡▒▒▒▒▒▒▒▒╞RESULT PROD╡▒▒▒▒▒▒▒▒│ ────────
════════╤ ──────┌─┴─┐┌──────────┐ │006├┤ LIFT UP │ =2.5s]└─┬─┘└──────────┘ │ ┼ LIFT HIGH ──────┌─ ─┐ 007 └─┬─┘ ════════ ────────┐
5.3.12 Action boxes: In some cases there is a need to make calculations and control, which is completely independent from a graph. There is a third type of box for this purpose. This is called ”Action box”. It is treated in the same way as the action window inside a graph. Press F10 and choose ”Action box”. An empty box will occur. Here you can write mathematical expressions together with logic and comparisons. A:/AUTO
┌────────┐ ├LIFT
PUSHB 1┤
Copyright Actron, A.B. 1994
DOWN
141
Practical handling LIFT LOW┤ ├LIFT UP ╔═══════════════════════════ Actions ═══════════════════════════╗ VALUE1 = COUNTER1*18 ║ ║ ANALOGOUT3 =ANALOGIN2/RESULT+34 ║ ║ G = F*H/(I+J)-K*15 ════════║ ║ ──────┌─║ ║ │0║ ║ =2.5s]└─║ ║ │ ║ ║ ──────┌─║ ║ │0╚═══════════════════════════════════════════════════════════════╝ └─┬─┘ ┌───┴────┐ ════════╧ │ │ ────────┐ └───┬────┘ ┼ PHOTO SW 2 ┌─┴─┐┌────────────┐ │004├┤ CYL 3 OUT │ └─┬─┘└────────────┘ ┼ CYL 3 END ┌─┴─┐┌────────────┐ │005├┤ LIFT DOWN │ └─┬─┘└────────────┘ ┼ LIFT LOW │ │ │ │ ────────┘ +.
Off-line
Series H
$
Copyright Actron AB 1994, 2009
Practical handling
When this is ready, press and the box will close. You can see the difference between a logic box and an action box as an action box has a vertical line on the top and on the bottom. (It can also have double lines on the side. These will symbolise values.) A:/AUTO
════════╤ ──────┌─┴─┐┌──────────┐ │006├┤ LIFT UP │ =2.5s]└─┬─┘└──────────┘ │ ┼ LIFT HIGH ──────┌─┴─┐ │007│ └─┬─┘ ════════╧ ────────┐ ┼ PHOTO SW 2 ┌─┴─┐┌────────────┐ │004├┤ CYL 3 OUT │ └─┬─┘└────────────┘ ┼ CYL 3 END ┌─┴─┐┌────────────┐ │005├┤ LIFT DOWN │ └─┬─┘└────────────┘ ┼ LIFT LOW │ │ │ │ ────────┘ +.
┌────────┐ PUSHB 1┤ ├LIFT DOWN LIFT LOW┤ ├LIFT UP PUSHB 2┤ │ LIFT HIGH┤ │ └────────┘ ╒════════╕ FACT1╡▒CALC2▒▒╞PROD FACT2╡▒▒▒▒▒▒▒▒╞RESULT PROD╡▒▒▒▒▒▒▒▒│ └────────┘ ┌───┴────┐ │ ╞VALUE1 │ ╞ANALOGOUT3 │ ╞G └───┬────┘
Off-line
Series H
$
5.3.13 Mathematical expressions: Mathematical expressions (calculations etc.), which are not connected directly to the specific PLC instructions can be written either in action boxes or actions connected to the graph. If the action, written on the left side in the box, e.g. ”VALUE1” is defined as a ”word” the expression will be treated as a mathematical expression instead of a normal logic action. The following symbols can be used: E.g. C A = B*C/D+E*(F-G)+100 C=TEMP>100*PROG1 It is possible to write a detailed action also in front of a mathematical action.
5.3.14 Comparison expressions: In all logical expressions comparisons and logics can be freely mixed. (See above, where the condition ”C”, to let the mathematical expression be executed, is that ”TEMP” is > 100 (Centigrade) and PROG1 is chosen. These comparison can also be written as transitions between steps in graphs.
E.g.
LEVEL < 100 * TIMER1
Copyright Actron, A.B. 1994
The condition for a transition from one step to another is that the level is below 100 and that the timer ”TIMER1” is out.
143
Practical handling
5.3.15 Zoom: To achieve maximum overview of during the work, you can both amplify and minimise the objects on the screen during the programming. Press < + > to increase. Press < - > to decrease. ELEMENT You will get the question: BRANCH GRAPH This means that you can choose different zooming for different parts of a project and different for different parts of a graph. If you choose ”ELEMENT” the step where the cursor is will decrease or increase. If you choose ”BRANCH” the branch where the cursor is will decrease or increase. The same thing happens if you choose GRAPH. Size 1
You will here see all significant information simultaneously in action boxes and transitions. This size is default.
(Size 2
All boxes will have the same width. )
This size will give a rough structure of the project. If is still possible to show the flow in a project during monitoring. This is practical when you want as much of the project as possible on the screen simultaneously. Example: Size 3
┌───────┐ │ ╔╧╗ │ ╚╤╝ │ ╪════╤ │ ┌┴┐ ┌┴┐ │ └┬┘ └┬┘ │ │ ┌┴┐ │ │ └┬┘ │ ╪════╧ │ ├────┐ │ ┌────┤ ┌┴┐ │ ┌┴┐ ┌┴┐ └┬┘ │ └┬┘ └┬┘ ┌┴┐ │ ┌┴┐ ┌┴┐ └┬┘ │ └┬┘ └┬┘ │ │ └────┤ │ │ ├────┘ └───────┘
+.
┌──┐ │ ╔╧╗ │ ╚╤╝ │ ┌┴┐ │ └┬┘ │ ┌┴┐ │ └┬┘ │ ┌┴┐ │ └┬┘ │ ┌┴┐ │ └┬┘ │ ┌┴┐ │ └┬┘ │ ┌┴┐ │ └┬┘ │ ┌┴┐ │ └┬┘ │ ┌┴┐ │ └┬┘ └──┘
Off-line
A:/AUTO
┌────────┐ PUSHB 1┤ ├LIFT DOWN LIFT LOW┤ ├LIFT UP PUSHB 2┤ │ LIFT HIGH┤ │ └────────┘ ╒════════╕ FACT1╡▒CALC2▒▒╞PROD FACT2╡▒▒▒▒▒▒▒▒╞RESULT PROD╡▒▒▒▒▒▒▒▒│ └────────┘ ┌───┴────┐ │ ╞VALUE1 │ ╞ANALOGOUT3 │ ╞G └───┬────┘
Series H
$
The different sizes can be used freely together. The printouts you order will show the same size as you have chosen on the screen.
Copyright Actron AB 1994, 2009
Copyright Actron AB 1994-2009
145
6 Hand programming units: There are two types of hand programmers: - PGM-GPH Portable graphic programmer. - PGM-CHH Instruction word programmer. For more information, see Hitachi manuals.
Copyright Actron AB 1994-2009
146
THIS PAGE INTENTIONALLY LEFT BLANK
Copyright Actron AB 1994-2009
147
Common description of the hardware
Common description of the hardware
Copyright Actron AB 1994, 2009
Common description of the hardware
7 Common description of the hardware:
7.1 General specification: Operation temperature Storage temperature Operation humidity Storage humidity Allowable instantaneous power failure time Vibration resistance Noise resistance
0 to 55 ° C -10 to 75 ° C 20% to 90% (non condensing) 10% to 90% (non condensing) 20 ms Frequency 16.7 Hz, multi amplitude 3 mm in X, Y and Z directions. 1500 V p-p in 100 ns with a pulse width of 1 μs. Based on NEMA ICS2-230-42 to 45 (except for inputs) Static noise 3000 V applied to exposed metal. 20 MΩ or more between external AC terminals and FG (ground) terminal. 1500 VAC in 1 minute between AC terminals and FG (ground) terminal. 100 Ω Must be free from corrosive gases such as ammonium, hydrogen sulphide etc. Natural air cooling
Insulation resistance Dielectric strength Grounding Atmosphere Cooling
7.2 Basic specification: HB -
Max. amount modules Amount of I/O exclusive remote I/O
H200 H250 16 (with BSM-9)
H252 max. 29 (with BSH)
up to 128 up to 256 up to 512
up to 232 up to 464 up to 928
H300-H2002 64 (for H2000/2)
up to 128 8-I/O modules 16-I/O modules 32-I/O modules 64-I/O modules
Process system Cycle time
Logic instructions Arithmetic instructions
Program memory Instructions
Logic Arithmetic
I/O updating Bit memories (R) Word memories (WR) Special memories
bits words
CPU-Link Remote Bit/Word (M/WM) Timers/Counters Timer Preset Counter Preset Edge detection Real time clock
Copyright Actron, A.B. 1994
up to 128 up to 256 up to 512
up to 1024 up to 2048 up to 4096
Cyclic program scan procedure. 1.5 μs/ 1.5 μs/ 0.6 μs/ 0.25 μs/ min 0.4 μs/ instruction instruction instruction instruction instruction >10 μs/ >10 μs/ >5 μs/ >3 μs/ >5 μs/ instruction instruction instruction instruction instruction 7.6 k steps 7.6 k steps 15.7 k steps 15.7 k steps up to 48 k steps 17 17 17 17 17 54 49 73 124 up to 124 direct direct, direct, I/O-copying direct I/O-copying I/O-copying 1984 1 k words 1 k words 1 k / 17 k 1 k / 17 k 1 k / 17 k / 50 k (WR0-3FF) (WR0-3FF) words words words 64 64 128 x 2 (256) 128 x 2 (256) 1024 words /16384 bits bits bits 128 x 4 (512) bits 512 bits/ /32 words x 4 4092/256 16384/1024 512 (TD+CU etc.) 0-255 for timers 0 to 65535 s with time base 0.01, 0.1 and 1 s 0 to 65535 128 positive/128 negative 512 positive/512 negative Year, month,day, week day, hour, minute and second (not H300-H2000)
149
Common description of the hardware
7.3 Process system: 7.3.1 In- and output update. All H CPUs can work with direct update. The H200 CPU *1 can also work with I/O copying. I/O-copying (or Refresh): The input status is read before the program scan and the outputs are written directly after the program scan. During the program scan the status of the inputs and outputs are only available in a memory area, which reflects the I/O status. Direct update: This means that the physical status of the inputs are read every time the address is used in the program. Every time an output is effected by the logic in the program it will also be updated physically.
I/O copying (refresh)
Direct I/O update
Y200
Program scan
Program
Logic
Program scan
Y202
Scan Program scan 1
Program scan 2
Scan
Program scan 3
Max 2 program scans
X115 Y202
Scan
X115 Y202
Min 1 program scan
Max 1 program scan
Min filter time and time for logic
Practical differences: with direct update you will get a faster response time between in- and outputs. (Max. 1 program cycle, while I/O copying can cause max. 2 program cycles, see drawing above)
*1
To change between I/O copying (refresh) and direct updating on the H200 CPU, change dip switch 3 on the component side of the CPU board. Direct update I/O copying (refresh)
= OFF (factory setting) = ON
Copyright Actron AB 1994, 2009
Common description of the hardware
To be sure that the contact has the same status during all the scan, do as follows:
WARNING! It can be different status of the contact during the same program scan.
7.4 Interrupt : There are different types of interrupts in a normal scan program. - Periodic interrupt. Occurs every 10 ms and updates timer values etc. - 10 ms interrupt. Program part executed every 10 ms. - 20 ms interrupt. Program part executed every 20 ms. - 40 ms interrupt. Program part executed every 40 ms. - External interrupts. interrupt from input signals.
Copyright Actron, A.B. 1994
Periodic update 10 ms interrupt 20 ms interrupt
Normal program
External interrupt
40 ms interrupt
151
Common description of the hardware
END INT 1 20 ms interru t
RTI
The periodic interrupt has the highest priority. It will interrupt an external interrupt. After a completed interrupt routine the program returns to the program line where it was interrupted. The periodic interrupt comes without any action from the user. If the rest of the interrupt routines shall be executed you have to specify this with the instructions INT n" and RTI and write a program inbetween, which shall be executed when it is an interrupt.
INT 17 External interru t
RTI For more information about the INT- and RTI-instructions, see page 107.
Copyright Actron AB 1994, 2009
Common description of the hardware
Types of interrupts: Interrupt no. INT0 INT1 INT2
Interrupt with 10 ms interval Interrupt with 20 ms interval Interrupt with 40 ms interval
INT16
Interrupt input no. 0
INT17 INT18 INT19 INT20 INT21 INT22 INT23 INT24 INT24 INT25 INT26 INT27 INT28 INT29 INT30 INT31
Interrupt input no. 1 Interrupt input no. 2 Interrupt input no. 3 Interrupt input no. 4 Interrupt input no. 5 Interrupt input no. 6 Interrupt input no. 7 HB: High speed counter = Preset Interrupt input no. 8 Interrupt input no. 9 Interrupt input no. 10 Interrupt input no. 11 Interrupt input no. 12 Interrupt input no. 13 Interrupt input no. 14 Interrupt input no. 15
X0+base address for module (X0 for HB) X1+ " X2+ " X3+ " X4+ " X5+ " X6+ " X7+ " X8+ " X9+ " X10+ " X11+ " X12+ " X13+ " X14+ " X15+ "
HB
H200
Yes Yes Yes
Yes Yes Yes
H250H2002 Yes Yes Yes
Yes
Yes
Yes Yes Yes Yes Yes Yes Yes Yes
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
Interrupt with a lower number has a higher priority. This means e.g. that a 10 ms update will interrupt a routine, which takes care of a interrupt input.. Periodic interrupt 10 ms interrupt 20 ms interrupt 40 ms interrupt
Input interrupt, high priority - ” - , low priority Normal scan
Observe that each interrupt takes time from the normal program scan. You can use a Watch Dog timer to check if the program execution takes too long time. (The Watch dog timer is 100 ms if nothing else is defined) The preset of this timer is defined under ”Setup- PLC” in the programming software. You can define a value between 10 ms and 2550 ms.
Copyright Actron, A.B. 1994
153
Common description of the hardware
7.5 Installation: 7.5.1 Mounting in general: (All PLC types) The control system has to be mounted vertically because of the ventilation. It is also possible to mount the system upside down if there is a reason for this. Correct mountin Correct mountin
Incorrect mounting ! Incorrect mounting !
Copyright Actron AB 1994, 2009
Common description of the hardware
-Reserve a distance of 50 mm from top and bottom of the PLC-Be careful, so no dirt, metal from hole drilling etc. falls into the PLC.
min 10 mm
-Avoid installing the PLC directly above a heat producing object, e.g. a transformer or power resistor.
Cable channels min 50 mm
- Keep a good distance from high voltage wiring etc. - Avoid installation directly in sun shine and where condensation, dust, oil smoke, corrosive gas can occur.
min 50 mm min 10 mm
- Avoid installation of the PLC where there is a risk of too much vibrations or shaking .
Copyright Actron, A.B. 1994
155
Common description of the hardware
7.5.2 Power connection: 220 VAC /110 VAC The system can work either with 220 VAC or 110 VAC as a standard HB H200-H252 H300-H2002 Flexible power supply Jumper on the power Jumper on the front supply board
7.5.3 24V DC Series H200-H252 has a 24 V DC power supply module, which is called PSM-D. Series H300-H2002 has a 24 V DC power supply module, which is called AVR-04DH or AVR-08DH.
7.5.4 Cable connection: Use if possible a wire with the area 2 mm2 for the power supply an ground. The ground can be shared with a relay panel etc. But it should not be shared with equipment, which produces noise (e.g. tyristor equipment, electric welding machines). It should be a maximum of 100 Ω to ground . 220/110 VAC
If there is much noise on the power connection, you should connect a noise filter.
noice filter
7.5.5 Input connections: DC Inputs: HB and H200-H252 have external 24 V terminal connections.
Copyright Actron AB 1994, 2009
Common description of the hardware
7.5.6 Output connections: RELAY Output
TRANSISTOR Output
PLC Outputs
AC or DC supply
TRIAC Output
PLC Outputs
PLC Outputs
DC supply
AC supply
Relay output: If the load is inductive and increases 10 VA, connect a RC circuit of 0.1 μF + 100Ω 100Ω in parallel to the load. If the load is fed by direct current, connect a diode in parallel to the load. Transistor outputs: Connect a diode in parallel to the load. Triac output: If the load is inductive or the load is very small, connect a RC- circuit of 0.1 μF + 100Ω 100Ω in parallel to the load.
7.5.7 The CPU-port: The CPU-port has a protocol, which can be used to communicate between the computer and the PLC. This can e.g. be used to connect SCADA system like Turbolink, Wizcon, etc. It is also used by Actsip and ActGraph. The protocol is also used for special communications. There are two products for this purpose:
H-COMM: Software routines written written in Microsoft C, containing containing the task code handling and communication routines. routines. It is using the ”Green leaf library”. This can be implemented by the user in the special project.
ActServ: DDE server for the H family PLCs This means that Microsoft Windows programs, which support DDE, can communicate directly with the PLC. (DDE means Dynamic Data Exchange and is supported e.g. by Excel and Visual Basic. Some very interesting applications are possible together with Excel, where the data can be collected automatically into Excel, calculated and presented in graphics. It is also possible to set values and control the PLC from Excel. For more detailed information, see separate description of ActServ.
Copyright Actron, A.B. 1994
157