SDC C-Project CF Review 프로그램
SWK
2023-03-10 5ce2e7ca14f09da2138ea783ef16044a01423413
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
/* pmacu.h
 *
 * 32-bit Motion Control Device Driver
 * Data structures and function entry-points for Pmac user-mode driver
 
HISTORY
 
*/
 
#ifndef _PMACU_H_
  #define _PMACU_H_
 
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif
 
//
// include needed headers
//
#ifndef __ATLBASE_H__
  #include <windows.h>
  #include <windowsx.h>
#endif
  #include <winsock2.h>
  //#include <mcstruct.h>
  //#include <common.h>
  //#include <mioctl.h>
  //#include <private.h>
#include "PComm32 Pro/mcstruct.h"
#include "PComm32 Pro/common.h"
#include "PComm32 Pro/mioctl.h"
#include "PComm32 Pro/private.h"
 
//  #include "PlxApi.h"
 
#ifndef _PMACSERVER
//////////////////////////////////////////////////////////////////////////////
// This section is included for the Pcomm32.dll and old server
  #include "dpr.h"
  #include "intr.h"
  #include "gather.h"
 
/****************************************************************************
 * information needed to locate/initialise hardware. Set by user
 * in ConfigDlgProc and written to registry to kernel driver.
 ****************************************************************************/
#pragma pack(push, 4)
typedef struct _Config_Location 
{
  PMACDEVICETYPE PmacType; // 1 = DT_PMAC1, 2 = DT_PMAC2,3 = DT_TURBO
  DWORD Location;          // typedef enum {LT_UNKNOWN, LT_ISA, LT_SER, LT_ETH, LT_PCI, LT_USB, LT_LAST};
  DWORD PCBusType;         // ISA, PCI etc.
  DWORD DPRRotSize[MAX_ROTBUF_PMAC]; // 16 originally
 
  DWORD DPRVarAdr;
 
  DWORD  dwDPRRTimeout;
  DWORD  dwDPRBKTimeout;
  DWORD  dwDPRCharTimeout;
  DWORD  dwDPRFlushTimeout;
  DWORD  dwBUSFlushTimeout;
  DWORD  dwBUSCharTimeout;
 
  DWORD  dwSERPortNumber;
  DWORD  dwSERBaudrate;
  DWORD  dwSERParity;  // 0 = no, 1 = odd, 2 = even
  DWORD  dwSERFlushTimeout;
  DWORD  dwSERCharTimeout;
  DWORD  dwSERWriteMultiplyerTimeout;
  DWORD  dwSERWriteConstantTimeout;
  DWORD  dwSERReadMultiplyerTimeout;
  DWORD  dwSERReadConstantTimeout;
  DWORD  dwSERReadIntervalTimeout;
 
  DWORD  dwDPRAutoActive;
  DWORD  dwDPRRealtActive;
  DWORD  dwDRPBackgActive;
  DWORD  dwDPRRealtPeriod;
  DWORD  dwDRPBackgPeriod;
  DWORD  dwEnableInterrupts;
 
  DWORD  dwIPAddress;
 
  CHAR szNcTitle[256];
  CHAR szSourceProfile[_MAX_PATH];
  CHAR szToolProfile[_MAX_PATH];
  CHAR szCoordProfile[_MAX_PATH];
  DWORD MachineType;
  DWORD NoOfTools;
  DWORD NoOfBlocks;
  DWORD NoOfCoordSys;
  DWORD MetricDisplay;
  double LeastHandleInc;
  double MaxHandleInc;
  double LeastJogInc;
  CHAR szAxisMotorMap[15];
  CHAR szAxisMotorSel[15];
  CHAR szAxisDispMap[15];
  double MaxRapidOvrd;
  double MaxFeedOvrd;
  // Axis stuff
  DWORD IsSpindle;
  DWORD HasSlave;
  DWORD IsPhantom;
  DWORD Display;
  DWORD DisplaySlave;
  DWORD HomeMode;
  DWORD HomePrgNumber;
  DWORD Precision;
  DWORD AxisMetricDisplay;
  DWORD MetricUnits;
  DWORD ProbePrgNumber;
  CHAR szPulsePerUnit[15];
  CHAR szInPositionBand[15];
  CHAR szMaxRapid[15];
  CHAR szMaxFeed[15];
  CHAR szFatalFError[15];
  CHAR szWarnFError[15];
  CHAR szJogSpeedLow[15];
  CHAR szJogSpeedMedLow[15];
  CHAR szJogSpeedMed[15];
  CHAR szJogSpeedMedHigh[15];
  CHAR szJogSpeedHigh[15];
  CHAR szFormatInch[15];
  CHAR szFormatMM[15];
} CONFIG_LOCATION, *PCONFIG_LOCATION;
#pragma pack(pop) 
#else
//////////////////////////////////////////////////////////////////////////////
// This section is included for the new server
 
 /****************************************************************************
 * information needed to locate/initialise hardware. Set by user
 * in ConfigDlgProc and written to registry to kernel driver.
 ****************************************************************************/
