《程序设计基础教程 - -C语言版》实验指导手册

更新时间:2024-06-04 14:38:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

Manipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand四川师范大学数学与软件科学学院信息与计算科学专业

《程序设计基础教程----C语言版》课程实验

指导手册

本实验指导手册旨在指导数学与软件科学学院信息与计算科学专业《程序设计基础教程----C语言版》(专业必修课)的实验教学活动过程。其主要使用对象为本课程主讲教师和实验指导教师。它可以作为教学过程中的教学辅助参考资料,也可以作为学生在本门课程的学习中,结合实际教学内容,完成相关实验并填写实验报告的主要依据。具体实施过程中,除开各实验中要求的必做题目外,教师可结合实际教学情况,根据学生接受程度作适当扩展。学生在进行实践设计活动时,也可以结合自身掌握和学习的实际情况进行有选择地实践。

本指导手册仅针对本学院信息与计算科学专业而设置。 本实验手册编写的参考书籍:

1.《程序设计基础教程----C语言版》,冯山,马廷淮 主编,北京:科学出版社,2008年5月

2.《C语言程序设计教程(第二版)》,谭浩强,张基温,唐永炎 编著,北京:高等教育出版社,2002年3月

3.《C语言习题集与上机指导(第二版)》,谭浩强,张基温 主编,北京:高等教育出版社,2002年1月

引言

程序设计是实践性很强的课程。实践也是学好程序设计课程中必不可少的重要环节。程序设计的实践分两个步骤:一是设计和编写解决问题的程序算法流程,并在此基础上编写源程序代码;二是在计算机上对程序进行调试,并使程序完成问题的求解过程,进行相应的逻辑测试。

实验过程中,应当注意如下问题:

(1) 上机实习的主要目的是训练C语言程序的上机调试能力和分析、解决调试过程中遇到的问题的能力。并在此过程中逐步提高程序编写与问题分析能力。而不是简单地对教材上的实例做验证式的操作;

(2) 上机内容可以结合教材内容和习题,或由老师布置专门的上机习题进行; (3) 为提高上机效果。必须在上机之前准备好上机的基本内容并编写好上机程

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that is Manipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand 序,尽量在上机之前先作好预先的阅读分析工作;

(4) 上机调试的基本方法:语法检查(编译)==>逻辑检查(设计者检查)==>测试。

上机实验的主要步骤:

(1) 了解实验目的和要求,并椐此复习或阅读相关教材内容;

(2) 根据题目要求,事先编写好程序,并经过设计者静态检查程序的语法正确性和逻辑正确性,分析可能出现的问题;

(3) 设计好上机时准备测试程序的用例;

(4) 上机调试通过程序,并记录上机调试中出现的问题和测试结论等,写出实验报告。

调试过程中,尤其要注意各种语法错误、逻辑错误调试经验的积累。 实验报告的主要内容: (1) 实验题目; (2) 目的要求;

(3) 程序说明(如程序结构、各模块的算法和数据结构等); (4) 经调试后的程序清单; (5) 测试情况说明;

(6) 分析(包含没有通过的程序的原因分析)。

实验报告的具体内容填写格式,参见《四川师范大学实验报告手册》格式的规定。其中,程序清单请附着在相应的实验单元后面,程序结果、说明与分析等写在实验结果处,如不够,可另行附页。

实验一 C语言程序的运行环境和运行一个C语言程序的方法

(2学时)

实验目的:

(1) 熟悉所用计算机系统的基本操作方法以及在该系统下安装、编辑、编译、连接和运行一个C语言源程序的基本操作步骤(以Turboc C为基本背景);

(2) 学习基本的C语言程序设计与调试环境设置方法; (3) 通过运行简单的C语言程序,了解C语言程序的特点。 实验内容:(要求至少调试3个以上的简单程序)

1.如果系统没有安装TC环境,则安装,否则,跳过此步;

2.配置好TC环境,熟悉TC编辑器的基本操作命令及其它基本功能;

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand3.完成并熟悉程序输入、编译、连接、运行过程,直到程序输出结果正确; 4.学习基本的调试程序方法(包含编译、连接错误信息的正确理解); 5.可参考的程序实例如下(也可以参考教材范例):

1) 最简单的C语言程序: int main(void) {

printf(\ return 0; }

2) 引用C语言函数库进行计算的程序:

/*Please try exercises in chapter one of textbook in page 15*/ #include \int main(void) {

float fX;

fX=sin(2.2922);

printf(\ return 0; } 3) 引用自定义函数的C语言程序:

/*This is the function of average for data fA,fB,fC*/ float average(float fA,float fB,float fC) {

float fAvg;

fAvg=(fA+fB+fC)/3.0; return fAvg; }

int main(void) {

float x1,x2,x3;

printf(\ scanf(\ printf(\

fX1,fX2,fX3,average(fX1,fX2,fX3));

return 0; } 4) 求1+2+3+...+100; 5) 给定5个数,求其最小者; 6) 求a+|b|。 实验准备:

(1) 计算机设备;(2) 程序调试环境的准备,如TC环境;(3) 实验源程序准备。 实验步骤:

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand (1) 安装TC,如果已安装好,可以跳过此步; (2) 进入TC的编辑窗口,进行基本的环境设置; (3) 熟悉基本的TC编辑操作方法和文件创建、保存方法;

(4) 输入一个C语言源程序,进行编辑、编译、连接、运行。完成一个简单的程序设计,运行输出正确结果;

(5) 输入其它源程序并进行调试(注意错误提示信息); (6) 编写实验报告。 实验结果:

(1) 对TC的安装、调试、基本操作、环境设置方法等方面进行描述; (2) 对TC程序的执行过程和结果进行分析;

(3) 给出实验过程中出现的主要问题和现象以及解决的方法; (4) 程序代码及运行结果描述。

实验二 数据类型、运算符和表达式(2学时)

实验目的:

(1) 掌握C语言的数据类型的声明、定义、赋值及引用;

(2) 掌握变量和常量之间的关系,以及各种常见的常量表示方法;

(3) 掌握C语言的有关运算。算术运算中的自反、自增(++)、自减(--)运算符的使用;关系表达式和逻辑表达式的逻辑值表示方法和基本运算规律;学会在C语言环境下表示条件表达式;

