ActiveX Control

Similar documents
The golden pins of the PCI card can be oxidized after months or years

Visual Basic D 3D

Microsoft PowerPoint - VB14.ppt

2 WF 1 T I P WF WF WF WF WF WF WF WF 2.1 WF WF WF WF WF WF

TC35短信发送程序设计

Microsoft Word - 小心翼翼的二十一點N.doc

TwinCAT 1. TwinCAT TwinCAT PLC PLC IEC TwinCAT TwinCAT Masc

投影片 1

untitled

投影片 1

Visual Basic AD/DA Visual Basic 2

游戏厅捕鱼技巧_天天酷跑游戏技巧 2048游戏技巧,游戏厅打鱼技巧_

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F

Chapter 16 集合

TPM BIOS Infineon TPM Smart TPM Infineon TPM Smart TPM TPM Smart TPM TPM Advanced Mode...8

行业

VB控件教程大全

Microsoft Word - CX1000-HMI_程序开发_PLC通讯

27 :OPC 45 [4] (Automation Interface Standard), (Costom Interface Standard), OPC 2,,, VB Delphi OPC, OPC C++, OPC OPC OPC, [1] 1 OPC 1.1 OPC OPC(OLE f

untitled

IsPostBack 2

RUN_PC連載_10_.doc

untitled

串口、网口猫池使用说明书

呼 喊 選 集 2 3 天 國 大 英 雄 基 督 徒 因 此 在 基 督 快 將 再 臨 的 前 夕, 思 想 施 洗 約 翰 的 道 路, 對 我 們 來 說, 是 具 有 時 代 意 義 的 施 洗 約 翰 其 人 工 作 需 要 人, 需 要 合 用 的 人 在 神 的 國 度 中, 祂 所

VB程序设计教程

Quick Start Guide

(W32) * (W32) WindowsWin32 API(DLL) Win32 API Visual Basic Visual C/C++ Windows XP/Server 2003/2000/NT/Me/98/95 (/) Windows XP / Server 2003 / 2000 /

Outline USB Application Requirements Variable Definition Communications Code for VB Code for Keil C Practice

穨文件1

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM

38 诚 信 始 于 入 口 从 入 口 处 着 手 打 好 律 师 队 伍 建 设 的 诚 信 基 础 / 刘 彦 平 4 0 我 国 证 券 公 司 治 理 缺 陷 的 根 源 及 其 出 路 / 黄 运 成 曹 里 加 李 畅 4 3 中 止, 因 为 什 么? 被 告 人 胡 鹏 等 五 人

ThreeDtunnel.doc

6020

<4D F736F F D D342DA57CA7DEA447B14D2DA475B57BBB50BADEB27AC3FEB14DA447B8D5C344>

PowerPoint Presentation

INTRODUCTION TO COM.DOC


untitled

Chapter 2

2/80 2

西班牙语专业本科培养方案

8idml_20_1_q

Chapter 2 GIGA-BYTE TECHNOLOGY CO., LTD. ("GBT") GBT GBT GBT

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

Microsoft Word - 專題製作研究報告書.doc

4. 於 INF Processing Options 對話窗中, 選取 Automatic 後按 OK 5. 於 Import File 對話窗中, 按 Start Copyright by ICP DAS Co., Ltd. All rights are reserved. 2 / 12

untitled

ansoft_setup21.doc

Microsoft PowerPoint - OPVB1基本VB.ppt

第一章

行业

星星排列 _for loop Protected Sub Page_Load(ByVal sender As Object, ByVal e As Dim h As Integer = 7 'h 為變數 ' Dim i, j As Integer For i = 1 To h

GIGA-BYTE TECHNOLOGY CO., LTD. ("GBT") GBT GBT GBT

3. 反 映 : 4. 五 花 八 门 : 5. 慷 慨 : 6. 参 与 : 7. 慰 劳 : 8. 延 续 : 9. 珍 爱 : 10. 浪 漫 : 三. 找 出 下 列 每 组 词 中 的 近 义 词 或 同 义 词 : 节 日 节 气 节 令 时 节 习 俗 民 俗 仪 式 风 俗 文 献

MATLAB 1

untitled

行业

AL-M200 Series

行业

新 闻 学 46 7 新 闻 传 播 学 院 广 告 学 28 4 广 播 电 视 学 23 3 新 闻 学 广 告 学 ). 级 学 生 申 请 准 入 需 修 完 或 正 在 修 2 门 专 业 准 入 课 程 并 取 得 相 应 学 分 ;2). 级 学 生 申 请 准 入 需