#pragma pack(push, 4)
typedef struct _Config_Location 
{
  PMACDEVICETYPE PmacType; // 1 = DT_PMAC1, 2 = DT_PMAC2,3 = DT_TURBO
  DWORD Location;          // typedef enum {LT_UNKNOWN, LT_ISA, LT_SER, LT_ETH, LT_PCI, LT_USB, LT_LAST};
  DWORD PCBusType;         // ISA, PCI etc.
  DWORD DPRRotSize[MAX_ROTBUF_PMAC]; // 16 originally
 
  DWORD DPRVarAdr;
 
  DWORD  dwDPRRTimeout;
  DWORD  dwDPRBKTimeout;
  DWORD  dwDPRCharTimeout;
  DWORD  dwDPRFlushTimeout;
  DWORD  dwBUSFlushTimeout;
  DWORD  dwBUSCharTimeout;
 
  DWORD  dwSERPortNumber;
  DWORD  dwSERBaudrate;
  DWORD  dwSERParity;  // 0 = no, 1 = odd, 2 = even
  DWORD  dwSERFlushTimeout;
  DWORD  dwSERCharTimeout;
  DWORD  dwSERWriteMultiplyerTimeout;
  DWORD  dwSERWriteConstantTimeout;
  DWORD  dwSERReadMultiplyerTimeout;
  DWORD  dwSERReadConstantTimeout;
  DWORD  dwSERReadIntervalTimeout;
 
  DWORD  dwDPRAutoActive;
  DWORD  dwDPRRealtActive;
  DWORD  dwDRPBackgActive;
  DWORD  dwDPRRealtPeriod;
  DWORD  dwDRPBackgPeriod;
  DWORD  dwEnableInterrupts;
 
  DWORD  dwIPAddress;
 
  CHAR szNcTitle[256];
  CHAR szSourceProfile[_MAX_PATH];
  CHAR szToolProfile[_MAX_PATH];
  CHAR szCoordProfile[_MAX_PATH];
  DWORD MachineType;
  DWORD NoOfTools;
  DWORD NoOfBlocks;
  DWORD NoOfCoordSys;
  DWORD MetricDisplay;
  double LeastHandleInc;
  double MaxHandleInc;
  double LeastJogInc;
  CHAR szAxisMotorMap[15];
  CHAR szAxisMotorSel[15];
  CHAR szAxisDispMap[15];
  double MaxRapidOvrd;
  double MaxFeedOvrd;
  // Axis stuff
  DWORD IsSpindle;
  DWORD HasSlave;
  DWORD IsPhantom;
  DWORD Display;
  DWORD DisplaySlave;
  DWORD HomeMode;
  DWORD HomePrgNumber;
  DWORD Precision;
  DWORD AxisMetricDisplay;
  DWORD MetricUnits;
  DWORD ProbePrgNumber;
  CHAR szPulsePerUnit[15];
  CHAR szInPositionBand[15];
  CHAR szMaxRapid[15];
  CHAR szMaxFeed[15];
  CHAR szFatalFError[15];
  CHAR szWarnFError[15];
  CHAR szJogSpeedLow[15];
  CHAR szJogSpeedMedLow[15];
  CHAR szJogSpeedMed[15];
  CHAR szJogSpeedMedHigh[15];
  CHAR szJogSpeedHigh[15];
  CHAR szFormatInch[15];
  CHAR szFormatMM[15];
} CONFIG_LOCATION, *PCONFIG_LOCATION;
#pragma pack(pop) 
  #include <intr.h>
  #include "pmac.h"
 