(4) 掌握不同类型数据之间的转换和赋值方法。 实验内容:

主要参考实例或内容(也可以参考教材或习题实例):

1. 请变成实现教材P54页题2-4(目的:观察各种数据类型的分配空间大小); 2. 教材相关内容为基础,考察变量的声明、定义、使用的先后关系;考察不同数据类型变量之间相互赋值的结果;考察各种形式的常量表示;

3. 基本的C语言运算规律,尤其是算术运算中的自反、自增、自减等运算和关系表达式、逻辑表达式的特殊运算规律的掌握。(可参考教材习题中的2-13,2-14和2-18,例2-20);

4. 关于不同数据类型之间的转换问题,参见教材例2-5~例2-12。

注:由于本章内容是基本的程序设计基础内容,所有这些内容必须要求熟练掌握和运用。因此,其中一些实验实例由教师在课堂实践教学中进行现场示范性讲解,

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand由学生课外自由验证课堂范例、教材范例以及教材习题和相关课外参考书籍和资料,进行综合性的验证实践,并写出心得报告。具体实验范例不需要确定下来。 实验准备:

分析测试目的并根据它准备好实验内容的各种测试用例。 实验步骤:

(1) 选择测试目标;

(2) 准备测试用例和具体的测试数据; (3) 上机调试进行测试并做测试记录; (4) 进行测试分析; (5) 编写实验报告。 实验结果:

(1) 根据测试目标写出测试报告; (2) 测试结果分析说明; (3) 测试程序代码清单。

实验三 最简单的C语言程序设计(2学时)

实验目的:

(1) 掌握顺序结构的程序设计概念、方法及各种赋值语句的使用方法; (2) 掌握基本的C语言程序设计中的输入、输出语句的使用方法。 实验内容:

1. 熟悉表3-1~表3-5中给出的格式化输入、输出格式控制符及其使用方法,并上机测试教材表例3-1~例3-10,观察C语言中的数据格式化输入、输出规律和方法;

2.输入并编辑以下程序代码:

int main(void) {

int nA,nB; float fC,fD; long lE,lF;

unsigned int u,v; char ch1,ch2;

scanf(\ scanf(\ scanf(\ scanf(\ scanf(\ printf(\

printf(\

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that is

Manipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand printf(\ printf(\ printf(\

printf(\ return 0; }

请分析和观察代码有无错误,如果有,有哪些?指出错误原因,并修正之,使其可以按照预想的目的输入相应数据并输出结果;

3. 输入华氏温度的值F,要求输出摄氏温度的取值C,其中,C=5/9*(F-32)。要求输出有文字说明,取两位小数位;

4. 用getchar()函数读入两个字符ch1,ch2,然后分别用putchar()和printf()函数输出这两个字符。试分析思考如下问题:(a) ch1和ch2的数据类型用什么?(b) 要求输出ch1和ch2的ASCII码,应如何处理?是用pringf()还是用putchar()?(c) 整型变量是否在任何情况下都可以相互代替?

5.*请编写和实现教材习题3-15,3-16,3-17和3-18,至少要求实现其中一个问题。 实验准备:

(1) 复习相关内容,阅读并分析1、2、3中的相关程序代码; (2) 对4、5题进行程序代码编写。 实验步骤:

(1) 对照阅读分析结果,上机验证1、2、3的结果,并做出相应分析; (3) 对4、5题进行上机调试,并进行测试、做测试记录; (4) 进行实验分析; (5) 编写实验报告。 实验结果:

(1) 根据测试目标写出测试报告; (2) 测试结果分析说明; (3) 测试程序代码清单。

实验四 分支结构的程序设计(4学时)

实验目的:

(1) 掌握C语言程序设计中逻辑量的表示和运用方法;

(2) 掌握C语言程序设计中条件表达式的值的计算方法及其跟程序执行流程之间的逻辑顺序关系;

(3) 掌握C语言中的4种选择结构语句的执行逻辑及其运用方法。

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand实验内容:

1. if 语句的实验。请分析如下语句段的逻辑关系:

int main(void) { ...

if (nA>1 && nB==0) nX=nX/nA; if (nA==2 || nX>1) nX=nX+1; ...

return 0; }

(a) 以算法流程图的形式表述;

(b) 增加输入、输出功能以补充完整该程序段,使之能够运行; (c) 测试该程序段的各种条件组合下的运行结果。测试数据组如下:

nA nB nX 1 1 1 1 1 2 3 0 1 2 0 4 2 1 1 1 0 2 2 1 2 3 0 2 (d) 分析讨论:

1) 用哪组数据就可以使程序段中每个处理语句都执行一次?为了找出程序中的逻辑错误,应使用什么样的数据进行测试?请上机验证自己的分析结果。

2) 用哪两组数据可以使程序段中的每个分支都至少运行一次?为找出各个分支中的逻辑错误,应选用什么样的数据进行逻辑测试?请上机验证自己的分析结果。

3) 用哪四组数据可以将从起点到终点的各条路径都覆盖一次?为了测试程序在各个不同路径上的错误,应选用什么样的测试数据?请上机验证自己的分析结果。

2. if else语句实验。用if else句型,编写求4个数中最大者的程序,并设计测试用例、记录测试结果;

3. 试用if else if else if ...else实现求4个数中最大者的程序,并做相应测试; 4. 试用switch语句句型实现以上程序,并做相应测试; 5. 请理清习题5-23的逻辑关系,上机进行验证。 实验准备:

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand (1) 阅读并分析第1题中的逻辑关系及其分支测试方法; (2) 分析并编写2、3、4题(需要绘制流程图)的程序代码。 实验步骤:

(1) 对照阅读分析结果,上机验证1题的测试结果,并做出相应分析; (2) 上机运行和测试所写的2、3、4、5题程序代码; (3) 进行实验分析; (4) 编写实验报告。 实验结果:

(1) 根据测试目标写出测试报告; (2) 测试结果分析说明; (3) 测试程序代码清单。

实验五 循环控制程序的设计(4学时)

实验目的:

(1) 复习和掌握算法的基本组成要素和描述特点;

(2) 在实验四的基础上,学习几种常见的循环程序的流程关系和运用方法; (3) 不同循环类型之间的转换方法; (4) 循环的应用。

实验内容:(1和2必做,3和4选做)

1.循环实验(教材习题5-20)。具体要求:

(1) 绘制流程图,编制程序代码。

(2) 分析不进入循环、只循环一次、只循环两次、进入死循环的条件,以及

此时各变量的值。

(3) 分析循环退出时的条件表达式值。 (4) 如何测试循环的次数?

(5) 能否将程序改写成另外的形式,如while改写成do while或for语句? (6) 总结条件循环的设计、实现步骤和测试方法。

2.计数型循环实验(教材习题5-30):九九表及其变体形状的打印。具体要求如下:

(1) 分析并绘制九九表的程序实现代码(右上三角形状); (2) 分析程序的执行过程;

(3)* 请在此基础上修改部分程序代码以打印如下一些变形九九表:右下三

角、左上三角、左下三角、倒序排列等形状,并观察、分析和总结其规律。 (4) 分析并总结计数型循环在do while, while和for循环句型中的实现方法

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand和步骤。

3.其它实验题目:

(1) 习题5-1(小孩吃梨问题); (2) 习题5-4(水果拼盘问题);

(3) 求两个非负整数u和v的最大公因子; (4) 求两个非负整数的最小公约数; (5) 用牛顿迭代法求解正实数a的平方根; (6) 用梯形法求函数的数值积分;

(7) 把由键盘输入的数列(1,3,5,7,9...)按相反的顺序(如...9,7,5,3,1)输出。

4.习题5-27和习题5-28。

实验准备:

(1) 编写所选实验题目的程序代码和流程图; (2) 检查源程序并给出其可能的运行结果说明。 实验步骤:

(1) 上机验证所选题目,并做相应测试和分析; (2) 进行实验分析;

(3) 总结循环程序设计、实现本方法及其经验; (4) 编写实验报告。 实验结果:

(1) 根据测试目标写出测试报告; (2) 测试结果分析说明; (3) 测试程序代码清单。

实验六 基于函数的模块化程序设计(4学时)

实验目的:

(1) 了解和掌握C语言环境下模块化程序设计的基础----基于函数模块的程序设计技术;

(2) 复习C语言程序的基本结构特点,了解基于函数模块的程序模块及其调用关系、过程;

(3) 函数的声明、定义、使用方法; (4) 对各种变量属性的使用方法;

(5) 对C语言中常用的预编译语句的基本掌握。

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand 实验内容:(第1题任选其两个小题,第2题和第3题必做)

1.函数的声明、定义和使用方法。具体实例如下: (1) 编写一个在屏幕上画一条正弦曲线的函数;

(2) 编写一个函数,它可以求出给定数的所有因子,如下形式显示其结果:72=2*2*2*3*3;

(3) 分别写出一个求N个数的最大公约数和最小公倍数的递归函数; (4) 试编制n碟片hanoi塔的问题求解函数,并利用它求解4个盘片的结果; (5) 试编写求n!的函数,并求n=7的结果。 具体要求如下:

(1) 编写程序通过调试获得正确结果; (2) 分析函数的声明、定义和使用方法; (3) 分别分析函数调用时的参数传值调用方法。

2.有关变量的属性实验(静态、动态、全局、局部等方面)。具体实例如下: (1) 仔细分析以下程序的执行结果,然后上机运行如下程序段,并对各个变量的属性及其使用结果进行比较分析:

int main(void)

{ /******(a)******/ int nX=1;

{/******(b)******/ void prt(void); int nX=3; prt();

printf(\ }/******(c)******/

printf(\ return 0; }

void prt(void)

{ /******(d)******/ int nX=5;

printf(\ }/******(e)******/

(2) 仔细分析下列程序,是否有错误之处?然后分析其执行结果,上机验证并对各个变量的存储属性及其结果进行比较分析:

#define LOW 11 #define HIGH 23 #define CHANGE 12 int i=LOW; int main(void)

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that is

Manipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand{

int workover(int i); int reset(int i); int i=HIGH; reset(i/2.5);

printf(\ reset(i=i/3);

printf(\ reset(i/2);

printf(\ workover(i);

printf(\ return 0; }

workover(int i); {

i=(i%i++)*((i*i)/(2*i)+4); printf(\ return (i); }

reset(int i); {

i=i<=CHANGE?LOW:HIGH++; return (i); }

(3) 分析、编辑并执行以下程序,如果有错,请指出其错误原因,同时需要指出各个变量的存储属性。

/*****file1.c*****/ int last(void); int new(int); int reset(void); exter int i; int main(void) {

int i,j; i=reset();

for (j=1;j<=3;j++) {

printf(“i=%d\\tj=%d\\n”,i,j); printf(“next(i)=%d\\t”,next(i)); printf(“last(i)=%d\\n”,last());

printf(“new(i+j)=%d\\n”,new(i+j)); }

int next(void) {

return (i++); }

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his twcontent control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that iss: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing hereas now it is successfully developed into industrial control computer used as a central collection and distribution system o great advantageused to control, wManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand return 0; }

/*****file2.c*****/ static int i=10; fast(void) {

rturn (i-=1_); }

new(int i) {

static int j=-5; return (i=j+=++i); }

/*****file3.c*****/ extern int i; reset() {

return (i); }

3.预编译命令实验。具体实例如下: (1) 一般宏替换实验(教材例7-5);

(2) 带参数的宏替换(教材例7-7~例7-12,习题7-8和习题7-9); (3) 习题7-11和习题7-12;

(4) 文件包含(#include \和#include <>)。 实验准备:

(1) 编写所选实验题目的程序代码和流程图; (2) 检查源程序并给出其可能的运行结果说明。 实验步骤:

(1) 上机验证所选题目,并做相应测试和分析; (2) 进行实验分析;

(3) 总结基于函数、宏等技术的模块化程序设计和实现方法及其经验; (4) 编写实验报告。 实验结果:

(1) 根据测试目标写出测试报告; (2) 测试结果分析说明; (3) 测试程序代码清单。

实验七 数组(6学时)

实验目的:

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand(1) 掌握C语言环境下数组的声明、定义和使用方法,包含其初始化、赋值、输入、输出和处理方法;

(2) 掌握字符数组和字符串数组的使用方法;

(3) 了解数组作为函数参数或返回值的传递和使用方法。 实验内容:(第1题必做,第2、3、4任选一个)

1.数组的基本使用方法实验。包含数组的声明方法、初始化方法、输入、输出方法、元素的引用方法以及数组作为函数参数的使用方法。

(1) 一维数组的声明、初始化及引用方法; (2) 二维数组的声明、初始化及引用方法;

(3) 字符数组和字符串数组的初始化及引用方法的差异分析; (具体实例参见教材实例)

测试函数声明和定义方法时,可以从以下几个方面进行测试:

1) 用已声明和定义的变量作为数组大小的声明; 2) 用已声明的const变量作为数组变量大小的声明; 3) 用宏名表示声明数组变量的大小; 4) 用表达式计算结果作为数组变量的大小; 5) 用宏的运算结果表示声明数组变量的大小。

(4) 分别按行序和列序顺序返回一个二维数组中各个元素的内存空间地址

值,以观察数组元素在计算机内存中的排列规律。 2.一维数组的应用。具体实例如下:

(1) 有一个数组大小为10,内放10个数,请找出其中对大和最小元素来,并

分别将其与数组第1个元素和最后1个元素交换。

(2) 有17个人围成一圈,其编号分别为1到17,如果从1号开始报数,凡报到7

的倍数的人必须离开该圈子,然后再接着往下数,直到最后只剩一个人为止。请问最后一个人原来的位置序号是多少?(扩展问题:请将每个人按出列顺序重新排列后,其排列的顺序是什么?) 3.二维数组应用。具体实例如下:

(1) 输入一个n*n的矩阵。1) 试求除开对角线上元素之外的元素之和;2) 求

每行中与相应对角线元素不同的元素之和;

(2) 有n个学生,m门功课。要求:1) 找出成绩最好的学生及其对应的课程

号码;2) 求全部同学每门课程的平均成绩; 4.字符数组应用。具体实例:

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand (1) 有三行文字,请找出其中空格的个数,并统计单词的个数。(注:单词

以一个或多个空格为间隔。如果一个单词刚好在行末结束,则下一行开头应该有空格,包含句号和逗号后面也应该有空格!)

(2) 输入n个国家的名字,要求按照字母的先后顺序排序,并输出排序前后的结果。 实验准备:

(1) 编写所选实验题目的程序代码和流程图; (2) 检查源程序并给出其可能的运行结果说明。 实验步骤:

(1) 上机验证所选题目,并做相应测试和分析; (2) 进行实验分析;

(3) 总结基于数组的程序设计和实现方法及其经验; (4) 编写实验报告。 实验结果:

(1) 根据测试目标写出测试报告; (2) 测试结果分析说明; (3) 测试程序代码清单。

实验八 指针(4学时)

实验目的:

(1) 掌握C语言环境下指针的声明、定义和使用方法; (2) 掌握指针和变量以及指针和数组的关系; (3) 掌握指针、数组之间的关系; (4) 掌握指针、函数之间的关系。 实验内容:

1.熟悉指针的基本使用方法。

(1) 请仔细分析以下程序段,并上机测试运行结果,对测试结果进行分析说明。

1) 程序段一:

int main() {

int i=3,j=6,k=9;

printf(“i=%d j=%d k=%d\\n”,*(&i),j,k); return 0; }

2) 程序段二:

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begandint main(void) {

int nA,*p; float fB,*q; p=&nA; q=&fB;

scanf(“%d,%f”, p, q); *p=nA*(*q);

printf(“nA is %d, p is %d and *p is %d\\n”, nA, p,*p); printf(“fB is %f, q is %d and *q is %d\\n”, nA, q,*q); printf(“p+1=%d q+1=%d\\n”,p+1,q+1); return 0; }

3) 程序段三:

int main(void) {

int nA,*p,**q,***r; p=&nA;q=&p;r=&q;

printf(“Please input nA::\\n”); scanf(“%d”,**r);

printf(The results are :”);

printf(“nA’ value is %d,%d,%d,%d\\n”,nA,*p,**q,***r); printf(“nA,p,q,r’s value is %d,%d,%d,%d\\n”,nA,p,q,r); return 0; } (2) 设计一个C语言程序,以测试以下表达式的运算顺序。

2. 想使指针变量pt1指向变量nA和nB中的大者,pt2指向其小者,以下程序能否实现此目的?为什么?如果不行,请给出实现的方法。

void swap(int *pt1,int *pt2) {

int *p;

p=p1;p1=p2;p2=p; }

int main(void) {

int nA,nB; int *pt1,*pt2;

scanf(“%d,%d”,&nA,&nB); pt1=&nA;pt2=&nB;

if (nA

3.请仔细分析教材例9-2、9-3、9-6~9-11,上机调试之。记录并分析程序运行结

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that is

Manipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand 果。

4.请仔细分析并执行以下程序段,并给出输入数据下的运行结果: int main(void) {

int fun1(); int fun2(); int fun3(); int fun4();

int (*function[4])(); int nA=10,nB=5,i; function[0]=fun1; function[1]=fun2; function[2]=fun3; function[3]=fun4; for (i=0;i<4;i++)

printf(“fun No.%d->%d\\n”,i+1,execute(nA,nB,function[i])); return 0; }

int execute(int nX,int nY,int *func()) {return ((*fun)(nX,nY));} int fun1(int nX,int nY) {return (nX+nY);} int fun2(int nX,int nY) {return (nX-nY);} int fun3(int nX,int nY) {return (nX*nY);} int fun4(int nX,int nY) {return (nX/nY);}

对如下main()函数,假设源程序名为list.c,则对编译连接后的list.exe程序,在DOS界面运行时输入命令行时,其执行结果是什么?为什么?

/*Second main() program*/ int main(int argc,char *argv[]) {

while (argc?1) printf(“%s\\n”,*++argv); return 0; }

实验准备:

(1) 编写所选实验题目的程序代码和流程图; (2) 检查源程序并给出其可能的运行结果说明。 实验步骤:

(1) 上机验证所选题目,并做相应测试和分析; (2) 进行实验分析;

(3) 总结指针及其程序设计、实现方法和经验; (4) 编写实验报告。 实验结果:

(1) 根据测试目标写出测试报告; (2) 测试结果分析说明;

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand(3) 测试程序代码清单。

实验九 结构体和共用体(4学时)

实验目的:

(1) 掌握C语言环境下结构体和共用体类型变量的定义和使用方法; (2) 掌握结构体类型数组的概念和使用;

(3) 掌握指向结构体变量的指针变量、尤其是链表概念; 实验内容:

1. 首先熟悉结构体类型变量的基本声明方法、结构体类型变量的内存分配原则、初始化和引用结构体变量及其成员变量的基本方法;然后掌握结构体变量的输入、输出方法。(参见教材例10-1~10-5)

2.基于结构体数组的应用实验。

(1) 有n个学生,每个学生的数据包括学好(num)、姓名(name[20])、性别(sex)、年龄(age),以及三门课程的成绩(score[3])。要求:在main()函数中输入这些学生的这些数据,然后设计一个函数count()来计算每个学生的总分和平均分,最后,打印出所有数据信息(包含原来输入的学生原始数据信息和求解出来的新信息)。

(2) 对第(1)题实验,求出其中成绩最好的人和成绩最差的人,并显示出来。(假定成绩最好和最差的人都只有一个)

(3)* 如果假定成绩最好和最差的人的个数不一定唯一,程序应该如何修改才能完成求出所有最好和最差者,以及输出它们来。

3.*链表实验。

(1) 建立一个链表,每个结点包含:职工号、工资。用malloc()函数开辟新结点,用free()函数回收不用的结点空间。要求从键盘输入5个员工的数据信息(用create_list()),然后,用函数output_list()将它们一一打印出来,用free_list()将链表中的结点空间回收。假设职工编号为1001,1005,1008,1010,1101。

注:malloc()和free()为系统函数。create_list(),output_list(),free_list()为用户自定义函数。

(2) 在(1)的基础上,新增一个函数inset_node()插入员工1006和1032的数据信息。要求新插入的员工后,员工仍然按职工号顺序排列。

(3) 在(2)的基础上,新增一个函数delete_node(),可以用来将指定员工的数据从链表中删除。

(4) 在(3)的基础上,增加回收所删除结点所占内存空间的功能。

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand (5)* 如何查看和测试链表中结点的内存空间地址?能否由此分析(1)、(2)、(3)中链表结点的逻辑结构? 实验准备:

(1) 复习有关结构体方面的所有知识,尤其是10-3-4节所学的动态存储分配技术;

(2) 编写所选实验题目的程序代码和流程图; (3) 检查源程序并给出其可能的运行结果说明。 实验步骤:

(1) 上机验证所选题目的程序设计结果,并做相应测试和分析; (2) 进行实验分析;

(3) 总结结构体程序设计和实现的基本方法及其经验,尤其是链表技术; (4) 编写实验报告。 实验结果:

(1) 根据测试目标写出测试报告; (2) 测试结果分析说明; (3) 测试程序代码清单。

实验十 位运算和文件操作(2学时)

实验目的:

(1) 掌握位运算的基本概念和方法,以及有关位运算的常见算法和基本应用; (2) 掌握文件和文件指针概念,以及文件的一般定义、操作方法。在此基础上了解有关文件的基本应用并熟悉相关函数。

注:重点掌握缓冲文件系统的操作和运用,在此基础上了解和熟悉文件的顺序读写和随机读写方法。 实验内容:

1. 熟悉位运算的基本操作方法。(以教材例11-1为基础)

2. 了解和熟悉位运算的基本应用。(以教材例11-2~11-6为基础) 3. 熟悉文件操作的基本步骤。(以例12-1~12-7为基础)

4. 了解文件的读、写函数的使用方法。(以例12-8~12-10为基础) 实验准备:

(1) 复习有关位运算和文件操作的基本知识;

(2) 仔细分析教材所提供的各程序实例及其可能执行结果; 实验步骤:

(1) 上机执行各实例程序,并做相应测试和分析;

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand(2) 总结基于位运算的程序设计特点及其可能的应用领域;总结文件的基本结构及其操作步骤,以及应用文件的主要问题领域。 (3) 编写实验报告。 实验结果:

(1) 根据测试目标写出测试报告; (2) 测试结果分析说明; (3) 测试程序代码清单。

补充:

1. Ken Thompson(计算机科学家、UNIX的鼻祖、C语言创始人之一)在1983年度ACM的TM奖颁奖大会上所陈述的其曾经编写过的最精练的C语言程序段。请分析该程序段的功能,并上机验证之。

char s[]={

‘\\t’, ‘0’, ‘\\n’, ‘}’, ‘;’, ‘\\n’, ‘\\n’, ‘/’, ‘*’, ‘\\n’, 0

}; /*其中,最后的0以前有213行被删除*/

int main() {

int i;

printf(“char \\ts[]={\\n”); for(i=0;s[i];i++)

printf(“\\t%d,\\n”,s[i]); printf(“%s”,s); return 0; }

2.历史上风格最差的(精巧的C)程序获得者Spencer Hines所写的程序(1987年USENIX大会上Award for Best One-Liner奖)。请分析该程序段的功能和执行结果,并上机运行验证之。

#include char **malloc();

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand int main(togo,toog) int togo; char *toog[]; {

char *ogto,

tgoo[80];FILE *ogot;int ootg,otog=79;

ottg=1;if(togo==ottg) goto gogo;goto goog;ggot; if (fgets(tgoo,otog,ogot)) goto gtgo;goto gott;

gtot:exit();ogtg:++oogt;goto ogoo;togg:if(ootg>0) goto oggt;goto ggot;ogog:if(!ogot) goto gogo; goto ggto;gtto:printf(“%dgoto\\’s\\n”,oogt);

goto gtot;oggt:if(!memcmp(ogto,“goto”,4)) goto otgg; goto gooo;gogo:exit(ottg);tggo:ootg=strlen(tgoo); goto tgog;oogo:--ootg;goto togg;

goo:--ogto;goto oogo;gott;fclose(ogto); goto gtto;otgg:ogto=ogto+3;

goto ogtg;tgog:ootg-=4;goto togg;gtgo:ogto=tgoo; goto tggo;ogoo:ootg-=3;goto gooo;goog:ogot=fopeb( toog[ottg],“r”);goto ogog;ggto:ogto=tgoo;goto ggot;} return 0; }

实验指导手册制定人:冯山

2008年9月

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that is

Manipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand

Turbo C2.0简介

Turbo C由Borland公司开发的用于微型计算机上的C编译器。它具有友好的集成用户界面、丰富的库函数。其集成功能模块中包括了编辑、编译、链接和调试、运行功能于一体。其提供的编译方式有两种:一是TC;一是TCC。TCC类似于UNIX操作系统中的C语言环境提供的CC和MS C中提供的CL命令(如果以它们为编译环境进行实验和开发,可以参考相关的手册资料)。

本手册以TC集成环境为主进行实验。因此,下面介绍其基本情况。

一. 安装

传统的TC安装方法,请参见有关的文献和手册(尤其是以软盘为基础的安装方法)。本实验手册提供一个简洁的自解压TC压缩包进行自动安装。步骤如下:

(1) 复制压缩包(TC.EXE)到准备建立TC环境的文件夹或目录;

(2) (双击)执行TC.EXE;(注:此TC.EXE是TC集成环境的可执行文件,与第(1)

步的自解压压缩包文件TC.EXE不同!)

注:可以观察到,在当前文件夹下新建了一个新的TC文件夹。

二. 基本环境配置

(1) 执行TC子文件夹中的TC.EXE文件;

(2) 通过ALT+O(Options),然后选择D功能(Directories),设置基本寻找路径:

1)LIB目录路径;2)INCLUDE目录路径;3)C程序代码所在目录路径;4) 结果输出目录路径;

(3) 通过ALT+O下的S功能(Save Options),将目录路径信息保存在TC配置文件

TCCONFIG.TC中(通常都在TC.EXE执行文件所在的文件夹中) 注:此时,就可以编辑、编译和链接、执行相关的C语言程序了。

三. TC功能简介

总体功能模块如图1所示。

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand 图1 Turbo C主界面(编辑界面)

运行TC进入的集成环境主界面(图1),可以看到有File, Edit, Run, Compile, Project, Options, Debug, Break/Watch等功能模块。其中,各菜单项名的第一个字符是红色,表明该字符是选择该菜单项的热键。所谓热键指的是快速选中的操作键,一般以ALT+热键字符或功能键完成选择功能。

图2 Turbo C的File菜单界面

File----主要是有关文件的操作命令。如Load, Pick, New, Save, Write to, Directory, Change dir, Os shell, Quit等(如图2所示)。其功能如下:

1) Load (F3):从当前路径把一个源文件装入编辑缓冲区;

2) Pick (Alt+F3):打开一个Pick表,以便选中最近打开过的文件(不超过8个文件);

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand3) New:清除编辑缓冲区中的内容,并将新文件装入(默认为NONAME.C); 4) Save (F2):将正在编辑的文件及时存盘。(第1次存盘时需要给出文件名字,默认为NONAME.C);