GIGA-BYTE TECHNOLOGY CO., LTD. ( GBT ) GBT GBT, GBT

FY.DOC

投稿類別:電子工程類


33 张 誌 总 经 理 北 京 金 豪 制 药 股 份 有 限 公 司 34 张 露 藜 董 事 长 北 京 峰 荟 财 智 知 识 产 权 顾 问 有 限 公 司 35 张 志 勇 董 事 长 总 裁 北 京 梅 泰 诺 通 信 技 术 股 份 有 限 公 司 36 赵 晨 执 行 合 伙 人

Contents

Sophos Central 快速安裝手冊

行业

2/14 Buffer I12, /* x=2, buffer = I 1 2 */ Buffer I243, /* x=34, buffer = I 2 43 */ x=56, buffer = I243 Buffer I243I265 code_int(int x, char *buffer)

Simulator By SunLingxi 2003

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File

(Methods) Client Server Microsoft Winsock Control VB 1 VB Microsoft Winsock Control 6.0 Microsoft Winsock Control 6.0 1(a). 2

epub83-1

概述

1. Install the software Note: You should logon with administrator privileges to Windows 7, Vista or XP in order to install the software properly. You

1.ai

Microsoft PowerPoint - 第14章.ppt

untitled

GV-R7500L Win 98/ 98SE, WinME Win XP Direct X Windows NT WINDO

行业

ebook129-9

Chapter 2 GIGA-BYTE TECHNOLOGY CO., LTD. ("GBT") GBT GBT GBT

多層次傳銷與獎金系統

投影片 1

行业

RunPC2_.doc

Data Management Software CL-S10w

目 录 第 一 部 分 档 案 局 概 况 一 主 要 职 责 二 部 门 决 算 单 位 构 成 第 二 部 分 档 案 局 2016 年 度 部 门 预 算 表 一 2016 年 度 市 级 部 门 收 支 预 算 总 表 二 2016 年 度 市 级 部 门 支 出 预 算 表 三 2016

2015 年 度 收 入 支 出 决 算 总 表 单 位 名 称 : 北 京 市 朝 阳 区 卫 生 局 单 位 : 万 元 收 入 支 出 项 目 决 算 数 项 目 ( 按 功 能 分 类 ) 决 算 数 一 财 政 拨 款 一 一 般 公 共 服 务 支 出 二

Chapter 2 GIGA-BYTE TECHNOLOGY CO., LTD. ("GBT") GBT GBT GBT

概述


Table of Contents Design Concept 03 Copyrights & TradeMark 04 Special Notice 05 Notice to concerned 05 Installation and Registration Introduction 07 s

Microsoft Word - InoTouch Editor编程软件手册 doc

Chapter 2 GIGA-BYTE TECHNOLOGY CO., LTD. ("GBT") GBT GBT GBT

AD/DA DI/DO ( PCI ISA ) DOS Windows 95/98 Windows NT Windows 2000 ActiveX Control (OCX) for Windows 95/98 ActiveX Control (OCX) for Windows NT ActiveX

5in1_eDVR_Manual_Chinese.cdr

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING

Transcription:

ActiveX Control For Visual Basic 2005.NET [ 版本 : 1.0] 1 安裝 Windows 驅動程式 請依照下列步驟 : 1. 執行 Windows 驅動程式安裝程式 ( 此範例為 PIO-DIO) 驅動程式位置 : CD:\NAPDOS\PCI\PIO-DIO\dll_ocx\Driver http://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/pio-dio/dll_ocx/driver/ Windows 驅動程式只支援 windows 98/NT/2000 及 XP/2003/Vista 32-bit 版本 在 Visual Basic 2005.NET 中使用 ActiveX Control (OCX), Ver.1.0, May/2009, Copyright By ICP DAS ---- 1

