📄 as_cpci75sd1.h
字号:
/* APEX MODEL cPCI75sd1 DLL FUNCTION PROTOTYPES */
/* 05/10/01 */
#include <windows.h>
#define SUCCESS 0
#if !defined __as_75sd1__
#define __as_75sd1__
#if defined(__cplusplus) || defined(__cplusplus__)
extern "C" {
#endif
/*****************************************************************/
/* */
/* If used with Visual Basic */
/* */
/* pass Long (4 bytes) into functions requiring int */
/* pass Double (8 bytes) into functions requiring double */
/* */
/* HANDLE As Long */
/* functions return Long */
/* */
/*****************************************************************/
/* */
/* Function Return Values */
/* */
/* #define AS_SUCCESS 0 */
/* #define CARD_NOT_FOUND 100 */
/* #define CHANNEL_PARAM_ERROR 101 */
/* #define ANGLE_PARAM_ERROR 102 */
/* #define FREQ_PARAM_ERROR 103 */
/* #define VOLT_PARAM_ERROR 104 */
/* #define RATIO_PARAM_ERROR 105 */
/* #define OFFSET_ERROR 106 */
/* #define D2_TEST_ERROR 107 */
/* #define PAGE_ERROR 108 */
/* #define WATCHDOG_ERROR 109 */
/* #define ENCODER_RES_PARAM_ERROR 110 */
/* #define ENCODER_MODE_ERROR 111 */
/* #define COMMUTATION_RES_PARAM_ERROR 112 */
/* #define COMMUTATION_MODE_ERROR 113 */
/* #define INVALID_INTERRUPT_EN 120 */
/* #define UNSUPPORTED_ERROR 199 */
/* #define INVALID_HANDLE 200 */
/* */
/*****************************************************************/
/********** DEVICE CONTROL **********/
HANDLE __stdcall as_75sd1_open(int card);
// Opens a device and returns a handle
// "card" refers to a number assigned when the PCI bus is searched for cards of
// this type. The first card found is card 0, the second is card 1, etc.
// If this number card is not found, HANDLE returned is ZERO.
// ************************ WARNING ****************************************
// ** **
// ** If a PCI card of this type is added or removed from the PCI BUS **
// ** the card number assigned to the remaining cards MAY BE MODIFIED. **
// ** **
// ******************************************************************************
int __stdcall as_75sd1_close(HANDLE cardHandle);
// Closes a device and returns OK
int __stdcall as_75sd1_getID(int card, int * id );
// if status = AS_SUCESS returns ID of card (cPCI-75sd1 ID = 7501)
// "card" refers to a number assigned when the PCI bus is searched for cards of
// this type. The first card found is card 0, the second is card 1, etc.
int __stdcall as_75sd1_getADDR(int card, int * addr );
// if status = AS_SUCESS returns I/O address of card
// "card" refers to a number assigned when the PCI bus is searched for cards of
// this type. The first card found is card 0, the second is card 1, etc.
/********* OUTPUT **********/
int __stdcall as_75sd1_getAngle(HANDLE cardHandle, int channel, double * angle);
// Reads the digital code from output memory of specified channel (1 - 8) to angle.
// angle is 0 to 360.0 deg
int __stdcall as_75sd1_getBinAngle(HANDLE cardHandle, int channel, int * angle);
// Reads back the digital code from input memory of specified channel (1 - 8) to angle.
// angle is 0 to 65536
int __stdcall as_75sd1_getTwoSpeedAngle(HANDLE cardHandle, int channel, double * angle);
// This option is not available on all Models check datasheet
// Reads the digital code from output memory of specified channel (2, 4, 6 or 8) to angle.
// Channel MUST be set to Two Speed Operation see datasheet
// angle is 0 to 360.0 deg
int __stdcall as_75sd1_getTwoSpeedBinAngle(HANDLE cardHandle, int channel, int * angle);
// Reads back the digital code from input memory of specified channel (2, 4, 6, or 8) to angle.
// Channel MUST be set to Two Speed Operation see datasheet
// angle is 0 to 16,777,215 ( 24 bits )
int __stdcall as_75sd1_setLatch(HANDLE cardHandle, int latch);
// sets the Latch word
// latch = 0, Output data Unlatched
// latch = 1, Output data held in Output latches until read or Unlatched
int __stdcall as_75sd1_getLatch(HANDLE cardHandle, int * enable);
// This function is not needed, and may not work properly. It is
// supplied to keep compatability with previous software
// Reads back the Latch word
// latch = 0, Output data Unlatched
// latch = 1, Output data held in Output latches until read or Unlatched
/********* SET-UP **********/
int __stdcall as_75sd1_setSynRes(HANDLE cardHandle, int channel, int SynRes);
// Sets the Synchro / Resolver Control for the specified channel ( 1 - 8 )
// 1 is Synchro, 0 is Resolver
// Synchro / Resolver Control available only on some units
int __stdcall as_75sd1_setSynResAll(HANDLE cardHandle, int SynRes);
// Sets the Synchro / Resolver Control for all channels with one word. Each bit controls
// a channel
// D0 controls Channel 1
// D7 controls channel 8
// 1 is Synchro, 0 is Resolver
// Synchro / Resolver Control available only on some units
int __stdcall as_75sd1_getSynRes(HANDLE cardHandle, int channel, int * SynRes);
// Reads back the Synchro / Resolver Control for the specified channel ( 1 - 8 )
// 1 is Synchro, 0 is Resolver
// Synchro / Resolver Control available only on some units
int __stdcall as_75sd1_getSynResAll(HANDLE cardHandle, int * SynRes);
// Reads back the Synchro / Resolver Control for all channels with one word. Each bit controls
// a channel
// D0 controls Channel 1
// D7 controls channel 8
// 1 is Synchro, 0 is Resolver
// Synchro / Resolver Control available only on some units
int __stdcall as_75sd1_setEncoderABres(HANDLE cardHandle, int channel, int ABres);
// Sets the Encoder A & B resolution Controls for the specified channel ( 1 - 8 )
// Also Sets the (A&B) or A,B,C Controls for the specified channel ( 1 - 8 ) to 0 for Encoder
// ABres = 0, Encoder resolution is 16 bits, (A&B) or A,B,C = 0
// ABres = 1, Encoder resolution is 15 bits, (A&B) or A,B,C = 0
// ABres = 2, Encoder resolution is 14 bits, (A&B) or A,B,C = 0
// ABres = 3, Encoder resolution is 13 bits, (A&B) or A,B,C = 0
// ABres = 4, Encoder resolution is 12 bits, (A&B) or A,B,C = 0
// see datasheet for further details
int __stdcall as_75sd1_getEncoderABres(HANDLE cardHandle, int channel, int * ABres);
// Reads back the Encoder A & B resolution Controls for the specified channel ( 1 - 8 )
// Also Checks the (A&B) or A,B,C Controls for the specified channel ( 1 - 8 ) for 0 and
// returns ENCODER_MODE_ERROR if not 0
// ABres = 0, Encoder resolution is 16 bits, (A&B) or A,B,C = 0
// ABres = 1, Encoder resolution is 15 bits, (A&B) or A,B,C = 0
// ABres = 2, Encoder resolution is 14 bits, (A&B) or A,B,C = 0
// ABres = 3, Encoder resolution is 13 bits, (A&B) or A,B,C = 0
// ABres = 4, Encoder resolution is 12 bits, (A&B) or A,B,C = 0
// see datasheet for further details
int __stdcall as_75sd1_setCommABCpoles(HANDLE cardHandle, int channel, int ABCpoles);
// Sets the A & B resolution Controls for the specified channel ( 1 - 8 )
// Also Sets the (A&B) or A,B,C Controls for the specified channel ( 1 - 8 ) to 1 (Commutation)
// ABCpoles = 0, Commutation for 4 poles, (A&B) or A,B,C = 1
// ABCpoles = 1, Commutation for 6 poles, (A&B) or A,B,C = 1
// ABCpoles = 2, Commutation for 8 poles, (A&B) or A,B,C = 1
// see datasheet for further details
int __stdcall as_75sd1_getCommABCpoles(HANDLE cardHandle, int channel, int * ABCpoles);
// Reads back the A & B resolution Controls for the specified channel ( 1 - 8 )
// Also Checks the (A&B) or A,B,C Controls for the specified channel ( 1 - 8 ) for 1 and
// returns COMMUTATION_MODE_ERROR if not 1
// ABCpoles = 0, Commutation for 4 poles, (A&B) or A,B,C = 1
// ABCpoles = 1, Commutation for 6 poles, (A&B) or A,B,C = 1
// ABCpoles = 2, Commutation for 8 poles, (A&B) or A,B,C = 1
// see datasheet for further details
/********* REFERENCE **********/
int __stdcall as_75sd1_setRefFreq(HANDLE cardHandle, double frequency);
// Sets the Reference Frequency for units with programmable references ( 360 - 10,000 Hz )
// Frequency resolution is 1 Hz
// ie for 400 Hz sets frequency code to 400
// Applies to Programmable Reference units only
int __stdcall as_75sd1_getRefFreq(HANDLE cardHandle, double * frequency);
// Reads back the Reference Frequency for units with programmable references ( 360 - 10,000 Hz )
// Frequency resolution is 1 Hz
// ie for 400 Hz sets frequency code to 400
// Applies to Programmable Reference units only
int __stdcall as_75sd1_setRefVoltage(HANDLE cardHandle, double voltage);
// Sets the Reference Voltage for units with programmable references ( 2 - 28 Volts )
// Voltage resolution is 0.1 Volts ( ie 2.0 volts => sets code to 20 )
// Applies to Programmable Reference units only
int __stdcall as_75sd1_getRefVoltage(HANDLE cardHandle, double * voltage);
// Reads back the Reference Voltage for units with programmable references ( 2 - 28 Volts )
// Voltage resolution is 0.1 Volts ( ie 2.0 volts => sets code to 20 )
// Applies to Programmable Reference units only
/********** STATUS **********/
int __stdcall as_75sd1_setActiveChannel(HANDLE cardHandle, int channel, int active);
// sets the active channel bit, of specified channel (1 - 8), in the Active channel word, which:
// Enables the Status bits ( Reference, Signal, and Test Status ), for the specified channel.
// active = 1, status bits, for specified channel are enabled
// active = 0, status bits, for specified channel are disabled
int __stdcall as_75sd1_setActiveChannelAll(HANDLE cardHandle, int active);
// sets the active channel word, which:
// Enables the Status bits ( Reference, Signal, and Test Status ). for each respective channel
// D0 controls active channel bit for channel 1
// D7 controls active channel bit for channel 8
// ie active = 0x0005 sets active channel bits of channel 1 and 3 high, and
// channels 2, 4, 5, 6, 7, and 8 low
int __stdcall as_75sd1_getActiveChannel(HANDLE cardHandle, int channel, int * active);
// Reads back the active channel bit, of the specified channel (1 - 8), which:
// Enables for Status bits ( Reference, Signal, and Test Status ), for the specified channel.
// active = 1, status bits, for specified channel are enabled
// active = 0, status bits, for specified channel are disabled
int __stdcall as_75sd1_getActiveChannelAll(HANDLE cardHandle, int * active);
// Reads back the Active Channel byte.
// Each bit is associated with a channel. 1 = channel is active, 0 = channel is inactive
// D0 is Channel 1 Active channel bit,
// D7 is Channel 8 Active channel bit
int __stdcall as_75sd1_getSignalStatus(HANDLE cardHandle, int channel, int * status);
// Reads back the Signal Status Bit for specified channel ( 1 - 8 )
// Status bits are disabled if channel is not active. See datasheet
int __stdcall as_75sd1_getSignalStatusAll(HANDLE cardHandle, int * status);
// Reads back the Signal Status for all channels with one word.
// Each bit is associated with a channel
// D0 indicates Channel 1 Signal Status,
// D7 indicates Channel 8 Signal Status,
// Status bits are disabled if channel is not active. See datasheet
int __stdcall as_75sd1_getRefStatus(HANDLE cardHandle, int channel, int * status);
// Reads back the Reference Status Bit for input reference on specified channel ( 1 - 8 )
// Status bits are disabled if channel is not active. See datasheet
int __stdcall as_75sd1_getRefStatusAll(HANDLE cardHandle, int * status);
// Reads back the Reference Status Bit for input reference, with one word.
// Each bit is associated with a channel
// D0 indicates Channel 1 Reference Status,
// D7 indicates Channel 8 Reference Status,
// Status bits are disabled if channel is not active. See datasheet
int __stdcall as_75sd1_getTestStatus(HANDLE cardHandle, int channel, int * testStatus);
// Reads back the Test Status Bit for wrap-around test on specified channel ( 1 - 8 )
// Status bits are disabled if channel is not active. See datasheet
int __stdcall as_75sd1_getTestStatusAll(HANDLE cardHandle, int * testStatus);
// Reads back the Test Status Bit for wrap-around test, with one word. Each bit is associated
// with a channel
// D0 indicates Channel 1 Test Status,
// D7 indicates Channel 8 Test Status,
// Status bits are disabled if channel is not active. See datasheet
/********** VELOCITY & ANGLE DELTA ***********/
int __stdcall as_75sd1_setVelScale(HANDLE cardHandle, int channel, int velScale);
// Sets the Velocity Scale word for the specified channel (1 - 8)
// VelScale = 4095 to 65535
// see datasheet for further details
int __stdcall as_75sd1_getVelScale(HANDLE cardHandle, int channel, int * velScale);
// Reads back the Velocity Scale word for the specified channel (1 - 8)
// VelScale = 4095 to 65535
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -