Главная » Просмотр файлов » CPM2A_PROGRAMMING MANUAL (W353-E1-2)

CPM2A_PROGRAMMING MANUAL (W353-E1-2) (986750), страница 57

Файл №986750 CPM2A_PROGRAMMING MANUAL (W353-E1-2) (Техническая документация) 57 страницаCPM2A_PROGRAMMING MANUAL (W353-E1-2) (986750) страница 572015-07-23СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 57)

The Flags subsection of each instruction listspossible reasons for ER being ON. ER will turn ON if operands are not enteredcorrectly. Instructions are not executed when ER is ON. A table of instructionsand the flags they affect is provided in Appendix B Error and Arithmetic Flag Operation.Indirect AddressingWhen the DM area is specified for an operand, an indirect address can be used.Indirect DM addressing is specified by placing an asterisk before the DM: *DM.When an indirect DM address is specified, the designated DM word will containthe address of the DM word that contains the data that will be used as the operand of the instruction.

If, for example, *DM 0001 was designated as the first operand and LR 00 as the second operand of MOV(21), the contents of DM 0001was 1111, and DM 1111 contained 5555, the value 5555 would be moved toLR 00.MOV(21)*DM 0001LR 00IndirectaddressWordDM 0000DM 0001DM 0002Content4C591111F35ADM 1111DM 1113DM 111455552506D541IndicatesDM 1111.5555 movedto LR 00.When using indirect addressing, the address of the desired word must be in BCDand it must specify a word within the DM area. In the above example, the contentof DM 0001 has to be in BCD and has to specify an address in the DM area of thePC being used. (Refer to Section 5 Memory Areas for DM area details.)Designating ConstantsAlthough data area addresses are most often given as operands, many operands and all definers are input as constants.

The available value range for a given definer or operand depends on the particular instruction that uses it.Constants must also be entered in the form required by the instruction, i.e., inBCD or in hexadecimal.335SectionDifferentiated Instructions7-47-4Differentiated InstructionsMost instructions are provided in both differentiated and non-differentiatedforms.

Differentiated instructions are distinguished by an @ in front of theinstruction mnemonic.A non-differentiated instruction is executed each time it is scanned as long as itsexecution condition is ON. A differentiated instruction is executed only once after its execution condition goes from OFF to ON. If the execution condition hasnot changed or has changed from ON to OFF since the last time the instructionwas scanned, the instruction will not be executed. The following two examplesshow how this works with MOV(21) and @MOV(21), which are used to move thedata in the address designated by the first operand to the address designated bythe second operand.00000MOV(21)HR 10Diagram ADM 0000Address0000000001InstructionOperandsLDMOV(21)00000HRDM10000000000Diagram B@MOV(21)AddressInstructionHR 100000000001LD@MOV(21)DM 0000Operands00000HRDM100000In diagram A, the non-differentiated MOV(21) will move the content of HR 10 toDM 0000 whenever it is scanned with 00000. If the cycle time is 80 ms and 00000remains ON for 2.0 seconds, this move operation will be performed 25 times andonly the last value moved to DM 0000 will be preserved there.In diagram B, the differentiated @MOV(21) will move the content of HR 10 to DM0000 only once after 00000 goes ON.

Even if 00000 remains ON for 2.0 secondswith the same 80 ms cycle time, the move operation will be executed only onceduring the first cycle in which 00000 has changed from OFF to ON. Because thecontent of HR 10 could very well change during the 2 seconds while 00000 isON, the final content of DM 0000 after the 2 seconds could be different depending on whether MOV(21) or @MOV(21) was used.All operands, ladder diagram symbols, and other specifications for instructionsare the same regardless of whether the differentiated or non-differentiated formof an instruction is used. When inputting, the same function codes are also used,but NOT is input after the function code to designate the differentiated form of aninstruction.

Most, but not all, instructions have differentiated forms.Refer to 7-11 INTERLOCK and INTERLOCK CLEAR – IL(02) and IL(03) for theeffects of interlocks on differentiated instructions.The CPM2A/CPM2C also provides differentiation instructions: DIFU(13) andDIFD(14). DIFU(13) operates the same as a differentiated instruction, but isused to turn ON a bit for one cycle.

