You're viewing an old version of the documentation. Click here to see the latest release.

创建一个HALCON中的”Hello World”程序

介绍

本教程展示了如何使用HALCON创建和开始开发Zivid HDevelop程序。

要求

备注

测试的HALCON版本是19.05 Progress。

说明

下面的屏幕截图提供了分步说明。

创建ZividHelloWorld.hdev

启动HALCON,然后单击 FileNew Program。将以下代码添加到 Program Window main ()

<c>* Connect to the camera</c>
<l>open_framegrabber ('GenICamTL',1, 1, 0, 0, 0, 0, 'progressive', -1, 'default', -1, 'false', 'default', 'default', 0, 0, AcqHandle)</l>
<c/>
<c>* Create a window and print 'Hello World!'</c>
<l>dev_open_window (0, 0, 512, 512, 'black', WindowHandle)</l>
<l>write_string(WindowHandle,'Hello World!')</l>

将代码保存为*ZividHelloWorld.hdev*至所需的位置。

运行程序

按键盘上的 F5 键运行程序。

HDevelop中的HALCON Hello World脚本

查 看 HALCON samples 并开始开发!