UHFReader18.DLL动态连接库使用手册

合集下载

动态链接库教程

动态链接库教程

动态链接库教程动态链接库(Dynamic Link Library,简称DLL)是一种可由多个程序共享的库文件,它包含了一组函数和数据,可以在程序运行时加载和调用。

DLL 文件可用于将一些通用的功能封装成函数,供多个程序调用,从而提高代码的复用性和开发效率。

本文将详细介绍动态链接库的概念、使用方法以及制作过程。

一、动态链接库的概念动态链接库是一种包含了函数和数据的库文件,它可以在程序运行时被加载和调用。

与静态链接库相比,动态链接库的优势在于节省内存空间和提高代码的复用性。

当多个程序需要使用同一个功能时,它们可以共享同一个DLL文件,避免了重复编写相同的代码。

二、动态链接库的使用方法在使用动态链接库之前,我们首先需要了解动态链接库的编译、加载和调用过程。

1.编译动态链接库在创建 DLL 文件时,我们需要按照一定的规范编写代码,并将其编译成 DLL 文件。

编译时,需要指定导出函数的修饰符(如 _stdcall、_cdecl等),以及导出函数的声明。

这些步骤可以在开发环境(如Visual Studio)中完成。

2.加载动态链接库在程序运行时,需要加载 DLL 文件。

我们可以通过调用LoadLibrary 函数来加载 DLL,该函数返回一个句柄,表示 DLL 的实例。

加载 DLL 文件后,我们可以通过该句柄获取 DLL 中导出函数的地址。

3.调用动态链接库在获取到DLL中导出函数的地址后,我们可以通过函数指针来调用DLL中的函数。

通过函数指针,程序可以跳转到DLL中执行指定的函数,从而完成相应的功能。

三、制作动态链接库下面以C++语言为例,简单介绍如何制作一个动态链接库。

1.创建DLL工程在 Visual Studio 中创建一个 DLL 项目,选择 DLL(动态链接库)作为项目类型。

在项目中添加需要导出的函数,并在头文件中进行声明。

2.编写导出函数在 DLL 项目中编写需要导出的函数,并在函数前添加修饰符(如_stdcall、_cdecl等)。

动态链接库的使用方法

动态链接库的使用方法

动态链接库的使用方法动态链接库(Dynamic Link Library,DLL)是Windows系统中一种常见的文件类型,用于存储可被程序在运行时动态加载的函数和数据。

它可以提供代码和资源的共享,使得程序的安装包更小,节省了系统资源。

使用动态链接库有以下几个优点:1.模块化:将程序代码和资源划分为独立的模块,便于开发和维护。

2.共享性:多个程序可以共享同一个动态链接库,减少重复的代码和数据的存储。

3.动态加载:可以在程序运行时动态地加载和卸载动态链接库,提高了程序的灵活性和可扩展性。

1.创建动态链接库:使用C/C++编程语言可以创建动态链接库。

首先,在开发环境中创建新的DLL项目,并选择动态链接库的类型。

在项目中添加需要的代码和资源,并编写相应的函数和数据接口。

将这些接口封装在一个头文件中,并在源文件中实现具体的功能。

最后,编译项目生成动态链接库文件(.dll 文件)。

2.导出函数和数据:在动态链接库中,明确指定哪些函数和数据需要被其他程序调用。

在函数和数据的声明前加上__declspec(dllexport)关键字即可。

例如:```C++__declspec(dllexport) int Add(int a, int b);```3.调用动态链接库:在其他程序中调用动态链接库中的函数和数据,需要先导入相应的函数和数据。

使用C/C++编程语言可以创建一个头文件,其中包含要导入的函数和数据的声明。

例如:```C++__declspec(dllimport) int Add(int a, int b);__declspec(dllimport) extern double PI;```然后,在使用这些函数和数据的源文件中包含这个头文件即可。

4.加载和卸载动态链接库:在程序运行时,需要动态地加载动态链接库,并在使用完之后卸载。

可以使用LoadLibrary函数来加载动态链接库,使用FreeLibrary函数来卸载动态链接库。

动态链接库教程(中文版)

动态链接库教程(中文版)

动态链接库教程(中⽂版)什么是动态链接库?DLL三个字母对于你来说⼀定很熟悉吧,它是Dynamic Link Library 的缩写形式,动态链接库 (DLL) 是作为共享函数库的可执⾏⽂件。

动态链接提供了⼀种⽅法,使进程可以调⽤不属于其可执⾏代码的函数。

函数的可执⾏代码位于⼀个 DLL 中,该 DLL 包含⼀个或多个已被编译、链接并与使⽤它们的进程分开存储的函数。

DLL 还有助于共享数据和资源。

多个应⽤程序可同时访问内存中单个 DLL 副本的内容。

本⽂⽐较了Visual C++所⽀持的三种动态链接库,列出了各⾃不同的特点和应⽤场合,详细地描述了三种动态链接库的建⽴和调⽤的⽅法。

关键字:动态链接库;导出函数;调⽤引⾔较⼤的应⽤程序都由很多模块组成,这些模块分别完成相对独⽴的功能,它们彼此协作来完成整个软件系统的⼯作。

