A SIMULATION APPROACH BEFORE USING THE INDUSTRIAL MICROCOMPUTER CONTROLLER INFORMATICA 3/1988 UDK 681.326.06:519.876.5 Anton Zorman Maksimiljan Gerkeš Viljem Žumer Krista Rizman Tehniška fakulteta Maribor In this paper we deabribe a simulation packet that enables the verification of the softvare portion of the controller before implementating the controller on a real object. This program is unlque of Its kind, as far as ne know, because it enables the exaniination of the controller's behavior in planner'3 Morkplace and so conaiderablv reduces start expenses. The simulation packet enables controlled execution of the us©r's program, clearly arranged writing out of data on the screen or on the printer and gives a chance for data modification. SIMDLAGIJSKI PRISTOP PRED UPORABO INDDSTRIJSKKOA MIKRORACDNALHIfiEEOA KRMILNIKA. V članku opisani siBUlaciJski paket omogoča verif ikaci.lo "rffi^rf^skega dela krmil1a pred vgraditvijo krmilnika na objekt. Po nam znanih podatkih Je to edini tovrstni program, ki omogoča preizkus obnašanja krmilja na projektantovem delovnem mestu in s tem znatno znižanje zagonskih stroSkov objekta. SlBulaoiJski paket omogoisa. prikaz izva.1an.1a uporabniškega programa, ur&i^n In preglsden lapls vrednosti na zaslon ali na tiskalnik in možnost 3premlnJan.1a vrednosti podatkov. 1 Initial oonsiderations about the industrial microcomputer oontroller and It's oinulation Requests for a system which upgrades standard progr.ammable controller functions came from industry. Initial efforts were made by Metalna, Maribor. After it's definition phase the project was supported by the Research Society of Slovenia (Raziskovalna Skupnost Slovenije) . Intentioa and praotical use of tha industrial microcomputer controller The controller is intended for control in capital equipment facilities plants, where heavy environment conditions and the immense equipment costs. do not allow any compromise. A number of unique functions wQre built in the controller to obtain the required functionality. Special attention wa3 dedicated to the user's program - control application development and verification tools. The paper decribes a unique part of the user development and verification software which allovs controlled application verification at the planner's workplace. This function reduces starting expenses when a capital object is put into work. With convenlent tools, software design methods and simulation, most of the mistakes, bugs and imperfections of the controller's software are dlscovered and removed before iraplementation on an object. Thus, the simulation of the controller's 3oftware can be carried out in different way3. Module simulation is specially efficient. It allows that only verified software blocks are put together into larger structures. Typical software modules are functions and sobroutines like structures in high level language, and asserabler like macros. Simple use of the simulation packet is assured with it's hlerarchical tree atructurod menu. The user aelects from the menu on the screen the actions to be executed. Each action is determined with a function key on the keyboard. The user selects the desired action by pressing the adequate function key on the keyboard. Figure 1 show3 an example of this principle. N E T « L U • Rtrlbor I K O U 9 rn « I CONTROLLER S 1 n U L « T I O N Fl SIHULATION F8 EKD Of 81KU.«TI0II Fig. 1: The initial simulation menu. After selecting the adequate menu's windoH of a selected action, it lights up in yellow colour. This light is an advertiseraent for the user to notice which action he had selected. In the same way, the simulator advertises the user 17 when he returns back over the menues. If there is no special, objective reasons, the selected action is executed inunediatel/. The user can present his program for the controller eitheir in a graphic form, the so-called coatact netHorks, or in textual, mnemonic form. The user must call the the simulation of his a kind of compiler. I special purpose: it program together with and pos3ibly wlth functions or subroutin which is 'understood simulation, when reque analyser before applying program. The analyser is t was designed for this translates the user's the declaration module some other files for es into the 'object form' and executed by the sted. The simulation can be executed only when the analyser does not find and report any errorCs) in the user'3 progrčun file, nor in the declaration module's file. A example of both files is on Figure 2a and Figure 2b. MAIN SET RESET BP ADD SUB MUL W17 = DIV BP AND CPL NEG BP RLC SLC TRANS TRANS Q = JPQ NOP 33 L237 M21 BP NOP BP END. Ml M2 5 CB12, CW7, CL323, CW17 CW111, 9 W16, CB12, CB12, 10 CL328, CB115. CB115. M300, Ml 33 = L236 = N ( 20 25 CB328, CW8, CL818, CW71, W17, B12 B13 65, 5, 3, 3, 100, (Ml A M2) BI . W16 L234 W12( W19 L235 B235 L236.7 M250 0 (W16 (W16 LT CW87) ) CL215 CL287 CL300 CL328 CL818 ENDCONST lOSPEC MODI is M0D2 is M0D3 is M0D4 is BLOCK CS <- 215 <- 287 <- 3000000 <- 328000 <- 818000000 TY31 TY31 TY31 TY31 C CS C CS C TS T TS T TS T 11 11 12 12 13 13 12 12 11 11 13 13 TXS 23 TX 23 TXS 24 TX 24 TXS TX TXS TX MS M MS M MS M DS D DS D DS D RS R RS R RS R- ENDBLOCK ENDIO END. YES, M6, NO, M6, VES, MIO, lOms, M2, lOOms, NO, Ml, M2, 70 M7, 80 M7, 90 Mil, M5, M6, M16, M17, M88 VES, 999 M8, M61,M62, M63, M64 M8, M9, MIO, Mil,. M12 M29, M3, 50 M3, Ims, M3, READ. M22, NO, M4, 100 M2, M4 Ml 2, "START' M3 WRITE, 2, "CK." M21, M3 NUMVRITE, 2, B333 M20, M3 NUMREAD, 2, L338 M26, M3 lOOms, NO, 333 M2, M20 VES, 238 M27 NO, 669 M84 11, lOms, M3, lOOms, M27, Is, M2, Is, M25, Is, M2, FIFO, M2, LIFO, M2, FIFO, M3, B W 8, M32, M33 18, 16, M26, M37 13, 32, L M21, M30 22, L M24, M32, M41, M52 30, B M25. M35, M43. M63 20, W M55. M55, M53, M57 Fig. 2a: The user's program (file TEST.MPR) Fig. 2b: The declaration module (file D2.DCM) DECLAR CONST CBIO CB12 CB115 CB119 CB123 CB321 CB328 CB378 CW17 CW71 CW73 CW78 CW87 CW111 CW200 CW312 CH419 CW788 CLO CL5 CL46 CL49 CL64 CL175 CL200 <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- <- 10 12 115 119 123 30 - 32 37 17 71 7300 78 87 111 2000 312 8841 788 0 5 46 49 64 175 2000000 NOTE The user does not need to Hrite the file type (MPR for user's (or main) program or DCM for declaration module), because special purpose editors do this. File types are alHays hidden from the users! Fig. 3a: Reading a name of the main progrsun. After ali neccessary files Here transiated, the simulation establishes the presenoe of error(3) very simply. If the analyser finds any error(s), then it does not produce the object file, which is a direct input to the simulation. In čase of an error the simulator Mrites a message on the screen. In this message it tells the user that he can not execute' the simulation because the error(s) 18 is(are) found and that the user can correct the error(s) in a corresponding editor. The program SIMULATION firfst of ali reada the name of user program's file (or main program's file) and the ncune of the declaration module. Figures 3a and 3b show the user's answers to both questlon3. Ci)t*r ittlirtUm todul'i un i «- Fig. 3b: Reading the .name of the declaration module. After successful return from the analyser and before the simulation execution, the simulator writes a detailed report about constants and function blocks used in the declaration module (Figures 4a and 4b). C O N 8 T A K T S 1$ 1 3 ij BiaOMMi ;ii78a 2000 2» 4' Fig. 4a: The report about CONSTANTS. If the value of a constant is too large for it's data type, then the simulator assigns the largest positive or negative value to that constant, depended on its sign! The data type of a oonstant is appointod by the second letter of the constant's name: B, W or [> for byte (8 bits), word (16 bits) or a longword (32 bits). of an instruction operand many bits of storage should be is the be. The BCD and The data type identifies how considered as a unit and what interpretation of that unit to simulator only recognises the integer ASCII data. An integer can be stored in a bit, byte, word or in longvord. Some instructions interpret the integer data as a signed value, Hhile others as a bit strings. FUNCnOII ILOCKS 0J|6tTAH.E Ml! S^^*^^ Sf ffiSISTU R 7 u mu Fig. 4b: The report about FUNCTION BLOCKS. 1.1 Represent&tion of function blooka & types of data and The user can use the following types of data: (a) (b) CONSTANTS The user assigns initial values to constants in the declaration module. During the execution of. the simulation the simulator has read only access to it's value. The user can assign a new value to a constant in the later described menues SINGLE CBANOE and ADJOST EDITOR. The controller's system data are set up by the operating system. The simulator simulates this function by (C) assigning them values. It can read only 3ystem data. The same principle to modify the system data is in valid as for constants. INTERNAL DATA Internal data are general purpose data. The simulator can use them slmllarly as variablea in a high level language: their values can be modlfled by the simulator. (d) (e) INPPT DATA Input data are external inputs into the controHer. physical OUTPUT DATA Output data are physlcal from the controller. outputs out We use 'the sinAle aasisnaent rula' for ali type3 of data, because of the simulation of parallel execution mutualy exclusive events. OvorvioH of the controller'a data t)rpes The user can use almost ali combinations of types of data with data types in simulation. This survey is shown on Figure 5. TYPE TYPE*s TYPE's DATA DATA OF DATA DATA TYPE's TYPE's A DATA NAME MARK NAME MARK SAMPLE CONSTANT DATA: BYTE Constant WORD Constant LONGVORD Constant SYSTEM DATA: BIT Sy3tem BYTE System HORD System LONGWORD System INTERNAL DATA: BIT Internal BYTE Internal WORD Internal LONGWORD Internal OUTPUT DATA: BIT Output BYTE Output WORD Output LONGHORD Output INPUT DATA: BIT Input BYTE Input WORD Input LONGWORD Input C C C S S S S * * * * 0 0 0 0 I I I I Byte Word Longword Bit Byte Word Longvjord Bit Byte Word LongHord Bit Byte Word Longword Bit Byte Word Longvord B W L * B W L M B W L * B W L * B W L CB18 CW555 CL234 S12 SB373 SW383 SL947 M991 B3 W495 L952 012.13 OB10.4 OW4.10 OL2.2 15.13 IB8.10 IW10.0 IL1.3 NOTE Asterlsk "*" means that at this plače there is no mark! Fig. 5: Survey about types of data. The user has six type8 of function blooka besides the types of data mentloned above. The function blocks are: (a) nUEB The timer enables temporal control over events in an object. After a certain tirne delay something can happen, the value of Hhich is programmable. 19 (b) (C) (d) MONOSTABLE The monostable ehables temporal control, too. It generates a pulse of apeclfic duration, the value of which is programmable. The raain difference between the monostable and the timer is the folloHing: the user can programmabl/ control the timer through its inputs. After the user had enabled the monostable to start running, he can no longer programmabl/ influence the monostable. Only one exception is allowed: the user can repeatedl/ start the monostable from the baginning! The counter permits the upcounting and dovmcounting of events. These two operations can be performed simultaneous/ or not, as required. DRtJM CONTROLLER The drum controller enables temporal or event-driven (through its inputs) control: values of output bits of currerit drum step are asaigned to actual bits. The two mentioned modes of operation are mutually exclusive. The IHCL (Industrial Microcomputer Controller Language) Is a mnemonlg PrOfframmaMe language for our controller. The user can simulate ali of the instructions of the IMCL: (e) of data (f) REGISTER The register enables storage in tHO different ways: * FIFO staok or * LIFO queue. 1EX1 The text enables simple input/output operations (communication betveen the user and the controller). 1.2 Simulation of a user's program execution The simulation receives the user's program merged together with other files in object code on a file. The file has seguential organizatlon. It conslsts of records arranged in the sequence in whtch they are written in the file (the first record written is the first record in the file, ... and so on). Particular instruction needs more records. Records of the same instruction are alHays arranged in this way: a first record contains an operand Hhich will have a result (one or two for division), a folloning record is a second operand, if it Indeed exists in syntax of an instruction. After operands, if the instruction has any, comes the operator. This is an instruction whlch will be executed. The simulator reads the records in the described regular sequence, too. Simulation of execution is based on the princlple of atack coaputer. The simulator reads a record from the object code's file. Records are already in correct sequence, in so-called reverse Polish notation. The content of a record is either an operator or an opcrand. If it is an operand then the ^ simulator pushes it on the stack. If it is an operator then the simulator pulls the corresponding number of operands from the stack, executes the operator (instruction) and assigns a value to a result. (1) (2) (3) (4) (5) (6) (?) (8) (9) (10) (11) (12) (13) (14) (15) (16) tl7) (18) (19) (20) (21) (22) (23) (24) (25) (26) (27) (28) (29) (30) (31) (32) (33) ARITHMETIC OPERATIONS: ADD - arithmetic addition SOB - arithmetic substraction DIV - arithmetic division Divide bv zero: The simulator assigns the largest positive or negative value to the result, dependebly on the numerator sign, a zero to the remainder and reports the overflo« of the result. The simulator »rites the values of condition flags (Negative, Zero, oVerfloH and Carry) on the screen, then follow the messages about the mode of execution and about the current number of cycles reiterations of execution of the user's progreus. In čase of dividing by zero the simulator always breaks execution and writes a message. After the message the user can continue with the execution of his program. He must press the key RON - Figure 61 MUL - arithmetic multiplication BIT OPERATIONS: A - logical AND operation over a bit's expressions O - logical OR operation over a bit's expressions N - negation of a bit's expre33ion SET - bit set RESET - reset bit P - protection and assignement BIT OPERATIONS BETVfEEN TERMS (8, 16 or 32 bit string'3 length): OR - logical OR operation XOR - logical XOR operation AND - logical AND operation NAND - logical NAND operation NOR - logical NOR operation COMPLEMENTS: NEG - one's complement CPL - two's complement TRANSFER OF BIT STRING: SLC - shift left SRC - shift right RLC - rotate left RRC - rotate right TRANS - general purpose transfer of bits betveen bit strings RELATIONAL OPERATORS: NE - operands are.not equal ? EQ - are both operands equal ? LT - first operauid is less than second one LTE - first operand ia less than or equals to the second one GT - first operand is greater than second one GTE - first operand is greater than or equals to the second one CONVERSIONS: CBIN - conversion from BCD to two's complement CBCD - conversion from two's complement to BCD CONTROL OPERATIONS: JPQ - jump if Q bit is equal 1 JPnotQ - jump if Q bit is equal O JPX - jump if X bit is equal 1 20 (34) JPnotX - Jump if X bit is equal O (35) JP - unconditional jump The simulator write3 a message to the user that the next step will be to execute a labelled program statement corresponding to the label of the JUMP statement. Jump skips the statements between JUMP instruction and this statementI The simulator Krites this message only in step-wise mode of execution! CALL OPERATIONS: (36) CALLM - calling a module (37) CAIJLQ - conditional calling a module MISCELLANEOUS OPERATIONS: (38) BP - break point When the simulator reaches a break point that it is not cancelled out in the user's program, it breaks te execution of simulation. The simulator writes a message about the break point irrespective of the mode of execution: step-wise mode or continous mode. (39) EQUAL - assignement an operand's value to a result (40) NOP - no operation In the step-wise mode of execution the simulator writes only a message that it reached the NOP instruction and reassigns ali condition flags to zero. Instructions are orthogonal which means that the user can use the same instruction with dlfferent data types. For example: once with a byte, some other tirne with a longvord. Internal types of data, which are longer than one bit, we can address also in index mode and indirect (deferred mode); for example: ADD (W3), W4(W6), W3. In such cases the value of indirectly addressed internal variablo tells the simulator on whioh internal datum (variable) the instruction will be actually executed, or in index mode of addressing, (indexed variable is within round brackets) a sum of both internal variables' values gives index (addreaa) of actual internal datum. 1.3 Representation execution ol program You can repeatedly execute the simulation of yours program as many times as you like. Every tirne you can choose one mode from the following modes of execution: (a) more cycles, (b) single cycle, (c) 3tep-wise mode, (d) continous mode, (e) with break point(s) or (f) without break point(s). operand names and values and values of conditional flags (Negative, Zero, oVerflov and Carry). The simulation can start with the following default modes of execution: a single cycle, continous mode and wath break pointsl If the user does not choose the step-wise mode then the entire user's program is executed at least once (depended on the number of cycles iterations of execution!) without the simulator writing out any message, except if there is a run tirne error or a break point instruction or a jump instruction! STEP NlSE I No Nuibtr Qt cvdti I 1 Citcution titi I 300 ti (of oni [ycli I) f o fi Qi t li I f 1 I I ! Thi progrit ii REAOV for iiicution ! If you »ish HSfiD COPV of thi icrfm priii <8HIfT> I Fl RUN m F3 cis F5 w n m Fig. 7: The user inscribes the value of the number of cycles. The user can cancel out ali of the used brealc polnts or Just some of them, or gives them active status, if hs chooses a menu of break polnts (the key BREAK POINT), whiGh is 3hown on Figure 8. Somž modes of execution are compatible Mith others. The user can, for example, execute the simulation in step-wise mode, with break points and has more cycles. One cycle is one iteration of the user's program execution. The key RUN (Figure 6) enables a commencement or a continuation of user's program execution. The 3tep-wi3e mode of execution enables the user's program execution step by step, one instruction after another. For particular instructions a message is Rritten on the screen. The message contains rudiraentary informations: which instruction is executed. BflE« - POIHTS 8P5 m BPlO BPJO BP23 COIOR Mani Briik-point ii KOT CMCELED ! Briik-point ii UNCELEO I CANCEL ALL AU CANČCL ONE F« 3ET OC F8 EIIT Fig. 8: A menu of break points. 21 If break point (BP) is cancelled out, then the execution of•simulation is not broken! Before executing an instruction, the simulator verifies if the neccessary operands have values. If they do not have, the simulator calls the user's attention to this fact. The user can choose either to inscribe an initial value to a datum or to confirm a simulation's proposal to assign a zero value to that datum. The simulation enables ali inscriptions of digits (numerical data) in: (a) binary nurnber system, (b) octal nurnber system, (c) decimal nurnber systera and (d) hexadecimal nurnber system. The user indicates the desired nurnber system by inscribing the first character: B, O or H for bihary, octal or hexadecimal nurnber system. For decimal nurnber system he does not inscribe any letter before digits! During the inscription of an integer number, the simulator ignores the prohibited characters. For example: letters that do not have sense for the selected number svstem. or letters the values of which are larger than the basis of the number system decremented by one. Likewise, the simulator reports an error if the numerical value exceeds the allowed integer interval of datum's data type (a bit, a byte, a word or a longuord) . During execution selected modes of exec user can make hard-copy ADJUST MODE that perm adjustment of used data select different modes of or not cancel out break wishes, he can terminate function is enabled by alwavs brinaa ua iiii^ the (depending on the ution and menues) the of the screen, use its an overview and and function blocks, execution, cancel out point(s) and, if he the simulation. This the key EXIT, Ihat Er£YiQua meau. The simulation perraits the user to repeatedly execute different user's programs or combinations of the same user's program with different declaration modules. 2 An instance of step-vise simple user'a program execution of Figure 9 shows an example of step-wise execution of a simple user's program, the source mnemonic form of which was presented on Figure 2a. We cut off the fundamental menu (presented on Figure 6) in order to spare space. Each message is Hritten above this menu. Temporal order of messages is from top to the bottom of a paper. STEP HtSE ! Vti Nuibir oi cyclii : 3 E>(cutian tiic i 900 is (of ont cycl( !l Initruction : 5ET Fli9i Retult(i) Rl I STEP KISE 1 In Nutttr af tycl»i i S £xicution tiai i 900 ii laf ont cycl> ! Instruction t RESET Rliultl!) i 112 i 0 Fligi : ) Th( ixKution o' the projrii it brtikid it BPS STEP KISE 1 rei Nutbtr of cycltt i S EnKution tlu : SOC •( (o) oni cycli ! Initroction i ACD OptrtniKtl : CBI2 1 12 CB328 1 32 fltiultd) : BI ! 44 STEP KISE ! Vil Nuibir af tyclii i 3 Emcution titt i 300 ii (of ont cycli Initructiod i GUB Opirinddl : an 1 H475 cm 1 8214 Riiultit) : HU 1 11239 STEP KISE 1 Tli Nuibtr of cy[lii i 3 E«Kution tlit 1 300 ti (of oni cycl> Initruction i MJL Optrindd) : CL323 1 ?3flS73 CL818 1 8IB00OOO0 Riiuitdl : L234 1 2I474BU47 STEP KISE 1 Vil Nuiber of cvdii t 5 Eifcution tlu 1 300 is lof oni cycli Initruction ! < Opirind(i) : «17 Riiultli) 1 »17 ; 17 STEP mSE 1 Tli KuibK of crdii 13. Eiicution tiM t 300 ii (of oni cyclt Initruction i DIV Opirtnddl 1 CMllI : 111 0(71 1 .71 Ritultd) 1 »12(11171 1 1 ( - FUgi ! 1 FUgi 1 ) FUgi 1 1 FUgi ! 11 FUgi 1 !1 -> »61 ) »20 1 40 (rniindirl N 0 1 » 0 » 0 * 0 » 0 N 0 1 1 I 0 1 0 1 1 0 I 0 v 0 v 0 v 0 v 1 v 0 v 0 C 0 C 0 C 0 C 0 C 0 1 22 Tht iitciition of tht progru it brtikid it BP9 ! STEP KISE I Yil Nvabir of Cfdtt i 9 Eitciition tlM i SOC tt (of otii cycli !) Flig« : H 2 V C O » O O Dptrandlil Rttultli) Initruction i AND mi i OOIOIOII 11111011 HI? I 00000000 OOOIOOOI m; ! 00000000 oooioooi STEP KISE I rti Nutbir of cvcili i 3 EnKutlon tiH I 300 li lof oni cjrdi !l Fligi I N i V C 10 0 0 Opirind(i) ! Rtiult(i) Initruction i CPL CBI2 I 00001100 B12 : tUlOlOO STEP KISE I yti Nuilitr ot tycli< i 3 Eiecution tiit : 300 is (of ont cyclt !) Initruction i HES Optrinddl Flagi t N Riiultli) CB12 i OOOOUDO BU I lUlOOU Tht »icaticn of tht prograi ii brtiktd it BPlO ! STEP VISE ! Ttf Nuibtr of Cfclii I S Eiicution tiM I SOO II (of Flaji oni cycli II Initruction i ALC Opiranddl s CU28 I OOOOOOOO 00000101 00000001 01000000 RDtatt no. I iS ( >> 1 !!! I Riiultdl I L2U I OOOOOOOO OOOOIOIO OOOOOOIO lOOOOOOO STEP KISE I rti Nviibtr of cvdti i 3 Etication tlH i 300 ii (of oni cjrdi !) Initruction ; SLC Optrand(i) t »113 : OIllOOlI Shift no. t 3 Rtiult(i) : B233 i 01100000 Fligt I I N 2 V C 0 0 10 I V O O Flagi i K 1 STEP KISE 1 Vtl 0 0 Nuibtr of cvdti 1 3 Eitcution tiii 1 300 it lof ont cydi !l Initruction i TRANS Optrinddl i CBI13 i giUOOll No. of biti 1 3 Rttultli) 1 L23i : OOCOOOIO 00010101 01000111 00111011 Fligi 1 II 1 STEP VISE ! Ytt 0 0 Nuibtr of cydtf i 3 ExKution tlaa i 300 as (of ont cycli '.) Initruction : TRMS ' • 11300 1 OOOOOOOO OOOOOOOO OOOOOOOO OOOOOOOO No, of biti 1 100 Riiultlil 1 II2S0 1 OOOOOOOO OOOOOOOO OOOOOOOO OOOOOOOO Fligt 1 II J STEP KISE 1 rti 0 0 Nuabir of cydii : S Extcutioii tiM ! 300 ii lof oni cydi !l Initruction i • Optrinddl i HI Riiultli) : g 1 1 Thi t>tcution of tht progru it brtiktd it LABEL 33 Fligi 1 N 1 STEP NIŠE I Yti 0 0 Nuabir of cvdti i S Eitcution tiii 1 300 ii lof ont cyclt !l Initruction i • Dptranddl i L2Ii RituUd) 1 L237 I 34flBt23 Fligi 1 N ! STEP mSE 1 Vti 0 1 Nuibir of cydit iS Emcutlon tlii i 300 ii lof ont cycli !l Initruction : A Optrinddl 1 "^ H2 1 0 lil 1 1 Riiultli) 1 filiult il 1 0 Fligt ! N I STEP mSE IT« 0 1 Nuibir of cydti I 3 Eitcution tiai t 300 ti lof oni cyd> !l Initruction i LT Opirindd) 1 Nli 1 11239 CW7 1 87 Riiultli) 1 Rttult it 1 0 V 0 v 0 •• v 0 v 0 v 0 v 0 r 0 C 0 r 0 r n C 0 r 0 23 STEP mSE i tu Nutber of cvdei : 3 CtKution tiM : iOO if Igf one cycU !l Flisi ; M I V C 0 10 0 Instruction i O Op»rind(>l ! Stjck - TOP St«k - TOP Rtiultli) : Reiult is SIEP KISE ! Tu HuibK of cyc](i t i EiKution ti«i I SOD II (of oni cycle !) FUgs I K Z V C 0 0 0 0 [nitruction i N Opsrindtfl i StJck - TOP ! Riiultd) ; Rnult it STEP VISE ; Yn NuibK of cycle> i I Eiicution tiu : 300 it lof oni cycli I) Fiigi i H 2 V C 0 0 0 0 Initruction i « Optrtndd) I Stick - TOP Ritultlt) : . m Thi iiecution of the projrii i> brtikid at BP20 ! STEP KISE I Vti Nuiber of cyclet : 3 Eutcution tiit : SOO ai (of Fligi ont cyclt !l Initruction i NDP Thp iiecution of the progrit i! briaked at BP2S I STEP KISE t In Nutbtr of crdii : i EiKution tiM I 300 is (of oni cycle !1 Start of tiecution of THE FUKCTION BLOCKS. STEP NIŠE : Tit Nuabir of cvclei : 3 Eticution tIt« : 300 ii (of oni cycle !) End of cycle : STEP NlSE : Ves Nuiber of cyclei : O EsKution tiM : 500 ii (of one cycle !) End o f t h I f i 1 I ! Eiecution of the prograi is finiihid ! Fig. 9: A step-wise mode of execution of a simple user's program. 3 Adjuatment and Hrlting out values In the fundamental simulation menu (Figure 6), the user must select ADJUST MODS (Figure 10). The simulator permlts two modes of adjusting and writing out data. If you listi HARD COPV of thi tcr>n priii '. Fl COMT VIEV Pli06 VIEi F3 ESIHOR Ft PRUT J« ČMME F8 EIIT Fig. 10: A menu of ADJUST MODE. The flrst mode is directed to a particular datum or function block and so we call it SINGLK CHANGE (Figure 11). The second mode is directed to ali values of the same t/pe of data - ADJUST KDITOR (Figure 12). If you ilth HARD. COPy of thi icnifl prtti (PrtSc) ! CONSUT R0NOSTAH.E SYSTEN VARIABLE REGISTER IKnRKAL PIABU COinTER F4 IUPUT TIKR OUTPUT DRUH' EITT TEIT Fig. 11: A menu of SINGLE CHANGE. 0 \ 3 4 5 i 7 8 1 10 . il 0 .- - cm 1 000107 000137 2 . . Radi« 8 3 0U20I - 4 - - Conitant Vord 3 i . - - 7 000021 0OC127 ¥ou can aii~kiyi on H Fl BDTTOII PASE UP DOVN F3 RI6HT F4 m BOTTOH F5 LIKE DISII Fi i" F7 CHMK m E5?T LIHE ? Fig. 12: A menu of ADJUST EDITOR. The way of selection is identical for both modes, because it runs through similar menues. The user selection starts on menu of types of data (Figure 13a). There are constants, internal data, sjrstem data, input and ouput data. The user chooses betveen a bit, a byte, a word and a longvord in the next menu of data types (Figure 13b). The user can choose ali data types for any selected type of data except a bit for constants, because the simulator does not have a constant bit! U rou >ish mi cm of Iht icntn presi Fig. 13a: Menu of types of data. H rou lish NMD COPT of thr icreen prcis (SHIFT) ! 24 C0N3TAKT SVSTEH VAKIABLE INTEm VARIABJ IRfUT OUTPUT E5!T E (KI) C (112) O O A T 11 TB i PRESET WLUE I NODIF I CURBENT VALUE i 0.100 SO »O O O (1131 R (n4l Fl BIT5 F2 BYTES n UORDS F4 LOHGNRIIS F8 EJIT 3. 1 Fig. 1.3b: Menu of data types. Adjustment and writing out values of function blocks' data The menu SINGLE CHANGE (Figure 11) enables adjustment and writing out values of function blocks' data. After selecting the type of a function block, the user inscribes its successive number and then, if it actually exists, the simulator draws its picture on the screen. The simulator then Hrites important Information about it: type of function block, its successive number, names and values of its input and output bits and current values of its typical variables. In a menu, under each drawing, the user can read nhich variables he can adjust and Mhat actions he can use (Figures 14a, 14b, 14c, 14d, 14e and 14f). S («) -O N 13 cmr VALUE I 0,100 333 . M ENT VALUE l O R III20) • O U rou niih HARD COPr of tht icrein priii ! Fl rinE BASE F2 CURREKT VALUE F3 PRESET VALUE FB EIIT Fig. 14d: A menu of TIMER. D 32 R (HJI « ( U mu • i - Ik, T VALUE ;KT VALUE - - ITEP! CURi NUflBfiiOF 6TEPS STEP CURRENT STl. iti; loolc STATES OMI 1.000 i li o 32 O 00000000 OOOOOOOO 00100000 F in30) • o If pu >ish HARD COPV of thi tcrttn prtu ! If yoti iiith HARD CDPY if tht icrtin prtu Fl TIflE BASE F2 CURRENT VALUE F3 PRESET VALUE FB EIIT Fig. 14a: A menu of MONOSTABLE. R U R (Ml • O I («24) • O - O (K32) « O - Uttr t|pt ii FIFO - quiui. I O lATA I O LEII6TH I 22 NUNBER OF DATA i O Oiti typt li longaord ITPUT 6AT GliTER L. IMER OF F IMl) 'O E IIIS2) • 1 [f you »iih HARD COPy of tht scrcM priss I Fl IKPUT MTA OUTPUT DATA f2 RE6ISTER LENETH KUIBER OF DATA • »II COKTENTS Fig. 14b: A menu of REGISTER. R (U) P m U M) D (d?) O - O - O - O - C 12 PRESET VALUE i IIODIF ! CURRENT VALUE t - E (dlOI « O - D (1111) «0 -F tN12) «0 Fl IRTERNAL VARIABLE UNIT 1 F2 IESSA6E UIIT 2 FB EIIT Fig. 14f: A menu of TEXT. 3.2 Adjustment and Hrltlng out values of data 'As mentioned above, the user can adjust and write out values of data in two places in our simulation. 3.3 SINGLE CHANGE After selecting type of data and its data type, the user inscribes its successive number in menu SIKGLE CHANGE. If the entered name is correct in the context of Figure 5 and has a value, then the simulator writes out its value in binary, octal, decimal and hexadecimal number system. Now, the user can adjust the value or return to the menu of data types. An instance of choosing and adjusting of a datum CH200 in menu SINGLE CHANGE is shovrn on fugures 15a and 15b. Conitint Hord NUIIBER i 200„ It iutt bi (riittr thin -I tnd liii thin 1000 ! If you aiih HARD COPV of tlit tcritn priii (SHIFT) (PrtSc) ! Fl CURRENT VAIUE F2 PfiESET VALUE FB EIIT Fig. 14c: A menu of COUNTER. Fl BVTES F2 NORDS FJ LONSUODDS FB EIIT Fig. 15a: Choosing a datum. 25 Cl(200 -- Cointint »uril to a datum required by the user (the key LINS ? on Figure 16). 01.0 VALUE ictil JlCilll om 0111 (103720 2000 07D0 1101 OOOO 11» VALUE I § injry ctil Otcital Htx 1111 1000 774060 -2000 f830 0011 0000 !i niD nu«lier'E vilue correct ? Anmer iiith V or N ! Fl BVTES F2 IIDflDS F3 LOtieilOiiDS FS EIII Fig. 15b: Adjusting the same datum. .3.3.1 ADJUST EDITOR ADJUST EDITOR is a screen editor that enables overlooking of ali values of a selected type of •data. We oan not usually write ali the values on a screen at the same tirne. We can see those values which are not moraentary on the screen by moving the window through a table of values (we called it a file sometimes). Function keys of the menu of ADJUST EDITOR enable this moving (Figure 16). To left on lini To rijht on line (PgUo) Pigt up Pi;t dom (Up Arroii> Lini up (Doiin Arroa) Lini dom To too ol pige "~RL> To bottoi of gigi " 10 lop o( JiU RL> (fjUp) (CTRL) n> To bottoa of filt RL) (Lih Arroi) Mord liU (tL> or , Hord rlgM Vou ctn uu l(iyi on tha Nuiiric Kiypad! Hiip; priii K BOTTOH mi. RISHT F* eoTTan F! LUE IP m I F7 CHAHEI VAr PR LUE ? Fig. 16: The possibilities of ADJUST EDITOR. We can move * to top of a file and * to bottom of a file. We can move window * up, * down, * left and * right. Within a window we can move * to top of a page and * to bottom of a page. We can move a line * up and * down and inside of the line * to left on line (beginning of line), * to right on line (end of line) Besides these, function keys, we can also the keypad's keys for the same purpose. The key CHANGE VALUK permits adjustment of values and the key PRINT enables writing out ali values of the selected type of data, clearlV arranged on the printer. 4 Concluaion The presented simulation packet is written in the programming language Turbo Pascal. The user can execute it on ali personal computers IBM XT/AT type, or compatible, eguiped with an operating sy3tem MSDOS. The simulation packet is a composition of twelve independenrt programs, which are connected with standard procedure Execute. The number of source program lines exceeds 50000, the object code is more than 360k. bytes of lenght. The SIMULATOR'is an integral part of the user's development tools. Consequently, the entire project offers the special purpose environments to the users. 5 References: * The industrial microcoraputer controller's architecture (in slovene). Metalna Maribor, 1987, * V. Zumer et al., Workstation for softvjare development, Technical report - in slovene, 1986 * V. 2umer et al., Workstation for software development, Technical report - in slovene, 1987 * Programmable Controllers SIMATIC 85 (different variants), SIMENS, 1984 * Programmable Controllers TSX (different variants), Telemecanlque, 1986 and from one datum to another * a datum left and * a datum right. « R.E Fairley, Software Engineering Concepts, McGraw-Hill Book Company, 1985 We.can move out of a current window only by moving a window, because by moving within a window we can not come out of it. * VAX Architecture Handbook, Digital Equipment Corporation, 1981 Such moving is often time-consuming and as we Kished to increase the efficincv of the ADJUST EDITOR, we added the above described possibilities stili another one: the movement