数控技术专业英语 第2版 教学课件 ppt 作者 刘瑛 王莉 1_ CHAPTER10

上传人:E**** 文档编号:89376561 上传时间:2019-05-24 格式:PPT 页数:13 大小:93.50KB
返回 下载 相关 举报
数控技术专业英语 第2版  教学课件 ppt 作者  刘瑛 王莉  1_ CHAPTER10_第1页
第1页 / 共13页
数控技术专业英语 第2版  教学课件 ppt 作者  刘瑛 王莉  1_ CHAPTER10_第2页
第2页 / 共13页
数控技术专业英语 第2版  教学课件 ppt 作者  刘瑛 王莉  1_ CHAPTER10_第3页
第3页 / 共13页
数控技术专业英语 第2版  教学课件 ppt 作者  刘瑛 王莉  1_ CHAPTER10_第4页
第4页 / 共13页
数控技术专业英语 第2版  教学课件 ppt 作者  刘瑛 王莉  1_ CHAPTER10_第5页
第5页 / 共13页
点击查看更多>>
资源描述

《数控技术专业英语 第2版 教学课件 ppt 作者 刘瑛 王莉 1_ CHAPTER10》由会员分享,可在线阅读,更多相关《数控技术专业英语 第2版 教学课件 ppt 作者 刘瑛 王莉 1_ CHAPTER10(13页珍藏版)》请在金锄头文库上搜索。

1、Unit 10 Program Flow,第10单元 程序流程,Reading Target,After reading this unit, you should be able to understand the program flow of subroutine.,Text,Program flow deals with the arrangement of the programthe logic path that the control follows as it progresses through the program. Programs need not go direc

2、tly from the beginning command directly to the end. This is called linear logic. Within a CNC program, you may use branching logic and logic statements that shorten and simplify the program. 程序流程处理程序的组织问题即控制器处理程序的时候所遵循的逻辑路径。程序不必从开始的指令直接执行到最后,这即所谓的线性逻辑。在CNC程序中,可以通过分支逻辑和逻辑语句缩短并简化程序。,Text,There are dif

3、ferent kinds of program flow statements Loops and subroutines. Both loops and subroutines can be contained within other logic statementscalled nesting logic. Now subroutine logic will be mainly introduced in this text. 程序中存在不同的程序流程语句即循环和子程序。循环和子程序都可以包含在其他的逻辑语句之中,称为嵌套。这一节中我们主要学习子程序逻辑。,Text,10.1 Subro

4、utine Example The easiest logic statement to understand is the subroutine, a mini-program sometimes called a subprogram. Subroutines are called up within the body of the main program, but are actually a separate group of commands that are usually outside the main program. 10.1子程序语句 最容易理解的逻辑语句就是子程序,它

5、是一个小程序,有时也称作subprogram。子程序是在主程序体内被调用的,但实际上却是存在于主程序外的单独的一组指令。,Text,Refer to Fig. 10-1. One example of the application of a subroutine would be drilling twenty-four deep holes in the part shown .To save time, the drill need not peck until it has drilled a certain depth. The group of commands repeated

6、at each hole are written once and called a subroutine. After locating the tool each time, the drilling subroutine is called up by the main program. 如图10-1,这是一个用子程序在所示零件上加工24个一定深度孔的例子。为了节省时间直到钻头钻到一定深度才会停止钻孔。加工每一个孔都要重复的那些指令只需要编写一次,叫做子程序。每一次当刀具定位完后,主程序就会调用钻孔子程序。,Text,Fig. 10-1 Programming the drilling

7、of this plate is simplified using subroutine logic. (通过使用子程序逻辑,对该盘的钻孔编程得到了简化。),Text,10.2 CNC Logic Diagrams When we study program flow, we study the path that the program takes. The logic statements are arranged to cause the flow to branch to the subroutine then back to the main program. Because thi

8、s can be complicated to envision, we will use a line drawing to represent program syntax. 10.2CNC逻辑图表 在我们学习程序流程时会学习程序的执行路径。逻辑语句的作用是将程序流程分流到子程序然后再返回主程序。由于想象起来比较复杂,我们用一个线条图来说明程序的句法。,Text,Refer to Fig. 10-2 . A logic diagram is used by computer programmers to make sure that their syntax makes sense. A

9、logic diagram uses lines to follow the program flow and word statements to denote the actions taken at a particular branch of the logic. Figure 10-2 shows two holes being drilled using the drill subroutine. The twenty four-hole example would be repeated twenty two more times in exactly the same form

10、. 如图10-2,计算机编程人员利用逻辑图表来确保程序句法的可行性。逻辑图用线条来表示程序流程和程序语句,从而表示出特定逻辑分支的动作。,Text,Fig. 10-2 A logic diagram is used to check your program flow. (用于检查程序流程的逻辑图表),Text,Refer to Fig. 10-2. By looking at the diagram, you can easily see why this is called “branching logic.” The main program begins with a start ma

11、in statement. That symbolizes the beginning of the program. The main program located the tool and then calls sub 1. The program flow branches away from the main program at the call statement to the start subroutine, where it performs the peck drill program. 如图10-2,通过逻辑图表可以容易地理解分支逻辑的由来。主程序开始于Main函数,这

12、标志着一个程序的开始,当刀具被定位好后主程序就会调用sub 1. 碰到调用语句时,程序流程将从主程序分流到子程序的开始,在这里它将执行钻孔程序。,Text,This subroutine is ended with a sub-end word or code. Then the program flow branches back to the main program then executes one block beyond the sub-start word. The main program then relocates the tool and calls the sub ag

13、ain. This illustration shows only two runs of the subroutine. 子程序结束于一个sub-end字或代码。这时程序流程分支又会返回到主程序接着执行sub-start指令上面的一个语句块,主程序将重新定位刀具并再次调用子程序。图10-2中已经给出了应用钻削子程序所钻的两个孔,加工24个孔的例子中我们只需要再以严格相同的方式来重复调用子程序22次。,Key Terms,CIM Computer-integrated Manufacturing 计算机集成制造 database 数据库 DNC Direct Numerical Control 计算机直接数控 process planning 工艺规划 postproduction 后处理 inventory库存,

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 高等教育 > 大学课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号