在构造软件系统时,如果将所有模块的源代码都静态编译到整个应⽤程序的EXE⽂件中,会产⽣⼀些问题:⼀个缺点是增加了应⽤程序的⼤⼩,它会占⽤更多的磁盘空间,程序运⾏时也会消耗较⼤的内存空间,造成系统资源的浪费;另⼀个缺点是,在编写⼤的EXE程序时,在每次修改重建时都必须调整编译所有源代码,增加了编译过程的复杂性,也不利于阶段性的单元测试;⽽且,⼀些模块的功能可能较为通⽤,在构造其它软件系统时仍会被使⽤。

Windows系统平台上提供了⼀种完全不同的较有效的编程和运⾏环境,你可以将独⽴的程序模块创建为较⼩的动态链接库(Dynamic Linkable Library,DLL)⽂件,并可对它们单独编译和测试。

在运⾏时,只有当EXE程序确实要调⽤这些DLL模块的情况下,系统才会将它们装载到内存空间中。

这种⽅式不仅减少了EXE ⽂件的⼤⼩和对内存空间的需求,⽽且使这些DLL模块可以同时被多个应⽤程序使⽤。

动态链接库概述动态链接库技术是Windows最重要的实现技术之⼀,Windows的许多新功能、新特性都是通过DLL来实现的。

UHF读写器用户手册说明书

UHF读写器用户手册说明书

