Real time pilot realizes software of the numerical control below Windows 95

  • Time:
  • Click:212
The summary elaborated Windows 95 interrupt a principle, introduced to use VxD to implement the method that interrupts processing. Pass the application in system of electric spark numerical control, those who proved this technology is practical with reliable. Keyword   VxD interrupts Abstract In This Paper of   of system of electric spark numerical control, the Principle Of Interrupt For Windows 95 Is Presented, and The Method Of Handling Interrupt, which Is Based On VxD, is Introduced.

It Is Demonstrated That This Technology Is Reliable And Useful In The Application Of NC For EDM.

1 preface in recent years, the development that has numerical control software on Windows 95 platform is the sign that numerical control product replaces and trend. Use the resource with rich Windows 95, can generate all sorts of menu and software of editor of numerical control instruction to wait conveniently, the development cycle of the product is short. And, using Windows 95 is the character of much task operating system, in make sure downstage treatment task is accurate below the circumstance that finish on time, executable still online monitor, breakdown is diagnosed wait for the task, develop the property of lead plane adequately. Current, forming machine of electric spark of domestic numerical control controls the operation platform of software to use DOS system or 16 Windows 3 commonly.

X system, and if abroad already used Windows 95 system A Ji company to control software platform as its, make the function such as the database of software and network gets very big rise, user use effect is very good. Additional, the software of tool of CAD/CAM software etc that is based on Windows 95 is very much, control the function of software to increase, on Windows 95 platform system of numerical control of development electric spark controls software is very be necessary. In fact, in the development of system of electric spark numerical control, often need to gather information of a few state in real time, pass interface board to convey signal lead plane, leader comes true through interrupting means to accept data real time measure and control. And the much task environment that Windows 95 is message drive, all sorts of messages queue up to handle orderly early or late by what they arrive, message mechanism does not divide task importance, if not have,interrupt a setting, only by message mechanism, unwarrantable numerical control controls the task to be carried out inside exact time downstage. Accordingly, want to solve this problem, must realize Windows 95 interrupt processing. The interrupts principle and implementation to mix 16 about DOS Windows 3 of 2   Windows 95.

