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

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

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

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

One instruction block thus consists of all the instructions between where you can draw a horizontal line across the ladder diagramwithout intersecting any vertical lines and the next place where you can draw thesame type of horizontal line.6-3-2Mnemonic CodeThe ladder diagram cannot be directly input into the PC via a Programming Console; the SSS is required. To input from a Programming Console, it is necessaryto convert the ladder diagram to mnemonic code.

The mnemonic code providesexactly the same information as the ladder diagram, but in a form that can betyped directly into the PC. Actually you can program directly in mnemonic code,although it in not recommended for beginners or for complex programs. Also,regardless of the Programming Device used, the program is stored in memory inmnemonic form, making it important to understand mnemonic code.Because of the importance of the Programming Console as a Programming Device and because of the importance of mnemonic code in complete understanding of a program, we will introduce and describe the mnemonic code along withthe ladder diagram.

Remember, you will not need to use the mnemonic code ifyou are inputting via the SSS (although you can use it with the SSS if you prefer).Program Memory Structure306The program is input into addresses in Program Memory. Addresses in ProgramMemory are slightly different to those in other memory areas because each address does not necessarily hold the same amount of data. Rather, each addressholds one instruction and all of the definers and operands (described in moreSectionBasic Ladder Diagrams6-3detail later) required for that instruction.

Because some instructions require nooperands, while others require up to three operands, Program Memory addresses can be from one to four words long.Program Memory addresses start at 00000 and run until the capacity of ProgramMemory has been exhausted. The first word at each address defines the instruction.

Any definers used by the instruction are also contained in the first word.Also, if an instruction requires only a single bit operand (with no definer), the bitoperand is also programmed on the same line as the instruction. The rest of thewords required by an instruction contain the operands that specify what data isto be used. When converting to mnemonic code, all but ladder diagram instructions are written in the same form, one word to a line, just as they appear in theladder diagram symbols. An example of mnemonic code is shown below. Theinstructions used in it are described later in the manual.AddressInstruction00000000010000200003000040000500006LDANDORLD NOTORAND LDMOV(21)OperandsHRDM000070000800009000100001100012000130001000010000200100001010000000CMP(20)DMHR0000002550520000DMDM00000500005020000520001ANDOUTMOV(21)LDANDOUTThe 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 operand column is leftblank for first line. It is a good idea to cross through any blank data columnspaces (for all instruction words that do not require data) so that the data columncan be quickly scanned to see if any addresses have been left out.When programming, addresses are automatically displayed and do not have tobe input unless for some reason a different location is desired for the instruction.When converting to mnemonic code, it is best to start at Program Memory address 00000 unless there is a specific reason for starting elsewhere.6-3-3Ladder InstructionsThe ladder instructions are those instructions that correspond to the conditionson the ladder diagram.

Ladder instructions, either independently or in combination with the logic block instructions described next, form the execution conditions upon which the execution of all other instructions are based.307SectionBasic Ladder DiagramsLOAD and LOAD NOT6-3The first condition that starts any logic block within a ladder diagram corresponds to a LOAD or LOAD NOT instruction. Each of these instruction requiresone line of mnemonic code. “Instruction” is used as a dummy instruction in thefollowing examples and could be any of the right-hand instructions described later in this manual.00000AddressA LOAD instruction.0000000001000020000300000A LOAD NOT instruction.InstructionLDInstructionLD NOTInstructionOperands0000000000When this is the only condition on the instruction line, the execution condition forthe instruction at the right is ON when the condition is ON.

For the LOAD instruction (i.e., a normally open condition), the execution condition would be ON whenIR 00000 was ON; for the LOAD NOT instruction (i.e., a normally closed condition), it would be ON when 00000 was OFF.AND and AND NOTWhen two or more conditions lie in series on the same instruction line, the firstone corresponds to a LOAD or LOAD NOT instruction; and the rest of the conditions, to AND or AND NOT instructions. The following example shows threeconditions which correspond in order from the left to a LOAD, an AND NOT, andan AND instruction. Again, each of these instructions requires one line of mnemonic code.0000000100LR 0000InstructionAddress00000000010000200003InstructionLDAND NOTANDInstructionOperandsLR00000001000000The instruction would have an ON execution condition only when all three conditions are ON, i.e., when IR 00000 was ON, IR 00100 was OFF, and LR 0000 wasON.AND instructions in series can be considered individually, with each taking thelogical AND of the execution condition (i.e., the total of all conditions up to thatpoint) and the status of the AND instruction’s operand bit.

