Galil DMC32 OSU
 All Files Functions Pages
Dmccom.h
Go to the documentation of this file.
1 
13 #ifndef DMCCOM_H_I_2FC43D18_4D95_434F_A3D5_6D32828701C4
14 #define DMCCOM_H_I_2FC43D18_4D95_434F_A3D5_6D32828701C4
15 
16 #ifdef __cplusplus
17  extern "C" {
18 #endif
19 
23 // typedefs to supplant Windows.h
24 typedef int BOOL;
25 typedef unsigned long DWORD;
26 typedef void VOID;
27 typedef void *HANDLE;
28 
29 // NEAR and FAR are cruft throwbacks to 16bit Win/Dos
30 // Kept to maintain syntax of old prototypes
31 #ifndef FAR
32  #define FAR
33 #endif
34 #ifndef NEAR
35  #define NEAR
36 #endif
37 typedef short int SHORT;
38 typedef short int NEAR* PSHORT;
39 typedef short int FAR* LPSHORT;
40 typedef unsigned short int USHORT;
41 typedef unsigned short int NEAR* PUSHORT;
42 typedef unsigned short int FAR* LPUSHORT;
43 #if defined(_WIN32) || defined(__WIN32__)
44  typedef long int LONG;
45 #endif
46 typedef long int NEAR* PLONG;
47 typedef long int FAR* LPLONG;
48 typedef unsigned long int ULONG;
49 typedef unsigned long int NEAR* PULONG;
50 typedef unsigned long int FAR* LPULONG;
51 typedef char CHAR;
52 typedef char NEAR* PCHAR;
53 typedef char FAR* LPCHAR;
54 typedef unsigned char UCHAR;
55 typedef unsigned char NEAR* PUCHAR;
56 typedef unsigned char FAR* LPUCHAR;
57 typedef unsigned char BYTE;
58 typedef unsigned char NEAR* PBYTE;
59 typedef unsigned char FAR* LPBYTE;
60 typedef void NEAR* PVOID;
61 typedef void FAR* LPVOID;
62 typedef char FAR* PSZ;
63 
64 #if defined(_WIN32) || defined(__WIN32__)
65  #define GALILCALL __stdcall
66 #else
67  #define GALILCALL FAR PASCAL __export
68 #endif
69 
70 #if !defined(_WIN32) && !defined(__WIN32__)
71  #ifndef TEXT
72  #define TEXT
73  #endif
74 #endif
75 
76 // Galil types
77 typedef LONG HANDLEDMC;
78 typedef HANDLEDMC FAR* PHANDLEDMC;
79 
80 //Deprecated types redefined for function stubs below.
81 typedef int GALILREGISTRY;
82 typedef GALILREGISTRY* PGALILREGISTRY;
83 typedef GALILREGISTRY* PGALILREGISTRY2;
84 typedef GALILREGISTRY* PGALILREGISTRY3;
85 
86 /*
87 // Controller model constants
88 #define DMC400 TEXT("DMC-400")
89 #define DMC600 TEXT("DMC-600")
90 #define DMC700 TEXT("DMC-700")
91 #define DMC1000 TEXT("DMC-1000")
92 #define DMC1200 TEXT("DMC-1200")
93 #define DMC1300 TEXT("DMC-1300")
94 #define DMC1410 TEXT("DMC-1410")
95 #define DMC1411 TEXT("DMC-1411")
96 #define DMC1412 TEXT("DMC-1412")
97 #define DMC1413 TEXT("DMC-1413")
98 #define DMC1414 TEXT("DMC-1414")
99 #define DMC1415 TEXT("DMC-1415")
100 #define DMC1425 TEXT("DMC-1425")
101 #define DMC3425 TEXT("DMC-3425")
102 #define DMC1416 TEXT("DMC-1416")
103 #define DMC1417 TEXT("DMC-14x7")
104 #define DMC1500 TEXT("DMC-1500")
105 #define DMC1600 TEXT("DMC-1600")
106 #define DMC1700 TEXT("DMC-1700")
107 #define DMC1800 TEXT("DMC-1800")
108 #define DMC1802 TEXT("DMC-1802")
109 #define DMC1806 TEXT("DMC-18x6")
110 #define DMC2000 TEXT("DMC-2000")
111 #define DMC2100 TEXT("DMC-2100")
112 #define DMC2102 TEXT("DMC-21x3/2")
113 #define DMC2200 TEXT("DMC-2200")
114 #define CDS3300 TEXT("CDS-33x0")
115 #define DMC4000 TEXT("DMC-40x0")
116 #define DMC7007 TEXT("IOC-7007")
117 
118 #define MODEL_UNKNOWN 0
119 #define MODEL_600 600
120 #define MODEL_700 700
121 #define MODEL_1000 1000
122 #define MODEL_1200 1200
123 #define MODEL_1300 1300
124 #define MODEL_1410 1410
125 #define MODEL_1411 1411
126 #define MODEL_1412 1412
127 #define MODEL_1413 1413
128 #define MODEL_1414 1414
129 #define MODEL_1415 1415
130 #define MODEL_1416 1416
131 #define MODEL_1417 1417
132 #define MODEL_1500 1500
133 #define MODEL_1600 1600
134 #define MODEL_1700 1700
135 #define MODEL_1800 1800
136 #define MODEL_1802 1802
137 #define MODEL_1806 1806
138 #define MODEL_2000 2000
139 #define MODEL_2100 2100
140 #define MODEL_2102 2102
141 #define MODEL_2200 2200
142 #define MODEL_3300 3300
143 #define MODEL_7007 7007
144 #define MODEL_4000 4000
145 #define MODEL_USERDEFINED 9999
146 
147 
148 // General defines
149 #define COMMAND_SIZE 80
150 #define MAX_CONTROLLERS 64
151 
152 // User defined message to notify application program of an interrupt
153 #define WM_DMCINTERRUPT (WM_USER+128) // Status byte from the controller is passed to user via the wParam argument
154 #define WM_MOTIONCOMPLETE (WM_USER+129)
155 #define WM_UNSOLICITEDMSG (WM_USER+130)
156 #define WM_NEWDATARECORD (WM_USER+131)
157 #define WM_DMCTHREADCLOSING (WM_USER+132)
158 */
159 
160 // Errors
161 #define DMCNOERROR 0
162 #define DMCWARNING_MONITOR 1
163 
164 #define DMCERROR_TIMEOUT -1
165 #define DMCERROR_COMMAND -2
166 #define DMCERROR_CONTROLLER -3
167 #define DMCERROR_FILE -4
168 #define DMCERROR_DRIVER -5
169 #define DMCERROR_HANDLE -6
170 #define DMCERROR_HMODULE -7
171 #define DMCERROR_MEMORY -8
172 #define DMCERROR_BUFFERFULL -9
173 #define DMCERROR_RESPONSEDATA -10
174 #define DMCERROR_DMA -11
175 #define DMCERROR_ARGUMENT -12
176 #define DMCERROR_DATARECORD -13
177 #define DMCERROR_DOWNLOAD -14
178 #define DMCERROR_FIRMWARE -15
179 #define DMCERROR_CONVERSION -16
180 #define DMCERROR_RESOURCE -17
181 #define DMCERROR_REGISTRY -18
182 #define DMCERROR_BUSY -19
183 #define DMCERROR_DEVICE_DISCONNECTED -20
184 #define DMCERROR_TIMEING_ERROR -21
185 #define DMCERROR_WRITEBUFFER_TOO_LARGE -22
186 #define DMCERROR_NO_MODIFY_PNP_CONTROLLER -23
187 #define DMCERROR_FUNCTION_OBSOLETE -24
188 #define DMCERROR_STREAMING_COMMAND_IN_PROGRESS -25
189 #define DMCERROR_DEVICEDRIVER_VERSION_TOO_OLD -26
190 #define DMCERROR_STREAMING_COMMAND_MUST_BE_SOLITARY -27
191 #define DMCERROR_FIRMWARE_VERSION_TOO_OLD -28
192 #define DMCERROR_ETHERNET_NO_MORE_HANDLES -29
193 #define DMCERROR_NETWORK_UNREACHABLE -30
194 
195 /*
196 // Constant values
197 
198 // Constant values for data record access
199 #include "dmcdrc.h"
200 
201 // Constant values for registry structures
202 
203 enum DMCControllerTypes
204 {
205  ControllerTypeISABus = 0, // ISA or PC-104 bus controller
206  ControllerTypeSerial = 1, // RS-232 serial controller
207  ControllerTypePCIBus = 2, // PCI or Compact PCI bus controller
208  ControllerTypeUSB = 3, // Universal serial bus controller
209  ControllerTypeEthernet = 4, // Ethernet controller
210  ControllerTypeVMEBus = 5 // VME bus controller
211 };
212 
213 enum DMCDeviceDrivers
214 {
215  DeviceDriverWinRT = 0, // Use WinRT device driver
216  DeviceDriverGalil = 1 // Use Galil device driver
217 };
218 
219 enum DMCSerialHandshake
220 {
221  SerialHandshakeHardware = 0, // Hardware handshake (RTS/CTS)
222  SerialHandshakeSoftware = 1, // Software handshake (XOn/XOff)
223  SerialHandshakeBoth = 2 // RESERVED FOR GALIL USE ONLY
224 };
225 
226 enum DMCBusIOStyle
227 {
228  DMC600IOStyle = 0, // For DMC-600, DMC-1400
229  DMC1000IOStyle = 1, // For DMC-1000, DMC-1200, DMC-1700, DMC-1802
230  DMC1600IOStyle = 2 // For DMC-1600, DMC-1800
231 };
232 
233 enum DMCInterruptStyle
234 {
235  DMC1000InterruptStyle = 0, // For DMC-1000
236  DMC1400InterruptStyle = 1, // For DMC-1400
237  DMC1700InterruptStyle = 2, // For DMC-1200, DMC-1700, DMC-1802
238  DMC1600InterruptStyle = 3 // For DMC-1600, DMC-1800
239 };
240 
241 enum DMCDataRecordAccess
242 {
243  DataRecordAccessNone = 0, // No data record access capability or data record access is off
244  DataRecordAccessDMA = 1, // Use DMA for data record access
245  DataRecordAccessFIFO = 2, // Use FIFO for data record access
246  DataRecordAccessBoth = 3, // RESERVED FOR GALIL USE ONLY
247  DataRecordAccessQR = 4 // RESERVED FOR GALIL USE ONLY
248 };
249 
250 enum DMCEthernetProtocol
251 {
252  EthernetProtocolTCP = 0,
253  EthernetProtocolUDP = 1
254 };
255 enum DMCVMEBusInterface
256 {
257  VMEBusInterfaceBit3 = 0,
258  VMEBusInterfaceVMIC = 1
259 };
260 
261 // Ethernet flags
262 #define ETH_NO_MULTICAST 0x0001 // Do not open a multi-cast session
263 #define ETH_UNSOLICITEDMESSAGES 0x0002 // Open an unsolicited message session on second handle
264 #define ETH_UNSOLICITEDMESSAGES_SAMEHANDLE 0x0004 // Open an unsolicited message session on same handle
265 
266 // Structures
267 
268 // Structure used to add/change/delete registry information
269 // Old-style structure
270 typedef struct _GALILREGISTRY
271 {
272 #ifdef UNDER_CE
273  TCHAR szModel[32]; // Controller model string
274 #else
275  CHAR szModel[16]; // Controller model string
276 #endif
277  USHORT usDeviceNumber; // Device number - for Galil use only
278  USHORT fDeviceDriver; // Use Galil or WinRT device driver
279  ULONG ulTimeout; // Time-out in milliseconds
280  ULONG ulDelay; // Delay in microsceonds
281  USHORT fControllerType; // Controller type (ISA bus, PCI bus, serial, etc.)
282  USHORT usCommPort; // Serial communications port
283  ULONG ulCommSpeed; // Serial Communications speed
284  USHORT fHandshake; // Serial communications handshake
285  USHORT usAddress; // Bus address
286  USHORT usInterrupt; // Interrupt
287  USHORT fDataRecordAccess; // Data record access type
288  USHORT usDMAChannel; // DMA channel
289  USHORT usDataRecordSize; // Data record size (for data record access)
290  USHORT usRefreshRate; // Data record refresh rate in 2^usRefreshRate ms
291  USHORT usSerialNumber; // Controller Serial Number
292 #ifdef UNDER_CE
293  TCHAR szPNPHardwareKey[128];// Hardware registry key for PNP controllers - for Galil use only
294 #else
295  CHAR szPNPHardwareKey[64]; // Hardware registry key for PNP controllers - for Galil use only
296 #endif
297 } GALILREGISTRY, FAR* PGALILREGISTRY;
298 
299 // Hardware info - ISA and PCI bus communications
300 typedef struct _BUSINFO
301 {
302  USHORT usDeviceNumber; // Device number - for Galil use only
303  USHORT fDeviceDriver; // Use Galil or WinRT device driver
304  USHORT fIOStyle; // Style of addressing status register on controller
305  USHORT usAddress; // I/O port address
306  USHORT fInterruptStyle; // Style of handling interrupts from controller
307  USHORT usInterrupt; // Interrupt
308  USHORT fDataRecordAccess; // Data record access type
309  USHORT usDMAChannel; // DMA channel
310  USHORT usDataRecordSize; // Data record size (for data record access)
311  USHORT usRefreshRate; // Data record refresh rate in 2^usRefreshRate ms
312  USHORT bPNP; // Plug and play? (TRUE | FALSE)
313  USHORT usAddress2; // Alternate I/O port address for PCI controllers
314  USHORT usReserved1; // Reserved for future use
315  USHORT nCommWaitMethod ; // Added 8/8/02 for specifying DMCCommand communication method.
316  BOOL bFirmSupportsIntComm; // Added 8/8/02 for signaling if device firmware supports int comm.
317  SHORT nDRCacheDepth; // Added 10/28/02 for recording data record cache depth.
318  ULONG ulHardwareID; // Added to uniquely identify controllers by serial number and function.
319 #ifdef UNDER_CE
320  TCHAR szPNPHardwareKey[128];// Hardware registry key for PNP controllers - for Galil use only
321 #else
322  CHAR szPNPHardwareKey[55]; // Hardware registry key for PNP controllers - for Galil use only
323 #endif
324 } BUSINFO;
325 
326 // Hardware info - serial communications
327 typedef struct _SERIALINFO
328 {
329  USHORT usCommPort; // Communications port
330  ULONG ulCommSpeed; // Communications speed
331  USHORT fHandshake; // Communications handshake
332  USHORT usDeviceNumber; // Device number - for Galil use only
333  USHORT usReserved1; // Reserved for future use
334 } SERIALINFO;
335 
336 // Hardware info - serial communications
337 typedef struct _WINSOCKINFO
338 {
339  ULONG ulPort; // Host port number - for Galil use only
340 #ifdef UNDER_CE
341  TCHAR szIPAddress[64]; // Host name string
342 #else
343  CHAR szIPAddress[32]; // Host name string
344 #endif
345  USHORT fProtocol; // UDP or TCP
346  ULONG fFlags; // Controls auto opening of multi-cast and unsolicited message sessions
347  USHORT fMsgProtocol; // Added 9/15/03. UDP or TCP. Relevant only when second handle is used for unsolicited messages.
348  USHORT fUseEthernetWait; // Added 9/15/03. Allows Ethernet read calls to wait on a FD_READ event rather than spinning the processor.
349  USHORT fUseUnsolicitedDR; // Added 10/7/03. Commands driver to open dedicated data record handle.
350  USHORT nRefreshRate; // Added 10/15/03. Sets the ethernet DR command frequency in millisec.
351  USHORT nCacheDepth; // Added 12/1/03. Allows ethernet implementation of DMCmGetDataRecordConstPointerArray and DMCmGetDataRecordArray.
352  USHORT usReserved3; // Reserved for future use
353 } WINSOCKINFO;
354 
355 // Hardware info - ISA and PCI bus communications
356 typedef struct _VMEBUSINFO
357 {
358  USHORT usDeviceNumber; // Device number - for Galil use only
359  USHORT fDeviceDriver; // Use Galil or WinRT device driver
360  USHORT fInterface; // Which VME to PC interface
361  ULONG ulMemoryAddress; // Physical memory address of VME interface card
362  ULONG ulMemoryOffset; // Offset in memory to Galil controller
363  USHORT usAddress; // I/O port address for VME interface card
364  USHORT fIOStyle; // Style of addressing status register on controller
365  USHORT fInterruptStyle; // Style of handling interrupts from controller
366  USHORT usInterrupt; // Interrupt (IRQ) mapped to PC (jumper on VME interface card)
367  USHORT usInterruptLevel; // Interrupt level on the VME bus (jumper on controller)
368  USHORT fDataRecordAccess; // Data record access type
369  USHORT usDataRecordSize; // Data record size (for data record access)
370  USHORT usRefreshRate; // Data record refresh rate in 2^usRefreshRate ms
371  USHORT bPNP; // Plug and play? (TRUE | FALSE)
372  ULONG ulReserved1; // Reserved for future use
373  ULONG ulReserved2; // Reserved for future use
374  ULONG ulReserved3; // Reserved for future use
375  ULONG ulReserved4; // Reserved for future use
376 } VMEBUSINFO;
377 
378 // Hardware info for registry
379 typedef union _HARDWAREINFO
380 {
381  BUSINFO businfo; // ISA and PCI bus information
382  SERIALINFO serialinfo; // Serial information
383  WINSOCKINFO winsockinfo; // WinSock (e.g. Ethernet) information
384  VMEBUSINFO vmebusinfo; // VME bus information
385 } HARDWAREINFO;
386 
387 // Structure used to add/change/delete registry information
388 // New-style structure
389 typedef struct _GALILREGISTRY2
390 {
391  USHORT usVersion; // Structure version
392  CHAR szModel[16]; // Controller model string
393  USHORT usModelID; // Model ID
394  USHORT fControllerType; // Controller type (ISA bus, PCI bus, serial, etc.)
395  ULONG ulTimeout; // Time-out in milliseconds
396  ULONG ulDelay; // Delay in microsceonds
397  ULONG ulSerialNumber; // Controller serial number
398  HARDWAREINFO hardwareinfo; // Union defining the hardware characteristics of the controller
399 } GALILREGISTRY2, FAR* PGALILREGISTRY2;
400 
401 // Added 8/4/04 to support friendly name.
402 typedef struct _GALILREGISTRY3
403 {
404  USHORT usVersion; // Structure version
405  CHAR szModel[16]; // Controller model string
406  USHORT usModelID; // Model ID
407  USHORT fControllerType; // Controller type (ISA bus, PCI bus, serial, etc.)
408  ULONG ulTimeout; // Time-out in milliseconds
409  ULONG ulDelay; // Delay in microsceonds
410  ULONG ulSerialNumber; // Controller serial number
411  HARDWAREINFO hardwareinfo; // Union defining the hardware characteristics of the controller
412  CHAR szDescription[16]; // 8/4/04. Added so that the controller can be referred to by description.
413 } GALILREGISTRY3, FAR* PGALILREGISTRY3;
414 
415 // Hardware info for user-defined bus controllers
416 // RESERVED FOR GALIL USE ONLY
417 typedef struct _BUSDEF
418 {
419  SHORT iIOType;
420  SHORT iIOMin;
421  SHORT iIOMax;
422  SHORT iIOSize;
423  SHORT iInterruptType;
424  SHORT iInterrupts;
425  SHORT iInterruptList[16];
426  SHORT iDataRecordAccessType;
427  SHORT iDMAChannels;
428  SHORT iDMAChannelList[8];
429  SHORT nCommWaitMethod;
430  UCHAR bFirmSupportsIntComm;
431 } BUSDEF;
432 
433 // Hardware info for user-defined serial controllers
434 // RESERVED FOR GALIL USE ONLY
435 typedef struct _SERIALDEF
436 {
437  SHORT iCommPorts;
438  SHORT iCommPortList[16];
439  SHORT iCommSpeeds;
440  LONG iCommSpeedList[16];
441  SHORT iHandshake;
442 } SERIALDEF;
443 
444 // Hardware info for user-defined controllers
445 // RESERVED FOR GALIL USE ONLY
446 typedef union _HARDWAREDEF
447 {
448  BUSDEF busdef;
449  SERIALDEF serialdef;
450 } HARDWAREDEF;
451 
452 // Structure used to describe user-defined controllers
453 // RESERVED FOR GALIL USE ONLY
454 typedef struct _CONTROLLERDEF
455 {
456 #ifdef UNDER_CE
457  TCHAR szModel[32];
458 #else
459  CHAR szModel[16];
460 #endif
461  SHORT iControllerType;
462  HARDWAREDEF hardwaredef;
463 } CONTROLLERDEF;
464 */
465 
470 
484 LONG FAR GALILCALL DMCOpen(USHORT usController, void *hwnd,
485  PHANDLEDMC phdmc);
486 
488 
501 LONG FAR GALILCALL DMCOpen2(USHORT usController, LONG lThreadID,
502  PHANDLEDMC phdmc)
503 {
504  return DMCOpen(usController, 0, phdmc);
505 }
506 
510 LONG FAR GALILCALL DMCOpenDesc(PSZ pszDescription, void *hwnd, PHANDLEDMC phdmc, PUSHORT pControllerNum)
511 {
512  return DMCERROR_ARGUMENT; //error code returned from legacy library when description not found.
513 }
514 
515 
516 LONG FAR GALILCALL DMCOpenDesc2(PSZ pszDescription, LONG lThreadID, PHANDLEDMC phdmc, PUSHORT pControllerNum)
517 {
518  return DMCERROR_ARGUMENT;
519 }
520 
521 
522 LONG FAR GALILCALL DMCGetHandle(USHORT usController, PHANDLEDMC phdmc)
523 {
524  return DMCERROR_HANDLE;
525 }
526 
527 HANDLE GALILCALL DMCInterruptEventHandle( USHORT arg)
528 {
529  return 0;
530 }
531 
532 LONG FAR GALILCALL DMCChangeInterruptNotification(HANDLEDMC hdmc, LONG lHandle)
533 {
534  return DMCERROR_HANDLE;
535 }
541 
548 LONG FAR GALILCALL DMCClose(HANDLEDMC hdmc);
549 
551 
571 LONG FAR GALILCALL DMCCommand(HANDLEDMC hdmc, PSZ pszCommand,
572  LPCHAR pchResponse, ULONG cbResponse);
573 
577 LONG FAR GALILCALL DMCFastCommand(HANDLEDMC hdmc, PSZ pszCommand)
578 {
579  return DMCERROR_HANDLE;
580 }
581 
582 LONG FAR GALILCALL DMCBinaryCommand(HANDLEDMC hdmc, LPBYTE pbCommand, ULONG ulCommandLength,
583  LPCHAR pchResponse, ULONG cbResponse)
584 {
585  return DMCERROR_HANDLE;
586 }
591 
600 LONG FAR GALILCALL DMCGetUnsolicitedResponse(HANDLEDMC hdmc,
601  LPCHAR pchResponse, ULONG cbResponse);
602 
606 LONG FAR GALILCALL DMCWriteData(HANDLEDMC hdmc,
607  LPCHAR pchBuffer, ULONG cbBuffer, LPULONG pulBytesWritten)
608 {
609  return DMCERROR_HANDLE;
610 }
611 
612 LONG FAR GALILCALL DMCReadData(HANDLEDMC hdmc,
613  LPCHAR pchBuffer, ULONG cbBuffer, LPULONG pulBytesRead)
614 {
615  return DMCERROR_HANDLE;
616 }
617 
622 
630 LONG FAR GALILCALL DMCGetAdditionalResponseLen(HANDLEDMC hdmc,
631  LPULONG pulResponseLen);
632 
634 
643 LONG FAR GALILCALL DMCGetAdditionalResponse(HANDLEDMC hdmc,
644  LPCHAR pchResponse, ULONG cbResponse);
645 
649 LONG FAR GALILCALL DMCError(HANDLEDMC hdmc, LONG lError, LPCHAR pchMessage,
650  ULONG cbMessage)
651 {
652  return DMCERROR_HANDLE;
653 }
654 
655 LONG FAR GALILCALL DMCClear(HANDLEDMC hdmc)
656 {
657  return DMCNOERROR;
658 }
659 
660 LONG FAR GALILCALL DMCReset(HANDLEDMC hdmc)
661 {
662  return DMCERROR_HANDLE;
663 }
664 
665 LONG FAR GALILCALL DMCMasterReset(HANDLEDMC hdmc)
666 {
667  return DMCERROR_HANDLE;
668 }
669 
675 
689 LONG FAR GALILCALL DMCVersion(HANDLEDMC hdmc, LPCHAR pchVersion,
690  ULONG cbVersion);
691 
693 
698 LONG FAR GALILCALL DMCDownloadFile(HANDLEDMC hdmc, PSZ pszFileName,
699  PSZ pszLabel);
700 
702 
707 LONG FAR GALILCALL DMCDownloadFromBuffer(HANDLEDMC hdmc, PSZ pszBuffer,
708  PSZ pszLabel);
709 
711 
715 LONG FAR GALILCALL DMCUploadFile(HANDLEDMC hdmc, PSZ pszFileName);
716 
718 
724 LONG FAR GALILCALL DMCUploadToBuffer(HANDLEDMC hdmc, LPCHAR pchBuffer,
725  ULONG cbBuffer);
726 
731 LONG FAR GALILCALL DMCSendFile(HANDLEDMC hdmc, PSZ pszFileName)
732 {
733  return DMCERROR_HANDLE;
734 }
735 
736 LONG FAR GALILCALL DMCSendBinaryFile(HANDLEDMC hdmc, PSZ pszFileName)
737 {
738  return DMCERROR_HANDLE;
739 }
740 
745 
760 LONG FAR GALILCALL DMCArrayDownload(HANDLEDMC hdmc, PSZ pszArrayName,
761  USHORT usFirstElement, USHORT usLastElement, LPCHAR pchData, ULONG cbData,
762  LPULONG cbBytesWritten);
763 
765 
780 LONG FAR GALILCALL DMCArrayUpload(HANDLEDMC hdmc, PSZ pszArrayName,
781  USHORT usFirstElement, USHORT usLastElement, LPCHAR pchData, ULONG cbData,
782  LPULONG pulBytesRead, SHORT fComma);
783 
788 LONG FAR GALILCALL DMCCommand_AsciiToBinary(HANDLEDMC hdmc, PSZ pszAsciiCommand,
789  ULONG ulAsciiCommandLength, LPBYTE pbBinaryResult,
790  ULONG cbBinaryResult, LPULONG pulBinaryResultLength)
791 {
792  return DMCERROR_HANDLE;
793 }
794 
795 LONG FAR GALILCALL DMCCommand_BinaryToAscii(HANDLEDMC hdmc, LPBYTE pbBinaryCommand,
796  ULONG ulBinaryCommandLength, PSZ pszAsciiResult,
797  ULONG cbAsciiResult, LPULONG pulAsciiResultLength)
798 {
799  return DMCERROR_HANDLE;
800 }
801 
802 LONG FAR GALILCALL DMCFile_AsciiToBinary(HANDLEDMC hdmc, PSZ pszInputFileName,
803  PSZ pszOutputFileName)
804 {
805  return DMCERROR_HANDLE;
806 }
807 
808 LONG FAR GALILCALL DMCFile_BinaryToAscii(HANDLEDMC hdmc, PSZ pszInputFileName,
809  PSZ pszOutputFileName)
810 {
811  return DMCERROR_HANDLE;
812 }
813 
814 LONG FAR GALILCALL DMCReadSpecialConversionFile(HANDLEDMC hdmc, PSZ pszFileName)
815 {
816  return DMCERROR_HANDLE;
817 }
818 
823 
828 LONG FAR GALILCALL DMCRefreshDataRecord(HANDLEDMC hdmc, ULONG ulLength);
829 
834 LONG FAR GALILCALL DMCGetDataRecord(HANDLEDMC hdmc, USHORT usGeneralOffset,
835  USHORT usAxisInfoOffset, LPUSHORT pusDataType, LPLONG plData)
836 {
837  return DMCERROR_HANDLE;
838 }
839 
840 LONG FAR GALILCALL DMCGetDataRecordByItemId(HANDLEDMC hdmc, USHORT usItemId,
841  USHORT usAxisId, LPUSHORT pusDataType, LPLONG plData)
842 {
843  return DMCERROR_HANDLE;
844 }
845 
846 LONG FAR GALILCALL DMCGetDataRecordSize(HANDLEDMC hdmc, LPUSHORT pusRecordSize)
847 {
848  return DMCERROR_HANDLE;
849 }
850 
851 LONG FAR GALILCALL DMCCopyDataRecord(HANDLEDMC hdmc, PVOID pDataRecord)
852 {
853  return DMCERROR_HANDLE;
854 }
855 
856 LONG FAR GALILCALL DMCGetDataRecordRevision(HANDLEDMC hdmc, LPUSHORT pusRevision)
857 {
858  return DMCERROR_HANDLE;
859 }
860 
861 LONG FAR GALILCALL DMCDiagnosticsOn(HANDLEDMC hdmc, PSZ pszFileName,
862  SHORT fAppend)
863 {
864  return DMCERROR_HANDLE;
865 }
866 
867 LONG FAR GALILCALL DMCDiagnosticsOff(HANDLEDMC hdmc)
868 {
869  return DMCERROR_HANDLE;
870 }
871 
872 LONG FAR GALILCALL DMCGetTimeout(HANDLEDMC hdmc, LONG FAR* pTimeout)
873 {
874  return DMCERROR_HANDLE;
875 }
876 
877 LONG FAR GALILCALL DMCSetTimeout(HANDLEDMC hdmc, LONG lTimeout)
878 {
879  return DMCERROR_HANDLE;
880 }
881 
882 LONG FAR GALILCALL DMCGetDelay(HANDLEDMC hdmc, LONG FAR* pDelay)
883 {
884  return DMCERROR_HANDLE;
885 }
886 
887 LONG FAR GALILCALL DMCSetDelay(HANDLEDMC hdmc, LONG lDelay)
888 {
889  return DMCERROR_HANDLE;
890 }
891 
892 LONG FAR GALILCALL DMCAddGalilRegistry(PGALILREGISTRY pgalilregistry,
893  LPUSHORT pusController)
894 {
895  return DMCERROR_RESOURCE;
896 }
897 
898 LONG FAR GALILCALL DMCAddGalilRegistry2(PGALILREGISTRY2 pgalilregistry2,
899  LPUSHORT pusController)
900 {
901  return DMCERROR_RESOURCE;
902 }
903 
904 LONG FAR GALILCALL DMCAddGalilRegistry3(PGALILREGISTRY3 pgalilregistry3,
905  LPUSHORT pusController)
906 {
907  return DMCERROR_RESOURCE;
908 }
909 
910 LONG FAR GALILCALL DMCModifyGalilRegistry(USHORT usController,
911  PGALILREGISTRY pgalilregistry)
912 {
913  return DMCERROR_RESOURCE;
914 }
915 
916 LONG FAR GALILCALL DMCModifyGalilRegistry2(USHORT usController,
917  PGALILREGISTRY2 pgalilregistry2)
918 {
919  return DMCERROR_RESOURCE;
920 }
921 
922 LONG FAR GALILCALL DMCModifyGalilRegistry3(USHORT usController,
923  PGALILREGISTRY3 pgalilregistry3)
924 {
925  return DMCERROR_RESOURCE;
926 }
927 
928 LONG FAR GALILCALL DMCGetGalilRegistryInfo(USHORT usController,
929  PGALILREGISTRY pgalilregistry)
930 {
931  return DMCERROR_RESOURCE;
932 }
933 
934 LONG FAR GALILCALL DMCGetGalilRegistryInfo2(USHORT usController,
935  PGALILREGISTRY2 pgalilregistry2)
936 {
937  return DMCERROR_RESOURCE;
938 }
939 
940 LONG FAR GALILCALL DMCGetGalilRegistryInfo3(USHORT usController,
941  PGALILREGISTRY3 pgalilregistry3)
942 {
943  return DMCERROR_RESOURCE;
944 }
945 
946 LONG FAR GALILCALL DMCEnumGalilRegistry(USHORT FAR* pusCount,
947  PGALILREGISTRY pgalilregistry)
948 {
949  return DMCERROR_RESOURCE;
950 }
951 
952 LONG FAR GALILCALL DMCEnumGalilRegistry2(USHORT FAR* pusCount,
953  PGALILREGISTRY2 pgalilregistry2)
954 {
955  return DMCERROR_RESOURCE;
956 }
957 
958 LONG FAR GALILCALL DMCEnumGalilRegistry3(USHORT FAR* pusCount,
959  PGALILREGISTRY3 pgalilregistry3)
960 {
961  return DMCERROR_RESOURCE;
962 }
963 
964 LONG FAR GALILCALL DMCDeleteGalilRegistry(SHORT sController)
965 {
966  return DMCERROR_RESOURCE;
967 }
968 
969 LONG FAR GALILCALL DMCGetControllerDesc(USHORT usController, PSZ pszControllerDesc, ULONG cbControllerDesc)
970 {
971  return DMCERROR_RESOURCE;
972 }
973 
974 LONG FAR GALILCALL DMCRegisterPnpControllers(USHORT* pusCount)
975 {
976  *pusCount = 0;
977  return DMCNOERROR;
978 }
979 
980 SHORT FAR GALILCALL DMCSelectController(/*HWND*/ int * hwnd)
981 {
982  return -1; //No controller selected.
983  //1 would likely be the desired answer, but not safe for multi-controller apps.
984 }
985 
986 VOID FAR GALILCALL DMCEditRegistry(/*HWND*/ int * hwnd)
987 {
988  return;
989 }
990 
991 LONG FAR GALILCALL DMCAssignIPAddress(/*HWND*/ int * hWnd, PGALILREGISTRY2 pgalilregistry2)
992 {
993  return DMCERROR_ARGUMENT;
994 }
995 
996 LONG FAR GALILCALL DMCWaitForMotionComplete(HANDLEDMC hdmc, PSZ pszAxes, SHORT fDispatchMsgs)
997 {
998  return DMCERROR_HANDLE;
999 }
1000 
1001 LONG FAR GALILCALL DMCDownloadFirmwareFile(HANDLEDMC hdmc, PSZ pszFileName, SHORT fDisplayDialog)
1002 {
1003  return DMCERROR_HANDLE;
1004 }
1005 
1006 LONG FAR GALILCALL DMCCompressFile(PSZ pszInputFileName, PSZ pszOutputFileName, USHORT usLineWidth,
1007  PUSHORT pusLineCount)
1008 {
1009  return DMCERROR_FILE;
1010 }
1011 
1012 //Start Functions in the legacy version of dmc32.dll, but not defined in legacy dmccom.h
1013 /*
1014 LONG FAR GALILCALL DMCOpen3(PGALILREGISTRY2 pgalilregistry2, LONG lHandle, USHORT fhwnd, PHANDLEDMC phdmc)
1015 {
1016  return DMCERROR_HANDLE;
1017 }
1018 LONG FAR GALILCALL GetAxisNumAndModelIndex(long hDMC, unsigned short *pNumAxis, long *pModelIndex)
1019 {
1020  *pNumAxis = 8;
1021  *pModelIndex = MODEL_UNKNOWN;
1022  return DMCNOERROR;
1023 }
1024 void FAR GALILCALL GetModelStringFromModelIndex(long *pModelIndex, char *pModelStringBuffer)
1025 {
1026  *pModelStringBuffer = 0; //null string
1027 }
1028 LONG FAR GALILCALL GetModelIndexFromModelString(char *pModelStringBuffer)
1029 {
1030  return MODEL_UNKNOWN;
1031 }
1032 */
1033 //End Functions in the legacy version of dmc32.dll, but not defined in legacy dmccom.h
1034 
1035 
1036 #if defined(_WIN32) || defined(__WIN32__)
1037 // Win32 device driver functions
1038 
1039 LONG FAR GALILCALL DMCReadRegister(HANDLEDMC hdmc, USHORT usOffset, PBYTE pbStatus)
1040 {
1041  return DMCERROR_HANDLE;
1042 }
1043 
1044 LONG FAR GALILCALL DMCWriteRegister(HANDLEDMC hdmc, USHORT usOffset, BYTE bStatus)
1045 {
1046  return DMCERROR_HANDLE;
1047 }
1048 
1049 LONG FAR GALILCALL DMCStartDeviceDriver(USHORT usController)
1050 {
1051  return DMCNOERROR;
1052 }
1053 
1054 LONG FAR GALILCALL DMCStopDeviceDriver(USHORT usController)
1055 {
1056  return DMCNOERROR;
1057 }
1058 
1059 LONG FAR GALILCALL DMCStopDeviceDriverEx( DWORD dwType )
1060 {
1061  return DMCNOERROR;
1062 }
1063 
1064 LONG FAR GALILCALL DMCStartDeviceDriverEx( DWORD dwType )
1065 {
1066  return DMCNOERROR;
1067 }
1068 
1069 LONG FAR GALILCALL DMCQueryDeviceDriver( DWORD dwType )
1070 {
1071  return DMCNOERROR;
1072 }
1073 
1074 LONG FAR GALILCALL DMCSendCW2OnClose( HANDLEDMC hdmc, BOOL *pbValue )
1075 {
1076  return DMCERROR_HANDLE;
1077 }
1078 
1079 LONG FAR GALILCALL DMCGetDataRecordItemOffsetById( HANDLEDMC hdmc, USHORT usItemId,
1080  USHORT usAxisId, LPUSHORT pusOffset, LPUSHORT pusDataType )
1081 {
1082  return DMCERROR_HANDLE;
1083 }
1084 
1089 
1097 LONG FAR GALILCALL DMCGetDataRecordConstPointer(HANDLEDMC hdmc, const char **pchDataRecord);
1098 
1103 LONG FAR GALILCALL DMCGetDataRecordConstPointerArray(HANDLEDMC hdmc, const char **pchDataRecord, LPUSHORT pusNumDataRecords)
1104 {
1105  return DMCERROR_HANDLE;
1106 }
1107 
1108 
1109 #ifdef __cplusplus
1110 
1111 struct CDMCFullDataRecord; // Forward declaration.
1112 LONG FAR GALILCALL DMCGetDataRecordArray(HANDLEDMC hdmc, CDMCFullDataRecord **pDataRecordArray, LPUSHORT pusNumDataRecords)
1113 {
1114  return DMCERROR_HANDLE;
1115 }
1116 
1117 struct CDMCFullDataRecord2; // Forward declaration.
1118 LONG FAR GALILCALL DMCGetDataRecordArray2(HANDLEDMC hdmc, CDMCFullDataRecord2 **pDataRecordArray, LPUSHORT pusNumDataRecords)
1119 {
1120  return DMCERROR_HANDLE;
1121 }
1122 
1127 #endif
1128 
1129 #endif
1130 
1131 #ifdef __cplusplus
1132  }
1133 #endif
1134 
1135 #endif // DMCCOM_H_I_2FC43D18_4D95_434F_A3D5_6D32828701C4
LONG FAR GALILCALL DMCOpen2(USHORT usController, LONG lThreadID, PHANDLEDMC phdmc)
Open communications with the Galil controller. DMCOpen2 is a wrapper around DMCOpen.
Definition: Dmccom.h:501
LONG FAR GALILCALL DMCGetAdditionalResponseLen(HANDLEDMC hdmc, LPULONG pulResponseLen)
Query the Galil controller for the length of additional response data.
LONG FAR GALILCALL DMCArrayDownload(HANDLEDMC hdmc, PSZ pszArrayName, USHORT usFirstElement, USHORT usLastElement, LPCHAR pchData, ULONG cbData, LPULONG cbBytesWritten)
Download an array to the Galil controller.
LONG FAR GALILCALL DMCRefreshDataRecord(HANDLEDMC hdmc, ULONG ulLength)
Refresh the data record used for fast polling.
LONG FAR GALILCALL DMCGetAdditionalResponse(HANDLEDMC hdmc, LPCHAR pchResponse, ULONG cbResponse)
Query the Galil controller for more response data.
LONG FAR GALILCALL DMCGetUnsolicitedResponse(HANDLEDMC hdmc, LPCHAR pchResponse, ULONG cbResponse)
Query the Galil controller for unsolicited responses.
LONG FAR GALILCALL DMCDownloadFile(HANDLEDMC hdmc, PSZ pszFileName, PSZ pszLabel)
Download a file to the Galil controller.
LONG FAR GALILCALL DMCOpen(USHORT usController, void *hwnd, PHANDLEDMC phdmc)
Open communications with the Galil controller.
LONG FAR GALILCALL DMCUploadFile(HANDLEDMC hdmc, PSZ pszFileName)
Upload a file from the Galil controller.
LONG FAR GALILCALL DMCArrayUpload(HANDLEDMC hdmc, PSZ pszArrayName, USHORT usFirstElement, USHORT usLastElement, LPCHAR pchData, ULONG cbData, LPULONG pulBytesRead, SHORT fComma)
Upload an array from the Galil controller.
LONG FAR GALILCALL DMCClose(HANDLEDMC hdmc)
Close communications with the Galil controller.
LONG FAR GALILCALL DMCUploadToBuffer(HANDLEDMC hdmc, LPCHAR pchBuffer, ULONG cbBuffer)
Upload to a buffer from the Galil controller.
LONG FAR GALILCALL DMCGetDataRecordConstPointer(HANDLEDMC hdmc, const char **pchDataRecord)
Get a const pointer to the most recent data record.
LONG FAR GALILCALL DMCCommand(HANDLEDMC hdmc, PSZ pszCommand, LPCHAR pchResponse, ULONG cbResponse)
Send a DMC command in ascii format to the Galil controller.
LONG FAR GALILCALL DMCVersion(HANDLEDMC hdmc, LPCHAR pchVersion, ULONG cbVersion)
Get the version of the Galil controller.
LONG FAR GALILCALL DMCDownloadFromBuffer(HANDLEDMC hdmc, PSZ pszBuffer, PSZ pszLabel)
Download from a buffer to the Galil controller.