5) Write to:改变正在编辑的文件名字,并写入磁盘(与Save as相似); 6) Directory:列出当前目录下的文件,以便选择; 7) Change dir:改变当前目录路径名字;

8) Os shell:暂时离开TC环境,进入操作系统界面(注:TC并没有退出!); 9) Quit (Alt+X):退出TC,返回DOS。

Edit----进入编辑区以编辑、修改源程序。主要的编辑功能命令如下(如图1所示): 1) 光标定位型命令:一类是纯粹的光标键表示

(?,?,Home,End,PgDn,PgUp,Up,Down等);一类是组合键表示。组合键以基准键上的ASDF为基础,结合QWER和ZXCV,可以方便地记忆其组合键的功能(由它们物理位置的中心点和水平、垂直中线为界,向左、右、上、下扩展成对记忆!)。例如:

Ctrl+S----左移一字符距离,Ctrl+D----右移一字符距离; Ctrl+A----左移一单词距离,Ctrl+F----右移一单词距离; Ctrl+X----上移一行,Ctrl+E----下移一行; Ctrl+W----上滚一次,Ctrl+Z----下滚一次; Ctrl+QE----光标移动到当前窗口的开始位置; Ctrl+QX----光标移动到当前窗口的底部位置; Ctrl+QR----光标移动到文件的开始位置; Ctrl+QC----光标移动到文件的结尾位置; Ctrl+QP----光标移动到上次的位置; Ctrl+QB----光标移动到块的开始位置; Ctrl+QK----光标移动到块的结尾位置; 2) 编辑型命令:

