| 12
 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
 
 |  
/******************************************************************************************************************
                                                                Data Device Corporation Proprietary Information
 
        This document contains proprietary information of Data Device Corporation.  Recipient agrees to use it
        solely for the limited purpose for which it was made available by Data Device Corporation and will not
        transmit it or any of the data contained within it, in whole or in part, for any purpose except with the prior
        written permission of Data Device Corporation.  Recipient further agrees to promptly return or destroy it
        upon the request of Data Device Corporation.
/*****************************************************************************************************************/
#ifdef __cplusplus
extern "C"
{
#endif
 
#include <stdio.h>
#ifndef _CVI_			// LabWindows CVI doesn't
#include <windows.h>	// like windows.h
#endif
 
#ifndef WINAPI
	#define WINAPI      __stdcall
#endif
 
/* TYPE DEFINITIONS */
 
#ifndef BYTE
typedef unsigned char       BYTE;
#endif
#ifndef UCHAR
typedef unsigned char       UCHAR;
#endif
#ifndef WORD
typedef unsigned short      WORD;
#endif
#ifndef USHORT
typedef unsigned short      USHORT;
#endif
#ifndef ULONG
typedef unsigned long      ULONG;
#endif
#ifdef _CVI_
typedef unsigned long		LONG;
#endif
 
// Note: int is 32 bits
 
 
 
#define OS_95							1		// Running Windows 95
#define OS_NT							2		// Running Windows NT
#define MAXCARDS						0xB		// Maximum number of cards supported by Control Panel
#define MAXCHANNEL						0x6		// Maximum number of channels on a card
#define CARDMASK						0x7
 
#define TRACK							0x1
#define INHIBIT							0x0
 
#ifndef NORMAL
#define NORMAL							0x1
#endif
 
#define BITE							0x0
 
#define MODE_CONTINUOUS					0x0
#define MODE_LATCH						0x1
 
#define ENABLE							0x1
#define DISABLE							0x0
 
#define RELAYSETTLE						50 /* Ms */
 
#define DSC36020						6
#define DSC36022						4
 
/* ERROR CONSTANTS */
 
#define SDC36016_CLEAR					0x00
#define SDC36016_NO_INIT				0x01
#define SDC36016_INVALID_CARD			0x02
#define SDC36016_INVALID_CHANNEL		0x04
 
/* REGISTER MAPPING */
 
#define SB3621x_ACSSD					0x00000000
#define SB3621x_BCSSD					0x00020000
#define SB3621x_CSTC					0x00800000
#define SB3621x_STCS					0x00820000
#define SB3621x_REFCS					0x01000000
#define SB3621x_STATSD					0x00000000
#define SB3621x_BWSTAT					0x00020000
#define SB3621x_DBSDchA					0x00800000
#define SB3621x_DBSDchB					0x00820000
#define SB3621x_DBSDchC					0x00840000
#define SB3621x_DBSDchD					0x00860000
#define SB3621x_DBSDchE					0x00880000
#define SB3621x_DBSDchF					0x008A0000
#define SB3621x_DBTCchA					0x01000000
#define SB3621x_DBTCchB					0x01020000
#define SB3621x_DBTCchC					0x01040000
#define SB3621x_DBTCchD					0x01060000
#define SB3621x_DBTCchE					0x01080000
#define SB3621x_DBTCchF					0x010A0000
#define SB3621x_RBSTATACSSD				0x01800000
#define SB3621x_RBSTATBCSSD				0x01820000
#define SB3621x_RBSTATREFCS				0x01840000
#define SB3621x_RBSTATCSTC				0x01860000
#define SB3621x_RBSTATSTCS				0x01880000
 
//Write SB3620x Registers///////////////////////////////
#define SB3620x_ACSSD					0x00000000
#define SB3620x_BCSSD					0x00020000
#define SB3620x_CSTC					0x00800000
#define SB3620x_REFCS					0x01000000
#define SB3620x_DRDYN					0x01800000
#define SB3620x_SPDR					0x01820000
#define SB3620x_FINEL					0x01840000
#define SB3620x_COARSEL					0x01860000
#define SB3620x_BRMC					0x01880000
#define SB3620x_BRMF					0x018A0000
 
//Read SB3620x Registers///////////////////////////////
 
#define SB3620x_STATSD					0x00000000
#define SB3620x_CDAT					0x00020000
#define SB3620x_FDAT					0x00040000
 
 
#define SB3620x_DBSD_CHA				0x00800000
#define SB3620x_DBSD_CHB				0x00820000
#define SB3620x_DBSD_CHC				0x00840000
#define SB3620x_DBSD_CHD				0x00860000
 
#define SB3620x_DBTC_CHA				0x01000000
#define SB3620x_DBTC_CHB				0x01020000
#define SB3620x_DBTC_CHC				0x01040000
#define SB3620x_DBTC_CHD				0x01060000
 
#define SB3620x_RBSTAT_ACSSD			0x01800000
#define SB3620x_RBSTAT_BCSSD			0x01820000
#define SB3620x_RBSTAT_CSREF			0x01840000
#define SB3620x_RBSTAT_SPDR_TC			0x01860000
#define SB3620x_RBSTAT_DRDYN			0x01880000
#define SB3620x_RBSTAT_BRM				0x018A0000
#define SB3620x_RBSTAT_BRMF				0x018C0000
 
#define SB3620x_INHIBITall				0x3C00		// Inhibit all 6 channels
////////////////////////////////////////////////////////
#define SB3622x_FBRM_CHB				0x00000000
#define SB3622x_CBRM_CHA				0x00020000
#define SB3622x_SR_CHAB 				0x00040000
#define SB3622x_SLD_CHB 				0x00060000
#define SB3622x_SLD_CHA 				0x00080000
#define SB3622x_CSROT_CHAB				0x000A0000
#define SB3622x_FBRM_CHD				0x00800000
#define SB3622x_CBRM_CHC				0x00820000
#define SB3622x_SR_CHCD 				0x00840000
#define SB3622x_SLD_CHD 				0x00860000
#define SB3622x_SLD_CHC 				0x00880000
#define SB3622x_CSROT_CHCD				0x008A0000
#define SB3622x_FBRM_CHF				0x01000000
#define SB3622x_CBRM_CHE				0x01020000
#define SB3622x_SR_CHEF					0x01040000
#define SB3622x_SLD_CHF 				0x01060000
#define SB3622x_SLD_CHE 				0x01080000
#define SB3622x_CSROT_CHEF				0x010A0000
#define SB3622x_BRDCS					0x01800000
#define SB3622x_RBSTATCSROT_AB			0x00000000
#define SB3622x_RBSTATCSROT_CD			0x00020000
#define SB3622x_RBSTATCSROT_EF			0x00040000
#define SB3622x_RBSTATBRDCS				0x00060000
#define SB3622x_RBSTATFBRM_CHB			0x00080000
#define SB3622x_RBSTATCBRM_CHA			0x000A0000
#define SB3622x_RBSTATSR_CHAB 			0x000C0000
#define SB3622x_RBSTATFBRM_CHD			0x000E0000
#define SB3622x_RBSTATCBRM_CHC			0x00800000
#define SB3622x_RBSTATSR_CHCD 			0x00820000
#define SB3622x_RBSTATFBRM_CHF			0x00840000
#define SB3622x_RBSTATCBRM_CHE			0x00860000
#define SB3622x_RBSTATSR_CHEF 			0x00880000
#define SB3622x_RCCDATA       			0x01000000
#define SB3622x_RCFDATA       			0x01020000
#define SB3622x_RCCDATB       			0x01040000
#define SB3622x_RCFDATB       			0x01060000
#define SB3622x_RCCDATC       			0x01080000
#define SB3622x_RCFDATC       			0x010A0000
#define SB3622x_TSECB       			0x010C0000
///////////////////////SB-3641x//////////////////////////
#define SB3641x_POSITION_CHAN1			0
#define SB3641x_BIT_CHAN1				1
#define SB3641x_POSITION_CHAN2			2
#define SB3641x_BIT_CHAN2				3
#define SB3641x_POSITION_CHAN3			4
#define SB3641x_BIT_CHAN3				5
#define SB3641x_POSITION_CHAN4			6
#define SB3641x_BIT_CHAN4				7
#define SB3641x_POSITION_CHAN5			8
#define SB3641x_BIT_CHAN5				9
#define SB3641x_POSITION_CHAN6			10
#define SB3641x_BIT_CHAN6				11
#define SB3641x_POSITION_CHAN7			12
#define SB3641x_BIT_CHAN7				13
#define SB3641x_POSITION_CHAN8			14
#define SB3641x_BIT_CHAN8				15
#define SB3641x_INHIBIT					16
//#define SB3641x_ENABLE				17
#define SB3641x_RESOLUTION				18
#define SB3641x_BANDWIDTH				19 
#define SB3641x_ENCODER					20   //MSB A Quad B   LSB  ZI Enable
//empty									21
#define SB3641x_SELF_TEST				22
#define SB3641x_TESTA1					24
#define SB3641x_TESTA2					25
#define SB3641x_TEST51					26
#define SB3641x_TEST52					27
 
 
/* For Twospeed_Inhibit */
#define SB3621x_INHIBITa				0x0004		// Inhibit channel A
#define SB3621x_INHIBITb				0x0008		// Inhibit channel B
#define SB3621x_INHIBITc				0x0010		// Inhibit channel C
#define SB3621x_INHIBITd				0x0020		// Inhibit channel D
#define SB3621x_INHIBITe				0x0040		// Inhibit channel E
#define SB3621x_INHIBITf				0x0080		// Inhibit channel F
#define SB3621x_INHIBITall				0x00FC		// Inhibit all 6 channels
 
#define SDC36016_REG_CONTROL            0x00
#define SDC36016_REG_STATUS             0x00
#define SDC36016_REG_CHANNEL_1_LSB      0x02
#define SDC36016_REG_CHANNEL_1_MSB      0x03
 
#define SDC36015_REG_CONTROL            0x00
#define SDC36015_REG_LSB                0x00
#define SDC36015_REG_MSB                0x01
#define SDC36015_REG_ERRCOUNT           0x02
#define SDC36015_REG_STATUS             0x03
 
#define API36005_REG_CONTROLA			0x04 /* READ/WRITE */
#define API36005_REG_ANGLE_LSB1			0x05 /* WRITE */
#define API36005_REG_ANGLE_LSB2			0x06 /* WRITE */
#define API36005_REG_ANGLE_MSB			0x07 /* WRITE */
 
#define SIM36010_REGISTER_SPEED_LSB		0x02 /* WRITE */
#define SIM36010_REGISTER_SPEED_MSB		0x03 /* WRITE */
#define SIM36010_REGISTER_CONTROLA		0x04 /* WRITE */
#define SIM36010_REGISTER_CONTROLB		0x05 /* WRITE */
#define SIM36010_REGISTER_ANGLE_LSB		0x06 /* WRITE */
#define SIM36010_REGISTER_ANGLE_MSB		0x07 /* WRITE */
#define SIM36010_REGISTER_STATUS		0x04 /* READ  */
 
/* FUNCTION PROTOTYPES */
 
char *WINAPI Initialize(int);				// (Card#)
void Initialize_PCI_Driver(void);			// Internal to dll
void Initialize_ISA_Driver(void);			// Internal to dll
void WINAPI Clear_All(int,int);				// (Card#, Channel)
void WINAPI Clear_Channel(int,int);			// (Card#, Channel)
LONG WINAPI Combine_Angle(int,WORD,WORD);	// (Card#, Angle LSB, Angle MSB)
void WINAPI Dynamic_Rotation(int,int,double,int,int);	// (Card#, Channel, Rate, Direction, # of Turns)
void WINAPI Enable_Rotation(int,int);		// (Card#, Channel)
void WINAPI Enable_TwoSpeed(int,int);		// (Card#, Channel)
void WINAPI Latch_Channel (int,int,int);	// (Card#, Channel, Mode) (0 or 1)
void WINAPI Latch_TwoSpeed_Data(int,int,int); // (Card#, Channel, Mode) (0 or 1)
void WINAPI Program_Amplitude(int,int);		// (Card#, Amplitude) (0-0xFF)
void WINAPI Program_Angle(int,int,WORD);	// (Card#, Channel, Angle to write)
void WINAPI Program_Bandwidth(int,int,int);	// (Card#, Channel, Bandwidth Mode) (0 or 1)
void WINAPI Program_Card(int,int);			// (Card#, Channel)
void WINAPI Program_Encoder(int,int,int);	// (Card#, Channel, Encoder Mode) (0 or 1)
void WINAPI Program_Frequency(int,int);		// (Card#, Frequency) (0-0xFF)
void WINAPI Program_Inhibit(int,int,int);	// (Card#, Channel, Inhibit Mode) (0 or 1)
float WINAPI Program_Multiplier(int,int,float,int,int); // (Card#, Channel, Multiplier, Direction.SpeedMode)
void WINAPI Program_Ratio(int,int,WORD);	// (Card#, Channel, Ratio)
void WINAPI Program_Resolution(int,int,int);// (Card#, Channel, Resolution) (10,12,14,16)
void WINAPI Program_Encoder_Resolution(int,int,int);// (Card#, Channel, Resolution) (10,12,14,16)
void WINAPI Program_Speed(int,double,int);	// (Card#, Speed to write, Polarity)
void WINAPI Read_All_Channels(int,WORD[6],int[6]);		// (Card#, Angle array, BITE array)
long WINAPI Read_Angle(int,int);			// (Card#, Channel) returns long Angle
WORD WINAPI Read_Angle_WORD(int,int);		// (Card#, Channel) returns WORD Angle
int  WINAPI Read_Bandwidth(int,int);		// (Card#, Channel) returns BOOL Bandwidth
int  WINAPI Read_Bite(int,int);				// (Card#, Channel) returns BOOL BITE
int  WINAPI Read_Control(int,int);			// (Card#, Channel) returns Control Register bits
WORD WINAPI Read_Converter(int,int);		// (Card#, Channel) Inhibits, Reads Angle, Uninhibits
int  WINAPI Read_Count(int);				// (Card#) returns SDC36015 counter
int  WINAPI Read_Counter(int,int);			// (Card#, Channel) returns SB3621x counter
int  WINAPI Read_Direction(int,int);		// (Card#, Channel) returns BOOL Direction
int  WINAPI Read_Encoder(int,int);			// (Card#, Channel) returns BOOL Encoder Mode
int  WINAPI Read_Inhibit(int,int);			// (Card#, Channel) returns BOOL Inhibit
int  WINAPI Read_Latched_Angle(int,int,int*,int*); // (Card#, Channel Pair, Coarse Angle, Fine Angle) returns 1 if data was Latched, 0 if not
int  WINAPI Read_LOR(int);					// (Card#) returns BOOL LOR
int  WINAPI Read_LOS(int);					// (Card#) returns BOOL LOS 
WORD WINAPI Read_Lsb(int);					// (Card#) returns lower 16 bits of API angle
WORD WINAPI Read_Msb(int);					// (Card#) returns upper 4 bits of API angle
int  WINAPI Read_Register(int,int);			// (Card#, Register) returns bits from Register
int  WINAPI Read_Resolution(int,int);		// (Card#, Channel) returns Resolution (10,12,14,16)
int  WINAPI Read_Status(int);				// (Card#)
void WINAPI Reset_Count(int);				// (Card#) resets SDC36015 counter
void WINAPI Reset_Counter(int,int);			// (Card#, Channel) resets SB3621x counter
int	 WINAPI SelfTest(int);					// (Card#)
void WINAPI Start_Rotation(int,int,int);	// (Card#, Channel, Mode) (0 or 1)
int	 WINAPI Start_SelfTest(int);			// (Card#)
void WINAPI Start_TwoSpeed(int,int,int);	// (Card#, Channel, Mode) (0 or 1)
void WINAPI Static_TwoSpeed(int,int,double);// (Card#, Channel Pair(0-2), Coarse Angle)
int	 WINAPI End_SelfTest(int);				// (Card#)
void WINAPI Twospeed_Inhibit(int,int);		// (Card#, ORed channels from above mapping)
void WINAPI Write_Converter(int,int,WORD);	// (Card#, Channel, Data to write)
void WINAPI Close(int);						// (Card#)
 
char* WINAPI Get_Card_Type(int);			// (Card#) returns string of card name
char* WINAPI Get_Card_Address(int);			// (Card#) returns address (ISA) or PCI slot of card
char* WINAPI Get_DLL_Version(void);			// returns version of current DLL
WORD  WINAPI DectoBin(double);				// (Decimal angle (360.000)) converts to Synchro binary
LONG  WINAPI DectoBin_Long(double);			// (Decimal angle) converts to 20 bit Synchro binary
double WINAPI BintoDec(WORD);				// (Synchro binary) converts to Decimal equivalent
double WINAPI BintoDec_Long(LONG);			// (Synchro binary) converts to 20 bit Decimal 
void WINAPI CalculateTwospeed(double,double,double,double*,int*); // (Coarse angle, Fine angle, speed, combined angle, error flag)
int  WINAPI Get_Last_Error(char*);			// (Empty string) returns char string of error, and error code
 
WORD WINAPI Synchro_ReadChar (unsigned long);			// Internal to DLL
WORD WINAPI Synchro_ReadShort(unsigned long);			// Internal to DLL
LONG WINAPI Synchro_ReadLong (unsigned long);			// Internal to DLL
BOOL WINAPI Synchro_WriteChar(unsigned long,UCHAR);		// Internal to DLL
BOOL WINAPI Synchro_WriteShort(unsigned long,USHORT);	// Internal to DLL
BOOL WINAPI Synchro_WriteLong(unsigned long,ULONG);		// Internal to DLL
 
 
/* Routines for specific hardware.  Not preferred method.  Use above generic routines. */
void WINAPI SB3620x_Initialize(int,int);
void WINAPI SB3620x_Program_Resolution(int,int,int);
void WINAPI SB3620x_Program_Bandwidth(int,int,int);
void WINAPI SB3620x_Program_Frequency(int,int);
void WINAPI SB3620x_Program_Amplitude(int,int);
int  WINAPI SB3620x_SelfTest(int);
int  WINAPI SB3620x_Start_SelfTest(int);
int  WINAPI SB3620x_End_SelfTest(int);
void WINAPI SB3620x_Program_Inhibit(int,int,int);
void WINAPI SB3620x_Twospeed_Inhibit(int,int);
int  WINAPI SB3620x_Read_Inhibit(int,int);
int  WINAPI SB3620x_Read_Resolution(int,int);
WORD WINAPI SB3620x_Read_Angle(int,int);
WORD WINAPI SB3620x_Read_Converter(int,int);
int  WINAPI SB3620x_Read_Direction(int,int);
int  WINAPI SB3620x_Read_Bandwidth(int,int);
int  WINAPI SB3620x_Read_Bite(int,int);
int  WINAPI SB3620x_Read_Counter(int,int);
void WINAPI SB3620x_Reset_Counter(int,int);
void WINAPI SB3620x_Clear_All(int,int);
void WINAPI SB3620x_Clear_Channel(int,int);
void WINAPI SB3620x_Enable_Rotation(int,int);
void WINAPI SB3620x_Enable_TwoSpeed(int,int);
void WINAPI SB3620x_Latch_Channel (int,int,int);
void WINAPI SB3620x_Latch_TwoSpeed_Data(int,int,int);
void WINAPI SB3620x_Program_Angle(int,int,WORD);
float WINAPI SB3620x_Program_Multiplier(int,int,float,int,int);
void WINAPI SB3620x_Program_Ratio(int,int,WORD);
int  WINAPI SB3620x_Read_Latched_Angle(int,int,int*,int*);
void WINAPI SB3620x_Start_Rotation(int,int,int);
void WINAPI SB3620x_Start_TwoSpeed(int,int,int);
void WINAPI SB3620x_Static_TwoSpeed (int,int,double);
void WINAPI SB3620x_Close(int);
//////////////////////Not sure/////////////////////////////////////////////////////////////
void WINAPI SB3620x_Program_Encoder(int,int,int);
void WINAPI SB3620x_Program_Encoder_Resolution(int,int,int);
int  WINAPI SB3620x_Read_Encoder(int,int);
int  WINAPI SB3620x_Read_Encoder_Resolution(int,int);
int  WINAPI SB3620x_Read_Control(int,int);
int  WINAPI SB3620x_Read_Register(int,int);
/////////////////////////////////////////////////////////////////////////////////////////
void WINAPI SB3621x_Initialize(int,int);
void WINAPI SB3621x_Program_Resolution(int,int,int);
void WINAPI SB3621x_Program_Bandwidth(int,int,int);
void WINAPI SB3621x_Program_Encoder(int,int,int);
void WINAPI SB3621x_Program_Encoder_Resolution(int,int,int);
void WINAPI SB3621x_Program_Frequency(int,int);
void WINAPI SB3621x_Program_Amplitude(int,int);
int  WINAPI SB3621x_SelfTest(int);
int  WINAPI SB3621x_Start_SelfTest(int);
int  WINAPI SB3621x_End_SelfTest(int);
void WINAPI SB3621x_Program_Inhibit(int,int,int);
void WINAPI SB3621x_Twospeed_Inhibit(int,int);
int  WINAPI SB3621x_Read_Inhibit(int,int);
int  WINAPI SB3621x_Read_Resolution(int,int);
WORD WINAPI SB3621x_Read_Angle(int,int);
WORD WINAPI SB3621x_Read_Converter(int,int);
int  WINAPI SB3621x_Read_Direction(int,int);
int  WINAPI SB3621x_Read_Bandwidth(int,int);
int  WINAPI SB3621x_Read_Encoder(int,int);
int  WINAPI SB3621x_Read_Bite(int,int);
int  WINAPI SB3621x_Read_Counter(int,int);
void WINAPI SB3621x_Reset_Counter(int,int);
void WINAPI SB3621x_Close(int);
 
void WINAPI SB3622x_Initialize(int,int);
void WINAPI SB3622x_Clear_All(int,int);
void WINAPI SB3622x_Clear_Channel(int,int);
void WINAPI SB3622x_Enable_Rotation(int,int);
void WINAPI SB3622x_Enable_TwoSpeed(int,int);
void WINAPI SB3622x_Latch_Channel (int,int,int);
void WINAPI SB3622x_Latch_TwoSpeed_Data(int,int,int);
void WINAPI SB3622x_Program_Amplitude(int,int);
void WINAPI SB3622x_Program_Angle(int,int,WORD);
void WINAPI SB3622x_Program_Frequency(int,int);
float WINAPI SB3622x_Program_Multiplier(int,int,float,int,int);
void WINAPI SB3622x_Program_Ratio(int,int,WORD);
void WINAPI SB3622x_Program_Resolution (int,int,int);
int  WINAPI SB3622x_Read_Control(int,int);
int  WINAPI SB3622x_Read_Latched_Angle(int,int,int*,int*);
int  WINAPI SB3622x_Read_Register(int,int);
int  WINAPI SB3622x_Read_Resolution(int,int);
void WINAPI SB3622x_Start_Rotation(int,int,int);
void WINAPI SB3622x_Start_TwoSpeed(int,int,int);
void WINAPI SB3622x_Static_TwoSpeed (int,int,double);
void WINAPI SB3622x_Close(int);
 
/////////////////////////////////////////////////////////////////////////////////////////
void WINAPI SB3641x_Initialize(int,int);
void WINAPI SB3641x_Program_Resolution(int,int,int);
void WINAPI SB3641x_Program_Bandwidth(int,int,int);
void WINAPI SB3641x_Program_AQuadB(int,int,int);
void WINAPI SB3641x_Program_Zip(int,int,int);
int  WINAPI SB3641x_SelfTest(int,int);
int  WINAPI SB3641x_Start_SelfTest(int);
int  WINAPI SB3641x_Read_SelfTest(int);
void WINAPI SB3641x_Program_Inhibit(int,int,int);
WORD WINAPI SB3641X_Mem_Read(int,int);
int WINAPI  SB3641X_Mem_Write(int,int,int);
 
WORD WINAPI SB3641x_Read_Angle(int,int);
int  WINAPI SB3641x_Read_Inhibit(int,int);
int  WINAPI SB3641x_Read_Resolution(int,int);
int  WINAPI SB3641x_Read_Bandwidth(int,int);
int  WINAPI SB3641x_Read_AQuadB(int,int);
int  WINAPI SB3641x_Read_Zip(int,int);
int  WINAPI SB3641x_Read_Bite(int,int);
void WINAPI SB3641x_Close(int);
////////////////////////////////////////////////////////////////////////////////////////
void WINAPI SDC36016_Initialize(int,int);
WORD WINAPI SDC36016_Read_Angle(int,int);
int  WINAPI SDC36016_Read_Inhibit(int,int);
WORD WINAPI SDC36016_Read_Converter(int,int);
int  WINAPI SDC36016_Read_Bite(int,int);
void WINAPI SDC36016_Program_Inhibit(int,int,int);
void WINAPI SDC36016_Close(int);
 
void WINAPI SDC36015_Initialize(int,int);
void WINAPI SDC36015_Program(int,WORD);
WORD WINAPI SDC36015_Read_Angle(int,int);
int  WINAPI SDC36015_Read_Bite(int);
void WINAPI SDC36015_Read_All_Channels(int,WORD [6],int [6]);
int  WINAPI SDC36015_Read_Los(int);
int  WINAPI SDC36015_Read_Count(int);
void WINAPI SDC36015_Reset_Count(int);
int  WINAPI SDC36015_Read_Status(int);
void WINAPI SDC36015_Close(int);
 
void WINAPI API36005_Initialize(int,int);
void WINAPI API36005_Program(int,int);
int  WINAPI API36005_Read_Bite(int);
int  WINAPI API36005_Read_Lor(int);
WORD WINAPI API36005_Read_Lsb(int);
WORD WINAPI API36005_Read_Msb(int);
LONG WINAPI API36005_Read_Angle(int);
LONG WINAPI API36005_Combine_Angle(int,WORD,WORD);
void WINAPI API36005_Close(int);
 
void WINAPI DSC_Initialize(int,int,int);
void WINAPI DSC_Program_Angle(int,int,WORD);
void WINAPI DSC_Dynamic_Rotation(int,int,double,int,int);
void WINAPI DSC_Write_Converter(int,int,WORD);
void WINAPI DSC_Close(int);
 
void WINAPI SIM36010_Initialize(int,int);
void WINAPI SIM36010_Program(int,int);
int	 WINAPI SIM36010_Read_Bite(int);
int  WINAPI SIM36010_Read_Lor(int);
void WINAPI SIM36010_Program_Angle(int,WORD);
void WINAPI SIM36010_Program_Speed(int,double,int);
void WINAPI SIM36010_Dynamic_Rotation(int,double,int);
void WINAPI SIM36010_Write_Converter(int,WORD);
void WINAPI SIM36010_Close(int);
 
/* COMMANDS */
					/*  New  Reg#  Posit    Mask   */
					/*  XXXX  X    XXX   XXXX XXXX */
#define SDC36015_IRQENA		0x06BF		/*  0000  0    110   1011 1111 */
#define SDC36015_IRQDIS		0x16BF		/*  0001  0    110   1011 1111 */
#define SDC36015_INHIBIT	0x04EF		/*  0000  0    100   1110 1111 */
#define SDC36015_TRACK		0x14EF		/*  0001  0    100   1110 1111 */
#define SDC36015_CRESET		0x15DF		/*  0000  0    101   1101 1111 */
#define SDC36015_C1			0x00F8		/*  0000  0    000   1111 1000 */
#define SDC36015_C2			0x10F8		/*  0001  0    000   1111 1000 */
#define SDC36015_C3			0x20F8		/*  0010  0    000   1111 1000 */
#define SDC36015_C4			0x30F8		/*  0011  0    000   1111 1000 */
#define SDC36015_C5			0x40F8		/*  0100  0    000   1111 1000 */
#define SDC36015_C6			0x50F8		/*  0101  0    000   1111 1000 */
 
#define API36005_NORMAL		0x177F
#define API36005_SELF_TEST	0x077F
#define API36005_CHANNEL_A	0x16BF
#define API36005_CHANNEL_B	0x06BF
#define API36005_REF_26		0x05DF
#define API36005_REF_115	0x15DF
#define API36005_TRACK		0x14EF
#define API36005_INHIBIT	0x04EF
#define API36005_RES_20		0x13F7
#define API36005_RES_16		0x03F7
#define API36005_RESOLVER	0x12FB
#define API36005_SYNCHRO	0x02FB
#define API36005_45_DEGREE	0x00FC
#define API36005_ll_118		0x10FC
#define API36005_ll_26		0x20FC
#define API36005_ll_90		0x30FC
 
 
/*  COMMAND DEFINITION BIT MAP
	   0 :  00  :    0 : 0000
	BITS : NEW  : REG# : POSITION */
 
#define SIM36010_ENABLE						0x25 /* WRITE */
#define SIM36010_DISABLE					0x05 /* WRITE */
#define SIM36010_115V						0x24 /* WRITE */
#define SIM36010_26V						0x04 /* WRITE */
#define SIM36010_CONNECT					0x23 /* WRITE */
#define SIM36010_DISCONNECT					0x03 /* WRITE */
#define SIM36010_RESOLVER					0x22 /* WRITE */
#define SIM36010_SYNCHRO					0x02 /* WRITE */
#define SIM36010_118						0x80 /* WRITE */
#define SIM36010_26							0xC0 /* WRITE */
#define SIM36010_90							0xE0 /* WRITE */
#define SIM36010_SPEED_ON					0x33 /* WRITE */
#define SIM36010_SPEED_OFF					0x13 /* WRITE */
#define SIM36010_RATE_INTERNAL				0x32 /* WRITE */
#define SIM36010_RATE_EXTERNAL				0x12 /* WRITE */
#define SIM36010_RANGE_HI					0x31 /* WRITE */
#define SIM36010_RANGE_LO					0x11 /* WRITE */
#define SIM36010_REF_INTERNAL				0x30 /* WRITE */
#define SIM36010_REF_EXTERNAL				0x10 /* WRITE */
 
// Device type           -- in the "User Defined" range."
#define GPD_TYPE 40000
 
// The IOCTL function codes from 0x800 to 0xFFF are for customer use.
 
#define IOCTL_GPD_READ_PORT_UCHAR \
    CTL_CODE( GPD_TYPE, 0x900, METHOD_BUFFERED, FILE_READ_ACCESS )
 
#define IOCTL_GPD_READ_PORT_USHORT \
    CTL_CODE( GPD_TYPE, 0x901, METHOD_BUFFERED, FILE_READ_ACCESS )
 
#define IOCTL_GPD_READ_PORT_ULONG \
    CTL_CODE( GPD_TYPE, 0x902, METHOD_BUFFERED, FILE_READ_ACCESS )
 
#define IOCTL_GPD_WRITE_PORT_UCHAR \
    CTL_CODE(GPD_TYPE,  0x910, METHOD_BUFFERED, FILE_WRITE_ACCESS)
 
#define IOCTL_GPD_WRITE_PORT_USHORT \
    CTL_CODE(GPD_TYPE,  0x911, METHOD_BUFFERED, FILE_WRITE_ACCESS)
 
#define IOCTL_GPD_WRITE_PORT_ULONG \
    CTL_CODE(GPD_TYPE,  0x912, METHOD_BUFFERED, FILE_WRITE_ACCESS)
 
	// LabWindows CVI want a name after the union (PortNum)
#ifdef _CVI_
typedef struct  _GENPORT_WRITE_INPUT {
    ULONG   PortNumber;     // Port # to write to
    union   {               // Data to be output to port
        ULONG   LongData;
        USHORT  ShortData;
        UCHAR   CharData;
    } PortNum;				// <-- Named union
}   GENPORT_WRITE_INPUT;
#endif
 
	// Microsoft doesn't want the name after the union
#ifndef _CVI_	
typedef struct  _GENPORT_WRITE_INPUT {
    ULONG   PortNumber;     // Port # to write to
    union   {               // Data to be output to port
        ULONG   LongData;
        USHORT  ShortData;
        UCHAR   CharData;
    };						// <-- No name
}   GENPORT_WRITE_INPUT;
#endif
 
#ifdef __cplusplus
}
#endif |