📄 4.2.4 事件方式.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0058)http://www.ekany.com/wdg98/cg/contents/chapter4/les424.htm -->
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD><TITLE>4</TITLE>
<META http-equiv=Content-Type content="text/html; charset=GB2312">
<META content=FrontPage.Editor.Document name=ProgId>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<META content="Microsoft Word 9" name=Originator><LINK
href="les424.files/filelist.xml" rel=File-List><LINK
href="les424.files/editdata.mso" rel=Edit-Time-Data><!--[if !mso]>
<STYLE>v\:* {
BEHAVIOR: url(#default#VML)
}
o\:* {
BEHAVIOR: url(#default#VML)
}
w\:* {
BEHAVIOR: url(#default#VML)
}
.shape {
BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]--><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>zlj</o:Author> <o:Template>Normal</o:Template> <o:LastAuthor>zlj</o:LastAuthor> <o:Revision>2</o:Revision> <o:TotalTime>2</o:TotalTime> <o:Created>1999-04-16T02:58:00Z</o:Created> <o:LastSaved>1999-04-16T03:00:00Z</o:LastSaved> <o:Pages>4</o:Pages> <o:Words>238</o:Words> <o:Characters>1358</o:Characters> <o:Company>CSCIMS</o:Company> <o:Lines>11</o:Lines> <o:Paragraphs>2</o:Paragraphs> <o:CharactersWithSpaces>1667</o:CharactersWithSpaces> <o:Version>9.2812</o:Version> </o:DocumentProperties></xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:PunctuationKerning/> <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:Compatibility> <w:SpaceForUL/> <w:BalanceSingleByteDoubleByteWidth/> <w:DoNotLeaveBackslashAlone/> <w:ULTrailSpace/> <w:DoNotExpandShiftReturn/> <w:AdjustLineHeightInTable/> <w:UseFELayout/> </w:Compatibility> </w:WordDocument></xml><![endif]-->
<STYLE>@font-face {
font-family: 宋体;
}
@font-face {
font-family: 楷体_GB2312;
}
@font-face {
font-family: @宋体;
}
@font-face {
font-family: @楷体_GB2312;
}
@page {mso-page-border-surround-header: no; mso-page-border-surround-footer: no; }
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin: 42.55pt; mso-footer-margin: 49.6pt; mso-paper-source: 0; layout-grid: 15.6pt; }
P.MsoNormal {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-style-parent: ""; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
LI.MsoNormal {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-style-parent: ""; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
DIV.MsoNormal {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-style-parent: ""; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
H3 {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 16pt; MARGIN: 13pt 0cm; TEXT-INDENT: 21.25pt; LINE-HEIGHT: 173%; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-pagination: lines-together; mso-fareast-font-family: 楷体_GB2312; mso-font-kerning: 1.0pt; mso-style-next: 正文; mso-outline-level: 3; mso-layout-grid-align: none; mso-fareast-language: EN-US
}
P.MsoBodyTextIndent {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; FONT-FAMILY: 宋体; TEXT-ALIGN: justify; mso-pagination: none; mso-font-kerning: 1.0pt; mso-layout-grid-align: none; mso-fareast-language: EN-US; mso-hansi-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"
}
LI.MsoBodyTextIndent {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; FONT-FAMILY: 宋体; TEXT-ALIGN: justify; mso-pagination: none; mso-font-kerning: 1.0pt; mso-layout-grid-align: none; mso-fareast-language: EN-US; mso-hansi-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"
}
DIV.MsoBodyTextIndent {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; FONT-FAMILY: 宋体; TEXT-ALIGN: justify; mso-pagination: none; mso-font-kerning: 1.0pt; mso-layout-grid-align: none; mso-fareast-language: EN-US; mso-hansi-font-family: "Times New Roman"; mso-bidi-font-family: "Times New Roman"
}
A:link {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
P.MsoDocumentMap {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; BACKGROUND: navy; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
LI.MsoDocumentMap {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; BACKGROUND: navy; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
DIV.MsoDocumentMap {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; BACKGROUND: navy; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify; mso-pagination: none; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 宋体; mso-font-kerning: 1.0pt
}
DIV.Section1 {
page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="1027"/></xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=ZH-CN style="TEXT-JUSTIFY-TRIM: punctuation; tab-interval: 21.0pt"
vLink=purple link=blue>
<H3 style="TEXT-INDENT: 0cm"><FONT face=楷体_GB2312 size=4><SPAN lang=EN-US
style="mso-fareast-language: ZH-CN">4.2.4 </SPAN><SPAN
style="FONT-FAMILY: 楷体_GB2312; mso-fareast-language: ZH-CN; mso-ascii-font-family: 'Times New Roman'">事件方式</SPAN><SPAN
lang=EN-US style="mso-fareast-language: ZH-CN"><o:p></o:p></SPAN></FONT></H3>
<P class=MsoBodyTextIndent><SPAN style="mso-fareast-language: ZH-CN"><FONT
face=楷体_GB2312
size=4>当某一台设备被设置成事件方式,程序和设备将同时工作。从设备输入的数据都可存放在一个事件队列或输入队列中。所有被设置成事件方式的输入数据(或事件)都可存放在一个事件队列中。在任一个时刻,事件队列按输入数据的顺序存放数据,并含有一个最大的数据类型项,在队列中的输入数据可按照逻辑设备类型、工作站号、物理设备编码进行检索。在应用程序中,检索事件队列可用下述命令:<SPAN
lang=EN-US><o:p></o:p></SPAN></FONT></SPAN></P>
<P class=MsoBodyTextIndent><SPAN lang=EN-US><FONT face=楷体_GB2312
size=4>await_event(time,device_class,ws,device_code)<o:p></o:p></FONT></SPAN></P>
<P class=MsoBodyTextIndent style="TEXT-INDENT: 0cm"><SPAN lang=EN-US
style="mso-fareast-language: ZH-CN"><FONT face=楷体_GB2312
size=4>time是应用程序设置的最长等待时间,当事件队列为空时,事件处理进程就挂起,直到最长等待时间已过或又有一个事件进入,才恢复事件处理进程。若在输入数据之前,等待时间就已过去,则参数device_class就返回一个空值。当time被赋成零或当队列为空,程序就立即返回到其它的处理过程。<o:p></o:p></FONT></SPAN></P>
<P class=MsoBodyTextIndent><SPAN style="mso-fareast-language: ZH-CN"><FONT
face=楷体_GB2312 size=4>当用<SPAN
lang=EN-US>await_event命令使某设备进入事件输入控制方式,而且事件队列为非空时,在队列的第一个事件就被传送到当前事件记录中,对于定位器、笔划设备、在device_class参数中存放了它们的类型。为了从当前事件记录中检索一个输入的数据,还需要采用一个事件输入方式命令,其格式类似与请求、取样方式的命令,但在此命令中不需要有工作站和设备码参数,因为在数据记录中已有这些参数。用户可用下述命令从当前事件记录中得到一个定位数据:<o:p></o:p></SPAN></FONT></SPAN></P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -