CPM2A_OPERATION MANUAL (W352-E1-3) (986749), страница 20
Текст из файла (страница 20)
The assignments can be displayed inany mode, but can be changed in PROGRAM mode only.OperationRUNMONITORPROGRAMRead assignmentOKOKOKChange assignmentNoNoOKAssign expansion instruction function codes before inputting the program.The CPM2A will not operate properly if expansion instructions aren’t assigned correctly. An expansion instruction can be assigned to one functioncode only.The PC Setup must be set for user-defined expansion instruction assignments. Set bits 8 to 11 of DM 6602 to 1 and turn the PC’s power off and thenon again to enable the new setting.There is a table on page 85 showing the default function code assignmentsin the CPM2A.1, 2, 3...1.
Press the CLR Key to bring up the initial display.2. Press the EXT Key to display the assignment for the first function code (17).EXTINST TBLREADFUN017:ASFT3. Press the Up and Down Arrow Keys to scroll through the expansion instruction function codes.↓INST TBLREADFUN018:FUN4. Press the CHG Key to assign a different expansion instruction to the selected function code.CHGINST TBLCHG?FUN018:FUN ~????5.
Press the Up and Down Arrow Keys to scroll through the expansion instructions that can be assigned to the selected function code.↓104INST TBLCHG?FUN018:FUN ~HEXSectionProgramming Console Operations4-46. Press the WRITE Key to assign the displayed instruction to the functioncode.WRITEINST TBLREADFUN018:HEX4-4-6 Setting and Reading a Program Memory Address and MonitoringI/O Bit StatusThis operation is used to display the specified program memory address and ispossible in any mode. In the RUN or MONITOR mode, the I/O bit status of bits inthe program will be displayed.RUNMONITOROKOKPROGRAMOKWhen inputting a program for the first time, it is generally written to ProgramMemory starting from address 000.
Because this address appears when thedisplay is cleared, it is not necessary to specify it.When inputting a program starting from other than 000 or to read or modify aprogram that already exists in memory, the desired address must be designated.1, 2, 3...1. Press the CLR Key to bring up the initial display.2. Input the desired address.
It is not necessary to input leading zeroes.C2A0A0002003. Press the Down Arrow Key.↓00200READLDOFF00000In the RUN or MONITORmode, ON/OFF status ofthe bit will be displayed.Pressing the MONTR Key will change to the I/O monitor display. Bits can beforce-set or force-reset from the I/O monitor display.
Press the CLR Key toreturn to I/O bit status monitoring of the initial address.Note The ON/OFF status of any displayed bit will be shown if the PC is inRUN or MONITOR mode.4. Press the Up and Down Arrow Keys to scroll through the program.↓00201READANDON00001↑00200READLDOFF000004-4-7 Entering or Editing ProgramsThis operation is used enter or edit programs. It is possible in PROGRAM modeonly.RUNNoMONITORNoPROGRAMOKThe same procedure is used to either input a program for the first time or tochange a program that already exists. In either case, the current contents ofProgram Memory is overwritten.105SectionProgramming Console Operations4-4The program shown in the following diagram will be entered to demonstratethis operation.00002AddressTIM 000#012312.3 sInstruction0020000201LDTIM00202MOV(021)OperandsIR00002000#0123MOV(021)#0100#010010LR 10LR00203ADB(050)ADB(050)#0100#FFF6DM 0000#0100#FFF6DM 00001, 2, 3...1.
Press the CLR Key to bring up the initial display.2. Specify the address where the program will begin.3. Input the address where the program will begin and press the Down ArrowKey. It is not necessary to input leading zeroes.C2A0A0↓00200READNOP (000)4. Input the first instruction and operand.LDC200200LD000025. Press the WRITE Key to write the instruction to Program Memory. The nextprogram address will be displayed.WRITE00201READNOP (000)If a mistake was made inputting the instruction, press the Up Arrow Key toreturn to the previous program address and input the instruction again. Themistaken instruction will be overwrittenTo specify the Completion Flag for a timer or counter, press the LD, AND,OR, or NOT Key followed by the TIM or CNT Key, and then input the timer/counter number last.6.
Input the second instruction and operand. (In this case it isn’t necessary toenter the timer number, because it’s 000.) Press the WRITE Key to write theinstruction to Program Memory.Timer numberTIMWRITE00201 TIM DATA#00007. Input the second operand (123 to specify 12.3 seconds) and press theWRITE Key. The next program address will be displayed.B1C2D3WRITE00202READNOP (000)If a mistake was made inputting the operand, press the Up Arrow Key toreturn to display the mistaken operand and input the operand again.Note a) Counters are input in the same basic way as timers except theCNT Key is pressed instead of the TIM Key.b) Timer and counter SVs are input in BCD, so it isn’t necessary topress the CONT/# Key.106SectionProgramming Console Operations4-48.
Input the third instruction and its operands. First input the instruction bypressing the FUN Key and then the function code (21 in this case).FUNC2B100202MOV (021)To input the differentiated version of an instruction, press the NOT Key afterthe function code (FUN 2 1 NOT). The “@” symbol will be displayed next todifferentiated instructions.
Press the NOT Key again to change back theinstruction back to a non-differentiated instruction. The “@” symbol will disappear.To change an instruction after it has been entered, simply scroll through theprogram until the desired instruction is displayed and press the NOT Key.The “@” symbol should be displayed next to the instruction.9. Press the WRITE Key to write the instruction to Program Memory. The inputdisplay for the first operand will be displayed.WRITE00202 MOV DATA A000• Writing Hexadecimal, BCD Constant10. Input the first operand.The operands of MOV (21) are normally word addresses, but a constant canbe input by pressing the CONT/# Key first.
When the CONT/# Key ispressed, the display will change to “#0000,” indicating that a constant can beentered.CONT#B1A0A000202 MOV DATA A#0100Press the WRITE Key to write the instruction to Program Memory. The inputdisplay for the second operand will appear.WRITE00202 MOV DATA B000Note The operands of MOV(21) can be word addresses, so the CONT/#Key must be pressed to input a constant.• Writing a Word Address11. Input the second operand.*EMBLR1A000202 MOV DATA BLR10Press the WRITE Key to write the instruction to Program Memory.
The nextprogram address will be displayed.WRITE00203READNOP (000)Note When the default display value is “000”, a word address can be inputimmediately without pressing the Shift and CH/# Keys.12. Input the next instruction.FUNF5A000203ADB (050)Press the WRITE Key to write the instruction to Program Memory.WRITE00203 ADB DATA A000• Writing an Unsigned Decimal Number107SectionProgramming Console Operations4-413. The first operand is input as an unsigned integer.CONTSHIFTTRNOT#00203 ADB DATA A#00000Input the value of the operand from 0 to 65535.C2F5600203 ADB DATA A#00256Note If an erroneous input is made, press the CLR Key to restore the statusprior to the input. Then enter the correct input.14.
Restore the hexadecimal display.SHIFTTR00203 ADB DATA A#0100Note If an input is made outside of the permissible range, a buzzer willsound and the hexadecimal display will not be displayed.WRITE00203 ADB DATA B00015. The second operand is input as a signed integer.CONTSHIFTTR#00203 ADB DATA B#+00000Input the value of the operand from –32,768 to 32,767. Use the SET Key toinput a positive number, and use the RESET Key to input a negative number.BRESET1A000203 ADB DATA B#Ć00010Note If an erroneous input is made, press the CLR Key to restore the statusprior to the input.
Then enter the correct input.16. Restore the hexadecimal display.SHIFTTR00203 ADB DATA B#FFF6WRITE00203 ADB DATA C000• Writing a Word Address (DM 0000)17. Input the final operand and then press the WRITE Key. (It isn’t necessary toinput leading zeroes.)EMDMWRITE00203 ADB DATA CDM 000000204READNOP (000)4-4-8 Instruction SearchThis operation is used to find occurrences of the specified instruction in the program and is possible in any mode.RUNOKMONITOROKPROGRAMOKThe ON/OFF status of any displayed bit will be shown if the PC is in RUN orMONITOR mode.1, 2, 3...1081.
Press the CLR Key to bring up the initial display.SectionProgramming Console Operations4-42. Input the address from which the search will begin and press the DownArrow Key. It is not necessary to input leading zeroes.B1A0A↓000100READTIM0013. Input the instruction to be found and press the SRCH Key. In this case, thesearch is for OUT 01000.In this case, the next OUT 01000 instruction is at address 200, as shownbelow.OUTB1A0A0A0SRCH00200SRCHOUT010004.
Press the Down Arrow Key to display the instruction’s operands or press theSRCH Key to search for the next occurrence of the instruction.5. The search will continue until an END instruction or the end of ProgramMemory is reached. In this case, an END instruction was reached ataddress 397.Indicates the addressof END instruction.SRCH00397SRCHEND (001)00.4KWIndicates the amount used by the userprogram in units of 0.1 Kwords.4-4-9 Bit Operand SearchThis operation is used to find occurrences of the specified operand bit in the program and is possible in any mode.RUNMONITOROKOKPROGRAMOKThe ON/OFF status of any displayed bit will be shown if the PC is in RUN orMONITOR mode.1, 2, 3...1. Press the CLR Key to bring up the initial display.2.
Input the operand address. It is not necessary to input leading zeroes.SHIFTCONT#F500000CONT SRCHLD000053. Press the SRCH Key to begin the search.SRCH00123CONT SRCHLD000054. Press the SRCH Key to search for the next occurrence of the operand bit.SRCH00255CONT SRCHAND NOT000055. The search will continue until an END instruction or the end of ProgramMemory is reached. In this case, an END instruction was reached.Indicates the addressof END instruction.SRCH00397CONT SRCHEND (001)00.4KWIndicates the amount used by the userprogram in units of 0.1 Kwords.109SectionProgramming Console Operations4-44-4-10 Inserting and Deleting InstructionsThis operation is used to insert or delete instructions from the program. It is possible in PROGRAM mode only.RUNMONITORNoNoPROGRAMOKTo demonstrate this operation, an IR 00105 NO condition will be inserted atprogram address 00206 and an IR 00103 NO condition deleted from address00205, as shown in the following diagram.Original Program00100001010010400103AddressInstruction00205002060020700208ANDAND NOTOUTEND(01)Operands010000020100102Delete00105DeleteInsertEND(01)Insertion001030010401000-InsertFollow the procedure below to insert the IR 00105 NO condition at address00206.1, 2, 3...1.