Overview about available DELIB-Functions
General
General Handling
DapiOpenModule
ULONG DapiOpenModule(ULONG moduleID, ULONG nr);
This function opens a particular module. p>
DapiCloseModule
ULONG DapiCloseModule(ULONG handle);
This command closes an opened module. p>
DapiGetLastError
ULONG DapiGetLastError();
This function returns the last registered error. p>
DapiGetLastErrorText
ULONG DapiGetLastErrorText(unsigned char * msg, unsigned long msg_length);
This function reads the text of the last registered error. p>
DapiGetDELIBVersion
ULONG DapiGetDELIBVersion(ULONG mode, ULONG par);
This function returns the installed DELIB version. p>
Special
Special functions
DapiSpecialCommand - DapiSpecialCMDGetModuleConfig
ULONG DapiSpecialCommand(ULONG handle, DAPI_SPECIAL_CMD_GET_MODULE_CONFIG, par, 0, 0);
This command returns the hardware equipment (number of in-/output channels) of the module. p>
Digital-input
Digital input functions
DapiDIGet1
ULONG DapiDIGet1(ULONG handle, ULONG ch);
This command reads a single digit input. p>
DapiDIGet8
ULONG DapiDIGet8(ULONG handle, ULONG ch);
This command reads 8 digital inputs simultaneously. p>
DapiDIGet16
ULONG DapiDIGet16(ULONG handle, ULONG ch);
This command reads 16 digital inputs simultaneously. p>
DapiDIGet32
ULONG DapiDIGet32(ULONG handle, ULONG ch);
This command reads 32 digital inputs simultaneously. p>
DapiDIGet64
ULONGLONG DapiDIGet64(ULONG handle, ULONG ch);
This command reads 64 digital inputs simultaneously. p>
DapiDIGetFF32
ULONG DapiDIGetFF32(ULONG handle, ULONG ch);
This command reads the flip-flops from the inputs and resets them.
(Input state change). p>
DapiDIGetCounter
ULONG DapiDIGetCounter(ULONG handle, ULONG ch, ULONG mode);
This command reads the counter of a digital input. p>
Special
Special functions
DapiSpecialCommand - DapiSpecialCounterLatchAll
void DapiSpecialCommand(ULONG handle, DAPI_SPECIAL_CMD_COUNTER, DAPI_SPECIAL_COUNTER_LATCH_ALL, 0, 0);
This command saves the counters of all digital inputs simultaneously into a temporary storage (latch).
So, after that, the counter of the latch can be read successively.
Here, the speciality is, that it is possible to "freeze" simultaneously the counter and the frozen counter (latch) can be read one by one. p>
DapiSpecialCommand - DapiSpecialCounterLatchAllWithReset
void DapiSpecialCommand(ULONG handle, DAPI_SPECIAL_CMD_COUNTER, DAPI_SPECIAL_COUNTER_LATCH_ALL_WITH_RESET, 0, 0);
This command saves the counters of all digital inputs simultaneously into a temporary storage (latch). In addition, the counters of the digital inputs will be reset. p>
Digital-output
Digital output functions
DapiDOSet1
void DapiDOSet1(ULONG handle, ULONG ch, ULONG data);
This is the command to set a single output. p>
DapiDOSet8
void DapiDOSet8(ULONG handle, ULONG ch, ULONG data);
This command sets 8 digital outputs simultaneously. p>
DapiDOSet16
void DapiDOSet16(ULONG handle, ULONG ch, ULONG data);
This command sets 16 digital outputs simultaneously. p>
DapiDOSet32
void DapiDOSet32(ULONG handle, ULONG ch, ULONG data);
This command sets 32 digital outputs simultaneously. p>
DapiDOSet64
void DapiDOSet64(ULONG handle, ULONG ch, ULONGLONG data);
This command is to set 64 digital outputs. p>
DapiDOSet1_WithTimer
void DapiDOSet1_WithTimer(ULONG handle, ULONG ch, ULONG data, ULONG time_ms);
This function sets a digital output (ch) to a value (data - 0 or 1) for a specified time in msec. p>
DapiDOReadback32
ULONG DapiDOReadback32(ULONG handle, ULONG ch);
This command reads back the 32 digital outputs. p>
DapiDOReadback64
ULONGLONG DapiDOReadback64(ULONG handle, ULONG ch);
This command reads back the 64 digital outputs. p>
Special
Special functions
DapiSpecialCommand - DapiSpecialCMDTimeout
void DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT, cmd, par1, par2);
This command serves to set the timeout time p>
DapiSpecialCommand - DapiSpecialCMDTimeoutGetStatus
ULONG DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_TIMEOUT, DAPI_SPECIAL_TIMEOUT_GET_STATUS, 0, 0);
This command reads the timeout status. p>
Analog-input
Analog input functions
DapiADSetMode
void DapiADSetMode(ULONG handle, ULONG ch, ULONG mode);
This is the command to configure the input range of an A/D converter. p>
DapiADGetMode
ULONG DapiADGetMode(ULONG handle, ULONG ch);
This command reads the set mode of an A/D converter . For mode description see DapiADSetMode. p>
DapiADGet
ULONG DapiADGet(ULONG handle, ULONG ch);
This command reads a data value of one channel of an A/D converter p>
DapiADGetVolt
float DapiADGetVolt(ULONG handle, ULONG ch);
This command reads a data value of one channel of an A/D converter in volts. p>
DapiADGetmA
float DapiADGetmA(ULONG handle, ULONG ch);
This command reads a data value of one channel of an A/D converter in mA. p>
DapiTempGet
float DapiTempGet(ULONG handle, ULONG ch);
Dieser Befehl liest einen Temperatur Kanal. p>
Analog-out
Analog output functions
DapiDASetMode
void DapiDASetMode(ULONG handle, ULONG ch, ULONG mode);
This command sets the mode for a D/A converter. p>
DapiDAGetMode
ULONG DapiDAGetMode(ULONG handle, ULONG ch);
This command reads back the chosen mode of a D/A converter. p>
DapiDASet
void DapiDASet(ULONG handle, ULONG ch, ULONG data);
This command transfers a data value to a channel of a D/A converter. p>
DapiDASetVolt
void DapiDASetVolt(ULONG handle, ULONG ch, float data);
This command sets a voltage to a channel of a D/A converter. p>
DapiDASetmA
void DapiDASetmA(ULONG handle, ULONG ch, float data);
This command sets a current to a channel of a D/A converter. p>
Special
Special functions
DapiSpecialCommand - DapiSpecialCMD_DA
void DapiSpecialCommand(handle, DAPI_SPECIAL_CMD_DA, cmd, ch, 0);
This command sets the voltage/current value to a D/A channel at powering up or after a timeout. (EEPROM Configuration) p>
Digital-input
Digital input functions
DapiCnt48ModeSet
void DapiCnt48ModeSet(ULONG handle, ULONG ch, ULONG mode);
This command sets the count mode for a single input channel. p>
DapiCnt48ModeGet
ULONG DapiCnt48Modeget(ULONG handle, ULONG ch);
This command returns the count mode of a single input channel. p>
DapiCnt48CounterGet32
ULONG DapiCnt48CounterGet32(ULONG handle, ULONG ch);
This command reads the first 32 bits of a 48 bit input counter. p>
DapiCnt48CounterGet48
ULONGLONG DapiCnt48CounterGet48(ULONG handle, ULONG ch);
This command reads a 48 bit counter of an input counter. p>
Special
Special functions
DapiSpecialCommand - DapiSpecialCMDSetDirDX_1
void DapiSpecialCommand(ULONG handle, DAPI_SPECIAL_CMD_SET_DIR_DX_1, ULONG ch, ULONG dir, 0);
This command sets the direction of the TTL-In/Outputs (1-Bit) p>
DapiSpecialCommand - DapiSpecialCMDSetDirDX_8
void DapiSpecialCommand(ULONG handle, DAPI_SPECIAL_CMD_SET_DIR_DX_8, ULONG ch, ULONG dir, 0);
This command sets the direction of the TTL-In/Outputs (8-Bit way) p>
Watchdog
Watchdog functions
DapiWatchdogEnable
void DapiWatchdogEnable(ULONG handle);
This function enables the watchdog. p>
DapiWatchdogDisable
void DapiWatchdogDisable(ULONG handle);
This function disables the watchdog. p>
DapiWatchdogRetrigger
void DapiWatchdogRetrigger(ULONG handle);
This function retriggers the watchdog timer. p>
Watchdog-Special
ULONG DapiSpecialCommand(ULONG handle, DAPI_SPECIAL_CMD_WATCHDOG, cmd, par1, 0);
This command returns or sets different status information of the Watchdog Stick p>
Stepper
Stepper motor functions
DapiStepperCommandEx
ULONG DapiStepperCommandEx(ULONG handle, ULONG motor, ULONG cmd, ULONG par1, ULONG par2, ULONG par3, ULONG par4, ULONG par5, ULONG par6, ULONG par7);
This extended command controls stepper motors. p>
DapiStepperCommand - DapiStepperCmdStop
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_STOP, 0, 0, 0, 0);
This command is used to stop the motor, the deceleration slope will be used. p>
DapiStepperCommand - DapiStepperCommand_GoPosition
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_GO_POSITION, position, 0, 0, 0);
With this command the motor will drive to a position. This command can only be used when the motor is not disabled and Go_Position or Go_Reference are not executed. p>
DapiStepperCommand - DapiStepperCommand_GoPosition_Relative
void DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_GO_POSITION_RELATIVE, go_pos_rel_par, 0, 0, 0);
With this command the motor will go to a relative position. In contrast to the command GO_POSITION, which goes to an absolute position, this command considers the current position. This command can only be used when the motor is not disabled and Go_Position or Go_Reference are not executed. p>
DapiStepperCommand - DapiStepperCommand_GoRefswitch
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_GO_REFSWITCH, par1, par2, par3, 0);
The motor goes to the referece position. p>
DapiStepperCommand - DapiStepperCommand_Fullstop
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_FULLSTOP, 0, 0, 0, 0);
This command is used to stop the motors immediately without using the the deceleration slope. After this command the motor position might be ignorred because the motor has been stopped uncontrolled. p>
DapiStepperCommand - DapiStepperCommand_Disable
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_DISABLE, par1, 0, 0, 0);
This command ist used to disable/enable the motor. The motor stops or starts driving. This command can be only used when the motor stopped. p>
DapiStepperCommand - DapiStepperCommand_SetPosition
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_SET_POSITION, par1, 0, 0, 0);
This command ist used to set the motor position. The resolution ist 1/16 Full-step. This command may be used anytime. p>
DapiStepperCommand - DapiStepperCommand_SetFrequency
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_SET_FREQUENCY, par1, 0, 0, 0);
This command is used to set the motor reference frequency. The motor frequency regulation takes on the compliance of the acceleration and deceleration slope. Step losses do not occur. The motor reference frequency is related to the full-step-mode.
The direction will be defined by the prefix. If the motor reference frequency is higher than the maximum frequency, the command is ignored.
With closed Endswitch1 the motor can only drive in positive direction, with closed Endswitch2 the motor can only drive in negative direction, otherwise the command is ignored. p>
DapiStepperCommand - DapiStepperCommand_SetFrequencyDirectly
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_SET_FREQUENCY_DIRECTLY, par1, 0 ,0 ,0);
This command is used to set the motor frequency. The motor frequency regulation takes no funktion on the compliance of the acceleration and deceleration slope. The user is responsible. Step losses can occur. The motor reference frequency is related to the full-step. The direction can be defined by the prefix.
The motor frequency can't exceed the maximum frequency. p>
DapiStepperCommand - DapiStepperCommand_GetFrequency
ULONG DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_GET_FREQUENCY, 0, 0 ,0 ,0);
This command is used to read the motor frequency. This command can be used everytime. p>
DapiStepperCommand - DapiStepperCommand_SetMotorcharacteristic
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_SET_MOTORCHARACTERISTIC, par1, par2, 0, 0);
With this command, you can set motor characteristics. p>
DapiStepperCommand - DapiStepperCommand_GetMotorcharacteristic
ULONG DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_GET_MOTORCHARACTERISTIC, par1, 0, 0, 0);
With this command, motor specific parameter can be read. This command may be used everytime. It is splitted in sub commands, that are analog to the parameters of the DAPI_STEPPER_CMD_SET_MOTORCHARATERISTIC p>
DapiStepperCommand - DapiStepperCommand_MotorcharacteristicLoadDefault
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_MOTORCHARACTERISTIC_LOAD_DEFAULT, 0, 0, 0, 0);
The characteristic of the motor is set back to default. p>
DapiStepperCommand - DapiStepperCommand_MotorcharacteristicEEPROMSave
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_MOTORCHARACTERISTIC_EEPROM_SAVE, 0, 0, 0, 0);
The current motor characteristic will be stored in the EEPROM. p>
DapiStepperCommand - DapiStepperCommand_MotorcharacteristicEEPROMLoad
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_MOTORCHARACTERISTIC_EEPROM_LOAD, 0, 0, 0, 0);
The motor characteristic can be loaded from the EEPROM. p>
DapiStepperCommand - DapiStepperCommand_GetCPUTemp
ULONG DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_GET_CPU_TEMP, 0, 0, 0, 0);
The temperature of the CPU can be read. p>
DapiStepperCommand - DapiStepperCommand_GetMotorSupplyVoltage
DapiStepperCommand(handle, motor, DAPI_STEPPER_CMD_GET_MOTOR_SUPPLY_VOLTAGE, 0, 0, 0, 0);
The voltage supply of the motor can be read. p>
DapiStepperGetStatus - DapiStepperGetStatus_GetPosition
ULONG DapiStepperGetStatus(handle, motor, cmd);
With this command the motor position can be read. p>
DapiStepperGetStatus - DapiStepperGetStatus_GetSwitch
ULONG DapiStepperGetStatus(handle, motor, cmd);
With this command, the status of the switches can be read. p>
DapiStepperGetStatus - DapiStepperGetStatus_GetActivity
ULONG DapiStepperGetStatus(handle, motor, DAPI_STEPPER_STATUS_GET_ACTIVITY);
With this command, some status informations (e.g. activity of the motor phase current) can be read. p>
Special
Special functions
DapiPing
ULONG DapiPing(ULONG handle, ULONG value);
This command checks the connection of an opened module. p>
DapiWriteByte
void DapiWriteByte(ULONG handle, ULONG adress, ULONG value);
This command performs a direct register write command to the module. p>
DapiWriteWord
void DapiWriteWord(ULONG handle, ULONG adress, ULONG value);
This command performs a direct register write command to the module. p>
DapiWriteLong
void DapiWriteLong(ULONG handle, ULONG adress, ULONG value);
This command performs a direct register write command to the module. p>
DapiWriteLongLong
void DapiWriteLongLong(ULONG handle, ULONG adress, ULONGLONG value);
This command performs a direct register write command to the module. p>
DapiReadByte
ULONG DapiReadByte(ULONG handle, ULONG adress);
This command performs a direct register read command to the module. p>
DapiReadWord
ULONG DapiReadWord(ULONG handle, ULONG adress);
This command performs a direct register read command to the module. p>
DapiReadLong
ULONG DapiReadLong(ULONG handle, ULONG adress);
This command performs a direct register read command to the module. p>
DapiReadLongLong
ULONGLONG DapiReadLongLong(ULONG handle, ULONG adress);
This command performs a direct register read command to the module. p>