2. 按 Next > 按鈕並開始安裝 3. 按 Next > 按鈕並選擇安裝路徑 在 Visual Basic 2005.NET 中使用 ActiveX Control (OCX), Ver.1.0, May/2009, Copyright By ICP DAS ---- 2

4. 按 Install 按鈕繼續安裝程序 5. 選擇 No, I will restart the computer later 並且按 Finish 按鈕 1 2 在 Visual Basic 2005.NET 中使用 ActiveX Control (OCX), Ver.1.0, May/2009, Copyright By ICP DAS ---- 3

2 安裝硬體裝置 請依照下列步驟 : 1. 關掉電腦電源 2. 打開電腦機殼 3. 選擇未使用的 PCI 插槽, 並移除保護裝置 4. 小心插入板卡至 PCI 插槽中, 並以螺絲固定住 5. 裝回電腦機殼 6. 啟動電腦電源 進入 Windows 後, 請依照提示訊息完成 Plug & Play 在 Visual Basic 2005.NET 中使用 ActiveX Control (OCX), Ver.1.0, May/2009, Copyright By ICP DAS ---- 4

3 使用 ActiveX Control (OCX) 在 VB.NET 2005 上使用 ActiveX Control, 請依照下列步驟 : 1. 新增 ActiveX Control (OCX) 到 VB.NET 2005 工具列上 在功能選單上, 選擇 Tools/ Choose Toolbox Items... 1 2 在 Visual Basic 2005.NET 中使用 ActiveX Control (OCX), Ver.1.0, May/2009, Copyright By ICP DAS ---- 5

2. 點選 COM Components 對話框列表裡的 PIODIOX Control 並且按 OK 按鈕 1 2 3 3. 工具列將會顯示 PIODIO (PCI Card OCX) 的元件圖示 在 Visual Basic 2005.NET 中使用 ActiveX Control (OCX), Ver.1.0, May/2009, Copyright By ICP DAS ---- 6

4. 產生一個新的專案 並且新增 PIODIO (PCI Card OCX) 元件到此專案中 1 2 注意 : 請注意, 在.NET 環境上, 所有 OCX 控制元件不能正確處理 Array 型態的參數 因為它們是不同的子系統 在.NET 環境使用 Array 型態的參數時, 你必須直接呼叫 Win32 DLL 函式來代替使用 OCX 控制元件 在 Visual Basic 2005.NET 中使用 ActiveX Control (OCX), Ver.1.0, May/2009, Copyright By ICP DAS ---- 7

4 撰寫 DIO 程式範例 設計 DIO 程式, 在程式中呼叫 OCX 函式 請依照下列步驟 : 1. 設計介面 : etotalboar ComName ListTest btnactive PIODIOX1 btnexit 在 Visual Basic 2005.NET 中使用 ActiveX Control (OCX), Ver.1.0, May/2009, Copyright By ICP DAS ---- 8

2. PIODIOX 函式列表, 如下 : property property property BSTR ErrorString; short ErrorCode; short ActiveBoard; short DriverInit(); long GetConfigAddressSpace(short naddrnum); short GetDllVersion(); short GetDriverVersion(); short InputByte(long IBaseAddr); long InputWord(long IBaseAddr); void OutputByte(long IBaseAddr, short noutputdata); void OutputWord(long IBaseAddr, long IOutputData); short DigitalIn(short nport); void DigitalOut(short nport, short noutputvalue); void SetCounter(short ncounterno, short ncountermode, long ncounterval); long ReadCounter(short ncounterno, short ncountermode); long ResetlrqCount(); void Installlrq(long* hevent, short nlrqsource, short nactivemode); void Removelrq(); void GetlrqCount(); long D48Freq(); void D48Installlrq(long* IHandle, short nlrqmask, short nactivemode); void D48Removelrq(); long D48Getlrqcount(); void SavelrqActiveFlag(); short GetlrqActiveFlag(short FlagNum); void DriverClose(); 更詳細 OCX 函式 資訊 請參考 : ActiveX Control for PCI series boards User's Manual http://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/manual/ocx%28activex%29_manual_for_pci _pio_piso_cards.pdf 在 Visual Basic 2005.NET 中使用 ActiveX Control (OCX), Ver.1.0, May/2009, Copyright By ICP DAS ---- 9