#endif  // _PMACSERVER
 
  #ifdef _CUI_
    #define _MAX_PATH MAX_PATHNAME_LEN
  #endif
 
  #define LINKLIST_FILE "PMAC_LINKLIST.INI"
 
  #ifdef __cplusplus
extern "C" {
  #endif
 
// forward declarations
typedef struct _USER_HANDLE USER_HANDLE, *PUSER_HANDLE;
typedef struct _GLOBAL_HANDLE GLOBAL_HANDLE, *PGLOBAL_HANDLE;
 
 
/////////////////////////////////////////////////////////////////////////////
// Process User Handle Sructure
/////////////////////////////////////////////////////////////////////////////
typedef struct _USER_HANDLE
{
 
  DWORD         dwSize;                         // Keep track of structure size
  DWORD         dwUser;                         // User No. for this device
  HANDLE        hDriver;                        // Handle to ring zero driver or COM
  HANDLE        hMutex;                         // Global mutex handle
  WSAEVENT      hPmacSockEvent;                 // Ethernet Event Object
  HANDLE        hEthMutex;
  CHAR          *szPmacData;                    // Buffered data on ethernet
  CHAR          *pData;                         // pointer to buffer next get line
  CHAR          *pDataStart;
  DWORD         dwPmacSockLastErr;
 
  // Command logging stuff
  BOOL       dCommandLogging;                   // Command Logging Enabled
  CHAR      tcComandLoggingFilename[MAX_PATH]; // Command Logging File Name
  UINT       uMaxCommandLoggingFileSize;        // Command Logging Max. file size
  HANDLE     hCommandLoggingFileHandle;         // Command Logging File Handle
  CHAR       languageDll[_MAX_PATH];            // Language translation DLL name
 
  // LT_COM - SERIAL
  BOOL          bDoChecksums;          // This process wants checksums
  char          csum;                  // Used to retain Command Sum for Checksummed comm
 
  // LT_ISA & LT_PCI - DPRAM
  ASCIIMODE     ascii_comm;            // current mode of ascii comm
  BOOL          bDpramAvailable;       // TRUE if DPRAM is available
  HANDLE        hDPRMutex;             // Global DPRAM serialized access mutex handle
  struct cpane  DPRCPanel;             // control panel           (ofs = 0x000,size = 36)
  struct cpane  DPRCPanelTurbo;        // ?? Turbo control panel  (ofs = 0x000,size = 36)
 
  struct backgvarbuf_status *bgv_status[MAX_VBGBUF_USERS ]; // Background variable data
  DWORD  DPRrotbuffer[16];                                  // DPR Binary Rotary Buffer Start
 
  // Gather stuff
  double *pGatherData[MAXGATHERS2 ];   // Pointers to gathered data
  double *pRTGatherData;               // Pointer to gathered data
 
  // Interrupt Stuff
  // inter-thread sync data
  UINT   ThreadId;
  HANDLE hThread;
  HANDLE hCompleteEvent;
  BOOL   bTerminateThread;
 
  // worker thread data
  MCCALLBACK Callback;                // interrupt callback function
  DWORD  WaitResult;
  INTRBUFFER Buffer;
 
  HWND   hWnd; // Window handle of app for use w/ messages boxes
//  PLX_DEVICE_OBJECT pcieDevice;
 
  /////////////////////////////////
  // ADDED for the NEW PmacServer and not used by the
  // PComm32.dll or OLD PmacServer, !Do not remove these from
  // the end of the structure
#ifndef _PMACSERVER
  UINT   dummy1;
  HANDLE dummy2;
  HANDLE dummy3;
  BOOL   dummy4;
#else
  // Interrupt Stuff & inter-thread sync data
  UINT   uiINTRThreadId;
  HANDLE hINTRThread;
  HANDLE hINTRCompleteEvent;
  BOOL   bINTRTerminateThread;
#endif
 
} USER_HANDLE, *PUSER_HANDLE;
 
///////////////////////////////////////////////////////////////////////////////
// Global
///////////////////////////////////////////////////////////////////////////////
#pragma pack(push, 4)
typedef struct _GLOBAL_HANDLE
{
  DWORD dwSize;       // Keep track of structure size
  BOOL  bInitialized; // Indicates that the global memory has been setup
 
  CHAR   version[VERSION_BUFFER_SIZE]; // store version string
  CHAR   date[DATE_BUFFER_SIZE];       // store date string
  CHAR   errorstr[80];                 // stored last error string
  PMACDEVICETYPE PmacType;             // 0 = DT_PMAC, 1 = DT_TURBO
  PMACFIRMWARETYPE PmacFirmware;
  DWORD  cpu_type;
  BOOL   bIsTurbo;
 
  LOCATIONTYPE Location; // PCBUS, SERIALPORT
  DWORD  dwEnum;         // Location Enumeration
 
  DWORD  dwMaxMotors;    // Maximum motors on PMAC, 32 if turbo else 8
  DWORD  dwMaxIMPQVars;  // Maximum IMPQ Vars on PMAC, 8191 if turbo else 1023
                         // BUS
  short  BUSCommError;   // BUS ascii comm error current value
 
  // LT_COM - SERIAL
  DCB           dcb;
  COMMTIMEOUTS  cto;
 
  DWORD         SERCommError;
  DWORD         SERPort;
  DWORD         SERBaudrate;
  UCHAR         SERParity;
  BOOL          SERCTSOutput;
  DWORD         SERRTSControl;
 
  // Status storage
  DWORD         DPRbuf_start;       // PMAC/TURBO DPR Start Address
  BOOL          bDPRInitialized;    // DPR has been initialized
  USHORT        DPRAsciiActive;     // DPR ASCII comm is currently active
 
  DWORD         DPRRealtActive;     // DPR foreground active
  DWORD         DPRRealtPeriod;     // DPR foreground update period in msec
  UINT          DPRNumMotors;       // number of motor/coords (i59) or masked
 
  DWORD         DPRAutoActive;      // DPR Automatic functions may need to be disabled for USB
 
  DWORD         DPRBackgActive;     // DPR background active
  DWORD         DPRBackgPeriod;     // DPR background update period in msec
  DWORD         EnableInterrupts;   // Enables Interrupts for PCI cards
 
  USHORT        DPRBackgvActive;    // DPR Background variable data buffer active
  USHORT        DPRCpanelActive;    // DPR control panel active
  USHORT        DPRRotaryActive;    // DPR Binary rotary buffer active
  struct realt  DPRRTBuffer;           // real time buffer        (ofs = 0x00D,size = 516)
  struct realtTURBO DPRRTBufferTurbo;  // Turbo real time buffer  (ofs = 0x068,size = 1556)
  struct backg  DPRBGBuffer;           // background buffer       (ofs = 0x228,size = 1028)
  struct backgTURBO DPRBGBufferTurbo;  // Turbo background buffer (ofs = 0x674,size = 1704)
 
  short         DPRCommError;       // DPR ascii comm error current value
  DWORD         i10;                // current i10 parameter
  double        posscale[32 ];      // current ix08 * 32 scale factor
  double        velscale[32 ];      // current ix09 * 32 scale factor
 
  USHORT        DPRRotSize[16];     // Size of DPRAM binary rotary 1 & 2
  USHORT        DPRBGVBnum_usrs;
  USHORT        DPRBGVBmulti_user_mode;
  DWORD         DPRVarStart;        // Start of DPR var & end of DPR buffers
 
  BOOL  CanUsePlcc;            // indicates can use compiled plc
  BOOL  WantUsePlcc;           // Want to compile PLC
  BOOL  Downloading;           // indicates download thread working
  BOOL  bootstrap_mode;        // In bootstrap mode
  DWORD linkfile[MAXLINKS];    // PLCC PMAC Link addresses
  DWORD plccbuffer;            // PLCC Program Scheduler Start Addresses
  DWORD plccret;               // PLCC Program RET
  DWORD plccstart;             // PLCC Program Start
  DWORD plccsize;              // Size of PLCC Memory
  DWORD plccjmp;               // PLCC Program Scheduler Start
  DWORD servosize;             // Size of Open Servo Memory
  BOOL    bSmallTurbo;            // Turbo CEM Style small memory Turbo
 
 
  // Gather stuff
  double ulGatherSampleTime;                    // Sample gather time in msec
  UINT   uGatherPeriod;                         // I19 number servo cycles per sample
  DWORD  dwGatherMask;                          // I20 (determines #sources & types)
  DWORD  dwGatherMask2;
  UINT   uGatherSources;                        // Number of sources gathered
  UINT   uGatherSamples;                        // Number of samples gathered
  UINT   uGatherSampleLen;                      // Number 24-bit words per sample
  BOOL   bGatherEnabled[MAXGATHERS2];           // Sources enabled
  char   szGatherAdr[MAXGATHERS2 ][MAXADRLEN ]; // Types and addresses of gathers
  UINT   uGatherSize[MAXGATHERS2];              // Size of gather type in 24bit words
 
  // Real gather stuff
  int    hRTGatherHandle;             // Handle to var background
  UINT   uRTGatherSources;            // Number of sources gathered
  UINT   uRTGatherSamples;            // Number of samples in gather array
  ULONG  ulRTGatherAdr[MAXRTGATHERS]; // Array of var buf gather sources
 
  // Mutex handle makes multi threading safe even from serial port
  //HANDLE hMutex;
 
  // Timeout values and counts
  DWORD  dwBaseTimeoutCount;
 
  DWORD  dwDPRRTimeoutCount;
  DWORD  dwDPRRTimeout;
  DWORD  dwDPRBKTimeoutCount;
  DWORD  dwDPRBKTimeout;
  DWORD  dwDPRCharTimeoutCount;
  DWORD  dwDPRCharTimeout;
  DWORD  dwDPRFlushTimeoutCount;
  DWORD  dwDPRFlushTimeout;
  DWORD  dwBUSCharTimeoutCount;
  DWORD  dwBUSCharTimeout;
  DWORD  dwSERFlushTimeout;
  DWORD  dwSERFlushTimeoutCount;
  DWORD  dwSERCharTimeout;
  DWORD  dwSERCharTimeoutCount;
 
  SOCKET initialSocket;
#ifndef WIN64
  SOCKET Dummy0;
#endif
  DWORD  initialPID;
  HANDLE initialSerial;
#ifndef WIN64
  HANDLE Dummy1;
#endif
  DWORD  initialSerPID;
  WSAPROTOCOL_INFO ProtocolInfo;
  DWORD  dwUserCount;
 
  DWORD  dwMaxDPRBKCoord;
  DWORD  dwMaxDPRRTMotor;
 
  BOOL   bHostRotBufMode;
 
  //LSJ Ãß°¡ ±â´É... for Socket failure free (2006.03.08)
  SOCKET    ArraySocket[32];
#ifndef WIN64
  SOCKET    Dummy2[32];
#endif
  DWORD        ArrayPID[32];
  HANDLE    ArraySerial[32];
#ifndef WIN64
  HANDLE    Dummy3[32];
#endif
  DWORD        ArraySerPID[32];
 
  //LSJ Ãß°¡ ±â´É... for ethernet multi-host application (2007.11.29)
  BOOL        bMultiHost;
  INT32        dwSockLockCnt;
} GLOBAL_HANDLE, *PGLOBAL_HANDLE;
#pragma pack(pop)
  #ifdef __cplusplus
}
  #endif
 
  #if defined( _DRIVER ) // DLL Include +++++++++++++++++++++++++++
                         // // debug macros
                         //  #if defined(DBG) || defined(_DEBUG)
                         //    void dbgPrintf(CHAR szFormat, ...);
                         //    extern int vcuDebugLevel;
                         //
                         //    #define dprintf(_x_)      dbgPrintf _x_
                         //    #define dprintf1(_x_)     if (vcuDebugLevel >= 1) dbgPrintf _x_
                         //    #define dprintf2(_x_)     if (vcuDebugLevel >= 2) dbgPrintf _x_
                         //    #define dprintf3(_x_)     if (vcuDebugLevel >= 3) dbgPrintf _x_
                         //    #define dprintf4(_x_)     if (vcuDebugLevel >= 4) dbgPrintf _x_
                         //  #else
                         //    #define dprintf(_x_)
                         //    #define dprintf1(_x_)
                         //    #define dprintf2(_x_)
                         //    #define dprintf3(_x_)
                         //    #define dprintf4(_x_)
                         // #endif
 
    #define WAIT_2SEC 2000 // Mutex object wait period of 2 sec.
    #define WAIT_5SEC 5000 // Mutex object wait period of 5 sec.
    #define TIMEOUT_COUNT_TIME    500
 
 
    #include <CRTDBG.H>
    #include <devioctl.h>
    #include <assert.h>
    #include "mcstruct.h"
    #include "mioctl.h"
    #include "registry.h"
    #include "bintoken.h"
    #include "cmplc56k.h"
    #include "pmacerr.h"