Ins----Insert On/Off; Del---删除光标处的字符;

BackSpace----删除光标之前的字符; Ctrl+N----在当前行插入一行; Ctrl+Y----删除当前光标所在的行;

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand Ctrl+T----删除光标相邻的左边单词; Ctrl+QY----删除光标到本行尾部的内容; 3) 块操作命令:

以BLOCK记忆相关操作命令。

Ctrl+KB----标记块的开始位置;Ctrl+KK----标记块的尾部位置; Ctrl+KC----块的复制;Ctrl+KV----块的移动;Ctrl+KY----块的删除; Ctrl+KH----块的隐藏;Ctrl+KR----块的盘读取;Ctrl+KW----块的盘写入 4) 其它命令:

Ctrl+U----取消上次操作;Ctrl+KD----保存退出;Ctrl+KQ----放弃退出; Ctrl+QF----寻找;Ctrl+QA----寻找并替换;Ctrl+QN----寻找标记处;

图3Turbo C的Run菜单界面 Run----运行程序。用Alt+R选中,然后单击Run即可。其快捷键为Ctrl+F9。其运行结果的查看用Alt+R后,选中user Screen(快捷键为Alt+F5)。(如图3所示)

Run (Ctrl+F9):编译、链接成目标文件和可执行文件,最后运行程序(注:这几步是自动执行的)。