3. 函式使用 : Form1_Load Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim i As Integer, wtotalboards As Integer, iboards As Integer Dim wsubaux As Long ' Initialize the driver and get the total boards wtotalboards = PIODIOX1.DriverInit btnactive.text = "Active" etotalboards.text = wtotalboards iboards = 0 For i = 0 To (wtotalboards - 1) PIODIOX1.ActiveBoard = i ' Set the active board wsubaux = PIODIOX1.GetConfigAddressSpace(4) ' Get the AddrBase If 64 = wsubaux Then ComName.Items.Add(Str(i) & ":PIO-D24/56") iboards = iboards + 1 End If Next i If iboards = 0 Then ComName.Items.Add("No Device") btnactive.enabled = False Else btnactive.enabled = True End If ComName.SelectedIndex = 0 End Sub btnexit Private Sub btnexit_click(byval sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.click End Sub PIODIOX1.DriverClose() ' Release the device resource Me.Close() 在 Visual Basic 2005.NET 中使用 ActiveX Control (OCX), Ver.1.0, May/2009, Copyright By ICP DAS ---- 10

btnactive Private Sub btnactive_click(byval sender As System.Object, ByVal e As System.EventArgs) Handles btnactive.click Dim InVal1, InVal2, InVal3 As Integer Dim i As Long PIODIOX1.ActiveBoard = 0 ListTest.Items.Clear() ListTest.Items.Add("Setting Port 0 to Output-Mode and Port 1,2 to Input-mode") ListTest.Items.Add(" ") Thread.Sleep(10) i = 1 While i <= &H80 PIODIOX1.DigitalOut(0, i) '// Port 0 digital output value ListTest.Items.Add("Output Port 0 (Hex)= " + Hex(i)) End Sub Thread.Sleep(100) InVal2 = PIODIOX1.DigitalIn(1) '// Port 1 digital input value InVal3 = PIODIOX1.DigitalIn(2) '// Port 2 digital input value ListTest.Items.Add(" Input Port 2, 1 (Hex)= " _ + Hex(InVal3) + " " _ + Hex(InVal2)) ListTest.Items.Add(" ") Application.DoEvents() Thread.Sleep(100) i = i * 2 End While PIODIOX1.DigitalIn(0) ' Port 0, Back to input mode ListTest.Items.Add( " The End " ) 在 Visual Basic 2005.NET 中使用 ActiveX Control (OCX), Ver.1.0, May/2009, Copyright By ICP DAS ---- 11

AxPIODIOX1_OnError Private Sub AxPIODIOX1_OnError(ByVal sender As System.Object, ByVal e As AxPIODIOXLib._DPIODIOXEvents_OnErrorEvent) Handles PIODIOX1.OnError ' Get the error massage MsgBox("Error Code:" + Str(PIODIOX1.ErrorCode) + Chr(13) + "Error Message:" + PIODIOX1.ErrorString) End Sub Form1_FormClosed Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed PIODIOX1.DriverClose() ' Release the device resource End Sub 5 參考資訊 ActiveX Control for PCI series boards User's Manual http://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/manual/ocx%28activex%29_manual_ for_pci_pio_piso_cards.pdf PCI1800X, PCI1602X, PCI1202X ActiveX Control User's Manual http://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/manual/ocx%28activex%29_manual_ for_pci_1002_1202_1602_1800_1802.pdf ActiveX Control (OCX) Installation in VB, Delphi and BCB Manual http://ftp.icpdas.com/pub/cd/iocard/pci/napdos/pci/manual/ocx%28activex%29_installati on_in_vb_delphi_bcb.pdf 在 Visual Basic 2005.NET 中使用 ActiveX Control (OCX), Ver.1.0, May/2009, Copyright By ICP DAS ---- 12