CN108897529A - A kind of development approach of PCI motion control card driving - Google Patents
A kind of development approach of PCI motion control card driving Download PDFInfo
- Publication number
- CN108897529A CN108897529A CN201810630085.XA CN201810630085A CN108897529A CN 108897529 A CN108897529 A CN 108897529A CN 201810630085 A CN201810630085 A CN 201810630085A CN 108897529 A CN108897529 A CN 108897529A
- Authority
- CN
- China
- Prior art keywords
- control card
- motion control
- driving
- code
- card
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a kind of development approaches of PCI motion control card driving.This method is:The hardware resource of motion control card is identified in driving initial phase using Microsoft Driver Foundation (WDF) driving model of Microsoft, obtains pci bus data communication address;In the event response module of WDF driving, read-write event is registered according to event type and mailing address and carries out the read-write of data;According to different Card Types, by the combination of random code and card number, specific globally unique identifier (GUID) is registered to distinguish different motion control cards, and identify for computer;Application software sends interaction of the reading and writing data event to driving to realize and drive by calling the standard of Microsoft to drive communication interface DeviecIoControl.The driving made using this method collects identification and communication and one, and installation is simpler, and drives exploitation relative to traditional WDM formula, and code is more succinctly, efficiently.
Description
Technical field
The present invention relates to computers and automation control area, more particularly to a kind of based on the movement control of pci bus type
The driving development approach of fabrication.
Background technique
In modernization industry manufacture, equipment automatization is always wherein important link, for meet mechanical equipment from
Dynamicization processing, the various High Performance Motion Control cards based on PC machine come into being, and support the motion control card of pci bus, also
To being more and more widely used.PCI bus is common physical bus in PC, because of its, speed strong with scalability
The features such as fast is spent, the important way of PC machine and peripheral communications is had become.Industrial personal computer transmits control instruction by pci bus
To motion control card, control card executes corresponding movement, while information is fed back to industrial personal computer by pci bus, has become
The conventional means of PC automation control.Therefore, the PCI driving for being suitble to motion control card to use is developed, it appears particularly important.
Common control card PCI driving development approach has through the WDM too development of Microsoft at present, because its development procedure is cumbersome, opens
The hair period is longer, has been abandoned by Microsoft in new WINDOWS system.There are also directly driven using third party's too development
, such as developed using the Windriver tool of Jungo company, the PCI of this method loading third-party first drives journey
Sequence, it is all very cumbersome in the exploitation, installation and use process of driving.It is basic at present in PCI driving in driving recognition methods
It is to be identified by unique GUID, the driver code of different motion control cards is caused also to differ widely, it is compatible
Property is not strong.It is right because the tool is in order to be compatible with most PCI driver especially when using Windriver tool
Bottom layer driving code is encapsulated, cause develop driving during, directly hardware cannot be operated, need using
The interface that the tool provides operates hardware, and this further restricts the freedom degrees of developer, while the tool valence
Lattice are expensive, and having time limits, and therefore, driver with independent intellectual property rights is developed, for motion control card apparatus
Quotient, it is particularly important.Simultaneously as WINDOWS operating system constantly upgrades, the shared office of new legacy system has been had already appeared at present
Face, this is driven with greater need for the strong PCI of motion control card manufacturer exploitation compatibility, is therefore made with the different operating system of compatibility
Developing instrument is driven with the WDF that Microsoft provides, accomplishes that a set of code is adapted to common operating system, it appears more necessary and urgent
It cuts.
Summary of the invention
The object of the present invention is to provide a kind of development approaches of PCI motion control card driving, to overcome the above shortcomings, thus
Improve development efficiency, property easy to use and the compatibility of motion control card driving.
Present example provides a kind of development approach of PCI motion control card driving, and specific steps include:
The newest WDF of Microsoft is installed and develops environment, writes basic WDF drive code set frame;
It is hard to write driver in EvtDevicePrepareHardware call back function in the initial phase of WDF
Part initial code;
Customized two IOCTL control routines, in the event response EvtIoDeviceControl call back function of WDF driving
It is interior, the program of identification control routine is write, control command can be identified and respond;
It is random to generate GUID number, and the latter half of the number is revised as the type of control card and registers the number,
The number can not only be used to distinguish the driving of distinct device, additionally it is possible to according to the number of latter half, scanning recognition industrial personal computer
In all similar motion control card.
Driver interface is write, when driver correctly loads, by GUID number, the driver is searched for and opens
Equipment, while DeviceIoControl interface and IOCTL control routine can be used, it is communicated with driver;
The equipment installation file (INF file) for writing the driver, can be carried out by the equipment manager of WINDOWS
Identification installation;
The driver and its matched interface developed using the above method are had following excellent compared to third party's tool is used
Point:The version of third party's tool need not be taken into consideration in developer, does not also need to pay for third party's tool, can develop has certainly
The driver code of main intellectual property, and free control can be carried out to pci bus.The driving of exploitation has extremely strong simultaneous
Capacitive, can the systems such as a set of code compatible XP, VISTA, WIN7 and WIN10, can identify, open and control simultaneously and is a variety of
Different types of motion control card greatly expands the application range of control card, simplifies development process, improves exploitation effect
Rate.
Detailed description of the invention
Fig. 1 is development process figure of the invention.
Specific embodiment
In order to improve the development efficiency based on the driving of PCI motion control card, the compatibility of driving is promoted, to improve user
Usage experience, the present invention provides a kind of production methods of control card driving, are driven using the PCI control card of this method production,
It does not need using third party's tool, can both accomplish the compatible mainstream operation system of a set of code, and different cards can be distinguished
Type and card quantity meet installation on an industrial personal computer and identify multiple control cards and use simultaneously.
As shown in Fig. 1, in the embodiment of the present invention, the detailed development process of PCI control card driving is as follows:
Step 101:The WDF driver framework of standard of compiling, including Driver Entry function, hardware initialization call back function, thing
Part handles call back function;
Step 102:In hardware initialization function, control card hardware identification code is write, and identifies control card resource, if
For I/O resource, resource address and length are saved, which will be used as base address, will use when data are transmitted.If do not looked for
To suitable resource, mistake is returned for computer and carries out miscue;
Step 103:Customized IOCTL_PCI_READPORT and IOCTL_PCI_WRITEPORT (are also possible to other classes
Like operation code), it is used in event handling call back function, if receiving IOCTL_PCI_READPORT event, in parsing event
Offset address, and the data for specifying address are read by READ_PORT_USHORT, if receiving IOCTL_PCI_WRITEPORT thing
Part, offset address and input data in parsing event are sent into WRITE_PORT_USHORT to send data to pci bus;
Step 104:128 GUID numbers are generated at random, and wherein latter 16 are replaced with the type of motion control card, example
Such as 0x89,0x69, particular kind of motion control card can accurately be found by the GUID, and by the number registration;
Step 105:Write application programming interfaces, interface include found by GUID the equipment operation interface for opening equipment and
The device communication interface being written and read by IOCTL operation code;
Step 106:Write INF file, and driver be installed, after installing successfully, can by application programming interfaces with
Motion control cartoon letters.
Claims (5)
1. a kind of PCI motion control card drives development approach, which is characterized in that include the following steps:
In the EvtDevicePrepareHardware call back function of WDF initial phase, the hardware of motion control card is identified
Resource, and record the hardware communications address of PCI;
In the queue message module of WDF, input and output control routine is defined, and in call back function EvtIoDeviceControl
PCI mailing address that is interior, identifying the control routine, while deviating and recording according to the mailing address of acquisition, with motion control card
Pci bus communicated;
In the registration process of WDF driving, GUID code is combined by random code and Card Type, marks every kind of motion control card driving
Unique identification title, and control card driver can be found by the GUID code in the application.
In the application, it by using the DeviceIoControl interface of Windows and the control routine defined, sends
Driving read write command simultaneously reads and writes data;
2. the method as described in claim 1, which is characterized in that in WDF initial phase
In EvtDevicePrepareHardware call back function, the hardware resource of motion control card is identified, and the hardware for recording PCI is logical
Believe address, including:
Identify the resource type of motion control card pci bus, including memory source and I/O resource.If identifying I/O resource, save
The initial address and length of I/O resource.If not recognizing resource, mistake is returned, and saves corresponding error message.
3. the method as described in claim 1, which is characterized in that in the queue message module of WDF, define input and output and control generation
Code, and in call back function EvtIoDeviceControl, identify the control routine, while deviating according to the mailing address of acquisition
With the PCI mailing address of record, communicated with the pci bus of motion control card, including:
Customized two IOCTL codes, respectively indicate the event code for outputting and inputting data, in call back function
In EvtIoDeviceControl, the type of data event is judged, if it is incoming event code, indicate that application program has sent
Data will be written to pci bus in data entry command, this moment by the address offset and data in resolve command, and according to
The communication base address of record calls WRITE_PORT interface that data are written.If it is outgoing event code, indicate that application program will
Pci bus data are read, pass through the address offset in order and communication base address this moment, call READ_PORT interface reading number
According to, and transmit that data to application program.
4. the method as described in claim 1, which is characterized in that in the registration process of WDF driving, pass through random code and card class
Type combines GUID code, marks the unique identification title of every kind of motion control card driving, and can in the application, by this
GUID code finds control card driver, including:
Unique GUID code is generated for each type of motion control card, what the front portion of the GUID code was randomly generated, after
A part is replaced with Card Type, in this way, same type of motion control card can be classified as one kind by computer, and
During the installation process, same motion control card only needs a kind of driver, and classification is clear, installs also fairly simple.Simultaneously
By the composition form of the GUID code, suitable application program can be write, scans the class of the different motion control card into system
Type is simultaneously communicated, and the card of a variety of identical or different types is supported to be mounted in the same operating system, at the same carry out identification and
Communication.
5. the method as described in claim 1, which is characterized in that in the application, by using Windows's
DeviceIoControl interface and the control routine defined send driving read write command and read-write data, including:
Driver scans the motion control card all into operating system first, and opens control card, saves and opens control card
Driver handle, by DeviceIoControl interface, incoming handle, the control routine and data predefined were both achievable
The control to motion control card is then completed in read-write to control card pci bus.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810630085.XA CN108897529A (en) | 2018-06-19 | 2018-06-19 | A kind of development approach of PCI motion control card driving |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810630085.XA CN108897529A (en) | 2018-06-19 | 2018-06-19 | A kind of development approach of PCI motion control card driving |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108897529A true CN108897529A (en) | 2018-11-27 |
Family
ID=64345535
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810630085.XA Pending CN108897529A (en) | 2018-06-19 | 2018-06-19 | A kind of development approach of PCI motion control card driving |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108897529A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114860321A (en) * | 2022-04-06 | 2022-08-05 | 网易(杭州)网络有限公司 | External device control method, device, equipment and medium based on raspberry pi |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101706758A (en) * | 2009-10-30 | 2010-05-12 | 广西大学 | Identification method of multiple sets of PCI equipment with same hardware configuration under Windows system |
CN103077140A (en) * | 2013-02-05 | 2013-05-01 | 北京配天大富精密机械有限公司 | Communication method and communication device for motion control card of robot and host |
US8583835B1 (en) * | 2008-08-06 | 2013-11-12 | Siliconsystems, Inc. | Command portal for executing non-standard storage subsystem commands |
CN104484292A (en) * | 2014-12-30 | 2015-04-01 | 飞天诚信科技股份有限公司 | Driver suitable for serial equipment and working method of driver |
CN104834526A (en) * | 2015-05-16 | 2015-08-12 | 深圳众为兴技术股份有限公司 | Manufacturing method for motion control card driver installation package |
-
2018
- 2018-06-19 CN CN201810630085.XA patent/CN108897529A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8583835B1 (en) * | 2008-08-06 | 2013-11-12 | Siliconsystems, Inc. | Command portal for executing non-standard storage subsystem commands |
CN101706758A (en) * | 2009-10-30 | 2010-05-12 | 广西大学 | Identification method of multiple sets of PCI equipment with same hardware configuration under Windows system |
CN103077140A (en) * | 2013-02-05 | 2013-05-01 | 北京配天大富精密机械有限公司 | Communication method and communication device for motion control card of robot and host |
CN104484292A (en) * | 2014-12-30 | 2015-04-01 | 飞天诚信科技股份有限公司 | Driver suitable for serial equipment and working method of driver |
CN104834526A (en) * | 2015-05-16 | 2015-08-12 | 深圳众为兴技术股份有限公司 | Manufacturing method for motion control card driver installation package |
Non-Patent Citations (5)
Title |
---|
F. MRAD等: "Real-time control of free-standing cart-mounted inverted pendulum using LabVIEW RT", 《CONFERENCE RECORD OF THE 2000 IEEE INDUSTRY APPLICATIONS CONFERENCE. THIRTY-FIFTH IAS ANNUAL MEETING AND WORLD CONFERENCE ON INDUSTRIAL APPLICATIONS OF ELECTRICAL ENERGY (CAT. NO.00CH37129)》 * |
J博士: "基于WDF的PCI/PCIe接口卡Windows驱动程序(4)- 驱动程序代码(源文件)", 《HTTPS://WWW.CNBLOGS.COM/JACKLU/P/4687325.HTML》 * |
J博士: "基于WDF的PCI/PCIe接口卡Windows驱动程序(5)-如何为硬件移植驱动程序", 《HTTPS://WWW.CNBLOGS.COM/JACKLU/P/6139347.HTML》 * |
MICROSOFT: "PCI driver programming guide", 《HTTPS://DOCS.MICROSOFT.COM/EN-US/WINDOWS-HARDWARE/DRIVERS/PCI/》 * |
隋佳彬: "基于DSP的数字传输系统的PCI上位机WinDriver驱动设计与研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114860321A (en) * | 2022-04-06 | 2022-08-05 | 网易(杭州)网络有限公司 | External device control method, device, equipment and medium based on raspberry pi |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10990422B2 (en) | Information processing device, information processing method and program | |
CN107851152B (en) | Apparatus and method for distributed operation of a security controller | |
EP1548580B1 (en) | Non-platform-specific unique identifier generation | |
US20090172219A1 (en) | Device and method for automatically launching applications residing on usb flash drives | |
CN1658174A (en) | Method and apparatus for smart memory pass-through communication | |
CN1734417A (en) | Application with multiple embedded drivers | |
EP2689341B1 (en) | Device flags | |
CN102981814A (en) | Method and apparatus to develop an application of an image forming apparatus | |
CN102073538A (en) | Real-time run-time system and functional module for such a run-time system | |
CN112905472A (en) | Kernel debugging system and method | |
US20060184924A1 (en) | Intelligent platform management interface firmware architecture and method of building the same | |
CN114546394B (en) | Unified Internet of things peripheral access and control method | |
CN102236618A (en) | Mass production method and system thereof for USB (universal serial bus) devices | |
CN108897529A (en) | A kind of development approach of PCI motion control card driving | |
CN113518341B (en) | eSIM code number management method and device | |
CN109086082B (en) | Method, system and medium for expanding BIOS function by SMBIOS | |
CN113360379B (en) | Program test environment creation method and program test environment creation apparatus | |
JP2008158710A (en) | Computer system | |
CN111857839A (en) | PXI/PXIe bus equipment driving system based on Linux | |
JP2005302026A (en) | Computer-readable medium, method, and computer system for accessing to networked peripheral device | |
CN1645856B (en) | Deterministic rule-based dispatch of objects to code | |
CN102520895A (en) | Printer driver and application decoupling using event centric registration model | |
CN112416444A (en) | Board switching control method, device, equipment and medium | |
CN107977335B (en) | Method and device for accessing resources | |
CN111078236A (en) | Automatic software installation method and system, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181127 |
|
RJ01 | Rejection of invention patent application after publication |