⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ibhnet_with_delphi.htm

📁 s5,s7用link与软PLC通信的例程
💻 HTM
字号:
<html>

<head>
<meta http-equiv="Content-Language" content="de">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Use of the IBHNet Component with Borland Delphi</title>
</head>

<body>

<p><b><font face="Arial" size="4">Use of the IBHNet Component with Borland
Delphi.</font></b></p>
<p>&nbsp;</p>
<p><font face="Arial">Create a new Project.</font></p>
<p><font face="Arial">Import the Type Library of the component you want to use
by selecting &quot;Project - Import Type Library&quot;. From the list, select
&quot;IBHNet Type Library (Version 1.0)&quot;, then click &quot;OK&quot;.</font></p>
<p><font face="Arial">Delphi will add the file &quot;IBHNETLib_TLB.pas&quot;
file to your project, which contains all the functions and methods, that are
exported by the IBHNet component.</font></p>
<p><font face="Arial">Add the imported file to the &quot;uses&quot; section of
your project (in the sample: The &quot;uses&quot; section of the form).</font></p>
<p><font face="Courier New" size="2">uses<br>
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, IBHNETLib_TLB;<br>
</font></p>
<p><font face="Arial">Also add the units required to use ActiveX and COM to the
project.</font></p>
<p><font face="Courier New" size="2">uses<br>
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, IBHNETLib_TLB,<br>
  StdCtrls, ActiveX;<br>
</font></p>
<p><font face="Arial">Add the interface of the object you want to use as a
variable with the scope required. In the sample we have added the variable
global to the form in the &quot;var&quot; section of the form.</font></p>
<p><font face="Courier New" size="2">var<br>
  Form1: TForm1;<br>
  IBHNet_Obj: IIIBHnet;<br>
  Value: OleVariant;<br>
</font></p>
<p><font face="Arial">Initialize the component you want to use, using the
functions generated during Import in the IBHNETLib_TLB.pas file, as shown in the
sample in the FormCreate event handler.</font></p>
<p><font face="Arial">Examine the event handlers to see how reading and writing
values from/to the PLC is managed.</font></p>
<p><font face="Arial">One of the important things when using Delphi is, that that
you make yourself familiar with safearrays and other automation compliant data
types like the Variant data type. This is especially important, if you want to
use the block-read (ReadVals) and block-write (WriteVals) functions of the
IBHNet component.</font></p>
<p>&nbsp;</p>
<p><font face="Arial">Your <b><i>IBHsoftec</i></b> support Team</font></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>

</body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -