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

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

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

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

When theexecution condition is ON, XORW(36) exclusively OR’s the contents of I1 and I2bit-by-bit and places the result in R.15ExampleI11000011001100110015I200010101010101010110011001100110015RFlags4521100ER:Indirectly addressed DM word is non-existent. (Content of *DM word isnot BCD, or the DM area boundary has been exceeded.)EQ:ON when the result is 0.Section 7-25Increment/Decrement Instructions7-24-5 EXCLUSIVE NOR – XNRW(37)Operand Data AreasI1: Input 1Ladder SymbolsIR, SR, AR, DM, HR, TC, LR, #XNRW(37)@XNRW(37)I1I1I2I2RRI2: Input 2IR, SR, AR, DM, HR, TC, LR, #R: Result wordIR, SR, AR, DM, HR, LRLimitationsDM 6144 to DM 6655 cannot be used for R.DescriptionWhen the execution condition is OFF, XNRW(37) is not executed.

When theexecution condition is ON, XNRW(37) exclusively NOR’s the contents of I1 andI2 bit-by-bit and places the result in R.15I11000011001100110015I20001010101010101015RFlags01100011001100110011Indirectly addressed DM word is non-existent. (Content of *DM word isnot BCD, or the DM area boundary has been exceeded.)ON when the result is 0.ER:EQ:7-25 Increment/Decrement Instructions7-25-1 BCD INCREMENT – INC(38)Ladder SymbolsOperand Data AreasINC(38)@INC(38)WdWdWd: Increment word (BCD)IR, SR, AR, DM, HR, LRLimitationsDM 6144 to DM 6655 cannot be used for Wd.DescriptionWhen the execution condition is OFF, INC(38) is not executed.

When the execution condition is ON, INC(38) increments Wd, without affecting Carry (CY).PrecautionsThe content of Wd will be incremented every cycle if the undifferentiated form ofINC(38) is used. Use the differentiated form (@INC(38)) or combine INC(38)with DIFU(13) or DIFD(14) to increment Wd just once.FlagsER:EQ:Wd is not BCDIndirectly addressed DM word is non-existent.

(Content of *DM word isnot BCD, or the DM area boundary has been exceeded.)ON when the incremented result is 0.453Section 7-25Increment/Decrement Instructions7-25-2 BCD DECREMENT – DEC(39)Ladder SymbolsOperand Data AreasDEC(39)@DEC(39)WdWdWd: Decrement word (BCD)IR, SR, AR, DM, HR, LRLimitationsDM 6144 to DM 6655 cannot be used for Wd.DescriptionWhen the execution condition is OFF, DEC(39) is not executed. When theexecution condition is ON, DEC(39) decrements Wd, without affecting CY.DEC(39) works the same way as INC(38) except that it decrements the valueinstead of incrementing it.PrecautionsThe content of Wd will be decremented every cycle if the undifferentiated form ofDEC(39) is used.

Use the differentiated form (@DEC(39)) or combine DEC(39)with DIFU(13) or DIFD(14) to decrement Wd just once.FlagsER:Wd is not BCD.Indirectly addressed DM word is non-existent. (Content of *DM word isnot BCD, or the DM area boundary has been exceeded.)EQ:454ON when the decremented result is 0.Section 7-26Subroutine Instructions7-26 Subroutine InstructionsSubroutines break large control tasks into smaller ones and enable you to reusea given set of instructions. When the main program calls a subroutine, control istransferred to the subroutine and the subroutine instructions are executed. Theinstructions within a subroutine are written in the same way as main programcode.

When all the subroutine instructions have been executed, control returnsto the main program to the point just after the point from which the subroutinewas entered (unless otherwise specified in the subroutine).7-26-1 SUBROUTINE ENTER – SBS(91)Ladder SymbolDefiner Data AreasN: Subroutine numberSBS(91) N000 to 049LimitationsThe subroutine number must be between 000 and 049.DescriptionA subroutine can be executed by placing SBS(91) in the main program at thepoint where the subroutine is desired. The subroutine number used in SBS(91)indicates the desired subroutine. When SBS(91) is executed (i.e., when theexecution condition for it is ON), the instructions between the SBN(92) with thesame subroutine number and the first RET(93) after it are executed beforeexecution returns to the instruction following the SBS(91) that made the call.Main programSBS(91)000Main programSBN(92)000SubroutineRET(93)END(01)SBS(91) may be used as many times as desired in the program, i.e., the samesubroutine may be called from different places in the program).455Section 7-26Subroutine InstructionsSBS(91) may also be placed into a subroutine to shift program execution fromone subroutine to another, i.e., subroutines may be nested.

When the secondsubroutine has been completed (i.e., RET(93) has been reached), programexecution returns to the original subroutine which is then completed before returning to the main program. Nesting is possible to up to sixteen levels. A subroutine cannot call itself (e.g., SBS(91) 000 cannot be programmed within thesubroutine defined with SBN(92) 000). The following diagram illustrates two levels of nesting.SBS(91) 010SBN(92) 010SBN(92) 011SBS(91) 011SBS(91) 012RET(93)RET(93)SBN(92) 012RET(93)The following diagram illustrates program execution flow for various executionconditions for two SBS(91).ASBS(91)000ABMainprogramSBS(91)OFF execution conditions forsubroutines 000 and 001BC001ON execution condition forsubroutine 000 onlyACSBN(92)000DBCON execution condition forsubroutine 001 onlyABECDSubroutinesRET(93)SBN(92)001ON execution conditions forsubroutines 000 and 001ADBECERET(93)END(01)FlagsER:A subroutine does not exist for the specified subroutine number.A subroutine has called itself.An active subroutine has been called.! Caution456SBS(91) will not be executed and the subroutine will not be called when ER isON.Section 7-26Subroutine Instructions7-26-2 SUBROUTINE DEFINE and RETURN – SBN(92)/RET(93)Ladder SymbolsSBN(92) NDefiner Data AreasN: Subroutine number000 to 049RET(93)LimitationsThe subroutine number must be between 000 and 049.Each subroutine number can be used in SBN(92) once only.DescriptionSBN(92) is used to mark the beginning of a subroutine program; RET(93) isused to mark the end.