Program reset(Ctrl+F2):终止当前的调试操作,释放分配给程序的空间,关闭已经打开的文件,但不释放断点设置。主要用于程序的动态调试中终止当前调试过程。

Go To cursor (F4):在动态调试过程中,使程序从当前调试位置运行到编辑窗口中光标所在的行位置。

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begandTrace into (F7):动态调试中,对当前光标所在的行,如果是函数调用,且Optiions/Compile/Code generation/Obj debug information为on状态,则自动跟进当前光标行中的函数之内部。

Step over (F8):用于动态调试时,运行到当前函数之下一语句,而不跟进函数内部去。

User screen (Alt+F5):显示屏幕输出结果。

图4 Turbo C的Compile菜单界面

Compile----编译程序。用Alt+C,然后选中Compile即可。其中,Make是对已编译的程序2#代码连接成.EXE,Build all项是无条件编译所有源程序文件(如图4所示)。具体如下:

Compile to OBJ----将源程序编译成2#目标文件; Make EXE file----将有效的.obj文件链接成.exe文件。

Link EXE file---由支撑库和.obj文件一起生成可执行的.exe文件; Build all---无条件编译和链接;

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that is

Manipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand 图5 Turbo C的Compile菜单界面

Project----处理多模块时的管理使用。可以用一个工程管理多个C语言源程序文件。有关工程文件的知识和使用方法,可参见Turbo C的帮助或相关资料 (如图5所示)。

