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

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

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

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

In the comparison table, comparison conditions (for comparing tothe PV) and interrupt routine combinations are saved.Target value:A maximum of 16 comparison conditions (target values and count directions) and interrupt routine combinations are saved in the comparison table.When the counter PV and the count direction match the comparison conditions, then the specified interrupt routine is executed.Range (zone) comparison:Eight comparison conditions (upper and lower limits) and interrupt routinecombinations are saved in the comparison table.

When the PV is greaterthan or equal to the lower limit and less than or equal to the upper limit, thenthe specified interrupt routine is executed.81SectionCPM1/CPM1A Interrupt FunctionsTarget ValueComparisons2-3The current count is compared to the target values in the order that target valuesare set in the comparison table and interrupts are generated as the count equalseach target value. Once the count has equaled all of the target values in thetable, the target value is set to the first target value in the table, which is againcompared to the current counted until the two values are equal.CountInterruptsComparison TableTarget value 1Target value 2Target value 3Target value 4Target value 5Initial valueTarget value12345The current count is compared in cyclic fashion to all of the ranges at the sametime and interrupts are generated based on the results of the comparisons.Range ComparisonsComparison Table0Count132Rage setting 1Rage setting 2Rage setting 3Rage setting 44Note When performing target value comparisons, do not repeatedly use the INI instruction to change the current value of the count and start the comparison operation.

The interrupt operation may not work correctly if the comparison operation is started immediately after changing the current value from the program.(The comparison operation will automatically return to the first target value oncean interrupt has been generated for the last target value. Repetitious operationis thus possible merely by changing the current value.)ProgrammingUse the following steps to program the high-speed counter.The high-speed counter begins the counting operation when the proper PC Setup settings are made, but comparisons will not be made with the comparisontable and interrupts will not be generated unless the CTBL(63) instruction isexecuted.The high-speed counter is reset to “0” when power is turned ON and when operation begins.The present value of high-speed counter is maintained in SR 248 and SR 249.Controlling High-speed Counter Interrupts1, 2, 3...1.

Use the CTBL(63) instruction to save the comparison table in theCPM1/CPM1A and begin comparisons.(@)CTBL(63)PCTBC: (3 digits BCD)000:Target table set and comparison begun001:Range table set and comparison begun002:Target table set only003:Range table set onlyTB: Beginning word of comparison table82SectionCPM1/CPM1A Interrupt Functions2-3If C is set to 000, then comparisons will be made by the target matchingmethod; if 001, then they will be made by the range comparison method.The comparison table will be saved, and, when the save operation is complete, then comparisons will begin. While comparisons are being executed,high-speed interrupts will be executed according to the comparison table.For details on the contents of the comparison tables that are saved, refer tothe explanation of the CTBL(63) instruction in Section 7 Instruction Set.Note The comparison results are normally stored in AR 1100 throughAR 1107 while the range comparison is being executed.If C is set to 002, then comparisons will be made by the target matchingmethod; if 003, then they will be made by the range comparison method.

Foreither of these settings, the comparison table will be saved, but comparisons will not begin, and the INI(61) instruction must be used to begin comparisons.2. To stop comparisons, execute the INI(61) instruction as shown below.(@)INI(61)000001000To start comparisons again, set the second operand to “000” (execute comparison), and execute the INI(61) instruction.Once a table has been saved, it will be retained in the CPM1/CPM1A duringoperation (i.e., during program execution) as long as no other table is saved.Reading the PVThere are two ways to read the PV.

The first is to read it from SR 248 andSR 249, and the second to use the PRV(62) instruction.Reading SR 248 and SR 249The PV of high-speed counter is stored in SR 248 and SR 249 as shown below.The leftmost bit will be F for negative values.Leftmost 4 digitsSR 249NoteRightmost 4 digitsSR 248Up/Down ModeIncrementing ModeF0032767 to 00032767(–32767)00000000 to 000655351. These words are refreshed only once every cycle, so there may be a difference from the actual PV.2. When high-speed counter is not being used, the bits in these words can beused as work bits.Using the PRV(62) InstructionRead the PV of the high-speed counter by using the PRV(62) instruction.(@)PRV(62)000P1: Leading word of PV000P1The PV of the high-speed counter is stored as shown below. The leftmost bit willbe F for negative values.Leftmost 4 digitsP1+1Rightmost 4 digitsP1Up/Down ModeF0032767 to 00032767(–32767)Incrementing Mode00000000 to 0006553583SectionCPM1/CPM1A Interrupt Functions2-3The PV is read when the PRV(62) instruction is actually executed.Changing the PVThere are two ways to change the PV of high-speed counter.

The first way is toreset it by using the reset methods. (In this case the PV is reset to 0.) The secondway is to use the INI(61) instruction.The method using the INI(61) instruction is explained here. For an explanation ofthe reset method, refer to the beginning of this description of high-speed counter.Change the timer PV by using the INI(61) instruction as shown below.(@)INI(61)D: Leading word for storing PV change data000002DLeftmost 4 digits Rightmost 4 digitsD+1DUp/Down ModeF0032767 to 00032767Incrementing Mode00000000 to 00065535To specify a negative number in up/down mode, set F in the leftmost digit.Application Example(Incrementing Mode)This example shows a program that uses the high-speed counter with singlephase inputs in the Incrementing Mode, making comparisons by means of thetarget matching method.The comparison conditions (target values and count directions) are stored in thecomparison table with the subroutine numbers.