UHF Reader User Manual2E-26562E-2657Contents1. Model Parameter: (3)2. Model Package: (3)3. Wiring Diagram: (4)3.1 Example with Anson Controller (5)3.2 Connect to Ground: (5)4. Installation: (5)4.1 Installation 1 example: (6)4.2 Mounting reader and height adjustment (6)4.3 Reader Installation Angle Adjustment (7)4.4 Installation Example-Parking Lot (7)4.5 Tag position in vehicle (8)5. Application: (9)6. Quick Start for Software (9)6.1 Connect reader With PC (9)6.1.1 RS232 Communication (10)6.1.2 TCP/IP Communication (10)6.2 Basic Settings: (12)6.2.1 Wiegand Parameter Input Zone: (12)6.2.2 Basic Parameters Input Zone: (12)6.2.3 Freq Parameters Input Zone: (14)6.2.4 Senior Parameter Input Zone: (14)6.2.5 Active Encrypt Function (14)6.2.6 . Get Parameter (17)6.2.7 Set Parameter (17)6.2.8 Default All (17)6.2.9 Net Initialize (17)6.3.10 WIFI Initialize (17)6.3 Senior Settings (17)6.4 EPC Read and Write (18)6.5 ISO1800-6B Read and Write (19)7. Notice (20)1. Model Parameter:2. Model Package:In the package include one reader, 1 RS232 Serial port , 12V adapter and the antenna bearer. When you open the box, please check the spare parts, if with any question, please contact distributor or sales department.See below picture for the inside package and separate products picture(2E -2656).RS232/485 RS232/4851-15mDescription PictureDeviceRS232 Serial PortCable12V AdapterAntenna Bearer3. Wiring Diagram:Description Model Wire No. Color Function1 Red DC9-15Positive 2E-2656/57V2 Black GND Negative 2E-2656/573.1 Example with Anson Controller3.2 Connect to Ground:In case you use the external power supply for the UHF reader, then you must have acommon ground with controller, or will cause unknown problems.4. Installation:In general there are two installation ways of UHF reader, see blow picture 1 and 2.7 2E-2656/572E-2656/57PIN58 Grey Trigger/ 2E-2656/57 9 Orange 485+ / 2E-2656/57 10 Purple 485-/ 2E-2656/57TCP/IP UHF reader without Grey, orange and purple cable. 4 Green Data0 Wiegand D0 5 Yellow TXD RS232 PIN26BrownRXDRS232 PIN32E-2656/577 Blue GND RS232 GND 3 White Data1 Wiegand D12E-2656/572E-2656/57(1) (2)Installation 1 will be easy for installation, but distance will be less than installation 2, installation 2 will be more difficult for installation.4.1 Installation 1 example:4.2 Mounting reader and height adjustmentFor installation 1, the mounting pole diameter should be 50-60mm, height should be 2.2m, we suggest to use the stainless steel material(thickness greater than 1.2mm), use the bearer inside the reader box to fix into pole top, and adjust the height from reader center position to road according to vehicle type, in general the height is 1.8-2.2m.For installation 2,the L type mounting pole diameter should be 60-80mm, the cross beam diameter should be 50-60mmmm, and we suggest to use the stainless steel material(thickness should be 1.2mm-2mm).Use the bearer inside the reader box to fix into pole top and adjust the height from reader center position to road according to vehicle type, in general the height is 3.5-4m.4.3 Reader Installation Angle AdjustmentSee below picture 3 and 4 for reference adjust angle for reader.3 44.4 Installation Example-Parking LotPrincipal to install the reader:(1)Reader and barrier gate linear distance no go across 1m.(2)Between reader and tag, no items covered.(3)Distance between reader and control panel or PC distance we suggest as closer as possible and install shielded communication cable.(4)For detailed installation please according to real situation.Reader close to barrier, and make sure the sensing area can cover the ground sensor,See below picture.4.5 Tag position in vehicleIn general, the parking devices are installed in the left side of the lane, then the tag should be stick in the position of below picture showed.For small vehicle, we suggest A, B and C position, for big truck or big bus, we suggest D, E and F position. The principal of the tagposition is not cover the eyesight of driver.Suggest Position: If reader install in left side, then suggest A and E position. If reader install in the top, then suggest B and F, if reader install in right side, then we suggest C and D position.Tag installation when vehicle windshield with metal UV film:(1) Original UV film: According to European standard, Position B willreserve2E-2656 is 1-6m, 2E-2657 is 1-15m. And the vehicle speed should less than 15km/h.120m*70mm space(no contain metal) for RFID stickers. When install the tag, just install in the B position.(2)Self-stick UV film: Cut a space 120*70mmm special for RFID stickers.We suggest B,D or E position.(3) Use anti-metal tags, install in the car license plate.(4) Manual hold the RFID card to read.Correct Hold Card Wrong Hold Card5. Application:(1) Transport Control:(2) Vehicle Management(3) Parking Management(4) Access Control Management(5) Product Anti-fake Detection(6) Anti-thief Management6. Quick Start for SoftwareThe UHF reader with software to read and write the tags and cards, as well to adjust the basic parameter of the reader.6.1 Connect reader With PCThere are two mode of reader, one is TCP/IP and RS232 communication, the other is RS232 communication only.6.1.1 RS232 CommunicationThere are two client in software package, on is RFIDDemo3203.exe other is Netconfig.exe. For RS232 communication device, just open RFIDDemo3203.exe client.See below.Please ensure serial port of reader connect with PC, and select correct port in PC, then select baud rate, then click connect.6.1.2 TCP/IP CommunicationFor TCP/IP communication, you need open two client, Netconfig.exe and RFIDDemo3203.exe. Netconfig.exe to get the IP address and port of connected UHF reader. You can open it by click broadcast.1.See blow procedure 1, click broadcast to get the IP of uhf reader.2.And input the detected IP, but make sure that your pc and the address at the same LAN, be simple, you can ping the IP, see procedure 2.3.Then click “Connect” to connect the reader.4. If communication OK, see below6.2 Basic Settings:6.2.1 Wiegand Parameter Input Zone:It is mainly related to Wiegand output interface. Only communication mode is Wiegand26 or Wiegand34 available.Byte Offset:The byte of card number to be offset, there is a initial position when read card number. To change the initial position, for example Wiegand 26,output 3 byte, but 18600-6B card number (E0 01 02 03 04 05 06 07) i s 8 byte, the parameter is this 3 byte, when the value is 0, it is (E0 01 02), when the value is 1, It is (01 02 03)... More details, please refer to Wiegand protocol.Output Period: It is frequency of Wiegand port. More details, please refer to Wiegand protocol. Pulse Width: It is the time length of Wiegand signal.Pulse Period: It is interval time that from first low pulse to next low pulse sending. For details, please refer to Wiegand protocol.Note: In general, user only need set byte offset, other setup is default.6.2.2 Basic Parameters Input Zone:Work Mode:It includes 3 items:Active , Passive and Response modeActive: Reader keep reading card, and transmit each of card number by communication port (apply to active upload data).Passive: Reader keep reading card, and each of card number store in reader, but do not upload card number,the max. storage is 100pcs (apply to passive upload). 3. Response: Reader do not read card, reader response according difference commands. For example, PC send a recognize card command, reader will read a time and reply card number to PC (apply to short distance read and write card, test).Output Mode:It includes RS232, TCPIP, CANBUS, Wiegand26 and Wiegand34.RS232: Serial port communication mode, It connects with PC serial port directly and point to point mode.TCPIP:Network communication mode, it communicate with PC by LAN or WAN. CANBUS:BUS communication mode, it is point to multiple mode.Wiegand26:It is standard reader communication mode, one-way communication mode. Wiegand34 :It is standard reader communication mode, one-way communication mode.Read Interval:The speed of reading card.Note: read card interval must more than 10ms. If read card interval is too short, it will short lift of the reader.Power Size: The max. value is 30.Trigger:1. Close: Close trigger mode to read card.2. Low Trigger: When trigger lead (gray wire) connect with low power (OV), reader power on, when trigger lead (gray wire) connect with high power (12V), reader power off.Note: When Trigger mode is Close, trigger lead must connect with high power or low power and can not be dangling.Same ID Interval:When reader read a same card continuously, reader only upload one data. The read interval can be set at here, and if the read time is over set interval, reader will upload continuously. Buzzer: When reader read card, the buzzer beep or not.Buzzer:It includes disable and enable, disable mean turn off the buzzer, when read card, no beep, enable mean turn on the buzzer, when read card, with beep.Card Type:1. ISO18000-6B:Only read ISO18000-6B protocol tag.;2. EPC (GEN 2 )Single – Tag :Only read EPC(GEN 2)protocol tag, read one tag one time. Reader hard to or not read multiple tags when put them in the effective range.3. EPC (GEN 2 )Multi – Tag:Only reader EPC (GEN 2 )protocol tag, multi-tag can be read.4. EPC (GEN2 )Multi –Data:Only read EPC (GEN 2 )protocol tag,except read default EPC area 12 bytes data, other area data can be read. (Select this type and set to read the length of other area data in senior parameter, the max. Is 12 bytes)5. ISO18000-6B + EPC (GEN 2 ): ISO18000-6B and EPC (GEN 2 )protocol tag can be read.Freq Parameters Input Zone It refer to 18000-6b and EPC card, normally hopping need be selected.6.2.3 Freq Parameters Input Zone:It refer to 18000-6b and EPC card, normally hopping need be selected.6.2.4 Senior Parameter Input Zone:It is used for multiple channel reader (split reader), integrative reader default is antenna 6.2.5 Active Encrypt FunctionFor this version software, the encrypt function is hided, to enable the encrypt function, please see below procedure.1) Press”F8” 5 Time s2) Choose then “Enabled”, and set password, then set Parameters [Set Para].3) Now, put the tag on the reader, the reader is not beep;4) Presses “Encrypt Tag”, until the reader beep, then enc rypt succeed;Note: when the encrypt tag, you can move the tag to accelerate the process of encryption;6.2.6 . Get ParameterClick “Get Para” button, parameter of the reader can be acquired. Acquire parameter succeed if display green in status bar; Acquire parameter failure if display red in status bar.(Do not read card when acquire parameter)6.2.7 Set ParameterWhen change parameter in demonstration area, click “Set Para” button, updated data will be set in currently reader. Setup succeed if display green in status bar; Setup failure if display red in status bar.6.2.8 Default AllClick “ Default All” button, basic parameter and senior parameter will recover to default. (Need to click “parameter setup”, updated parameter will be set in reader).6.2.9 Net InitializeNull6.3.10 WIFI InitializeNull6.3 Senior SettingsSenior settings is mainly setup the TCP/IP reader parameter, such as IP address, Syris config and time config etc.TCP/IP config: User can modify the TCP/IP uhf readerSYRIS Config: It is to set Syris SN and Syris ID.Time Config: It is to set reader time.Soft Config: In general can ignore the function, soft reset, is reset the device by software.6.4 EPC Read and WriteThe module is used to read and write the EPC card number. when you click the module, will show below picture interface.Identify:When click, the card in the reader Hex number will display here.Read: When click read, the related address and length Hex number will display, for example the card number is 01-02-03-04-05-06-08-09-10-11-12,Address 2, length 2: 01-02, length is 3, then 01-02-03Address 3., length 2:03-04Address 4, length 2: 05-06...Write: When click write, will write the related Hex to related address.For example the card number is 01-02-03-04-05-06-07-08-09-12-10Address is 2 and length is 2, and write 02-01 to the address, then the card no. Become 02-01-03-04-05-06-07-08-09-10-11-12If write to address 3 and the length is 2.Then card number become 01-02-02-01-05-06-08-09-10-11-126.5 ISO1800-6B Read and WriteFor this module is to read and write 1800-6B card number.Identify:When click, the card in the reader Hex number will display here.Read: When click read, the related address and length Hex number will display, for example the card number is E0-04-00-00-3F-0B-22-07-00-00-00-00,Address 0, length 2: E0-04, length is 3, then E0-04-00Address 1., length 2:04-00Address 2, length 2: 00-00...Write: When click write, will write the related Hex to related address.For example the card number is E0-04-00-00-3F-0B-22-07-00-00-00-00,Address is 0 and length is 2, and write 01-02 to the address, then the card no. Become 01-02-00-00-3F-0B-22-07-00-00-00-00,If write to address 1 and the length is 2.Then card number become E0-01-02-00-3F-0B-22-07-00-00-00-007. Notice1. When reader is working, the operator should away from reader 30cm to satisfy the FCC RF requirement.2. Reader must away from the high he strong magnetic field3. When reader use external power supply, must connect the common ground with the controller or the device you connect with.4. For the reader, we suggest 9-15v power supply, you’d better use the power supply we supply or appropriate voltage power supply.5. Mount the reader on a round pole or flat surface when you do installation.6. Connect all the wire as wiring diagram suggest.。

COMFatekPLC动态链接库使用说明书

COMFatekPLC动态链接库使用说明书

COMFatekPLC动态链接库使用说明书一、使用对象和场合:对象:柯力内部软件开发人员。

场合:需要与永宏PLC通讯的上位机程序开发项目。

只作为项目中上位机程序调用的一个组件存在。

二、简要说明COMFatekPLC类库是在VS2008平台下,用C#语言开发的一款能与永宏PLC通讯的动态链接库。

通过调用该动态链接库,可以快速的与PLC实现数据交互,缩短上位机软件开发周期。

该dll库不能作为单独软件而独立运行。

三、COMFatekPLC功能简介1、命令永宏PLC运行/停止函数。

2、一次读写n个M点的状态函数。

3、一次读写n个Y点的状态函数。

4、一次读取n个X点的状态函数。

5、一次读写n个数据区的数据(D区/DD区)函数。

四、COMFatekPLC函数使用介绍1.添加引用:在新建的上位机软件工程中添加FatekPLC.dll的引用。

2.new一个对象:在工程中定义全局对象变量,在主窗口登录事件中new该对象,在new对象时,必须先定义串口号(与PLC通讯的串口号)和PLC的站号。

public FatekPLC plc_contrl;//定义对象//new一个对象, m_PLC_SerialPort为上位机与PLC的通讯串口号,m_PLC_Station为PLC的站号地址。

plc_contrl= new FatekPLC(m_PLC_SerialPort,m_PLC_Station);3.调用函数:可调用FatekPLC.dll 库中的读写M 、Y 、X 点状态,读写D 区的数据。

① 运行/停止:plc_contrl.RunStop_Plc(int runStat);//runstat 为int 型,为0时PLC 停止运行,为1时PLC 启动运行②读取M 点:plc_contrl.Read_M(int length, int array)//返回null 为读取失败,length 为读取长度,array 为起始地址③读取Y 点:plc_contrl.Read_Y(int length, int array)// 同上④读取X 点:plc_contrl.Read_X(int length, int array)// 同上⑤读取D 区:plc_contrl.Read_D(int length,int array) //返回浮点型,length 为读取长度,array 为起始地址⑥读取DD 区:plc_contrl.Read_DDdd(int length,int array) //返回long 型,length 为读取长度,array 为起始地址⑦写入M 点:plc_contrl.Write_M_Port(int length, int array, int [] value)// 写多个M 点,返回为成功,-1为程序错误,为通讯端口未打开,为返回位数或校验不对,length 为读取长度,array 为起始地址,value 为写入值数组(1,0)⑧写入Y 点:plc_contrl.Write_Y_Port(int length, int array, int [] value)// 同上⑨写入X 点:plc_contrl.Write_X_Port(int length,int array, int [] value)// 同上⑩写入D 区:plc_contrl.Write_D(int length,int array, int [] value)// 同上,value 为值函数表格详细如下:区域 读写读/写读(length 为读取长度,arr ay 为读取起始地址)写(length 为写入长度,array 为写入起始地址,value 为写的值数组)M 点String Read_M(int length, int array)int Write_M_Port(int length, int array, int [] value)X 点String Read_X(int length, int array)\(输入不允许写)Y 点String Read_Y(int length, int array)int Write_Y_Port(int length, int array, int [] value)D 点int [] Read_D(int length, int array)int Write_D(int length, int array, int [] value)DD 点(无符号长整型)long [] Read_DDdd(int length, int array)int Write_DD(int length, int array, long [] value)DD 点(浮点型)float [] Read_DDd(int length, int array)int Write_DD(int length, int array, float [] value)命令运行/停止int RunStop_Plc(int runStat) (runStat 为1时为运行,为0时为停止)。

动态链接库的使用方法

动态链接库的使用方法

动态链接库的使用方法动态链接库是一堆变量,函数和类的集合体,供其它函数调用。

为什么要使用动态链接库,原因很多,其中三条1.可跨平台调用2.方便二次开发3.方便项目管理。

动态链接库的使用有两个方面,一是把原来的源代码做成动态链接库文件(即生成DLL和lib 格式的文件),二是在其它源代码中使用动态链接库。

一.把源代码做成动态链接库文件可以使用vc6.0及其以上的版本来做,直接建一个动态链接库工程,这个工程和其它的工程类似,有头文件和源文件,不同之处是在为了让DLL导出函数,需在每一个要导出的函数前添加标识符_declspec(dllexport)或declspec(dllimport)。

在头文件中,申明要导出的函数,类,以及一些全局变量。

在源文件中,定义或实现头文件中要导出的函数,类以及变量。

1.做单独的头文件,该头文件可以同时用于动态链接库和使用动态链接库的程序。

为了方便的添加标识符,我们一般在头文件中使用宏定义,示例如下:#ifdef DLL1_API#else#define DLL1_API _declspec(dllimport)#endif这样在后面的使用中,可以用DLL1_API来代替_declspec(dllimport),如下:DLL1_API int add (int a,int b);DLL1_API int subtract(int a,int b);class DLL1_API Point{public:void output(int x,int y);};2.在动态链接库的源文件中包含动态链接库头文件和一条宏定义在源文件中,要重新定义标识符,使用_declspec(dllexport),所以在源文件中也要添加一条宏定义#define DLL1_API _declspec(dllexport),之后再包含头文件#include "Dll1.h"二.在目标程序中调用动态链接库在使用动态链接库的程序中隐式的调用动态链接库:1.把动态链接库的头文件拷贝到目标程序目录下2.在使用动态链接库的源文件中包含该头文件3.拷贝动态链接库的两个文件到目标程序目录下4.在vc6.0的工程/设置/连接中的对象/库模块中输入动态链接库文件名,如DLL1.lib 三.其它1.关于DLL中全局变量的定义在头文件中声明,在源文件中定义,如:在头文件中extern_declspec(dllimport)int num_cai1;在源文件中则是int num_cai1=200;2._declspec(dllexport)和_declspec(dllimport)在功能上没什么区别,使用哪个都一样,但是其标识的意义不同,export是输出,用在DLL中,表示该函数是DLL中要输出的函数。

动态连接库的调用

动态连接库的调用

使用显式调用方式可以让程序员来决定DLL文件何时加载或不加载,而操作系统在载入应用程序时不必要将所有该应用程序所引用的DLL都一起加载到内存中,只要在使用某个DLL时再将其载入,这样就可以减少应用程序在初始加载时所使用的时间和对内存的消耗。在对DLL加载的过程中,Windows将遵循下面的搜索顺序来定位DLL:
①包含EXE文件的目录;
②进程的当前工作目录 ;
③Windows系统目录 ;
④Windows目录 ;
⑤列在Path环境变量中的一系列目录。
总结
在Windows操作系统中使用动态链接库(DLL)有很多优点,最主要的一点是多个应用程序、甚至是不同语言编写的应用程序可以共享一个DLL文件,真正实现了资源"共享",大大缩小了应用程序的执行代码,更加有效地利用了内存;使用DLL的另一个优点是DLL文件作为一个单独的程序模块,封装性、独立性好,在软件需要升级的时候,开发人员只需要修改相应的DLL文件就可以了,而且,当DLL中的函数改变后,如果没有修改参数,程序代码并不需要重新编译。这在编程时十分有用,大大提高了软件开发和维护的效率。
2、显式调用
这种调用方式是指在应用程序中用Load Library或MFC提供的AfxLoadLibrary显式的将自己所做的动态连接库调进来,并指定DLL的路径作为参数。LoadLibary返回HINSTANCE参数,应用程序在调用GetProcAddress函数时使用这一参数。当完成对动态链接库的导入以后,再使用GetProcAddress()获取想要引入的函数,该函数将符号名或标识号转换为DLL内部的地址,之后就可以象使用本应用程序自定义的函数一样来调用此引入函数了。在应用程序退出之前,应该用Free Library或MFC提供的AfxFreeLibrary释放动态连接库。

UHFReader18.DLL动态连接库使用手册

UHFReader18.DLL动态连接库使用手册

UHFREADER18.DLL动态连接库使用手册V2.01.操作系统: (1)2.函数详单: (1)2.1)通用函数: (1)2.2)EPCC1-G2协议函数: (2)2.3)18000-6B协议函数: (4)3.函数的描述: (5)3.1)通用函数: (5)3.1.1) AutoOpenComPort():自动连接串口 (5)3.1.2) OpenComPort():连接到指定串口 (6)3.1.3) CloseComPort():关闭串口连接 (7)3.1.4) CloseSpecComPort():关闭指定串口 (7)3.1.5)GetReaderInformation():获得读写器的信息 (7)3.1.6) WriteComAdr():写入读写器地址 (8)3.1.7) WriteScanTime():设置询查命令最大响应时间 (8)3.1.8) SetPowerDbm():设置读写器功率 (9)3.1.9) Writedfre():设置读写器工作频率 (9)3.1.10) Writebaud():设置串口波特率 (10)3.1.11) SetWGParameter():设置韦根参数 (10)3.1.12) SetWork Mode():设置工作模式 (11)3.1.13) GetWork ModeParameter ():读取工作模式参数 (12)3.1.14) ReadActiveModeData ():读取主动模式数据- (12)3.1.15) SetAccuracy():EAS检测精度测试 (13)3.1.16) SetOffsetTime ():Syris响应偏置时间设置 (13)3.1.17) SetFhssMode ():设置读写器跳频模式 (13)3.1.18) GetFhssMode ():获取读写器跳频模式。

(14)3.1.19) SetT riggerTime():触发延时设置。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

UHFREADER18.DLL动态连接库使用手册V2.01.操作系统: (1)2.函数详单: (1)2.1)通用函数: (1)2.2)EPCC1-G2协议函数: (2)2.3)18000-6B协议函数: (4)3.函数的描述: (5)3.1)通用函数: (5)3.1.1) AutoOpenComPort():自动连接串口 (5)3.1.2) OpenComPort():连接到指定串口 (6)3.1.3) CloseComPort():关闭串口连接 (7)3.1.4) CloseSpecComPort():关闭指定串口 (7)3.1.5)GetReaderInformation():获得读写器的信息 (7)3.1.6) WriteComAdr():写入读写器地址 (8)3.1.7) WriteScanTime():设置询查命令最大响应时间 (8)3.1.8) SetPowerDbm():设置读写器功率 (9)3.1.9) Writedfre():设置读写器工作频率 (9)3.1.10) Writebaud():设置串口波特率 (10)3.1.11) SetWGParameter():设置韦根参数 (10)3.1.12) SetWork Mode():设置工作模式 (11)3.1.13) GetWork ModeParameter ():读取工作模式参数 (12)3.1.14) ReadActiveModeData ():读取主动模式数据- (12)3.1.15) SetAccuracy():EAS检测精度测试 (13)3.1.16) SetOffsetTime ():Syris响应偏置时间设置 (13)3.1.17) SetFhssMode ():设置读写器跳频模式 (13)3.1.18) GetFhssMode ():获取读写器跳频模式。

(14)3.1.19) SetT riggerTime():触发延时设置。

(14)3.2)EPCC1-G2协议函数: (15)3.2.1) Inventory_G2 ():G2询查命令 (15)3.2.2) ReadCard_G2 ():G2读取数据命令 (15)3.2.3) WriteCard_G2 ():G2写命令 (16)3.2.4) E raseCard_G2 ():G2块擦除命令 (18)3.2.5) SetCardProtect_G2 ():G2设定存储区读写保护状态命令 (19)3.2.6) DestroyCard_G2 ():G2销毁标签命令 (20)3.2.7) WriteEPC_G2 ():G2写EPC号命令 (21)3.2.8) SetReadProtect_G2 ():G2单张读保护设置命令 (21)3.2.9) SetMultiReadProtect_G2 ():G2多张读保护设置命令 (22)3.2.10) RemoveReadProtect_G2 ():G2解锁读保护命令 (23)3.2.11) CheckReadProtected_G2 ():G2测试标签是否被读保护命令 (23)3.2.12) SetE ASAlarm_G2 ():G2EAS报警设置命令 (24)3.2.13) Check EASAlarm_G2 ():G2EAS报警探测命令 (24)3.2.14) Lock UserBlock_G2 ():G2user区块锁命令(永久锁定) (25)3.2.15) WriteBlock_G2 ():G2块写命令 (26)3.3)18000-6B协议函数: (27)3.3.1) Inventory_6B ():6B寻查命令(单张) (27)3.3.2) Inventory2_6B ():6B按条件寻查电子标签命令 (27)3.3.3) ReadCard_6B ():6B读数据命令 (28)3.3.4) WriteCard_6B ():6B写数据命令 (29)3.3.5) CheckLock_6B ():6B锁定检测命令 (29)3.3.6) LockByte_6B ():6B锁定命令 (30)4.其他返回值定义 (31)5.错误代码定义 (32)上位机应用程序通过UHFREADER18.DLL操作EPCC1-G2和18000-6B格式电子标签读写器。