The interrupts principle and mechanism respect introduction material of X is very much, it is relatively easy that implementation rises, no longer give uncecessary details. Here emphasizes those who elaborate Windows 95 to interrupt a principle, brief introduction shows a method actually. Well-known, the 8086CPU series chip of Intel set 0, 1, the 2 executive code reliability with 4 3 level (namely Ring 0 ~ 3 class) , use to 0 class only in Windows 95 with 3 class. Executive Ring 0 the code of class, can be opposite directly hardware, interrupt and file system undertakes physics is visited, only operating system and its component are allowed to be carried out inside Ring 0 class. And the code that uses a program is carried out inside the Ring 3 class in reliability lowest only, its visit the memory capacity beyond hardware and oneself process space to be restricted. Normally, implementation of two kinds of methods can be used to interrupt below Windows 95, one kind is to write DLL program, another kind is to use fictitious equipment driver (VxD) . The distinction of both depends on: VxD moves at Ring 0 class as the component of the operating system, and DLL program moves at Ring 3 class. In fact, vxD also is considered as the executable DLL below a 32 protection mode. What should make clear is VxD moves in fictitious machine to manage implement (under VMM) control, VMM is to be located in the most rock-bottom operating system component (VMM included all and basic system function, if the task attempers, fictitious memory operation, program is loaded reach stop, the communication between the task, in addition, responsible still processing is interrupted basically reach exceptional circumstance) . Hardware equipment is sent after data gets ready interrupt signal, but VxD does not intercept and capture these to interrupt signal directly, rely on however fictitious but process designing interrupts controller (VPICD) comes hardware is interrupted. VPICD can interrupt hardware map to arrive other equipment, provide a service to other equipment, allow fictitious equipment to request to interrupt through these services, can interrupt signal in hardware of the imitate in VMM. What go up in hardware as a result of much task of Windows 95 system even if pass hardware is fictitious change those who will come true, use this kind of method to realize taller time precision to accord with the principle of itself of Windows 95 system, go to the lavatory simply and the stability that is helpful for Windows 95 system. See figure below. Graph of VxD moving process because this, come true below Windows 95 system at present relatively the real time control of high accuracy, use commonly write VxD program to come true. Realize time method to be as follows: (1) uses the API(VTDAPI) of the fictitious timer that place of Windows system itself offers. Applied process must get the entrance address of VTDAPI above all, repass function VTDAPI-Begin-Int-Period will install break cycle, VTDAPI-Start-User-Timer of usable finally function starts timer, the callback function that statement will be transferred by cycle. What need points out is Windows 95 such 32 timer can be registered in the system. (2) uses fictitious timer device fictitious hardware timer, offer other and fictitious equipment to suspend rate service or capture with what will build clock given of port of fictitious equipment I/O prohibit or open. Install a system to break cycle through functional VTD-Begin-Min-Int-Period above all. Can force to time equipment prohibits or open port next through functional VTD-Enable-Trapping and VTD-Disable-Trapping. Start timer through functional Set-VM-Time-Out, the real time that coordinates corresponding function to fulfil a requirement controls the job. Actually, to external physics is interrupted, can use this kind of method likewise. To show fictitious equipment suspend control, introduce structure of a data above all, the definition is as follows: Initialization of ∥ of   of WORD VID-Options; of several     is the IRQ of application of fictitious equipment of ∥ of   of WORD VID-IRQ-Number; of   of   of   of STRUCT VPICD-IRQ-Descriptor {the ∥ of   of DWORD VID-Virt-Int-Proc; of address     that user of ∥ of   of DWORD VID-Hw-Int-Proc; of   of 0     suspends processing program is fictitious interrupt processing physics of ∥ of   of DWORD VID-EOI-Proc; of   of program address   interrupts an end, user of ∥ of   of PVOID VID-Hw-Int-Ref; of   of 500ms     interrupts parameter} ; Fictitious equipment interrupts pilot to handle a process to be as follows: Above all, the user lades through CreateFile() function VxD, the system sends DEVICE-DYNAMIC-INIT message to VxD, call corresponding initialization program. Next, carry out suspend processing program, its measure is to call VPICD-Pyhs-EOI to end physics to interrupt, call VPICD-Set-Int-Request the setting is fictitious interrupt, undertake discontinuous handling, call VPICD-Clear-Int-Request cleared and fictitious interrupt, call VPICD-Virtual-EOI the end is fictitious interrupt. When the user uninstalls VxD through CloseHandle() function, the system sends DEVICE-DYNAMIC-EXIT message to VxD, control those who handle a program to call correspondence to quit processing program. Understood fictitious equipment to interrupt the principle that controls a process, can use VxD implementation to interrupt processing conveniently. Current, have representative VxD to develop kit draw together: The DDK of equipment driver development kit that Microsoft company makes, this product appears earlier, use range is wider also, but demand development staff has certain assembly language base, workload is bigger. The is used at writing equipment driver kit VtoolsD that Vireo Software company develops, it includes Quick VxD of builder of code of a VxD, but to load and the tool that uninstall VxD VxDLoad, can give out system already the VxDView of information of to load VxD, and the C++ of ANSI C moving library, VMM/VxD service library, VxD kind library. VtoolsD besides can work to fall in Windows95 environment, still have very strong development capability and taller development efficiency, it is a quite outstanding software package. Additional, the writes equipment driver kit WinDriver that KRFTech company makes also is a pretty good development tool, like VtoolsD, can make process designing personnel writes equipment driver with C++ language, is not will much energy is put in write those complex, kernels that are hard to debug on mode code, use thereby rise convenient and reliable. 3   VxD is in an application in numerical control system in the system of numerical control of electric spark forming machine that we develop development, very tall to the servo control requirement of main shaft, because this needs quite tall real time sex. After using Windows 95 operating system, must solve problem of real time sex, wove for this VxD program. Length of be confined to, can combine a function to introduce simply to show a process actually only. The basis devises plan, use IRQ10 to interrupt signal as hardware, interrupt a source to be offerred by exterior hardware timer, set is 1ms. Quick VxD of builder of code of the VxD in use VtoolsD creates framework of a VxD automatically. Amid adds his code, if hardware interrupts processing function: VOID MyHwInt: ∥ of InterruptHandling(); of   of   of   of   of {of   of OnHardwareInt(VMHANDLE HVM)   interrupts processing function, included specific to load of trends of order of VxD of   of   of} of ClearCarry();     mixes the   of   of   of SendPhysicalEOI(); of   of control task   that wants implementation uninstall function: BOOL MyintDevice: BOOL MyintDevice of   of   of} of   of   of Else Return FALSE; of   of   of   of} of   of   of   of Return TRUE; of   of   of   of   of PMyIRQ->physicalUnmask(); of   of   of   of   of   of If(pMyIRQ&&pMyIRO->hook()){of   of   of   of PMyIRQ=new MyHwInt(); of   of   of   of   of {of OnSysDynamicDeviceInit()     : The communication function between VxD of   of   of} of   of   of Return TRUE; of   of   of   of Delet PMyIRQ; of   of   of   of PMyIRQ->physicalMask(); of   of   of   of   of {of OnSysDynamicDeviceExit()     and main program: DWORD MyintDevice: {of   of OnW32DeviceIoControl(PIOCTLPARAMS PDIOCParams)   ... Case 111: of   of   of   of Switch(pDIOCParmas->dioc-IOCtlCode){of       ?   of   of   of Reak; of  of   of      Default: ?   of   of Return 0; of   of   of   of} of   of   of  Reak;   ...   of     } is waited a moment. Normally the circumstance falls, source code can be compiled with VC++ directly through, generate the VxD of need. If need debugged word, the software of tool of Soft/ICE For Windows 95 that uses Numega Technologies firm will debug VxD quite convenient. Carry out a proof, after use VxD, the servo with certain recombine is politic, the servo that solved main shaft well controls a problem, treatment precision gets assuring reliably, and systematic stability is very good also, via taking an examination of machine hind for long, did not appear any unusual. Because the hardware of Windows system is opaque,control of 4 real time uses the development trend of the program quality, make average user should be finished certain hardware operation has greater difficulty. Already made the systematic core of Windows 95 in view of VxD and VMM, the design line of business of VxD already became real time to control the crucial technology that uses a program. Additional, microsoft company asks to satisfy pilot of on industry a few real time, special rolled out Windows CE of real time operating system in June 1999. We know, will tell to operating system of a real time, have 3 crucial parameter, interrupt what interrupt by processing of driver of the greatest time of operating system and equipment driver screen, equipment namely the greatest time and break those who begin to be carried out to the task to suspend defer time from which, the referenced value that these 3 parameter in Windows CE system are restricted to be worth all is in small second class, this asks to be able to be satisfied basically to present a few control. By this token, the real time that is based on Windows CE system uses the development of the program, will become a possibility. CNC Milling