If both of these are ON,an ON execution condition will be produced for the next instruction. If either isOFF, the result will also be OFF. The execution condition for the first ANDinstruction in a series is the first condition on the instruction line.Each AND NOT instruction in a series would take the logical AND between itsexecution condition and the inverse of its operand bit.308SectionBasic Ladder DiagramsOR and OR NOT6-3When two or more conditions lie on separate instruction lines running in paralleland then joining together, the first condition corresponds to a LOAD or LOADNOT instruction; the rest of the conditions correspond to OR or OR NOT instructions. The following example shows three conditions which correspond in orderfrom the top to a LOAD NOT, an OR NOT, and an OR instruction.

Again, each ofthese instructions requires one line of mnemonic code.00000Instruction00100LR 0000Address00000000010000200003InstructionOperandsLD NOTOR NOTORInstruction00000001000000LRThe instruction would have an ON execution condition when any one of the threeconditions was ON, i.e., when IR 00000 was OFF, when IR 00100 was OFF, orwhen LR 0000 was ON.OR and OR NOT instructions can be considered individually, each taking thelogical OR between its execution condition and the status of the OR instruction’soperand bit. If either one of these were ON, an ON execution condition would beproduced for the next instruction.Combining AND and ORInstructionsWhen AND and OR instructions are combined in more complicated diagrams,they can sometimes be considered individually, with each instruction performinga logic operation on the execution condition and the status of the operand bit.The following is one example.

Study this example until you are convinced thatthe mnemonic code follows the same logic flow as the ladder diagram.00000000010000200003Instruction00200Address000000000100002000030000400005InstructionLDANDORANDAND NOTInstructionOperands0000000001002000000200003Here, an AND is taken between the status of IR 00000 and that of IR 00001 todetermine the execution condition for an OR with the status of IR 00200. Theresult of this operation determines the execution condition for an AND with thestatus of IR 00002, which in turn determines the execution condition for an ANDwith the inverse (i.e., and AND NOT) of the status of IR 00003.309SectionBasic Ladder Diagrams6-3In more complicated diagrams, however, it is necessary to consider logic blocksbefore an execution condition can be determined for the final instruction, andthat’s where AND LOAD and OR LOAD instructions are used.

Before we consider more complicated diagrams, however, we’ll look at the instructions required tocomplete a simple “input-output” program.6-3-4OUTPUT and OUTPUT NOTThe simplest way to output the results of combining execution conditions is tooutput it directly with the OUTPUT and OUTPUT NOT. These instructions areused to control the status of the designated operand bit according to the execution condition.

With the OUTPUT instruction, the operand bit will be turned ONas long as the execution condition is ON and will be turned OFF as long as theexecution condition is OFF. With the OUTPUT NOT instruction, the operand bitwill be turned ON as long as the execution condition is OFF and turned OFF aslong as the execution condition is ON. These appear as shown below. In mnemonic code, each of these instructions requires one line.Address00000010000000000001InstructionLDOUTOperands00000010000000101001Address0000000001InstructionLDOUT NOTOperands0000101001In the above examples, IR 01000 will be ON as long as IR 00000 is ON andIR 01001 will be OFF as long as IR 00001 is ON.

Here, IR 00000 and IR 00001would be input bits and IR 01000 and IR 01001 output bits assigned to the Unitscontrolled by the PC, i.e., the signals coming in through the input points assignedIR 00000 and IR 00001 are controlling the output points assigned IR 01000 andIR 01001, respectively.The length of time that a bit is ON or OFF can be controlled by combining theOUTPUT or OUTPUT NOT instruction with Timer instructions. Refer to Examples under 7-15-1 Timer – TIM for details.310SectionBasic Ladder Diagrams6-3-56-3The END InstructionThe last instruction required to complete a simple program is the END instruction. When the CPU Unit scans the program, it executes all instructions up to thefirst END instruction before returning to the beginning of the program and beginning execution again.

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

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

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

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