1.操作系统:WINDOWS 2000/XP2.函数详单:UHFREADER18.DLL包括了如下的操作函数:2.1)通用函数:1)long WINAPI AutoOpenComPort(long *port,unsigned char * ComAdr,unsigned char baud, long *FrmHandle);2)long WINAPI OpenComPort(long Port, unsigned char *ComAdr, unsigned char Baud,long *FrmHandle);3)long WINAPI CloseComPort(void);4)long WINAPI CloseSpecComPort(long FrmHandle);5)long WINAPI GetReaderInformation(unsigned char *ComAdr, unsigned char *V ersionInfo, unsigned char *ReaderType, unsigned char *TrType,unsigned char * dmaxfre , unsigned char *dminfre, unsigned char *powerdBm,unsigned char *ScanTime, long FrmHandle);6)long WINAPI WriteComAdr(unsigned char *ComAdr, unsigned char *ComAdrData, long FrmHandle);7)long WINAPI WriteScanTime(unsigned char *ComAdr, unsigned char *ScanTime, long FrmHandle);8)long WINAPI SetPowerDbm (unsigned char *ComAdr, unsigned char powerDbm, long FrmHandle);9)long WINAPI Writedfre (unsigned char *ComAdr, unsigned char dmaxfre, unsigned char dminfre,long FrmHandle);10)long WINAPI Writebaud (unsigned char *ComAdr, unsigned char * baud, long FrmHandle);11)long WINAPI SetWGParameter(unsigned char *ComAdr, unsigned char Wg_mode,unsigned char Wg_Data_Inteval,unsigned char Wg_Pulse_Width, unsigned char Wg_Pulse_Inteval,long FrmHandle);12)long WINAPI SetWorkMode(unsigned char *ComAdr, unsigned char * Parameter, long FrmHandle);13)long WINAPI GetWorkModeParameter (unsigned char *ComAdr, unsigned char * Parameter, long FrmHandle);14)long WINAPI ReadActiveModeData (unsigned char *ActiveModeData, unsigned char * Datalength, long FrmHandle);15)long WINAPI SetAccuracy(unsigned char *ComAdr, unsigned char Accuracy , long FrmHandle);16)long WINAPI SetOffsetTime (unsigned char *ComAdr, unsigned char OffsetTime, long FrmHandle);17)long WINAPI SetFhssMode (unsigned char *ComAdr, unsigned char FhssMode, long FrmHandle);18)long WINAPI GetFhssMode (unsigned char *ComAdr, unsigned char *FhssMode, long FrmHandle);19)long WINAPI SetTriggerTime(unsigned char *ComAdr, unsigned char* TriggerTime, long FrmHandle);2.2)EPCC1-G2 协议函数:1)long WINAPI Inventory_G2(unsigned char *ComAdr, unsigned char AdrTID, unsigned char LenTID, unsigned char TIDFlag,unsigned char * EPClenandEPC, long *Totallen, long *CardNum,long FrmHandle);2)long WINAPI ReadCard_G2 (unsigned char *ComAdr, unsigned char * EPC, unsigned char Mem, unsigned char WordPtr, unsigned char Num, unsigned char * Password , unsigned char maskadr, unsigned char maskLen, unsigned char maskFlag, unsigned char * Data , unsigned char EPClength, unsigned char * errorcode,long FrmHandle);3)long WINAPI WriteCard_G2 (unsigned char *ComAdr, unsigned char * EPC, unsigned char Mem, unsigned char WordPtr, unsigned char Writedatalen, unsigned char *Writedata,unsigned char * Password, unsigned char maskadr, unsigned char maskLen, unsigned char maskFlag, long WrittenDataNum, unsigned char EPClength, unsigned char * errorcode,long FrmHandle);4)long WINAPI EraseCard_G2 (unsigned char *ComAdr, unsigned char * EPC, unsigned char Mem, unsigned char WordPtr, unsigned char Num, unsigned char * Password, unsigned char maskadr, unsigned char maskLen, unsigned char maskFlag, unsigned char EPClength, unsigned char * errorcode,long FrmHandle);5)long WINAPI SetCardProtect_G2 (unsigned char *ComAdr, unsigned char * EPC, unsigned char select, unsigned char setprotect, unsigned char * Password, unsigned char maskadr, unsigned char maskLen, unsigned char maskFlag,unsigned char EPClength, unsigned char * errorcode,long FrmHandle);6)long WINAPI DestroyCard_G2 (unsigned char *ComAdr, unsigned char * EPC, unsigned char * Password, unsigned char maskadr, unsigned char maskLen, unsigned char maskFlag,unsigned char EPClength, unsigned char * errorcode,long FrmHandle);7)long WINAPI WriteEPC_G2 (unsigned char *ComAdr, unsigned char * Password, unsigned char * WriteEPC, unsigned char WriteEPClen, unsigned char * errorcode,long FrmHandle);8)long WINAPI SetReadProtect_G2 (unsigned char *ComAdr, unsigned char * EPC, unsigned char * Password, unsigned char maskadr, unsigned char maskLen, unsigned char maskFlag,unsigned char EPClength, unsigned char * errorcode,long FrmHandle);9)long WINAPI SetMultiReadProtect_G2 (unsigned char *ComAdr, unsigned char * Password, unsigned char * errorcode,long FrmHandle);10)long WINAPI RemoveReadProtect_G2 (unsigned char *ComAdr, unsigned char * Password, unsigned char * errorcode,long FrmHandle);11)long WINAPI CheckReadProtected_G2 (unsigned char *ComAdr, unsigned char *readpro,unsigned char * errorcode,long FrmHandle);12)long WINAPI SetEASAlarm_G2 (unsigned char *ComAdr, unsigned char * EPC, unsigned char * Password, unsigned char maskadr, unsigned char maskLen, unsigned char maskFlag, unsigned char EAS, unsigned char EPClength, unsigned char * errorcode,long FrmHandle);13)long WINAPI CheckEASAlarm_G2 (unsigned char *ComAdr, unsigned char * errorcode,long FrmHandle);14)long WINAPI LockUserBlock_G2 (unsigned char *ComAdr, unsigned char * EPC, unsigned char * Password, unsigned char maskadr, unsigned char maskLen, unsigned char maskFlag, unsigned char BlockNum,unsigned char EPClength, unsigned char * errorcode,long FrmHandle);15)long WINAPI WriteBlock_G2 (unsigned char *ComAdr, unsigned char * EPC, unsigned char Mem, unsigned char WordPtr, unsigned char Writedatalen, unsigned char *Writedata,unsigned char * Password, unsigned char maskadr, unsigned char maskLen, unsigned char maskFlag, long WrittenDataNum, unsigned char EPClength, unsigned char * errorcode,long FrmHandle);2.3)18000-6B 协议函数:1)long WINAPI Inventory_6B (unsigned char *ComAdr, unsigned char * ID_6B ,long FrmHandle);2)long WINAPI Inventory2_6B (unsigned char *ComAdr, unsigned char Condition , unsigned char StartAddress, unsigned char mask , unsigned char * ConditionContent,unsigned char * ID_6B , long * Cardnum,long FrmHandle);3)long WINAPI ReadCard_6B (unsigned char *ComAdr, unsigned char * ID_6B , unsigned char StartAddress, unsigned char Num, unsigned char * Data, unsigned char * errorcode, long FrmHandle);4)long WINAPI WriteCard_6B (unsigned char *ComAdr, unsigned char * ID_6B , unsigned char StartAddress, unsigned char * Writedata, unsigned char Writedatalen, unsigned char * writtenbyte, unsigned char * errorcode, long FrmHandle);5)long WINAPI LockByte _6B (unsigned char *ComAdr, unsigned char * ID_6B , unsigned char Address, unsigned char * errorcode, long FrmHandle);6)long WINAPI CheckLock_6B (unsigned char *ComAdr, unsigned char * ID_6B , unsigned char Address, unsigned char * ReLockState,unsigned char * errorcode, long FrmHandle);3.函数的描述:3.1)通用函数:3.1.1) AutoOpenComPort():自动连接串口功能描述:该函数用于自动识别与读写器连接的串口并且执行初始化操作,然后通过连接串口和读写器以创建通信连接。

相关文档
最新文档