Project name:给出工程文件名(.prj文件)。是产生.EXE和.MAP文件的主文件名。 Break make on:在Make时的终止缺省条件。有Warning, Error, Fatal Error和Link四种情况下,可以终止Make过程。

Auto Dependencies:自动检查.c文件和.obj文件的日期和时间关系。当为on时,如果.c文件时间和.obj文件中存放的编译时间不一致,则重新编译。当为off时,则不作此检查。

Clear project:清除project。

Remove messages:清除消息窗口中的错误信息。

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand图6-1-1 Turbo C的Options/Compiler/Model菜单界面

图6-1-2 Turbo C的Options/Compiler/Code generation菜单界面

图6-1-3 Turbo C的Options/Compiler/Optimization菜单界面

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand 图6-1-4 Turbo C的Options/Compiler/Source菜单界面

图6-1-5 Turbo C的Options/Compiler/Errors菜单界面

图6-1-6 Turbo C的Options/Compiler/Names菜单界面

Options----系统环境参数配置选项。主要用于配置Turbo C的集成工作环境(见图

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand6-1到图6-6)。它包含Compiler, Linker, Environment, Directories, Arguments, Save options, Retrieve options等子菜单。各子菜单还有更低一级的子菜单项。

(A) Compiler的子功能如图6-1-1到图6-1-6所示。

1) Model:Tiny, Small, Medium, Compact, Large, Huge等6种。分别表示程序模式的内存访问空间的类型。

2) Defines:用于预先定义一些宏、赋值语句等命令,以便所有程序中使用。 3) Code generation:用于控制所生成的目标代码形式。例如: Calling convention----选择参数传递方式,如c或Pascal。 Instruction----选择指令系统,如8088/8086或80186/80286。

Floating point----选择浮点运算模式。其中,Emulation表示用软件模拟的方法实现浮点数;8087/80287表示选择用8087/80287协处理器进行浮点运算;none----表示无浮点运算。

Default char type----规定字符默认类型:signed和unsigned。 Alignment----字的地址对齐方式:Word或Byte。

4) Optimization:控制生成代码的优化策略。例如:Optimization for size/speed表示要么对生成代码的规模大小上优化,要么对生成代码的速度进行优化;Use register variables用于设置是否允许使用寄存器变量;Jump optimization表示是否除去多余的跳转和重新调解循环等;off表示不进任何优化工作。

5) Source:主要用于配置源代码的控制设置。例如:Identifier length表示标识符中有效字符的个数,默认为32,可以设置为1-32范围之间;Nested comments表示是否允许在注释中允许使用嵌套;ANSI keywords only表示是用ANSI标准的关键字还是用Turbo C的关键字。

6) Error:用于控制编译器处理和响应诊断信息的配置。例如:Error stop after表示报告编译错误的个数。默认为25个,范围可设置成0-255;Warning stop for表示警告的个数。默认为100个,可设置成0-255;Display warnings选择显示警告信息的类型。其余子项及更低级子项的设置类推。

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand 图6-2 Turbo C的Options/Linker菜单界面

(B) Linker的子功能如图6-2所示。

1) Map file:控制是否产生映射文件.map。

2) Initialize segments:控制是否对没有初始化的段进行初始化。

3) Default libraries:对另外的编译器所编译的.obj文件中指定的缺省库表,在链接时是否需要寻找它们进行链接。

4) Graphics libraries:图形数据库是否需要打开。

5) Warn duplicate symbols:是否检查和报警与.lib文件中有重复的符号。 6) Stack warning:是否需要产生no stack警告信息。 7) Case-sensitive link:控制是否大小写敏感。

图6-3 Turbo C的Options/Environment菜单界面

(C) Environment的子功能如图6-3所示。

Message Tracking:控制当信息窗口中信息滚动时,Turbo C是否跟踪编辑器里的语法错误以及跟踪方式。Current File表示只跟踪当前编辑窗口中的文件;

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that is

Manipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begandAll Files表示加载并跟踪与错误信息相关的每个文件;off表示不跟踪。

Keep messages:On表示需要保存当前窗口中的信息;Off表示不保存。 Config auto save:表示在Run/Run或File/Os shell时,只要有选择项被改变,Turbo C是否自动保存该选择项。

Edit auto save:控制是否在编译时自动保存源文件。如Run/Run或File/Os shell或File/Quit时。

Backup files:控制是否在保存文件时自动生成原文件的.bak文件。

Tab size:设置TAB键表示的空格数。默认为8个空格,可选择2-16之间的值。 Zoomed windows:将现行窗口的大小放大到最大。等价于F5功能键的作用。 Screen size:设置屏幕的显示行数。标准为25行,EGA可设为43行,VGA可设为50行。

图6-4 Turbo C的Options/Directories菜单界面

(D) Directories的子功能如图6-4所示。

Include directories:指定include目录/文件夹所在的位置。 Library directories:指定lib目录/文件夹所在的位置。

Output directory:输出文件所在的目录/文件夹 (如.obj和.map等文件)。 Turbo C directory:指定Turbo C所在的目录/文件夹。

Pick file name:指定pick文件的文件名。默认为TCPICK.TP。

Current pick file:显示当前pick文件名和它所在的目录/文件夹(只是显示信息,不能修改)。

(E) Arguments用于指定命令行执行程序时所需的参数输入。

例如,对带参数的main()函数的执行时,可以利用此功能。 (F) Save options:将Options中的设置结果保存到环境配置文件TCCONFIG.TC中。

注:配置文件的名字可以修改。

(G) Retrieve save options:恢复以前保存的环境选项设置文件中的信息。

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detect the external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand 图7-1 Turbo C的Debug菜单界面