#ifndef _PMACSERVER
    #include "dprrealt.h"
    #include "dprbkg.h"
    #include "bus.h"
    #include "serial.h"
    #include "dprotlib.h"
    #include "hostbinrot.h"
    #include "cmplclib.h"
    #include "download.h"
    #include "utildt.h"
    #include "lips.h"
    #include "macro.h"
    #include "dialog.h"
#endif
 
 
#pragma pack(push, 4)
// Global externals
typedef struct tagGlobalData
{
  DWORD         dwSize;
  DWORD         dwUserCount; // Count uf users
 
  REG_ACCESS    RegistryAccess[MAX_MOTION_DEVICES + 1]; // registry access global
  CONFIG_LOCATION cfg[MAX_MOTION_DEVICES];              // Configuration values from registry
  GLOBAL_HANDLE gh[MAX_MOTION_DEVICES + 1];             // driver access handle
 
  HMODULE       hLangModule;
#ifndef WIN64
  HMODULE    Dummy0;
#endif
  char USResponse[MAX_MOTION_DEVICES + 1][USRESPONSE_SIZE];// Unsolicited response buffer
  DWORD         usr_next_in[MAX_MOTION_DEVICES + 1];
  DWORD         usr_next_out[MAX_MOTION_DEVICES + 1];
 
  char ChangeMonitor[MAX_MOTION_DEVICES + 1][IVARCHANGEMONITOR_SIZE];// Used for monitoring I-Variable Mod's by apps
  DWORD         cm_next_in[MAX_MOTION_DEVICES + 1];
  DWORD         cm_next_out[MAX_MOTION_DEVICES + 1];
 
  HANDLE        hServerPID ;
#ifndef WIN64
  HANDLE    Dummy1;
#endif
  DWORD         dwServerPID;
  BOOL          My_g_bDPRThreadRunning;
} GLOBAL_DATA, *PGLOBAL_DATA;
#pragma pack(pop) 
 