Up to 16 target values can bestored. The corresponding subroutine is executed when the counter’s PVmatches the target value.The following data is stored for the comparison table:DM 00000002 Number of comparison conditions: 2DM 00011000 Target value 1: 1000DM 00020000DM 00030030 Comparison 1 interrupt subroutine no.: 30DM 00042000 Target value 2: 2000DM 00050000DM 00060031 Comparison 2 interrupt subroutine no.: 31The following diagram shows the example ladder program.

DM 6642 must beset to 014, where is the reset method which can be set to 0 or 1.25315 (ON for first cycle)CTBL(63)000000DM 0000SBN(92)Registers comparison table, target value modeFirst word of the comparison table030Interrupt program 30RET(93)SBN(92)031Interrupt program 31RET(93)84CPM1/CPM1A Interrupt FunctionsApplication Example(Up/Down Mode)Section2-3This example shows a program that uses the high-speed counter with phase-difference inputs in the Up/Down Mode, making comparisons by means of therange comparison method.The comparison conditions (upper/lower limits of the ranges) are stored in thecomparison table with the subroutine numbers.

Up to 8 separate ranges can bedefined. The corresponding subroutine is executed when the counter’s PV iswithin the range.Note Always set 8 ranges. If fewer than 8 ranges are needed, set the remaining subroutine numbers to FFFF. A value of FFFF indicates that no subroutine is to beexecuted.The following data is stored for the comparison table:DM 00001500DM 00010000 Lower limit 1: 1,500 countsDM 00023000DM 00030000 Upper limit 1: 3,000 countsDM 00040040 Range 1 interrupt subroutine no.: 40DM 00057500DM 00060000 Lower limit 2: 7,500 countsDM 00070000DM 00080001 Upper limit 2: 10,000 countsDM 00090041 Range 2 interrupt subroutine no.: 41DM 00100000DM 00110000DM 00120000DM 00130000DM 0014FFFF Range 3 interrupt subroutine not executed...............DM 00350000DM 00360000DM 00370000DM 00380000DM 0039FFFF Range 8 interrupt subroutine not executed85SectionSRM1(-V2) Interrupt Functions2-4The following diagram shows the example ladder program.

DM 6642 must beset to 010, where is the reset method which can be set to 0 or 1.25315 (ON for first cycle)CTBL(63)000001DM 0000Registers comparisonrange comparison modetable,First word of the comparison tableSBN(92)040Interrupt program 40RET(93)SBN(92)041Interrupt program 41RET(93)2-4SRM1(-V2) Interrupt FunctionsThis section explains the settings and methods for using the SRM1(-V2) interrupt functions.2-4-1 Types of InterruptsThe SRM1(-V2) has only one type of interrupt processing, as outlined below.Interval Timer InterruptsInterrupt processing is executed by an interval timer with a precision of 0.1 ms.2-4-2 Interval Timer InterruptsThe SRM1(-V2) is equipped with one interval timer. When the interval timertimes out, the main program is interrupted and the interrupt program is executedimmediately, regardless of the point in the cycle.There are two modes for interval timer operation, the One-shot Mode, in whichonly one interrupt will be executed when time expires, and the Scheduled Interrupt Mode in which the interrupt is repeated at a fixed interval.The interval timer’s set value can be set anywhere from 0.5 to 319,968 ms, inunits of 0.1 ms.OperationUse the following instruction to activate and control the interval timer.Starting Up in One-Shot ModeUse the STIM(69) instruction to start the interval timer in the one-shot mode.(@)STIM(69)C1C2C31, 2, 3...86C1: Interval timer, one-shot mode (000)C2: Timer set value (first word address)C3: Subroutine no.

(4 digits BCD): 0000 to 00491. When C2 is entered as a word address:C2: Decrementing counter set value (4 digits BCD): 0000 to 9999C2 + 1: Decrementing time interval (4 digits BCD; unit: 0.1 ms): 0005 to 0320(0.5 ms to 32 ms)Each time that the interval specified in word C2 + 1 elapses, the decrementing counter will decrement the present value by one. When the PV reaches0, the designated subroutine will be called just once and the timer will stop.SectionSRM1(-V2) Interrupt Functions2-4The time from when the STIM(69) instruction is executed until time elapsesis calculated as follows:(Content of C2) × (Content of C2 + 1) × 0.1 ms = (0.5 to 319,968 ms)2.

When C2 is entered as a constant:The set value of the decrementing counter will equal the specified constant(in ms) and the decrementing time interval will be 10 (1 ms).Starting Up in Scheduled Interrupt ModeUse the STIM(69) instruction to start the interval timer in the scheduled interruptmode.(@)STIM(69)C1C2C31, 2, 3...C1: Interval timer, scheduled interrupt mode (003)C2: Timer set value (leading word no.)C3: Subroutine no. (4 digits BCD): 0000 to 00491. When C2 is entered as a word address:C2: Decrementing counter set value (4 digits BCD): 0000 to 9999C2 + 1: Decrementing time interval (4 digits BCD; unit: 0.1 ms): 0005 to 0320(0.5 ms to 32 ms)The meanings of the settings are the same as for the one-shot mode, but inthe scheduled interrupt mode the timer PV will be reset to the set value anddecrementing will begin again after the subroutine has been called. In thescheduled interrupt mode, interrupts will continue to be repeated at fixed intervals until the operation is stopped.2.

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

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

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

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