图7-2 Turbo C的Debug/Evaluate菜单界面

Debug----动态调试控制功能。主要用于动态跟踪程序的执行过程(如图7-1所示)。 (A) Evaluate:用于监视、跟踪程序执行过程中的语句或表达式的值的变化。从图7-2看,在跟踪过程中,还可以动态跟踪和修改程序中相关的参数值进行观察(从New value处输入新值)。注:在各个窗口条之间的切换方法是用TAB键完成。

(B) Call stack (Ctrl+F3):显示程序正在执行的函数调用序列。注:堆栈的特点是先进后出,因此,main()始终在栈的底端。从这里可以观察到函数调用顺序,同时,也可以观察到很多与此相关的参数情况。

(C) Find function:快速定位并显示编辑窗口中某一函数的声明和定义情形。 (D) Refresh display:当编辑屏幕被重写时,恢复当前屏幕的内容。

(E) Display swapping:在编辑窗口和用户窗口之间切换。Smart为缺省方式,表示在执行代码显示输出时显示用户屏,然后返回编辑窗口;None表示不切换;Always表示每执行一条语句就切换一次。

(F) Source debugging:控制编译器是否在可执行文件中加入调试信息。On表示加入;Standalone表示可加入,但只能用独立的工具Turbo debugger进行;None表示

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corrsponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that isManipulator is now used as a industrial robots in use, the control objectives often appear often in industrial automation. Industrial automation technology has gradually matured, as mature a technology line has been rapid development in industrial automation as a separate subject. Manipulator application began to filter into welding, logistics, mechanical processing, and other industries. Especially at high or very low temperatures, full of poisonous gases, high radiation case, robot in similar circumstances showed great use also brings great convenience to the staff. Precisely because of this robot to get people's attention began to be a high degree of development. Labor rates, working conditions, labor intensive aspects of promoting development. Both at home and abroad to develop the PLC (programmable logic controller) is in various special circumstances and under special conditions set for mechanical devices. Now turned on the development of the microelectronics automatic control technology and the rapid development of thetrains, the success of PLC hardware software and simulation control win big and successful development, now continues to develop as a factory automation standards. Because robots are good development of the technology makes a good optimization of productive capital, and robot shows this unique advantages, such as: has good compatibility, wide availability, hardware is complete, and programming that can be mastered in a short time, so in the context of industrial PLC applications became ubiquitous. Manipulator in many developed country agriculture and industry has been applied, such as the use of mechanical harvesting large areas of farmland, repeated operations on the high-speed line that uses a robotic arm, and so on. oday, the high level of automation combined with restrictions on the manipulator development level is slightly lower than the international. The design is mainly arm welding machine by PLC Automation control. This of design let designers on in school by learn of has a must of consolidation, understand has some usually didn't opportunities awareness in world range within some leading level of knowledge has has must awareness, hope designers can in yihou of design in the can success of using in this design in the proceeds of experience 1.2 manipulator in both at home and abroad of research profile automation mechanical arm research began Yu 20th century medium-term, after years with with computer and automation technology of development, Makes mechanical arm on the Grand stage of industrial automation and shine, gradually became an industrial evaluation standards, and its importance can be seen. Now original robotic arm spent most of mass production and use on the production line, which is programmed robotic arm. As the first generation of manipulator position control systems main features, although not back several generations that can detecthe external environment, but can still successfully complete like welding, painting, delivery as well as for materials simple movements. Second generation mechanicalarms are equipped with sensors and manipulators have the environment there is a certain amount of \chanical arm is to use the program as a basis. Difference is that the robot begand不加入。

Break/watch----断点设置和跟踪、观察。主要用于动态跟踪程序的执行过程(如图8所示)。

图8 Turbo C的Break/watch菜单界面

(A) Add watch (Ctrl+F7):加入一个准备跟踪监视的表达式。

(B) Delete watch :删除监视窗口中的表达式,默认为最后一个。 (C) Edit watch:修改监视窗口中的表达式。 (D) Remove all watches:删除所有表达式。

(E) Toggle Breakpoint (Ctrl+F8):在光标所在行设置断点。 (F) Clear all breakpoints:清除所有断点。

(G) View next breakpoint:把光标移到下一断点处。

manipulator control mode and programmable controllers introduction 2.1 Select discussion with manipulator control 2.1.1 classification of control relays and discrete electronic circuit can control old industrial equipment, but also more common. Mainly these two relatively cheap and you can meet the old-fashioned, simple (or simple) industrial equipment. So he can see them now, however these two control modes (relay and discrete electronic circuits) are these fatal flaws: (1) cannot adapt to the complex logic control, (2) only for the current project, the lack of compatibility and (3) not reforming the system with equipment improvements. Spring for the development of China's modern industrial automation technology the substantial increase in the level of industrial automation, completed the perfect relay of the computer too much. In terms of controlling the computer showed his two great advantages: (1) each of the hardware can be installed on one or more microprocessors; (2) the official designer of the software writing content control is all about. Now in several ways in the context of industrial automation can often be seen in three ways: (1) Programmable Logical Controller (referred to as IPC); (2) Distributed Control System (DCS for short), and (3) the Programmable Logical Controller (PLC for short). 2.1.2 PLC and the IPC and DCS contrast contrast 1, each of the three technologies of origins and development requirements for fast data processing makes it invented the computer. The men brought in terms of hardware there, using a high level of standardization, can use more compatibility tools, is a rich software resources, especially the need for immediacy in operational systems. So the computer can effectively control is used to control and meet its speed, on the virtual model, real-time and in computational requirements. Distributed system started with a control system for industrial automatic instrument used to control, whereas now it is successfully developed into industrial control computer used as a central collection and distribution system and transition of distributed control system in analogue handling, loop control, has begun to reflect the use of a huge advantage. Though distributed system has great advantages in loop regulation, but only as a means of continuous process control. Optimization of PLC is the corresponding relay needs was born, its main use in the work order control, early primary is replaced relay this hulking system, focused on the switch controlling the running order of functions. Marked by the microprocessor in the early 1970 of the 20th century emerged, micro-electronics technology has developed rapidly, people soon microelectronics processing technology will be used in the Programmable Logical Controller (that is

本文来源:https://www.bwwdw.com/article/pwm6.html

Top