extern USER_HANDLE   vh[MAX_MOTION_DEVICES + 1 ]; // driver access handle
extern PGLOBAL_DATA  pGlobalData;
extern OSVERSIONINFO OsInfo;                      // Operating system information
 
  #ifdef __cplusplus
extern "C" {
  #endif
 
 
  #ifdef __cplusplus
}
  #endif
 
  #else // Application include +++++++++++++++++++++++++++++++++++++++++++++++++
 
//     #include <mioctl.h>
//     #include <mmsystem.h>
//     #include <common.h>
//     #include <bus.h>
//     #include <dpr.h>
//     #include <serial.h>
//     #include <intr.h>
//     #include <dprotlib.h>
//     #include <hostbinrot.h>
//     #include <dprbkg.h>
//     #include <cmplclib.h>
//     #include <pmacerr.h>
//     #include <download.h>
//     #include <utildt.h>
//     #include <gather.h>
//     #include <lips.h>
//     #include <macro.h>
#include "PComm32 Pro/mioctl.h"
#include <mmsystem.h>
#include "PComm32 Pro/common.h"
#include "PComm32 Pro/bus.h"
#include "PComm32 Pro/dpr.h"
#include "PComm32 Pro/serial.h"
#include "PComm32 Pro/intr.h"
#include "PComm32 Pro/dprotlib.h"
#include "PComm32 Pro/hostbinrot.h"
#include "PComm32 Pro/dprbkg.h"
#include "PComm32 Pro/cmplclib.h"
#include "PComm32 Pro/pmacerr.h"
#include "PComm32 Pro/download.h"
#include "PComm32 Pro/utildt.h"
#include "PComm32 Pro/gather.h"
#include "PComm32 Pro/lips.h"
#include "PComm32 Pro/macro.h"
 
  #ifdef __cplusplus
extern "C" {
  #endif
 
extern HANDLE *ghLangModule;
extern USER_HANDLE   vh[MAX_MOTION_DEVICES + 1 ]; // driver access handle
extern GLOBAL_HANDLE gh[MAX_MOTION_DEVICES + 1 ]; // device access handle
 
  #ifdef __cplusplus
}
  #endif
 
  #endif
 
 
#endif //_PMACU_H_