DIFD(14) also turns ON a bit for one cycle, butdoes it when the execution condition has changed from ON to OFF. Refer to7-8-4 DIFFERENTIATE UP and DOWN - DIFU(13) and DIFD(14) for details.336Coding Right-hand Instructions7-5Section7-5Coding Right-hand InstructionsWriting mnemonic code for ladder instructions is described in Section 6 Ladderdiagram Programming. Converting the information in the ladder diagram symbolfor all other instructions follows the same pattern, as described below, and is notspecified for each instruction individually.The first word of any instruction defines the instruction and provides any definers.

If the instruction requires only a signal bit operand with no definer, the bitoperand is also placed on the same line as the mnemonic. All other operands areplaced on lines after the instruction line, one operand per line and in the sameorder as they appear in the ladder symbol for the instruction.The address and instruction columns of the mnemonic code table are filled in forthe instruction word only.

For all other lines, the left two columns are left blank. Ifthe instruction requires no definer or bit operand, the data column is left blank forfirst line. It is a good idea to cross through any blank data column spaces (for allinstruction words that do not require data) so that the data column can be quicklyscanned to see if any addresses have been left out.If an IR or SR address is used in the data column, the left side of the column is leftblank. If any other data area is used, the data area abbreviation is placed on theleft side and the address is placed on the right side. If a constant to be input, thenumber symbol (#) is placed on the left side of the data column and the numberto be input is placed on the right side.

Any numbers input as definers in theinstruction word do not require the number symbol on the right side. TC bits,once defined as a timer or counter, take a TIM (timer) or CNT (counter) prefix.When coding an instruction that has a function code, be sure to write in the function code, which will be necessary when inputting the instruction via the Programming Console. Also be sure to designate the differentiated instruction withthe @ symbol.Note The mnemonics of expansion instructions are followed by “(––)” as the functioncode to indicate that they must be assigned function codes by the user in theinstructions table before they can be used in programming.

Refer to page 148 fordetails.337SectionCoding Right-hand Instructions7-5The following diagram and corresponding mnemonic code illustrates the pointsdescribed previously.00000Address Instruction00001DIFU(13) 2160000002001000020021600BCNT(67)01001 01002LR 0000Data00000LD0000000001AND0000100002OR0000200003DIFU(13)2160000004LD0010000005AND NOT0020000006LD0100100007AND NOT0100200008AND NOT00009OR LD00010AND00011BCNT(67)#0001004HR 0000005TIM 000LR0000––21600#0150TIM 000––#MOV(21)0001004HR 00HRLR 00HR 001500012LD00013TIM33800005000#0100000014LD00015MOV(21)00016LD00017OUT NOT00TIM0150000––HR00LR00HR001501000SectionCoding Right-hand InstructionsMultiple Instruction Lines00000If a right-hand instruction requires multiple instruction lines (such as KEEP(11)),all of the lines for the instruction are entered before the right-hand instruction.Each of the lines for the instruction is coded, starting with LD or LD NOT, to form‘logic blocks’ that are combined by the right-hand instruction.

An example of thisfor SFT(10) is shown below.Address Instruction00001ISFT(10)00002PHR 00001000020001001 010027-521600RHR 00Data00000LD0000000001AND0000100002LD0000200003LD0010000004AND NOT0020000005LD0100100006AND NOT00007AND NOT00008OR LD00009AND00010SFT(10)HRHR0000011LDHR001500012OUT NOTLR 0000HR 00150100101002LR0000––216000001001339SectionInstruction Tables7-67-6Instruction TablesThis section provides tables of the instructions supported by the CPM1/CPM1A,CPM2A/CPM2C, and SRM1(-V2) PCs. The first few tables can be used to findinstructions by function code. The last table can be used to find instructions bymnemonic.

In both tables, the @ symbol indicates instructions with differentiated forms.7-6-1 CPM1/CPM1A Function CodesThe following table lists the CPM1/CPM1A instructions that have fixed functioncodes. Each instruction is listed by mnemonic and by instruction name. Use thenumbers in the leftmost column as the left digit and the number in the columnheading as the right digit of the function code.Right digitLeftdigit230NOPNOOPERATION0ENDEND1ILINTERLOCKILCINTERLOCKCLEARJMPJUMP4JMEJUMP END5(@) FALFAILUREALARM ANDRESET6FALSSEVEREFAILUREALARMSTEPSTEPDEFINESNXTSTEP START1SFTSHIFTREGISTERKEEPKEEPCNTRREVERSIBLECOUNTERDIFUDIFFERENTIATE UPDIFDDIFFERENTIATEDOWNTIMHHIGHSPEEDTIMER(@) WSFTWORDSHIFT(@) ASFTASYNCHRONOUS SHIFTREGISTER------2CMPCOMPARE(@) MOVMOVE(@) MVNMOVE NOT(@) BINBCD TOBINARY(@) BCDBINARY TOBCD(@) ASLSHIFT LEFT(@) ASRSHIFTRIGHT(@) ROLROTATELEFT(@) RORROTATERIGHT(@) COMCOMPLEMENT3(@) ADDBCD ADD(@) SUBBCDSUBTRACT(@) MULBCDMULTIPLY(@) DIVBCDDIVIDE(@) ANDWLOGICALAND(@) ORWLOGICAL OR(@) XORWEXCLUSIVEOR(@) XNRWEXCLUSIVENOR(@) INCINCREMENT(@) DECDECREMENT4(@) STCSET CARRY(@) CLCCLEARCARRY------------(@) MSGMESSAGEDISPLAY---------5(@) ADBBINARY ADD(@) SBBBINARYSUBTRACT(@) MLBBINARYMULTIPLY(@) DVBBINARYDIVIDE(@) ADDLDOUBLEBCD ADD(@) SUBLDOUBLEBCDSUBTRACT(@) MULLDOUBLEBCDMULTIPLY(@) DIVLDOUBLEBCDDIVIDE------6CMPLDOUBLECOMPARE(@) INIMODE CONTROL(@) PRVHIGHSPEEDCOUNTERPV READ(@) CTBLCOMPARISON TABLELOAD(@) SPEDSPEED OUTPUT (seenote)(@) PULSSET PULSES(see note)---(@) BCNTBIT COUNTER(@) BCMPBLOCKCOMPARE(@) STIMINTERVALTIMER7(@) XFERBLOCKTRANSFER(@) BSETBLOCK SET---(@) XCHGDATAEXCHANGE(@) SLDONE DIGITSHIFT LEFT(@) SRDONE DIGITSHIFTRIGHT(@) MLPX4-TO-16DECODER(@) DMPX16-TO-4ENCODER(@) SDEC7-SEGMENTDECODER---8(@) DISTSINGLEWORDDISTRIBUTE(@) COLLDATACOLLECT(@) MOVBMOVE BIT(@) MOVDMOVE DIGIT(@) SFTRREVERSIBLE SHIFTREGISTER(@) TCMPTABLECOMPARE(@) ASCASCIICONVERT------(@) INTINTERRUPTCONTROL9---(@) SBSSUBROUTINEENTRYSBNSUBROUTINEDEFINERETSUBROUTINERETURN---------(@) IORFI/OREFRESH---(@) MCROMACRONote Only for the CPM1A transistor output models.340789SectionInstruction Tables7-67-6-2 CPM2A/CPM2C Function CodesThe following table lists the CPM2A/CPM2C instructions that have fixed functioncodes.

Характеристики

Тип файла
PDF-файл
Размер
2,99 Mb
Тип материала
Высшее учебное заведение

Список файлов учебной работы

Свежие статьи
Популярно сейчас
Почему делать на заказ в разы дороже, чем купить готовую учебную работу на СтудИзбе? Наши учебные работы продаются каждый год, тогда как большинство заказов выполняются с нуля. Найдите подходящий учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6489
Авторов
на СтудИзбе
303
Средний доход
с одного платного файла
Обучение Подробнее