Each subroutine is identified with a subroutine number, N,that is programmed as a definer for SBN(92). This same subroutine number isused in any SBS(91) that calls the subroutine (see 7-26-1 SUBROUTINE ENTER – SBS(91)). No subroutine number is required with RET(93).All subroutines must be programmed at the end of the main program.

When oneor more subroutines have been programmed, the main program will beexecuted up to the first SBN(92) before returning to address 00000 for the nextcycle. Subroutines will not be executed unless called by SBS(91).END(01) must be placed at the end of the last subroutine program, i.e., after thelast RET(93). It is not required at any other point in the program.PrecautionsIf SBN(92) is mistakenly placed in the main program, it will inhibit programexecution past that point, i.e., program execution will return to the beginningwhen SBN(92) is encountered.If either DIFU(13) or DIFU(14) is placed within a subroutine, the operand bit willnot be turned OFF until the next time the subroutine is executed, i.e., the operand bit may stay ON longer than one cycle.FlagsThere are no flags directly affected by these instructions.7-26-3 MACRO – MCRO(99)Operand Data AreasN: Subroutine numberLadder Symbols000 to 127MCRO(99)@MCRO(99)NNI1I1O1O1I1: First input wordLimitationsIR, SR, AR, DM, HR, TC, LRO1: First output wordIR, SR, AR, DM, HR, LRThe subroutine number must be between 000 and 049.If a DM address is used for O1, O1 through O1+3 must be read/write DM.DescriptionThe MACRO instruction allows a single subroutine to replace several subroutines that have identical structure but different operands.

There are 4 inputwords (SR 232 to SR 235) and 4 output words (SR 236 to SR 239), allocated toMCRO(99). These 8 words are used in the subroutine and take their contentsfrom I1 to I1+3 and O1 to O1+3 when the subroutine is executed.457Section 7-27Pulse Output InstructionsWhen the execution condition is OFF, MCRO(99) is not executed. When theexecution condition is ON, MCRO(99) copies the contents of I1 to I1+3 to SR 232to SR 235, and then calls and executes the subroutine specified in N.

When thesubroutine is completed, the contents of SR 236 through SR 239 are then transferred back to O1 to O1+3 before MCRO(99) is completed.Note Refer to page 145 for more details on MCRO(99).ExampleIn this example, the contents of DM 0010 through DM 0013 are copied to SR 232through SR 235, and then subroutine 10 is called and executed. When the subroutine is completed, the contents of SR 236 through SR 239 are copied to output words DM 0020 to DM 0023.Main programMCRO(99)010DM 0010DM 0020Main programSBN(92)010SubroutineRET(93)END(01)FlagsER:A subroutine does not exist for the specified subroutine number.An operand has exceeded a data area boundary.Indirectly addressed DM word is non-existent.

(Content of *DM word isnot BCD, or the DM area boundary has been exceeded.)A subroutine has called itself.An active subroutine has been called.7-27 Pulse Output Instructions7-27-1 SET PULSES – PULS(65)Ladder SymbolsOperand Data AreasP: Port specifierPULS(65)@PULS(65)PPCCNN000 or 010C: Control data000 or 001N: Number of pulsesIR, SR, AR, DM, HR, LR458Section 7-27Pulse Output InstructionsLimitationsThis instruction is supported by the CPM1A and CPM2A/CPM2C PCs withtransistor outputs only.N and N+1 must be in the same data area.DM 6144 to DM 6655 cannot be used for N.DescriptionPULS(65) is used to set the number of pulses for pulse outputs that are startedlater in the program using SPED(64) or ACC(––).

The number of pulses set withPULS(65) are output in independent mode.The number of pulses cannot be changed while pulses are being output. In general, PULS(65) should be executed just once each time that the number ofpulses needs to be set; use the differentiated variation (@PULS(65)) or an inputcondition that is ON for just one cycle.Note Refer to 2-5 Pulse Output Functions for more details.Port Specifier (P)The port specifier indicates the pulse output location. The parameters set by thein C and N will apply to the next SPED(64) or ACC(––) instruction in which thesame port output location is specified.PPulse output location(s)000 Single-phase pulse output 0 without acceleration or deceleration (output01000) or single-phase pulse output 0 with trapezoidal acceleration and deceleration (outputs 01000 and 01001)010 Single-phase pulse output 1 without acceleration or deceleration (output01001)This setting is supported by CPM2A/CPM2C PCs only.Control Data (C)The control data determines the type of pulses (relative or absolute).CPulse type000 Relative pulse specification001 Absolute pulse specification (Valid only when the absolute coordinate systemis being used.)This setting is supported by CPM2A/CPM2C PCs only.Number of Output Pulses (N+1 and N)N+1 and N contain the 8-digit BCD number of output pulses setting for independent mode pulse outputs.

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

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

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

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