Sie sind auf Seite 1von 317

Standardsoftware

APCI-3xxx (Standard)

9
9.1

STANDARDSOFTWARE
Softwarefunktionen
ADDIPACK untersttzt die folgenden Funktionen fr die APCI-3xxx Tabelle 9-1: Untersttzte Software-Funktionen Funktionalitt Analoge Eingnge (APCI-3016, APCI-3116) Funktionsname b_ADDIDATA_GetNumberOfAnalogInputs b_ADDIDATA_GetNumberOfAnalogInputModules b_ADDIDATA_GetNumberOfAnalogInputsForTheModule b_ADDIDATA_GetAnalogInputModuleNumber b_ADDIDATA_GetAnalogInputModuleGeneralInformation Ausgabe: - Auflsung: 16-Bit - Unipolar / bipolar konfigurierbar - verfgbare Konvertierungszeit: s, ms - Konvertierungsauflsung: 16-Bit - Min. Konvertierungszeit: 5 s b_ADDIDATA_GetAnalogInputModuleSingleAcquisitionInforma tion Ausgabe: - Interrupt vorhanden Vorhandene Gains: 1, 2, 5, 10 Hardware-/Softwaretrigger vorhanden Kein Hardwaregate Zugriffs-Mode: 32-Bit b_ADDIDATA_GetAnalogInputModuleAutoRefreshInformation Ausgabe: - Interrupt nicht vorhanden Vorhandene Gains: 1, 2, 5, 10 Hardware-/Softwaretrigger vorhanden Kein Hardwaregate Zugriffs-Mode: 32-Bit

54

APCI-3xxx (Standard)

Standardsoftware

Funktionalitt
-

Funktionsname b_ADDIDATA_GetAnalogInputModuleSCANInformation Ausgabe: - Vorhandene Gains: 1, 2, 5, 10 Hardware-/Softwaretrigger vorhanden Kein Hardwaregate EinzelSCAN Zyklus-Mode vorhanden xSCAN Zyklus-Mode vorhanden Kontinuierlicher SCAN Zyklus-Mode vorhanden Verzgerung vorhanden Vorhandenes Verzgerungstiming: s, ms Auflsung Verzgerungszeit: 16-Bit b_ADDIDATA_GetAnalogInputModuleSequenceInformation Ausgabe: - Vorhandene Gains: 1, 2, 5, 10 Hardware-/Softwaretrigger vorhanden Kein Hardwaregate Einzelzyklus-Mode vorhanden xZyklus-Mode vorhanden Kontinuierlicher Sequenz-Zyklus-Mode vorhanden Verzgerung mglich Vorhandenes Verzgerungstiming: s, ms Auflsung Verzgerungszeit: 16-Bit

b_ADDIDATA_InitAnalogInput Vorhandene Parameter: - Gain: 1, 2, 5, 10 Polaritt: Unipolar/bipolar Offset-Bereich:Nicht verwendet Coupling: DC b_ADDIDATA_ReleaseAnalogInput b_ADDIDATA_Read1AnalogInput Vohandene Parameter: - Interrupt: Aktiv/inaktiv - Einheit Konvertierungszeit: s/ms - Konvertierungszeit: 5 bis 65535 bei s 1 bis 65535 bei ms b_ADDIDATA_ConvertDigitalToRealAnalogValue b_ADDIDATA_ConvertMoreDigitalToRealAnalogValues b_ADDIDATA_GetAutoRefreshAcquisitionChannelPointer b_ADDIDATA_GetAutoRefreshAcquisitionModulePointer

55

Standardsoftware

APCI-3xxx (Standard)

Funktionalitt

Funktionsname b_ADDIDATA_GetAnalogInputAutoRefreshModuleCounterPoint er b_ADDIDATA_StartAutoRefreshAcquisition Vorhandene Parameter: - Einheit Konvertierungszeit: s/ms - Konvertierungszeit: 5 bis 65535 bei s 1 bis 65535 bei ms b_ADDIDATA_StopAutoRefreshAcquisition b_ADDIDATA_InitAnalogInputSCANAcquisition Vorhandene Parameter: - Einheit Konvertierungszeit:s/ms - Konvertierungszeit: 5 bis 65535 bei s 1 bis 65535 bei ms - Scan-Mode: Einzel/X Zyklus/ kontinuierlich - Verzgerungs-Mode: Nicht verwendet/Mode1/Mode2 - Verzgerungs-Timing: s/ms b_ADDIDATA_StartAnalogInputSCAN b_ADDIDATA_GetAnalogInputSCANStatus b_ADDIDATA_ConvertDigitalToRealAnalogValueSCAN b_ADDIDATA_StopAnalogInputSCAN b_ADDIDATA_CloseAnalogInputSCAN b_ADDIDATA_InitAnalogInputSequenceAcquisition Vorhandene Parameter: - Einheit Konvertierungszeit:s/ms - Konvertierungszeit: 5 bis 65535 bei s 1 bis 65535 bei ms - Mode: X Zyklus/kontinuierlich - Verzgerungs-Mode: Nicht verwendet/Mode1/Mode2 - Verzgerungs-Timing: s/ms b_ADDIDATA_StartAnalogInputSequenceAcquisition b_ADDIDATA_ConvertDigitalToRealAnalogValueSequenceAcq uisition b_ADDIDATA_GetSequenceAcquisitionCounter b_ADDIDATA_StopAnalogInputSequenceAcquisition b_ADDIDATA_ReleaseAnalogInputSequenceAcquisition b_ADDIDATA_GetAnalogInputHardwareTriggerInformation Rckgabe: - High-/Low-Level auswhlbar - Kann verwendet werden fr Autorefresh, SCAN, Sequenz, Einzelkonvertierung

56

APCI-3xxx (Standard)

Standardsoftware

Funktionalitt

Funktionsname - Max Triggerzhler ist 65535 (16-Bit) - One shot Trigger-Mode vorhanden - Einzelzyklus-Trigger-Mode vorhanden - X Zyklus Trigger-Mode vorhanden b_ADDIDATA_EnableDisableAnalogInputHardwareTrigger Parameter: - Level: High/Low - Aktion: Autorefresh/SCAN/Sequenz, Einzelkonvertierung One shot Einzelzyklus x Zyklus b_ADDIDATA_GetAnalogInputHardwareTriggerStatus b_ADDIDATA_GetAnalogInputSoftwareTriggerInformation Rckgabe: - Kann fr Autorefresh, SCAN, Sequenz, Einzelkonvertierung verwendet werden - One shot Trigger-Mode vorhanden - Einzelzyklus-Trigger-Mode vorhanden - X Zyklus Trigger-Mode vorhanden b_ADDIDATA_EnableDisableAnalogInputSoftwareTrigger Vorhandene Parameter: - Aktion: Autorefresh/SCAN/Sequenz One shot Einzelzyklus x Zyklen b_ADDIDATA_GetAnalogInputSoftwareTriggerStatus b_ADDIDATA_GetNumberOfAnalogInputs b_ADDIDATA_GetNumberOfAnalogInputModules b_ADDIDATA_GetNumberOfAnalogInputsForTheModule b_ADDIDATA_GetAnalogInputModuleNumber b_ADDIDATA_GetAnalogInputModuleGeneralInformation Rckgabe: -Auflsung: 12-Bit - Unipolar/bipolar konfigurierbar - Verfgbares Konvertierungstiming: s, ms - Konvertierungsauflsung: 16-Bit - Min. Konvertierungszeit 5s

Analoge Eingnge (APCI-3010, APCI-3110)

57

Standardsoftware

APCI-3xxx (Standard)

Funktionalitt

Funktionsname b_ADDIDATA_GetAnalogInputModuleSingleAcquisitionInforma tion Return: - Interrupt vorhanden - Vorhandene Gains: 1, 2, 5, 10 - Kein Hardware/Software-Trigger - Kein Hardwaregate b_ADDIDATA_GetAnalogInputModuleAutoRefreshInformation Return: - Interrupt nicht vorhanden - Vorhandene Gains: 1, 2, 5, 10 - Hardware-/Softwaretrigger vorhanden - Kein Hardwaregate - Zugriffs-Mode: 32-Bit b_ADDIDATA_GetAnalogInputModuleSCANInformation Rckgabe: - Vorhandene Gains: 1, 2, 5, 10 - Hardware-/Softwaretrigger vorhanden - Kein Hardwaregate - Einzel SCAN Zyklus-Mode vorhanden -X SCAN Zyklus-Mode vorhanden - Kontinuierlicher SCAN Zyklus-Mode vorhanden - Verzgerung vorhanden - Vorhandenes Verzgerungstiming: s, ms - Auflsung Verzgerungszeit: 16-Bit b_ADDIDATA_GetAnalogInputModuleSequenceInformation Rckgabe: - Vorhandene Gains: 1, 2, 5, 10 - Hardware-/Softwaretrigger vorhanden - Kein Hardwaregate - Einzelsequenz-Mode vorhanden - X Sequenz-Mode vorhanden - Kontinuierlicher Sequenz-Mode vorhanden - Vorhandene Verzgerung - Vorhandenes Verzgerungstiming: s, ms - Auflsung Verzgerungszeit: 16-Bit b_ADDIDATA_InitAnalogInput Vorhande Parameter: - Gain: 1, 2, 5, 10 - Polaritt: Unipolar/Bipolar - Offset-Beeich: Nicht verwendet - Coupling DC b_ADDIDATA_ReleaseAnalogInput

58

APCI-3xxx (Standard)

Standardsoftware

Funktionalitt

Funktionsname b_ADDIDATA_Read1AnalogInput Vorhandene Parameter: - Interrupt: Akiviert/deaktiviert - Einheit Konvertierungszeit: s/ms - Konvertierungszeit: 5 bis 65535 bei s 1 bis 65535 bei ms b_ADDIDATA_ReadMoreAnalogInputs Vorhandene Parameter: - Interrupt: Aktiviert/deaktiviert - Einheit Konvertierungszeit: s/ms - Konvertierungszeit: 5 bis 65535 bei s 1 bis 65535 bei ms b_ADDIDATA_ConvertDigitalToRealAnalogValue b_ADDIDATA_ConvertMoreDigitalToRealAnalogValues b_ADDIDATA_GetAutoRefreshAcquisitionChannelPointer b_ADDIDATA_GetAutoRefreshAcquisitionModulePointer b_ADDIDATA_GetAnalogInputAutoRefreshModuleCounterPoint er b_ADDIDATA_StartAutoRefreshAcquisition Vorhandene Parameter: - Einheit Konvertierungszeit: s/ms - Konvertierungszeit: 5 bis 65535 bei s 1 bis 65535 bei ms b_ADDIDATA_StopAutoRefreshAcquisition b_ADDIDATA_InitAnalogInputSCANAcquisition Vorhandene Parameter: - Einheit Konvertierungszeit:s/ms - Konvertierungszeit: 5 bis 65535 bei s 1 bis 65535 bei ms - Mode: Einzel/X Zyklus/ kontinuierlich - Verzgerungs-Mode: Nicht verwendet/Mode1/Mode2 - Verzgerungstiming: s/ms b_ADDIDATA_StartAnalogInputSCAN b_ADDIDATA_GetAnalogInputSCANStatus b_ADDIDATA_ConvertDigitalToRealAnalogValueSCAN b_ADDIDATA_StopAnalogInputSCAN b_ADDIDATA_CloseAnalogInputSCAN 59

Standardsoftware

APCI-3xxx (Standard)

Funktionalitt

Funktionsname b_ADDIDATA_InitAnalogInputSequenceAcquisition Vorhandene Parameter: - Einheit Konvertierungszeit: s/ms - Konvertierungszeit; 5 bis 65535 bei s 1 bis 65535 bei ms - Scan-Mode: X Zyklus/ kontinuierlich - Verzgerungs-Mode: Nicht verwendet/Mode1/Mode2 - Verzgerungstiming: s/ms b_ADDIDATA_StartAnalogInputSequenceAcquisition b_ADDIDATA_ConvertDigitalToRealAnalogValueSequenceAcq uisition b_ADDIDATA_GetSequenceAcquisitionCounter b_ADDIDATA_StopAnalogInputSequenceAcquisition b_ADDIDATA_ReleaseAnalogInputSequenceAcquisition b_ADDIDATA_GetAnalogInputHardwareTriggerInformation Rckgabe: - High-/Low-Level auswhlbar - Kann fr Autorefresh, SCAN und Sequenz verwendet werden - Max. Triggerzhler ist 65535 (16-Bit) - One shot Trigger-Mode vorhanden - Einzelzyklustrigger-Mode vorhanden - X-Zyklustrigger-Mode vorhanden. b_ADDIDATA_EnableDisableAnalogInputHardwareTrigger Vorhandene Parameter: - Level: High/Low - Aktion: Autorefresh/SCAN/Sequenz One shot Einzelzyklus x Zyklen b_ADDIDATA_GetAnalogInputHardwareTriggerStatus b_ADDIDATA_GetAnalogInputSoftwareTriggerInformation Rckgabe: - Kann verwendet werden fr Autorefresh, SCAN, Sequenz - One shot Trigger-Mode vorhanden - Einzelzyklustrigger-Mode vorhanden - X Zyklen Trigger-Mode vorhanden

60

APCI-3xxx (Standard)

Standardsoftware

Funktionalitt

Funktionsname Vorhandene Parameter: - Aktion: Autorefresh/SCAN/Sequenz One shot Einzelzyklus x-Zyklen b_ADDIDATA_GetAnalogInputSoftwareTriggerStatus

Analoge Ausgnge (APCI-3110, APCI-3116)

b_ADDIDATA_GetNumberOfAnalogOutputs Rckgabe: - Vorhandene Spannungs-Modes: 2 - Mode 0: Bipolar (12-Bit) - Mode 1: Unipolar (11-Bit) - Keine Synchronisierung vorhanden b_ADDIDATA_Init1AnalogOutput Vorhandene Parameter: - Vorhandene Spannungs-Modes : 2 - Mode 0: Bipolar (12-Bit) - Mode 1: Unipolar (11-Bit) - Keine Synchronisierung vorhanden b_ADDIDATA_InitMoreAnalogOutputs Vorhandene Parameter: - Vorhandene Spannungs-Modes: 2 - Mode 0: Bipolar (12-Bit) - Mode 1: Unipolar (11-Bit) - Keine Synchronisierung vorhanden b_ADDIDATA_Write1AnalogOutput b_ADDIDATA_WriteMoreAnalogOutputs b_ADDIDATA_Release1AnalogOutput b_ADDIDATA_ReleaseMoreAnalogOutputs b_ADDIDATA_GetAnalogOutputInformation() Synchronisierung fr den analogen Ausgang vorhanden = Nein Anzahl der vorhandenen Spannungsmodes = 2 Information Spannungsmode 0: Auflsung = 12-Bit Max. Ausgangswert = 10 V Auswahl der Polaritt ber Hardware = Nein Auswahl der Polaritt ber Software = Ja Unipolar konfigurierbar = Nein Bipolar konfigurierbar = Ja Information Spannungsmode 1: Auflsung = 11-Bit 61

Standardsoftware

APCI-3xxx (Standard)

Funktionalitt

Funktionsname Max. Ausgangswert = 10 V Auswahl der Polaritt ber Hardware = Nein Auswahl der Polaritt via Software = Ja Unipolar konfigurierbar = Ja Bipolar konfigurierbar = Nein

24 V Ausgnge (APCI-3010, APCI-3016, APCI-3110, APCI-3116)

b_ADDIDATA_GetNumberOfDigitalOutputs b_ADDIDATA_GetDigitalOutputInformation Rckgabe: Ausgangstyp : 24 V Kein Interrupt vorhanden b_ADDIDATA_SetDigitalOutputMemoryOn b_ADDIDATA_SetDigitalOutputMemoryOff b_ADDIDATA_Set1DigitalOutputOn b_ADDIDATA_Set1DigitalOutputOff b_ADDIDATA_Set2DigitalOutputOn b_ADDIDATA_Set2DigitalOutputOff b_ADDIDATA_Set4DigitalOutputOn b_ADDIDATA_Set4DigitalOutputOff b_ADDIDATA_Set8DigitalOutputOn b_ADDIDATA_Set8DigitalOutputOff b_ADDIDATA_Set16DigitalOutputOn b_ADDIDATA_Set16DigitalOutputOff b_ADDIDATA_Set32DigitalOutputOn b_ADDIDATA_Set32DigitalOutputOff b_ADDIDATA_Get1DigitalOutputStatus b_ADDIDATA_Get2DigitalOutputStatus b_ADDIDATA_Get4DigitalOutputStatus b_ADDIDATA_Set8DigitalOutputsOff b_ADDIDATA_Set16DigitalOutputsOn b_ADDIDATA_Set16DigitalOutputsOff b_ADDIDATA_Set32DigitalOutputsOn b_ADDIDATA_Set32DigitalOutputsOff b_ADDIDATA_Get1DigitalOutputStatus b_ADDIDATA_Get2DigitalOutputStatus

62

APCI-3xxx (Standard)

Standardsoftware

Funktionalitt

Funktionsname b_ADDIDATA_Get4DigitalOutputStatus

TTLAusgnge (APCI-3110, APCI-3116, APCI-3010, APCI-3016)

b_ADDIDATA_GetNumberOfDigitalOutputs b_ADDIDATA_GetDigitalOutputInformation Return: Ausgangstyp: TTL Kein Interrupt vorhanden b_ADDIDATA_SetDigitalOutputMemoryOn b_ADDIDATA_SetDigitalOutputMemoryOff b_ADDIDATA_Set1DigitalOutputOn b_ADDIDATA_Set1DigitalOutputOff b_ADDIDATA_Set2DigitalOutputOn b_ADDIDATA_Set2DigitalOutputOff b_ADDIDATA_Set4DigitalOutputOn b_ADDIDATA_Set4DigitalOutputOff b_ADDIDATA_Set8DigitalOutputOn b_ADDIDATA_Set8DigitalOutputOff b_ADDIDATA_Set16DigitalOutputOn b_ADDIDATA_Set16DigitalOutputOff b_ADDIDATA_Set32DigitalOutputOn b_ADDIDATA_Set32DigitalOutputOff b_ADDIDATA_Get1DigitalOutputStatus b_ADDIDATA_Get2DigitalOutputStatus b_ADDIDATA_Get4DigitalOutputStatus

24 V-Eingnge b_ADDIDATA_GetNumberOfDigitalInputs (APCI-3010, APCI-3016, APCI-3110, APCI-3116) b_ADDIDATA_GetDigitalInputInformationEx Rckgabe: Eingangstyp : 24 V Kein Interrupt vorhanden b_ADDIDATA_Read1DigitalInput b_ADDIDATA_Read2DigitalInputs b_ADDIDATA_Read4DigitalInputs b_ADDIDATA_Read8DigitalInputs b_ADDIDATA_Read16DigitalInputs b_ADDIDATA_Read32DigitalInputs 63

Standardsoftware

APCI-3xxx (Standard)

Funktionalitt

Funktionsname b_ADDIDATA_GetDigitalInputInformationEx Rckgabe: Eingangstyp : TTL Kein Interrupt vorhanden b_ADDIDATA_Read1DigitalInput b_ADDIDATA_Read2DigitalInputs b_ADDIDATA_Read4DigitalInputs b_ADDIDATA_Read8DigitalInputs b_ADDIDATA_Read16DigitalInputs b_ADDIDATA_Read32DigitalInputs b_ADDIDATA_GetNumberOfTimers b_ADDIDATA_GetTimerInformationEx Rckgabe: Interrupt vorhanden: 16-Bit Zeiteinehit vorhanden: s, ms, s Ausgang vorhanden: High/Low Vorhandene Modes: 2 and 3 b_ADDIDATA_InitTimer Vorhandene Parameter: Interrupt: Auflsung: Zeiteinheit: Modes: b_ADDIDATA_StartTimer b_ADDIDATA_StartAllTimers b_ADDIDATA_TriggerTimer b_ADDIDATA_TriggerAllTimers b_ADDIDATA_StopTimer b_ADDIDATA_StopAllTimers b_ADDIDATA_ReleaseTimer b_ADDIDATA_ReadTimerValue b_ADDIDATA_ReadTimerStatus

TTL-Eingnge b_ADDIDATA_GetNumberOfDigitalInputs (APCI-3010, APCI-3016, APCI-3110, APCI-3116)

Timer (APCI-3010, APCI-3016, APCI-3110, APCI-3116)

Aktiviert oder deaktiviert 16-Bit s oder ms oder s 2 oder 3

b_ADDIDATA_EnableDisableTimerInterrupt

64

APCI-3xxx (Standard)

Standardsoftware

Funktionalitt

Funktionsname b_ADDIDATA_EnableDisableTimerOutput Vorhandene Parameter: Aktion: Low oder High b_ADDIDATA_GetTimerHardwareOutputStatus b_ADDIDATA_ReleaseTimer b_ADDIDATA_TestTimerAsynchronousFIFOFull b_ADDIDATA_GetNumberOfCounters b_ADDIDATA_GetCounterInformationEx Rckgabe: Interrupt vorhanden Auflsung: 16-Bit Ausgang vorhanden: High/Low Vorhandener Zhler-Mode: Up/Down Vorhandene Einganglevels: High/Low b_ADDIDATA_InitCounter Vorhandene Parameter: Auflsung: 16-Bit Einganglevels: High/Low b_ADDIDATA_SetCounterDirection Vorhandene Parameter: Zhler-Mode: Up/Down b_ADDIDATA_EnableDisableCounterInterrupt b_ADDIDATA_StartCounter b_ADDIDATA_StartAllCounters b_ADDIDATA_ClearCounter b_ADDIDATA_TriggerCounter b_ADDIDATA_TriggerAllCounters b_ADDIDATA_StopCounter b_ADDIDATA_StopAllCounters b_ADDIDATA_ReleaseCounter b_ADDIDATA_ReadCounterValue b_ADDIDATA_ReadCounterStatus Vorhandene Parameter: Vorhandene Einganglevels: High/Low

Zhler (APCI-3010, APCI-3016, APCI-3110, APCI-3116)

b_ADDIDATA_GetCounterHardwareOutputStatus b_ADDIDATA_TestCounterAsynchronousFIFOFull

65

Standardsoftware

APCI-3xxx (Standard)

Funktionalitt Watchdog (APCI-3110, APCI-3116)

Funktionsname b_ADDIDATA_GetNumberOfWatchdogs b_ADDIDATA_GetWatchdogInformationEx Rckgabe: Interrupt vorhanden Auflsung: 16-Bit Ausgang vorhanden: High/Low Vorhandene Zeiteinheit: s, ms, s b_ADDIDATA_InitWatchdog Vorhandene Parameter: Auflsung: 16-Bit Zeiteinheit: s, ms, s b_ADDIDATA_EnableDisableWatchdogInterrupt b_ADDIDATA_StartWatchdog b_ADDIDATA_StartAllWatchdogs b_ADDIDATA_TriggerWatchdog b_ADDIDATA_TriggerAllWatchdogs b_ADDIDATA_StopWatchdog b_ADDIDATA_StopAllWatchdogs b_ADDIDATA_ReleaseWatchdog b_ADDIDATA_ReadWatchdogStatus b_ADDIDATA_EnableDisableWatchdogOutput Vorhandene Parameter: Vorhandene Einganglevels: High/Low b_ADDIDATA_GetWatchdogHardwareOutputStatus b_ADDIDATA_TestWatchdogAsynchronousFIFOFull

66

APCI-3xxx (Standard)

Standardsoftware

9.2

Softwarebeispiele
Tabelle 9-2: Untersttzte Softwarebeispiele fr die APCI-3xxx

Funktionalitt Analoge Eingnge

Nummer des Beispieles SAMPLE00 SAMPLE01 SAMPLE02

Beschreibung Zeigt 1 analoge Eingangsinformation Liest 1 analogen Eingangskanal ohne Interrupt. Der Benutzer gibt an, welchen Kanal er verwenden mchte. Liest 1 analogen Eingangskanal mit Interrupt. Der Benutzer gibt an, welchen Kanal er verwenden mchte. Der Benutzer gibt den Interrupt-Mode an (synchron, asynchron) Liest mehrere analoge Eingangskanle ohne Interrupt. Liest mehrere analoge Eingangskanle mit Interrupt. Der Benutzer gibt den Interrupt-Mode an (synchron, asynchron) Testet die Sequenzerfassung mit Interrupt. Der Benutzer gibt an, welchen Kanal er verwenden mchte. Der Benutzer gibt den Interrrupt-Mode an (synchron, asynchron) Der Benutzer gibt, falls vorhanden, den externen Trigger- und Gate-Mode an. Der Benutzer gibt an, ob er eine Verzgerung verwenden mchte und gibt ihre Zeit ein. Testet die Autorefresh Sequenzerfassung. Der Benutzer gibt an, welchen Kanal er verwenden mchte. Der Benutzer gibt, falls vorhanden, den externen Trigger- und Gate-Mode an. Initialisiert den SCAN mit Interrupt. Der Benutzer gibt, falls vorhanden, den externen Trigger- und Gate-Mode an. Der Benutzer gibt an, ob er die Verzgerung verwenden mchte und gibt ihre Zeit ein. Der Benutzer gibt den Interrupt-Mode (synchron, asynchron) an.

SAMPLE03 SAMPLE04 SAMPLE05

SAMPLE06

SAMPLE07

Digitale Eingnge

SAMPLE00 SAMPLE01

Bekommt die Informationen des ausgewhlten digitalen Eingangkanals Liest 1 digitalen Eingang

67

Standardsoftware

APCI-3xxx (Standard)

Funktionalitt

Nummer des Beispieles SAMPLE02 SAMPLE03 SAMPLE04 SAMPLE05 SAMPLE06 SAMPLE01

Beschreibung Liest 2 digitale Eingnge Liest 4 digitale Eingnge Liest 8 digitale Eingnge Liest 16 digitale Eingnge Liest 32 digitale Eingnge Testet 1 digitalen Ausgang mit oder ohne Ausgangsspeicheroption: Gibt, falls mglich, den Status des digitalen Ausgangs an. Testet 2 digitale Ausgnge mit oder ohne Ausgangsspeicheroption. Gibt, falls mglich, den Status der digitalen Ausgnge an. Testet 4 digitale Ausgnge mit oder ohne Ausgangsspeicheroption. Gibt, falls mglich, den Status der digitalen Ausgnge an. Testet 8 digitale Ausgnge mit oder ohne Ausgangsspeicheroption. Gibt, falls mglich, den Status der digitalen Ausgnge an. Testet 16 digitale Ausgnge mit oder ohne Ausgangsspeicheroption. Gibt, falls mglich, den Status des digitalen Ausgnge an. Testet 32 digitale Ausgnge mit oder ohne Ausgangsspeicheroption. Gibt, falls mglich, den Status des digitalen Ausgnge an. Zeigt alle Timerinformationen Initialisierung von 1 Timer ohne Interrupt. Der Benutzer kann den Timer durch Tastendruck triggern. Der Benutzer whlt den Timer aus, den er verwenden mchte. Der Benutzer gibt an, ob der HW-Gate, der HW-Trigger und der HW-Ausgang verwendet werden. Initialisierung von 1 Timer mit Interrupt. Der Benutzer kann den Timer durch Tastendruck triggern. Der Benutzer gibt den Timer an, den er verwenden mchte. Der Benutzer gibt an, ob der HW-Gate, der HW-Trigger und der HW-Ausgang verwendet werden. Der Benutzer gibt den Interrupt-Mode an (asynchron/synchron).

Digitale Ausgnge

SAMPLE02

SAMPLE03

SAMPLE04

SAMPLE05

SAMPLE06

Timer

SAMPLE00 SAMPLE01

SAMPLE02

68

APCI-3xxx (Standard)

Standardsoftware

Funktionalitt

Nummer des Beispieles SAMPLE03

Beschreibung Initialisierung von allen Timern ohne Interrupt. Der Benutzer kann den Timer durch Tastendruck triggern. Der Benutzer whlt den Timer aus, den er verwenden mchte. Der Benutzer gibt an, ob der HW-Gate, der HW-Trigger und der HW-Ausgang verwendet werden Initialisierung von allen Timern mit Interrupt. Der Benutzer kann den Timer durch Tastendruck triggern Der Benutzer gibt an, ob der HW-Gate, der HW-Trigger und der HW-Ausgang verwendet werden Der Benutzer gibt den Interrupt.Mode (asynchron/synchron) an. Zeigt alle Zhlerinformationen Initialisierung von 1 Zhler ohne Interrupt. Der Benutzer kann den Zhler durch Tastendruck triggern. Der Benutzer gibt an, welchen Zhler er testen mchte. Der Benutzer gibt an, ob der HW-Gate, der HW-Trigger und der HW-Ausgang verwendet werden Initialisierung von 1 Zhler mit Interrupt. Der Benutzer kann den Zhler durch Tastendruck triggern. Der Benutzer gibt an, welchen Zhler er testen mchte. Der Benutzer gibt an, ob der HW-Gate, der HW-Trigger und der HW-Ausgang verwendet werden Der Benutzer gibt den Interrupt-Mode an (asynchron/synchron) Initialisierung von allen Zhlern ohne Interrupt. Der Benutzer kann den Zhler durch Tastendruck triggern. Der Benutzer gibt an, welchen Zhler er testen mchte. Der Benutzer gibt an, ob der HW-Gate, der HW-Trigger und der HW-Ausgang verwendet werden Initialisierung von allen Zhlern mit Interrupt. Der Benutzer kann den Zhler durch Tastendruck triggern. Der Benutzer gibt an, welchen Zhler er testen mchte. Der Benutzer gibt an, ob der HW-Gate, der HW-Trigger und der HW-Ausgang verwendet werden Der Benutzer gibt den Interrupt-Mode (asynchron / synchron) an. Zeigt alle Watchdoginformationen 69

SAMPLE04

Zhler

SAMPLE00 SAMPLE01

SAMPLE02

SAMPLE03

SAMPLE04

Watchdog

SAMPLE00

Standardsoftware

APCI-3xxx (Standard)

Funktionalitt

Nummer des Beispieles SAMPLE01

Beschreibung Initialisierung von 1 Watchdog ohne Interrupt. Der Benutzer kann den Watchdog durch Tastendruck triggern. Der Benutzer whlt den Watchdog aus, den er verwenden mchte. Der Benutzer gibt an, ob der HW-Gate, der HW-Trigger und der HW-Ausgang verwendet werden Initialisierung von 1 Watchdog mit Interrupt. Der Benutzer kann den Watchdog durch Tastendruck triggern. Der Benutzer whlt den Watchdog aus, den er verwenden mchte. Der Benutzer gibt an, ob der HW-Gate, der HW-Trigger und der HW-Ausgang verwendet werden Der Benutzer gibt den Interrupt-Mode (asynchron/synchron) an. Initialisierung von allen Watchdogs ohne Interrupt. Der Benutzer kann den Watchdog durch Tastendruck triggern. Der Benutzer whlt den Watchdog aus, den er testen mchte. Der Benutzer gibt an, ob der HW-Gate, der HW-Trigger und der HW-Ausgang verwendet werden Initialisierung von allen Watchdogs mit Interrupt. Der Benutzer kann den Watchdog durch Tastendruck triggern. Der Benutzer whlt den Watchdog aus, den er testen mchte. Der Benutzer gibt an, ob der HW-Gate, der HW-Trigger und der HW-Ausgang verwendet werden. Der Benutzer gibt den Interrupt-Mode (asynchron/synchron) an. Zeigt 1 analoge Ausgangsinformation Schreib 1 analogen Ausgangswert ohne Synchronisierung (Rampengenerierung). Schreibt mehrere analoge Ausgangswerte ohne Synchronisierung (Rampengenerierung).

SAMPLE02

SAMPLE03

SAMPLE04

Analoge Ausgnge

SAMPLE00 SAMPLE01 SAMPLE02

70

Anschluss an die Peripherie

APCI-3xxx (Standard)

7
7.1

ANSCHLUSS AN DIE PERIPHERIE


Steckerbelegung
Abb. 7-1: 37-pol. SUB-D Stiftstecker (Analoge Ein- und Ausgnge)

30

APCI-3xxx (Standard)

Anschluss an die Peripherie

Abb. 7-2: 50-pol. Pfostenstecker (TTL E/A und 24 V E/A)

WICHTIG!
Die Nummerierung des 50-pol. SUB-D Steckers entspricht der blichen Zhlweise wie sie auch beim Stecker fr die LP-Montage aufgedruckt ist. Allerdings ist beim Stecker zur Verbindung an ein Flachbandkabel eine andere Zhlweise im Stecker eingeprgt (entspricht der Nummerierung des Flachband).

31

Anschluss an die Peripherie

APCI-3xxx (Standard)

Tabelle 7-1: Anschluss der digitalen Ein-/Ausgnge (24 V und TTL) Pinnummer am 50-pol. Pfostensteckers 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 Beschreibung Pinnummer am Frontblech des FB8001 (50-pol. SUB-D Stiftstecker) Ausgangskanal 3 Eingangskanal 3 (+) Eingangskanal 3 (-) Ausgangskanal 2 Eingangskanal 2 (+) Eingangskanal 2 (-) Ausgangskanal 1 Eingangskanal 1 (+) Eingangskanal 1 (-) Ausgangskanal 0 Eingangskanal 0 (+) Eingangskanal 0 (-) GND O +24 V Nicht belegt Nicht belegt Nicht belegt Nicht belegt Nicht belegt Nicht belegt Nicht belegt Nicht belegt Nicht belegt Nicht belegt TTL-Kanal GND TTL-Kanal GND TTL-Kanal 15 TTL-Kanal 23 TTL-Kanal 7 TTL-Kanal 14 1 34 18 2 35 19 3 36 20 4 37 21 5 38 22 6 39 23 7 40 24 8 41 25 9 42 26 10 43 27

32

APCI-3xxx (Standard)

Anschluss an die Peripherie

Pinnummer am 50-pol. Pfostensteckers 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

Beschreibung

Pinnummer am Frontblech des FB8001 (50-pol. SUB-D Stiftstecker) 11 44 28 12 45 29 13 46 30 14 47 31 15 48 32 16 49 33 17 50

TTL-Kanal 22 TTL-Kanal 6 TTL-Kanal 13 TTL-Kanal 21 TTL-Kanal 5 TTL-Kanal 12 TTL-Kanal 20 TTL-Kanal 4 TTL-Kanal 11 TTL-Kanal 19 TTL-Kanal 3 TTL-Kanal 10 TTL-Kanal 18 TTL-Kanal 2 TTL-Kanal 9 TTL-Kanal 17 TTL-Kanal 1 TTL-Kanal 8 TTL-Kanal 16 TTL-Kanal 0

33

DIN EN ISO 9001:2000 certified

ADDI-DATA GmbH Airpark Business Center Airport Boulevard B210 77836 Rheinmnster Germany Phone: +49 7229 18470 Fax: +49 7229 1847222 E-mail: info@addi-data.com

Software description

ADDIDRIVER
Common functions

Edition: 08.04 08/2010

ADDIDRIVER

Table of contents

1 2
2.1

INTRODUCTION...................................................................................3 SOFTWARE FUNCTIONS........................................................................4


Common functions ...............................................................................................4 1) i_ADDIDATA_OpenWin32Driver (..) .................................................................................. 4 2) i_ADDIDATA_GetCurrentDriverHandle (..) ........................................................................ 6 3) v_ADDIDATA_GetDriverVersion (..) .................................................................................. 7 4) b_ADDIDATA_GetLocalisation (..)...................................................................................... 8 5) b_ADDIDATA_CloseWin32Driver (..)............................................................................... 11 Error ....................................................................................................................12 1) i_ADDIDATA_GetLastError (...)........................................................................................ 12 2) i_ADDIDATA_GetLastErrorAndSource (...)...................................................................... 13 3) b_ADDIDATA_EnableErrorMessage (...)........................................................................... 29 4) b_ADDIDATA_DisableErrorMessage (...) ......................................................................... 31 5) b_ADDIDATA_FormatErrorMessage (...) .......................................................................... 33

2.2

Tables
Table 1-1: Type Declaration for Windows 98/NT/2000/XP ........................................................3 Table 2-1: Return values for i_ADDIDATA_OpenWin32Driver ....................................................5 Table 2-2: Function number .................................................................................................14 Table 2-3: Error number ........................................................................................................21

Introduction

ADDIDRIVER

INTRODUCTION
IMPORTANT! Note the following conventions in the text:
Function: Variable "b_ADDIDATA_GetNumberOfAnalogInputs" dw_DriverHandle

Table 1-1: Type Declaration for Windows 98/NT/2000/XP Borland C Microsoft C Borland Pascal pointer byte integer long longint var byte var integer var long var string var longint double Microsoft Visual Basic Windows any integer integer long long integer integer long string long double

VOID BYTE INT WORD DWORD PBYTE PINT PWORD PCHAR PDWORD DOUBLE

void unsigned char int unsigned short int long unsigned char * int *

void unsigned char int unsigned short int long unsigned char * int *

unsigned short int * unsigned short int * char * long * double char * long * double

ADDIDRIVER

Common functions

2
2.1

SOFTWARE FUNCTIONS
Common functions
1) i_ADDIDATA_OpenWin32Driver (..) Syntax: <Return value> = i_ADDIDATA_OpenWin32Driver Parameters: - Input: BYTE b_CompilerDefine (BYTE b_CompilerDefine, PDWORD pdw_DriverHandle)

The user has to choose the language under Windows in which he wants to program - ADDIDATA_DLL_COMPILER_C = 0: The user programs in C. - ADDIDATA_DLL_COMPILER_ VB = 2: The user programs in Visual Basic for Windows. - ADDIDATA_DLL_COMPILER_VB_5 or ADDIDATA_DLL_COMPILER_VB_6 = 4: The user programs in Visual Basic 5 or 6 for Windows NT or Windows 95. - ADDIDATA_DLL_COMPILER_PASCAL = 1: The user programs in Pascal or Delphi. - ADDIDATA_DLL_LABVIEW = 3: The user programs in Labview. Returns the driver handle. This parameter is the first to be called up for each function.

- Output: PDWORD pdw_DriverHandle

Task: This function loads the ADDIDATA driver. All information concerning the ADDI-DATA boards is read. The user choose the language in which he/she wants to program through the parameter b_CompilerDefine. Calling convention: ANSI C : INT i_ReturnValue; DWORD dw_DriverHandle; i_ReturnValue = i_ADDIDATA_OpenWin32Driver (ADDIDATA_DLL_COMPILER_C, &dw_DriverHandle); Return value: 0: No error -100.: See Table 2-1

Common functions

ADDIDRIVER

Table 2-1: Return values for i_ADDIDATA_OpenWin32Driver


Constant Return value Meaning

Common function errors


ADDIDATA_FUNCTIONALITY_NOT_AVAILABLE ADDIDATA_FUNCTIONALITY_NO_RING_0 ADDIDATA_SYSTEM_ERROR ADDIDATA_NO_FREE_DRIVER_HANDLE_FOUND ADDIDATA_DRIVER_SHARED_MEMORY_ERROR ADDIDATA_DRIVER_OPENING_ERROR ADDIDATA_CURRENT_PROCESS_HDL_NOT_AVAIBLE ADDIDATA_GET_SHARED_MEMORY_ERROR ADDIDATA_DRIVER_HANDLE_ERROR ADDIDATA_DRIVER_NOT_OPEN ADDIDATA_ONE_OR_MORE_BOARDS_NOT_FOUND ADDIDATA_DRIVER_ALREADY_OPEN ADDIDATA_REGISTRY_PROBLEM ADDIDATA_ADDIDATA_SHARED_PATH_NOT_AVAILABLE ADDIDATA_TEMPERATURE_CONVERT_FILE_ERROR ADDIDATA_TEMPERATURE_BUFFER_SHARED_MEMORY_ERROR ADDIDATA_COMPILER_DEFINED_ERROR ADDIDATA_MULTIPROCESS_NOT_AVAILABLE_IN_THIS_VERSION ADDIDATA_READY_BIT_TIMEOUT_OCCUR ADDIDATA_ERROR_FILE_NOT_AVAILABLE ADDIDATA_ERROR_STRING_TOO_SMALL ADDIDATA_ERROR_STRING_NOT_FOUND ADDIDATA_REGISTRY_NOT_UPDATED ADDIDATA_DRIVER_FREE_SHARED_MEMORY_ERROR ADDIDATA_DRIVER_RING_0_PREPARATION_ERROR ADDIDATA_DRIVER_MEMORY_MAP_ERROR ADDIDATA_REGISTRY_COULD_NOT_BE_TESTED ADDIDATA_ADDEVICEMAPPER_ALREADY_STARTED ADDIDATA_EXTERN_DRIVER_DLL_LOAD_ERROR ADDIDATA_EXTERN_DRIVER_APCI_1500_DLL_NOT_FOUND ADDIDATA_EXTERN_DRIVER_APCI_1500_DLL_VERSION_ERROR ADDIDATA_VIRTUAL_BOARD_FILE_NOT_FOUND ADDIDATA_REALBOARD_XML_FILE_NOT_FOUND ADDIDATA_REALBOARD_XML_FILE_BACKUO_ERROR ADDIDATA_COPY_VIRTUAL_BOARD_FILE_ERROR ADDIDATA_ADDEVICEMAPER_CALL_ERROR ADDIDATA_IEEE1394a_WRONG_HANDLE ADDIDATA_IEEE1394a_WRONG_ADRESS ADDIDATA_IEEE1394a_DEVICE_TEMPORARY_NOT_AVAILABLE ADDIDATA_IEEE1394a_DEVICE_PERMANENTLY_NOT_AVAILABLE ADDIDATA_IEEE1394a_DEVICE_UNKNOWN_ERROR ADDIDATA_ONE_OR_MORE_DEVICE_NOT_READY ADDIDATA_SOAP_NEW_ERROR ADDIDATA_SOAP_COMMUNICATION_ERROR ADDIDATA_SOCKET_WSASTARTUP_ERROR ADDIDATA_SOCKET_GETHOSTBYNAME_ERROR ADDIDATA_CREATE_SOCKET_ERROR ADDIDATA_SOCKET_CONNECTOR_ERROR ADDIDATA_MUTEX_CREATION_ERROR -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 -140 -141 -142 -143 -144 -145 -146 -147 -174 -175 -176 -177 -178 Functionality not available This function cannot be called up in the synchronous mode Cannot detect the 32-bit system No driver handle available (up to 25 drivers can be used) The allocation of the user shared memory is wrong The ADDI-DATA sys/vxd driver cannot be loaded The current process handle is not available Error by allocation of the shared memory Driver handle passed to the function not available Driver is not open One or more boards not found Driver already open The registry information is not complete The path of the shared files is not available There is an error in the temperature convert file Problem by allocation of the shared memory for the converting buffer The compiler defined is not available Multiprocess operation is not supported by this driver version. Timeout occurred while ready bit was waiting. The error file error.dat and function.dat are not available in the shared directory. The error string parameter(s) is or are too small. Error string not found in the error file. The registry has not been updated. Start ADDIREG to update it. Error in the free shared memory Error in preparation of ring 0 Memory mapping error The registry could not be tested ADDEVICE MAPPER program is already started. External DLL file cannot be loaded External DLL file not found (only for the APCI-1500) The version of the external DLL file (only for the APCI-1500) is not correct. File of the virtual board not found Real board XML file not found Real board XML file error backup error Virtual board file copy error ADDevice Mapper call error The IEEE-1394a device handle used is wrong. The IEEE-1394a device adress used is wrong. The IEEE-1394a device is temporary not available. The IEEE-1394a device is permanently not available. The IEEE-1394a device generate an unknown error. One or more ADDI-DATA device not ready. Soap new function error soap communication error Socket startup error Socket: Get host by name error Create socket error Socket connect error Mutex creation error

ADDIDRIVER 2) i_ADDIDATA_GetCurrentDriverHandle (..)

Common functions

Syntax: <Return value> = i_ADDIDATA_GetCurrentDriverHandle (PDWORD pdw_DriverHandle) Parameters: - Input: No input parameter has occurred. - Output: PDWORD pdw_DriverHandle Returns the driver handle of the process which calls up the function Task: Gives the driver handle of the process which calls up the function. Calling convention: ANSI C : INT i_ReturnValue; DWORD dw_DriverHandle; i_ReturnValue = i_ADDIDATA_GetCurrentDriverHandle (&dw_DriverHandle); Return value: 0 : No error has occurred. -106 : ADDIDATA_CURRENT_PROCESS_HDL_NOT_AVAIBLE : The current process handle is not available

Common functions 3) v_ADDIDATA_GetDriverVersion (..)

ADDIDRIVER

Syntax: <Return value> = v_ADDIDATA_GetDriverVersion (PDWORD pdw_DriverVersion) Parameters: - Input: No input signal has occurred. - Output: PDWORD pdw_DriverVersion Returns the driver version in Hex form: 0x09000210 means 0900/0210 Task: This function returns the version of the ADDIDriver. Calling convention: ANSI C : DWORD dw_DriverVersion; v_ADDIDATA_GetDriverVersion (&dw_DriverVersion); Return value: No value returned

ADDIDRIVER 4) b_ADDIDATA_GetLocalisation (..)

Common functions

Syntax: <Return value> = b_ADDIDATA_GetLocalisation (str_RequestInformation s_RequestInformation, DWORD dw_RequestInformationStructSize, pstr_LocalisationInformation ps_LocalisationInformation, DWORD dw_LocalisationInformationStructSize) Parameters - Input: str_RequestInformation s_RequestInformation: Structure for requesting the localisation information typedef struct { WORD w_EntityVirtualIndex; BYTE b_EntityType; BYTE b_Reserved1; WORD w_Functionality; BYTE b_Reserved2[2];

// Virtual Index // ADDIDATA_LOCALISATION_CHANNEL or ADDIDATA_LOCALISATION_MODULE // Not used // ADDIDATA_NameOfTheFunctionality // Not used

}str_RequestInformation,*pstr_RequestInformation; with ADDIDATA_LOCALISATION_CHANNEL 0 ADDIDATA_LOCALISATION_MODULE 1 and ADDIDATA_DIGITAL_INPUT 0 ADDIDATA_DIGITAL_OUTPUT 1 ADDIDATA_ANALOG_INPUT 2 ADDIDATA_ANALOG_OUTPUT 3 ADDIDATA_TIMER 4 ADDIDATA_WATCHDOG 5 ADDIDATA_TEMPERATURE 6 ADDIDATA_COUNTER 7 ADDIDATA_RESISTANCE 9 ADDIDATA_PRESSURE 11 ADDIDATA_TRANSDUCER 12 DWORD dw_RequestInformationStructSize Size of the structure requesting the localisation information DWORD dw_LocalisationInformationStructSize Size of the structure containing the localisation information

Common functions

ADDIDRIVER

- Output: pstr_LocalisationInformation ps_LocalisationInformation Structure containing the localisation information typedef struct { WORD w_ChannelRealIndex; WORD w_ModuleRealIndex; CHAR

// Real index of the channel // Real Index of the module

c_BoardName[MAX_PATH]; // Board name of the device containing the entity // Base address of the device containing the entity // Interrupt address of the device containing the entity // Device number (BIOS) of the device containing the entity // Not used

DWORD dw_BoardAddress[6]; BYTE BYTE b_BoardInterrupt; b_DeviceNbr;

BYTE CHAR

b_Reserved[2];

c_PCISlotNumberInformation[MAX_PATH]; // PCI slot of the device containing the entity

DWORD dw_DeviceSerialNumber; // Serial number of the device containing the entity DWORD dw_Reserved; // Not used }str_LocalisationInformation,*pstr_LocalisationInformation; Task: Localise the entity (channel or module) of the virtual board in the real hardware configuration. Can be called up by the driver. Calling convention: ANSI C : INT i_ReturnValue; str_RequestInformation s_RequestInformation; str_LocalisationInformation s_LocalisationInformation; s_RequestInformation.w_EntityVirtualIndex = 0; s_RequestInformation.b_EntityType = ADDIDATA_LOCALISATION_CHANNEL; s_RequestInformation.w_Functionality = ADDIDATA_DIGITAL_INPUT; i_ReturnValue = i_ADDIDATA_GetLocalisation (s_RequestInformation, sizeof(str_RequestInformation), &s_LocalisationInformation, sizeof(str_LocalisationInformation));

ADDIDRIVER

Common functions

Return value: 0 : No error ADDIDATA_ENTITY_COULD_NOT_BE_FOUND: The entity content in the request information could not be found. ADDIDATA_ENTITY_TYPE_IS_WRONG : The entity type is wrong. ADDIDATA_ENTITY_FUNCTIONALITY_IS_WRONG : The entity functionality is wrong. ADDIDATA_REQUEST_INFORMATION_STRUCT_SIZE_IS_WRONG : The dw_RequestInformationStructSize is wrong. ADDIDATA_LOCALISATION_INFORMATION_STRUCT_SIZE_IS_WRONG The dw_LocalisationInformationStructSize is wrong. with -1000: ADDIDATA_ENTITY_COULD_NOT_BE_FOUND -1001: ADDIDATA_ENTITY_TYPE_IS_WRONG -1002: ADDIDATA_ENTITY_FUNCTIONALITY_IS_WRONG -1003: ADDIDATA_REQUEST_INFORMATION_STRUCT_SIZE_IS_WRONG -1004: ADDIDATA_LOCALISATION_INFORMATION_STRUCT_SIZE_IS_WRONG

10

Common functions 5) b_ADDIDATA_CloseWin32Driver (..)

ADDIDRIVER

IMPORTANT! Call up this function each time you want to quit the user program!
Syntax: <Return value> = b_ADDIDATA_CloseWin32Driver (DWORD dw_DriverHandle) Parameters - Input: DWORD dw_DriverHandle - Output: No output signal has occurred.

Handle of the ADDI-DATA driver

Task: Closes the ADDI-DATA driver and blocks the access to all boards. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle; (dw_DriverHandle);

b_ReturnValue = b_ADDIDATA_CloseWin32Driver

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

11

ADDIDRIVER

Common functions

2.2

Error
IMPORTANT! Each function of the ADDIDRIVER returns a value of the type Byte.
When the return value is "False", the user can receive the error source through the functions described below. 1) i_ADDIDATA_GetLastError (...) Syntax: <Return value> = i_ADDIDATA_GetLastError (DWORD PWORD PINT PBYTE dw_DriverHandle, pw_FunctionNumber, pi_ErrorCode, pb_ErrorLevel)

Parameters: - Input: DWORD dw_DriverHandle - Output: PWORD pw_FunctionNumber PINT pi_ErrorCode PBYTE pb_ErrorLevel

Handle of the driver Number of the function on which an error has occurred. See Table 2-2 Error number. See Table 2-3 0: An error has occurred in the application (ring 3) 1: The function which caused the error has been called up in the user interrupt routine. This parameter has only a meaning for 32-bit operating systems. (ring 0)

Task: Transmits the last error message. Calling convention: ANSI C : WORD INT INT INT w_FunctionNumber; i_ErrorCode; i_ErrorLevel; i_ReturnValue; (dw_DriverHandle, &w_FunctionNumber, &i_ErrorCode, &b_ErrorLevel);

i_ReturnValue = i_ADDIDATA_GetLastError

Return value: 0: No error 1: Error message present - 101: Function cannot be called up in the user interrupt routine - 102: Error message not found

12

Common functions 2) i_ADDIDATA_GetLastErrorAndSource (...) Syntax: <Return value> = i_ADDIDATA_GetLastErrorAndSource (DWORD dw_DriverHandle, PWORD pw_FunctionNumber, PINT pi_ErrorCode, PBYTE pb_ErrorLevel, PDWORD pdw_ErrorSource) Parameters: - Input: DWORD dw_DriverHandle - Output: PWORD pw_FunctionNumber PINT pi_ErrorCode PBYTE pb_ErrorLevel

ADDIDRIVER

Handle of the driver Number of the function on which an error has occurred. See Table 2-2 Error number. See Table 2-3 0: An error has occurred in the application (ring 3) 1: The function which caused the error has been called up in the user interrupt routine. This parameter has only a meaning for 32-bit operating systems. (ring 0) Error source value.

PDWORD pdw_ErrorSource Task: Transmits the last error message.

Calling convention: ANSI C : WORD w_FunctionNumber; INT i_ErrorCode; INT i_ErrorLevel; INT i_ReturnValue; DWORD dw_ErrorSource; i_ReturnValue = i_ADDIDATA_GetLastErrorAndSource (dw_DriverHandle, &w_FunctionNumber, &i_ErrorCode, &i_ErrorLevel, &dw_ErrorSource); Return value: 0: No error 1: Error message present - 101: Function cannot be called up in the user interrupt routine - 102: Error message not found

13

ADDIDRIVER

Common functions

Table 2-2: Function number


Constant Return value Function

Common function
ADDIDATA_OPEN_WIN32_DRIVER ADDIDATA_CLOSE_ WIN32_DRIVER ADDIDATA_GET_CURRENT_DRIVER_HANDLE 10 11 14 i_ADDIDATA_OpenWin32Driver b_ADDIDATA_CloseWin32Driver i_ADDIDATA_GetCurrentDriverHandle

Interrupt
ADDIDATA_SET_FUNCTIONALITY_INT_ROUTINE ADDIDATA_TEST_INTERRUPT ADDIDATA_RESET_FUNCTIONALITY_INT_ROUTINE 50 51 52 b_ADDIDATA_SetFunctionalityIntRoutineWin32 b_ADDIDATA_TestInterrupt b_ADDIDATA_ResetFunctionalityIntRoutine

Error Messages
ADDIDATA_GET_LAST_ERROR_MESSAGE ADDIDATA_ENABLE_ERROR_MESSAGE ADDIDATA_DISABLE_ERROR_MESSAGE ADDIDATA_FORMAT_ERROR_MESSAGE 100 101 102 103 i_ADDIDATA_GetLastError b_ADDIDATA_EnableErrorMessage b_ADDIDATA_DisableErrorMessage b_ADDIDATA_FormatErrorMessage

Timer
ADDIDATA_GET_NUMBER_OF_TIMERS ADDIDATA_GET_TIMER_INFORMATION ADDIDATA_INIT_TIMER ADDIDATA_ENABLE_DISABLE_TIMER_INTERRUPT ADDIDATA_START_TIMER ADDIDATA_START_ALL_TIMERS ADDIDATA_TRIGGER_TIMER ADDIDATA_TRIGGER_ALL_TIMERS ADDIDATA_STOP_TIMER ADDIDATA_STOP_ALL_TIMERS ADDIDATA_READ_TIMER_VALUE ADDIDATA_READ_TIMER_STATUS ADDIDATA_ENABLE_DISABLE_TIMER_HARDWARE_GATE ADDIDATA_GET_TIMER_HARDWARE_GATE_STATUS ADDIDATA_ENABLE_DISABLE_TIMER_HARDWARE_TRIGGER ADDIDATA_GET_TIMER_HARDWARE_TRIGGER_STATUS ADDIDATA_ENABLE_DISABLE_TIMER_HARDWARE_OUTPUT ADDIDATA_GET_TIMER_HARDWARE_OUTPUT_STATUS ADDIDATA_RELEASE_TIMER ADDIDATA_TEST_TIMER_ASYNCHRONOUS_FIFO_FULL ADDIDATA_GET_TIMER_INFORMATION_EX 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 b_ADDIDATA_GetNumberOfTimers b_ADDIDATA_GetTimerInformation b_ADDIDATA_InitTimer b_ADDIDATA_EnableDisableTimerInterrupt b_ADDIDATA_StartTimer b_ADDIDATA_StartAllTimers b_ADDIDATA_TriggerTimer b_ADDIDATA_TriggerAllTimers b_ADDIDATA_StopTimer b_ADDIDATA_StopAllTimers b_ADDIDATA_ReadTimerValue b_ADDIDATA_ReadTimerStatus b_ADDIDATA_EnableDisableTimerHardwareGate b_ADDIDATA_GetTimerHardwareGateStatus b_ADDIDATA_EnableDisableTimerHardwareTrigger b_ADDIDATA_GetTimerHardwareTriggerStatus b_ADDIDATA_EnableDisableTimerHardwareOutput b_ADDIDATA_GetTimerHardwareOutputStatus b_ADDIDATA_ReleaseTimer b_ADDIDATA_TestTimerAsynchronousFIFOFull b_ADDIDATA_GetTimerInformationEx

14

Common functions

ADDIDRIVER

Constant

Return value

Function

Watchdog
ADDIDATA_GET_NUMBER_OF_WATCHDOGS ADDIDATA_GET_WATCHDOG_INFORMATION ADDIDATA_INIT_WATCHDOG ADDIDATA_ENABLE_DISABLE_WATCHDOG_INTERRUPT ADDIDATA_START_WATCHDOG ADDIDATA_START_ALL_WATCHDOGS ADDIDATA_TRIGGER_WATCHDOG ADDIDATA_TRIGGER_ALL_WATCHDOGS ADDIDATA_STOP_WATCHDOG ADDIDATA_STOP_ALL_WATCHDOGS ADDIDATA_READ_WATCHDOG_STATUS ADDIDATA_ENABLE_DISABLE_WATCHDOG_HARDWARE_GATE ADDIDATA_GET_WATCHDOG_HARDWARE_GATE_STATUS ADDIDATA_ENABLE_DISABLE_WATCHDOG_HARDWARE_TRIGGER ADDIDATA_GET_WATCHDOG_HARDWARE_TRIGGER_STATUS ADDIDATA_GET_WARNING_DELAY_INFORMATION ADDIDATA_INIT_WARNING_DELAY ADDIDATA_ENABLE_DISABLE_WATCHDOG_WARNING_RELAY ADDIDATA_ENABLE_DISABLE_WATCHDOG_RESET_RELAY ADDIDATA_RELEASE_WATCHDOG ADDIDATA_GET_WATCHDOG_INFORMATION_EX ADDIDATA_SET_WATCHDOG_RESET_RELAY_MODE ADDIDATA_TEST_WATCHDOG_ASYNCHRONOUS_FIFO_FULL ADDIDATA_ENABLE_DISABLE_WATCHDOG_HARDWARE_OUTPUT ADDIDATA_GET_WATCHDOG_HARDWARE_OUTPUT_STATUS 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 b_ADDIDATA_GetNumberOfWatchdogs b_ADDIDATA_GetWatchdogInformation b_ADDIDATA_InitWatchdog b_ADDIDATA_EnableDisableWatchdogInterrupt b_ADDIDATA_StartWatchdog b_ADDIDATA_StartAllWatchdogs b_ADDIDATA_TriggerWatchdog b_ADDIDATA_TriggerAllWatchdogs b_ADDIDATA_StopWatchdog b_ADDIDATA_StopAllWatchdogs b_ADDIDATA_ReadWatchdogStatus b_ADDIDATA_EnableDisableWatchdogHardwareGate b_ADDIDATA_GetWatchdogHardwareGateStatus b_ADDIDATA_EnableDisableWatchdogHardwareTrigger b_ADDIDATA_GetWatchdogHardwareTriggerStatus b_ADDIDATA_GetWarningDelayInformation b_ADDIDATA_InitWarningDelay b_ADDIDATA_EnableDisableWatchdogWarningRelay b_ADDIDATA_EnableDisableWatchdogResetRelay b_ADDIDATA_ReleaseWatchdog b_ADDIDATA_GetWatchdogInformationEx b_ADDIDATA_SetWatchdogResetRelayMode b_ADDIDATA_TestWatchdogAsynchronousFIFOFull b_ADDIDATA_EnableDisableWatchdogHardwareOutput b_ADDIDATA_GetWatchdogHardwareOutputStatus

Temperature
ADDIDATA_INIT_TEMPERATURE_CHANNEL ADDIDATA_READ_1_TEMPERATURE_CHANNEL ADDIDATA_GET_NUMBER_OF_TEMPERATURE_CHANNELS ADDIDATA_CONVERT_DIGITAL_TO_REAL_TEMPERATURE_VALUE ADDIDATA_GET_TEMPERATURE_CHANNEL_INFORMATION ADDIDATA_INIT_TEMPERATURE_WARNING ADDIDATA_ENABLE_DISABLE_TEMPERATURE_WARNING_CHANNEL ADDIDATA_START_ALL_TEMPERATURE_WARNINGS ADDIDATA_STOP_ALL_TEMPERATURE_WARNINGS ADDIDATA_RELEASE_TEMPERATURE_WARNING ADDIDATA_RELEASE_TEMPERATURE_CHANNEL ADDIDATA_READ_MORE_TEMPERATURE_CHANNELS ADDIDATA_INIT_TEMPERATURE_CHANNEL_SCAN ADDIDATA_START_TEMPERATURE_CHANNEL_SCAN ADDIDATA_GET_TEMPERATURE_CHANNEL_SCAN_STATUS ADDIDATA_CONVERT_DIGITAL_TO_REAL_TEMPERATURE_VALUE_ SCAN ADDIDATA_STOP_TEMPERATURE_CHANNEL_SCAN ADDIDATA_CLOSE_TEMPERATURE_CHANNEL_SCAN ADDIDATA_GET_NUMBER_OF_TEMPERATURE_MODULES ADDIDATA_GET_NUMBER_OF_TEMPERATURE_CHANNELS_FOR_ THE_MODULE ADDIDATA_CONVERT_DIGITAL_TO_REAL_TEMPERATURE_ WITH_CORRECTION_PARAMETERS ADDIDATA_CONVERT_MORE_DIGITAL_TO_REAL_TEMPERATURE_ VALUES ADDIDATA_TEST_TEMPERATURE_CHANNEL_SHORT_CIRCUIT ADDIDATA_TEST_TEMPERATURE_CHANNEL_CONNECTION ADDIDATA_TEST_TEMPERATURE_ASYNCHRONOUS_FIFO_FULL 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 419 420 421 422 423 424 425 b_ADDIDATA_InitTemperatureChannel b_ADDIDATA_Read1TemperatureChannel b_ADDIDATA_GetNumberOfTemperatureChannels b_ADDIDATA_ConvertDigitalToRealTemperatureValue b_ADDIDATA_GetTemperatureChannelInformation b_ADDIDATA_InitTemperatureWarning b_ADDIDATA_EnableDisableTemperatureWarningChannel b_ADDIDATA_StartAllTemperatureWarnings b_ADDIDATA_StopAllTemperatureWarnings b_ADDIDATA_ReleaseTemperatureWarning b_ADDIDATA_ReleaseTemperatureChannel b_ADDIDATA_ReadMoreTemperatureChannels b_ADDIDATA_InitTemperatureChannelSCAN b_ADDIDATA_StartTemperatureChannelSCAN b_ADDIDATA_GetTemperatureChannelSCANStatus b_ADDIDATA_ConvertDigitalToRealTemperatureValue SCAN b_ADDIDATA_StopTemperatureChannelSCAN b_ADDIDATA_CloseTemperatureChannelSCAN b_ADDIDATA_GetNumberOfTemperatureModules b_ADDIDATA_GetNumberOfTemperatureChannelsForThe Module b_ADDIDATA_ConvertDigitalToRealTemperatureWith CorrectionParameters b_ADDIDATA_ConvertMoreDigitalToRealTemperature Values b_ADDIDATA_TestTemperatureChannelShortCircuit b_ADDIDATA_TestTemperatureChannelConnection b_ADDIDATA_TestTemperatureAsynchronousFIFOFull

15

ADDIDRIVER

Common functions

Constant

Return value

Function

Digital inputs
ADDIDATA_GET_NUMBER_OF_DIGITAL_INPUTS ADDIDATA_GET_DIGITAL_INPUT_INFORMATION ADDIDATA_READ_1_DIGITAL_INPUT ADDIDATA_READ_2_DIGITAL_INPUTS ADDIDATA_READ_4_DIGITAL_INPUTS ADDIDATA_READ_8_DIGITAL_INPUTS ADDIDATA_READ_16_DIGITAL_INPUTS ADDIDATA_READ_32_DIGITAL_INPUTS ADDIDATA_INIT_DIGITAL_INPUT_INTERRUPT ADDIDATA_ENABLE_DISABLE_DIGITAL_INPUT_INTERRUPT ADDIDATA_RELEASE_DIGITAL_INPUT_INTERRUPT ADDIDATA_GET_DIGITAL_INPUT_INFORMATION_EX ADDIDATA_INIT_1_DIGITAL_INPUT_LEVEL ADDIDATA_READ_1_DIGITAL_INPUT_STATUS ADDIDATA_READ_MORE_DIGITAL_INPUT_STATUS ADDIDATA_READ_1_DIGITAL_INPUT_VALUE ADDIDATA_READ_MORE_DIGITAL_INPUT_VALUE ADDIDATA_CONVERT_1_DIGITAL_INPUT_VALUE ADDIDATA_GET_DIGITAL_INPUT_MODULE_FILTER_INFORMATION ADDIDATA_INIT_DIGITAL_INPUT_MODULE_FILTER ADDIDATA_ENABLE_DISABLE_DIGITAL_INPUT_MODULE_FILTER ADDIDATA_SET_DIGITAL_INPUT_MODULE_LEVEL_SELECTION ADDIDATA_SAVE_DIGITAL_INPUT_MODULE_LEVEL ADDIDATA_TEST_DIGITAL_INPUT_ASYNCHRONOUS_FIFO_FULL 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 b_ADDIDATA_GetNumberOfDigitalInputs b_ADDIDATA_GetDigitalInputInformation b_ADDIDATA_Read1DigitalInput b_ADDIDATA_Read2DigitalInputs b_ADDIDATA_Read4DigitalInputs b_ADDIDATA_Read8DigitalInputs b_ADDIDATA_Read16DigitalInputs b_ADDIDATA_Read32DigitalInputs b_ADDIDATA_InitDigitalInputInterrupt b_ADDIDATA_EnableDisableDigitalInputInterrupt b_ADDIDATA_ReleaseDigitalInputInterrupt b_ADDIDATA_GetDigitalInputInformationEx b_ADDIDATA_Init1DigitalInputLevel b_ADDIDATA_Read1DigitalInputStatus b_ADDIDATA_ReadMoreDigitalInputStatus b_ADDIDATA_Read1DigitalInputValue b_ADDIDATA_ReadMoreDigitalInputValue b_ADDIDATA_Convert1DigitalInputValueInAnalogValue b_ADDIDATA_GetDigitalInputModuleFilterInformation b_ADDIDATA_InitDigitalInputModuleFilter b_ADDIDATA_EnableDisableDigitalInputModuleFilter b_ADDIDATA_SetDigitalInputModuleLevelSelection b_ADDIDATA_SaveDigitalInputModuleLevel b_ADDIDATA_TestDigitalInputAsynchronousFIFOFull

Digital outputs
ADDIDATA_GET_NUMBER_OF_DIGITAL_OUTPUTS ADDIDATA_GET_DIGITAL_OUTPUT_INFORMATION ADDIDATA_SET_DIGITAL_OUTPUT_MEMORY_ON ADDIDATA_SET_DIGITAL_OUTPUT_MEMORY_OFF ADDIDATA_SET_1_DIGITAL_OUTPUT_ON ADDIDATA_SET_2_DIGITAL_OUTPUTS_ON ADDIDATA_SET_4_DIGITAL_OUTPUTS_ON ADDIDATA_SET_8_DIGITAL_OUTPUTS_ON ADDIDATA_SET_16_DIGITAL_OUTPUTS_ON ADDIDATA_SET_32_DIGITAL_OUTPUTS_ON ADDIDATA_SET_1_DIGITAL_OUTPUT_OFF ADDIDATA_SET_2_DIGITAL_OUTPUTS_OFF ADDIDATA_SET_4_DIGITAL_OUTPUTS_OFF ADDIDATA_SET_8_DIGITAL_OUTPUTS_OFF ADDIDATA_SET_16_DIGITAL_OUTPUTS_OFF ADDIDATA_SET_32_DIGITAL_OUTPUTS_OFF ADDIDATA_GET_1_DIGITAL_OUTPUT_STATUS ADDIDATA_GET_2_DIGITAL_OUTPUT_STATUS ADDIDATA_GET_4_DIGITAL_OUTPUT_STATUS ADDIDATA_GET_8_DIGITAL_OUTPUT_STATUS ADDIDATA_GET_16_DIGITAL_OUTPUT_STATUS ADDIDATA_GET_32_DIGITAL_OUTPUT_STATUS ADDIDATA_INIT_DIGITAL_OUTPUT_INTERRUPT ADDIDATA_ENABLE_DISABLE_DIGITAL_OUTPUT_INTERRUPT ADDIDATA_RELEASE_DIGITAL_OUTPUT_INTERRUPT ADDIDATA_TEST_DIGITAL_OUTPUT_ASYNCHRONOUS_FIFO_FULL 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 623 624 625 626 b_ADDIDATA_GetNumberOfDigitalOutputs b_ADDIDATA_GetDigitalOutputInformation b_ADDIDATA_SetDigitalOutputMemoryOn b_ADDIDATA_SetDigitalOutputMemoryOff b_ADDIDATA_Set1DigitalOutputOn b_ADDIDATA_Set2DigitalOutputsOn b_ADDIDATA_Set4DigitalOutputsOn b_ADDIDATA_Set8DigitalOutputsOn b_ADDIDATA_Set16DigitalOutputsOn b_ADDIDATA_Set32DigitalOutputsOn b_ADDIDATA_Set1DigitalOutputOff b_ADDIDATA_Set2DigitalOutputsOff b_ADDIDATA_Set4DigitalOutputsOff b_ADDIDATA_Set8DigitalOutputsOff b_ADDIDATA_Set16DigitalOutputsOff b_ADDIDATA_Set32DigitalOutputsOff b_ADDIDATA_Get1DigitalOutputStatus b_ADDIDATA_Get2DigitalOutputStatus b_ADDIDATA_Get4DigitalOutputStatus b_ADDIDATA_Get8DigitalOutputStatus b_ADDIDATA_Get16DigitalOutputStatus b_ADDIDATA_Get32DigitalOutputStatus b_ADDIDATA_InitDigitalOutputInterrupt b_ADDIDATA_EnableDisableDigitalOutputInterrupt b_ADDIDATA_ReleaseDigitalOutputInterrupt b_ADDIDATA_TestDigitalOutputAsynchronousFIFOFull

16

Common functions

ADDIDRIVER

Constant

Return value

Function

Analog outputs
ADDIDATA_GET_NUMBER_OF_ANALOG_OUTPUTS ADDIDATA_GET_ ANALOG_OUTPUT_INFORMATION ADDIDATA_INIT_1_ANALOG_OUTPUT ADDIDATA_INIT_MORE_ANALOG_OUTPUTS ADDIDATA_WRITE_1_ANALOG_OUTPUT ADDIDATA_WRITE_MORE_ANALOG_OUTPUTS ADDIDATA_RELEASE_1_ANALOG_OUTPUT ADDIDATA_RELEASE_MORE_ANALOG_OUTPUTS ADDIDATA_ENABLE_DISABLE_1_ANALOG_OUTPUT_SYNC ADDIDATA_ENABLE_DISABLE_MORE_ANALOG_OUTPUTS_SYNC ADDIDATA_TRIGGER_ANALOG_OUTPUT 700 701 702 703 704 705 706 707 708 709 710 b_ADDIDATA_GetNumberOfAnalogOutputs b_ADDIDATA_GetAnalogOutputInformation b_ADDIDATA_Init1AnalogOutput b_ADDIDATA_InitMoreAnalogOutputs b_ADDIDATA_Write1AnalogOutput b_ADDIDATA_WriteMoreAnalogOutputs b_ADDIDATA_Release1AnalogOutput b_ADDIDATA_ReleaseMoreAnalogOutputs b_ADDIDATA_EnableDisable1AnalogOutputSync b_ADDIDATA_EnableDisableMoreAnalogOutputsSync b_ADDIDATA_TriggerAnalogOutput

Analog inputs
ADDIDATA_GET_NUMBER_OF_ANALOG_INPUTS ADDIDATA_GET_NUMBER_OF_ANALOG_INPUT_MODULES ADDIDATA_GET_NUMBER_OF_ANALOG_INPUTS_FOR_THE_MODULE ADDIDATA_GET_ANALOG_INPUT_INFORMATION ADDIDATA_INIT_ANALOG_INPUT ADDIDATA_TEST_ANALOG_INPUT_SHORT_CIRCUIT ADDIDATA_TEST_ANALOG_INPUT_CONNECTION ADDIDATA_READ_1_ANALOG_INPUT ADDIDATA_READ_MORE_ANALOG_INPUTS ADDIDATA_CONVERT_DIGITAL_TO_REAL_ANALOG_VALUE ADDIDATA_CONVERT_MORE_DIGITAL_TO_REAL_ANALOG_VALUES ADDIDATA_INIT_ANALOG_INPUT_SCAN ADDIDATA_START_ANALOG_INPUT_SCAN ADDIDATA_GET_ANALOG_INPUT_SCAN_STATUS ADDIDATA_CONVERT_DIGITAL_TO_REAL_ANALOG_VALUE_SCAN ADDIDATA_STOP_ANALOG_INPUT_SCAN ADDIDATA_CLOSE_ANALOG_INPUT_SCAN ADDIDATA_RELEASE_ANALOG_INPUT ADDIDATA_TEST_ANALOG_INPUT_ASYNCHRONOUS_FIFO_FULL ADDIDATA_GET_ANALOG_INPUT_MODULE_NUMBER ADDIDATA_GET_ANALOG_INPUT_MODULE_AUTO_REFRESH_ ACQUISITION_INFORMATION ADDIDATA_GET_ANALOG_INPUT_MODULE_SEQUENCE_ ACQUISITION_INFORMATION ADDIDATA_GET_ANALOG_INPUT_AUTO_REFRESH_CHANNEL_ POINTER ADDIDATA_GET_ANALOG_INPUT_AUTO_REFRESH_MODULE_ POINTER ADDIDATA_START_ANALOG_INPUT_AUTO_REFRESH ADDIDATA_STOP_ANALOG_INPUT_AUTO_REFRESH ADDIDATA_READ_1_ANALOG_INPUT_AUTO_REFRESH_VALUE ADDIDATA_INIT_ANALOG_INPUT_SEQUENCE_ACQUISITION ADDIDATA_START_ANALOG_INPUT_SEQUENCE_ACQUISITION ADDIDATA_PAUSE_ANALOG_INPUT_SEQUENCE_ACQUISITION ADDIDATA_STOP_ANALOG_INPUT_SEQUENCE_ACQUISITION ADDIDATA_RELEASE_ANALOG_INPUT_SEQUENCE_ACQUISITION ADDIDATA_CONVERT_DIGITAL_TO_REAL_ANALOG_VALUE_SEQUENCE ADDIDATA_GET_ANALOG_INPUT_SEQUENCE_ACQUISITION_HANDLE_ STATUS ADDIDATA_GET_ANALOG_INPUT_HARDWARE_TRIGGER_INFORMATION ADDIDATA_ENABLE_DISABLE_ANALOG_INPUT_HARDWARE_TRIGGER ADDIDATA_GET_ANALOG_INPUT_HARDWARE_TRIGGER_STATUS ADDIDATA_ENABLE_DISABLE_ANALOG_INPUT_SOFTWARE_TRIGGER ADDIDATA_ANALOG_INPUT_SOFTWARE_TRIGGER ADDIDATA_GET_ANALOG_INPUT_SOFTWARE_TRIGGER_STATUS 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 b_ADDIDATA_GetNumberOfAnalogInputs b_ADDIDATA_GetNumberOfAnalogInputModules b_ADDIDATA_GetNumberOfAnalogInputsForTheModule b_ADDIDATA_GetAnalogInputInformation b_ADDIDATA_InitAnalogInput b_ADDIDATA_TestAnalogInputShortCircuit b_ADDIDATA_TestAnalogInputConnection b_ADDIDATA_Read1AnalogInput b_ADDIDATA_ReadMoreAnalogInputs b_ADDIDATA_ConvertDigitalToRealAnalogValue b_ADDIDATA_ConvertMoreDigitalToRealAnalogValues b_ADDIDATA_InitAnalogInputSCAN b_ADDIDATA_StartAnalogInputSCAN b_ADDIDATA_GetAnalogInputSCANStatus b_ADDIDATA_ConvertDigitalToRealAnalogValueSCAN b_ADDIDATA_StopAnalogInputSCAN b_ADDIDATA_CloseAnalogInputSCAN b_ADDIDATA_ReleaseAnalogInput b_ADDIDATA_TestAnalogInputAsynchronousFIFOFull b_ADDIDATA_GetAnalogInputModuleNumber b_ADDIDATA_GetAnalogInputModuleAutoRefreshInformati on b_ADDIDATA_GetAnalogInputModuleSequenceInformation b_ADDIDATA_GetAnalogInputAutoRefreshChannelPointer b_ADDIDATA_GetAnalogInputAutoRefreshModulePointer b_ADDIDATA_StartAnalogInputAutoRefresh b_ADDIDATA_StopAnalogInputAutoRefresh b_ADDIDATA_Read1AnalogInputAutoRefreshValue b_ADDIDATA_InitAnalogInputSequenceAcquisition b_ADDIDATA_StartAnalogInputSequenceAcquisition b_ADDIDATA_PauseAnalogInputSequenceAcquisition b_ADDIDATA_StopAnalogInputSequenceAcquisition b_ADDIDATA_ReleaseAnalogInputSequenceAcquisition b_ADDIDATA_ConvertDigitalToRealAnalogValueSequence b_ADDIDATA_GetAnalogInputSequenceAcquisitionHandle Status b_ADDIDATA_GetAnalogInputHardwareTriggerInformation b_ADDIDATA_EnableDisableAnalogInputHardwareTrigger b_ADDIDATA_GetAnalogInputHardwareTriggerStatus b_ADDIDATA_EnableDisableAnalogInputSoftwareTrigger b_ADDIDATA_AnalogInputSoftwareTrigger b_ADDIDATA_GetAnalogInputSoftwareTriggerStatus

17

ADDIDRIVER

Common functions

ADDIDATA_GET_ANALOG_INPUT_MODULE_GENERAL_INFORMATION ADDIDATA_GET_ANALOG_INPUT_MODULE_SINGLE_ACQUISITION_ INFORMATION ADDIDATA_GET_ANALOG_INPUT_AUTO_REFRESH_MODULE_ COUNTER_POINTER ADDIDATA_GET_ANALOG_INPUT_MODULE_SCAN_ACQUISITION_ INFORMATION ADDIDATA_INIT_ANALOG_INPUT_SCAN_ACQUISITION ADDIDATA_GET_ANALOG_INPUT_SOFTWARE_TRIGGER_ INFORMATION

840 841 842 843 844 845

b_ADDIDATA_GetAnalogInputAutoRefreshModuleCounterPointer b_ADDIDATA_GetAnalogInputModuleGeneralInformation b_ADDIDATA_GetAnalogInputModuleSingleAcquisition Information b_ADDIDATA_GetAnalogInputModuleSCANInformation b_ADDIDATA_InitAnalogInputSCANAcquisition b_ADDIDATA_GetAnalogInputSoftwareTriggerInformation

Resistance
ADDIDATA_GET_NUMBER_OF_RESISTANCE_CHANNELS ADDIDATA_GET_NUMBER_OF_RESISTANCE_CHANNEL_MODULES ADDIDATA_GET_NUMBER_OF_RESISTANCE_CHANNELS_FOR_THE_ MODULE ADDIDATA_GET_ RESISTANCE_CHANNELS_INFORMATION ADDIDATA_INIT_RESISTANCE_CHANNEL ADDIDATA_TEST_RESISTANCE_CHANNEL_SHORT_CIRCUIT ADDIDATA_TEST_RESISTANCE_CHANNEL_CONNECTION ADDIDATA_READ_1_RESISTANCE_CHANNEL ADDIDATA_READ_MORE_RESISTANCE_CHANNELS ADDIDATA_CONVERT_DIGITAL_TO_REAL_RESISTANCE_VALUE ADDIDATA_CONVERT_MORE_DIGITAL_TO_REAL_RESISTANCE_ VALUES ADDIDATA_INIT_RESISTANCE_CHANNEL_SCAN ADDIDATA_START_RESISTANCE_CHANNEL_SCAN ADDIDATA_GET_RESISTANCE_CHANNEL_SCAN_STATUS ADDIDATA_CONVERT_DIGITAL_TO_REAL_RESISTANCE_VALUE_ SCAN ADDIDATA_STOP_RESISTANCE_CHANNEL_SCAN ADDIDATA_CLOSE_RESISTANCE_CHANNEL_SCAN ADDIDATA_RELEASE_RESISTANCE_CHANNEL ADDIDATA_TEST_RESISTANCE_CHANNEL_ASYNCHRONOUS_FIFO_ FULL 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 b_ADDIDATA_GetNumberOfResistanceChannels b_ADDIDATA_GetNumberOfResistanceChannelModules b_ADDIDATA_GetNumberOfResistanceChannelsForTheModule b_ADDIDATA_GetResistanceChannelInformation b_ADDIDATA_InitResistanceChannel b_ADDIDATA_TestResistanceChannelShortCircuit b_ADDIDATA_TestResistanceChannelConnection b_ADDIDATA_Read1ResistanceChannel b_ADDIDATA_ReadMoreResistanceChannels b_ADDIDATA_ConvertDigitalToRealResistanceValue b_ADDIDATA_ConvertMoreDigitalToRealResistanceValues b_ADDIDATA_InitResistanceChannelSCAN b_ADDIDATA_StartResistanceChannelSCAN b_ADDIDATA_GetResistanceChannelSCANStatus b_ADDIDATA_ConvertDigitalToRealResistanceValueSCAN b_ADDIDATA_StopResistanceChannelSCAN b_ADDIDATA_CloseResistanceChannelSCAN b_ADDIDATA_ReleaseResistanceChannel b_ADDIDATA_TestResistanceChannelAsynchronousFIFOFull

Counter
ADDIDATA_GET_NUMBER_OF_COUNTERS ADDIDATA_GET_COUNTER_INFORMATION ADDIDATA_INIT_COUNTER ADDIDATA_COUNTER_DIRECTION ADDIDATA_ENABLE_DISABLE_COUNTER_INTERRUPT ADDIDATA_START_COUNTER ADDIDATA_START_ALL_COUNTERS ADDIDATA_CLEAR_COUNTER ADDIDATA_TRIGGER_COUNTER ADDIDATA_TRIGGER_ALL_COUNTERS ADDIDATA_STOP_COUNTER ADDIDATA_STOP_ALL_COUNTERS ADDIDATA_READ_COUNTER_VALUE ADDIDATA_READ_COUNTER_STATUS ADDIDATA_ENABLE_DISABLE_COUNTER_HARDWARE_GATE ADDIDATA_GET_COUNTER_HARDWARE_GATE_STATUS ADDIDATA_ENABLE_DISABLE_COUNTER_HARDWARE_TRIGGER ADDIDATA_GET_COUNTER_HARDWARE_TRIGGER_STATUS ADDIDATA_ENABLE_DISABLE_COUNTER_HARDWARE_OUTPUT ADDIDATA_GET_COUNTER_HARDWARE_OUTPUT_STATUS ADDIDATA_RELEASE_COUNTER ADDIDATA_TEST_COUNTER_ASYNCHRONOUS_FIFO_FULL ADDIDATA_GET_COUNTER_INFORMATION_EX 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 b_ADDIDATA_GetNumberOfCounters b_ADDIDATA_GetCounterInformation b_ADDIDATA_InitCounter b_ADDIDATA_SetCounterDirection b_ADDIDATA_EnableDisableCounterInterrupt b_ADDIDATA_StartCounter b_ADDIDATA_StartAllCounters b_ADDIDATA_ClearCounter b_ADDIDATA_TriggerCounter b_ADDIDATA_TriggerAllCounters b_ADDIDATA_StopCounter b_ADDIDATA_StopAllCounters b_ADDIDATA_ReadCounterValue b_ADDIDATA_ReadCounterStatus b_ADDIDATA_EnableDisableCounterHardwareGate b_ADDIDATA_GetCounterHardwareGateStatus b_ADDIDATA_EnableDisableCounterHardwareTrigger b_ADDIDATA_GetCounterHardwareTriggerStatus b_ADDIDATA_EnableDisableCounterHardwareOutput b_ADDIDATA_GetCounterHardwareOutputStatus b_ADDIDATA_ReleaseCounter b_ADDIDATA_TestCounterAsynchronousFIFOFull b_ADDIDATA_GetCounterInformationEx

18

Common functions

ADDIDRIVER

Pressure
ADDIDATA_GET_NUMBER_OF_PRESSURE_CHANNELS ADDIDATA_GET_NUMBER_OF_PRESSURE_MODULES ADDIDATA_GET_NUMBER_OF_PRESSURE_CHANNELS_FOR_THE_ MODULE ADDIDATA_GET_ PRESSURE_CHANNELS_INFORMATION ADDIDATA_INIT_PRESSURE_CHANNEL ADDIDATA_READ_1_PRESSURE_CHANNEL ADDIDATA_READ_MORE_PRESSURE_CHANNELS ADDIDATA_CONVERT_DIGITAL_TO_REAL_PRESSURE_VALUE ADDIDATA_CONVERT_MORE_DIGITAL_TO_REAL_PRESSURE_ VALUES ADDIDATA_INIT_PRESSURE_CHANNEL_SCAN ADDIDATA_START_PRESSURE_CHANNEL_SCAN ADDIDATA_GET_PRESSURE_CHANNEL_SCAN_STATUS ADDIDATA_CONVERT_DIGITAL_TO_REAL_PRESSURE_VALUE_ SCAN ADDIDATA_STOP_PRESSURE_CHANNEL_SCAN ADDIDATA_CLOSE_PRESSURE_CHANNEL_SCAN ADDIDATA_RELEASE_PRESSURE_CHANNEL ADDIDATA_TEST_PRESSURE_CHANNEL_ASYNCHRONOUS_FIFO_ FULL 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1118 b_ADDIDATA_GetNumberOfPressureChannels b_ADDIDATA_GetNumberOfPressureModules b_ADDIDATA_GetNumberOfPressureChannelsForTheModul e b_ADDIDATA_GetPressureChannelInformation b_ADDIDATA_InitPressureChannel b_ADDIDATA_Read1PressureChannel b_ADDIDATA_ReadMorePressureChannels b_ADDIDATA_ConvertDigitalToRealPressureValue b_ADDIDATA_ConvertMoreDigitalToRealPressureValues b_ADDIDATA_InitPressureSCAN b_ADDIDATA_StartPressureSCAN b_ADDIDATA_GetPressureSCANStatus b_ADDIDATA_ConvertDigitalToRealPressureValueSCAN b_ADDIDATA_StopPressureChannelSCAN b_ADDIDATA_ClosePressureChannelSCAN b_ADDIDATA_ReleasePressureChannel b_ADDIDATA_TestPressureChannelAsynchronousFIFOFull

Transducer
ADDIDATA_GET_NUMBER_OF_TRANSDUCERS_CHANNELS ADDIDATA_GET_NUMBER_OF_TRANSDUCER_MODULES ADDIDATA_GET_NUMBER_OF_TRANSDUCER_CHANNELS_FOR_THE_ MODULE ADDIDATA_GET_TRANSDUCER_CHANNEL_MODULE_NUMBER ADDIDATA_GET_TRANSDUCER_MODULE_GENERAL_INFORMATION ADDIDATA_GET_TRANSDUCER_MODULE_SINGLE_ACQUISITION_ INFORMATION ADDIDATA_GET_TRANSDUCER_MODULE_AUTO_REFRESH_ACQUISIT ION_INFORMATION ADDIDATA_GET_TRANSDUCER_MODULE_SEQUENCE_ACQUISITION_ INFORMATION ADDIDATA_INIT_TRANSDUCER_CHANNEL ADDIDATA_RELEASE_TRANSDUCER_CHANNEL ADDIDATA_READ_1_TRANSDUCER_CHANNEL ADDIDATA_CONVERT_DIGITAL_TO_REAL_METRIC_VALUE ADDIDATA_READ_MORE_TRANSDUCER_CHANNELS ADDIDATA_CONVERT_MORE_DIGITAL_TO_REAL_METRIC_VALUE ADDIDATA_GET_TRANSDUCER_HARDWARE_TRIGGER_INFORMATION ADDIDATA_ENABLE_DISABLE_TRANSDUCER_HARDWARE_TRIGGER ADDIDATA_GET_TRANSDUCER_HARDWARE_TRIGGER_STATUS ADDIDATA_ENABLE_DISABLE_TRANSDUCER_SOFTWARE_TRIGGER ADDIDATA_TRANSDUCER_SOFTWARE_TRIGGER ADDIDATA_GET_TRANSDUCER_SOFTWARE_TRIGGER_STATUS ADDIDATA_GET_TRANSDUCER_HARDWARE_GATE_INFORMATION ADDIDATA_ENABLE_DISABLE_TRANSDUCER_HARDWARE_GATE ADDIDATA_GET_TRANSDUCER_HARDWARE_GATE_STATUS ADDIDATA_TEST_TRANSDUCER_CHANNEL_SECONDARY_CONNECTION ADDIDATA_ENABLE_DISABLE_TRANSDUCER_MODULE_PRIMARY_ CONNECTION_TEST ADDIDATA_TEST_TRANSDUCER_MODULE_PRIMARY_CONNECTION ADDIDATA_ENABLE_DISABLE_TRANSDUCER_MODULE_PRIMARY_ SHORT_CIRCUIT_INTERRUPT ADDIDATA_INIT_TRANSDUCER_SEQUENCE_ACQUISITION ADDIDATA_START_TRANSDUCER_SEQUENCE_ACQUISITION ADDIDATA_PAUSE_TRANSDUCER_SEQUENCE_ACQUISITION ADDIDATA_STOP_TRANSDUCER_SEQUENCE_ACQUISITION 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 b_ADDIDATA_GetNumberOfTransducerChannels b_ADDIDATA_GetNumberOfTransducerModules b_ADDIDATA_GetNumberOfTransducerChannelsForThe Module b_ADDIDATA_GetTransducerChannelModuleNumber b_ADDIDATA_GetTransducerModuleGeneralInformation b_ADDIDATA_GetTransducerModuleSingleAcquisition Information b_ADDIDATA_GetTransducerModuleAutoRefresh Information b_ADDIDATA_GetTransducerModuleSequenceInformation b_ADDIDATA_InitTransducerChannel b_ADDIDATA_ReleaseTransducerChannel b_ADDIDATA_Read1TransducerChannel b_ADDIDATA_ConvertDigitalToRealMetricValue b_ADDIDATA_ReadMoreTransducerChannels b_ADDIDATA_ConvertMoreDigitalToRealMetricValue b_ADDIDATA_GetTransducerHardwareTriggerInformations b_ADDIDATA_EnableDisableTransducerHardwareTrigger b_ADDIDATA_GetTransducerHardwareTriggerStatus b_ADDIDATA_EnableDisableTransducerSoftwareTrigger b_ADDIDATA_TransducerSoftwareTrigger b_ADDIDATA_GetTransducerSoftwareTriggerStatus b_ADDIDATA_GetTransducerHardwareGateInformations b_ADDIDATA_EnableDisableTransducerHardwareGate b_ADDIDATA_GetTransducerHardwareGateStatus b_ADDIDATA_TestTransducerChannelSecondaryConnection b_ADDIDATA_EnableDisableTransducerModulePrimary ConnectionTest b_ADDIDATA_TestTransducerModulePrimaryConnection b_ADDIDATA_EnableDisableTransducerModulePrimaryShort CircuitInterrupt b_ADDIDATA_InitTransducerSequenceAcquisition b_ADDIDATA_StartTransducerSequenceAcquisition b_ADDIDATA_PauseTransducerSequenceAcquisition b_ADDIDATA_StopTransducerSequenceAcquisition

19

ADDIDRIVER

Common functions

ADDIDATA_RELEASE_TRANSDUCER_SEQUENCE_ACQUISITION ADDIDATA_CONVERT_TRANSDUCER_SEQUENCE_DIGITAL_TO_REAL _METRIC_VALUE ADDIDATA_GET_TRANSDUCER_SEQUENCE_ACQUISITION_HANDLE_ STATUS ADDIDATA_REARM_TRANSDUCER_MODULE_PRIMARY_SHORT_ CIRCUIT_CONNECTION_TEST ADDIDATA_GET_TRANSDUCER_MODULE_CONVERT_TIME_DIVISION _FACTOR_INFORMATION ADDIDATA_INIT_TRANSDUCER_MODULE_CONVERT_TIME_DIVISION _FACTOR ADDIDATA_RELEASE_TRANSDUCER_MODULE_CONVERT_TIME_ DIVISION_FACTOR ADDIDATA_GET_TRANSDUSER_AUTO_REFRESH_CHANNEL_POINTER ADDIDATA_GET_TRANSDUSER_AUTO_REFRESH_MODULE_POINTER ADDIDATA_GET_TRANSDUSER_AUTO_REFRESH_MODULE_COUNTER _POINTER ADDIDATA_START_TRANSDUSER_AUTO_REFRESH ADDIDATA_STOP_TRANSDUSER_AUTO_REFRESH ADDIDATA_SET_TRANSDUSER_AUTO_REFRESH_AVERAGE_VALUE ADDIDATA_SET_TRANSDUSER_AUTO_REFRESH_AVERAGE_MODE ADDIDATA_SET_TRANSDUCER_AUTO_REFRESH_THREAD ADDIDATA_GET_TRANSDUCER_HARDWARE_TRIGGER_INFORMATIO N_EX ADDIDATA_ENABLE_DISABLE_TRANSDUCER_HARDWARE_TRIGGER _EX ADDIDATA_READ_1_TRANSDUCER_AUTO_REFRESH_VALUE ADDIDATA_READ_TRANSDUCER_AUTO_REFRESH_COUNTER_VALUE

1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249

b_ADDIDATA_ReleaseTransducerSequenceAcquisition b_ADDIDATA_ConvertTransducerSequenceDigitalToReal MetricValue b_ADDIDATA_GetTransducerSequenceAcquisitionHandleStatus b_ADDIDATA_RearmTransducerModulePrimaryShortCircuit ConnectionTest b_ADDIDATA_GetTransducerModuleConvertTimeDivisionFa ctorInformation b_ADDIDATA_InitTransducerModuleConvertTimeDivisionFa ctor b_ADDIDATA_ReleaseTransducerModuleConvertTime DivisionFactor b_ADDIDATA_GetTransducerAutoRefreshChannelPointer b_ADDIDATA_GetTransducerAutoRefreshModulePointer b_ADDIDATA_GetTransducerAutoRefreshModuleCounter Pointer b_ADDIDATA_StartTransducerAutoRefresh b_ADDIDATA_StopTransducerAutoRefresh b_ADDIDATA_SetTransducerAutoRefreshAverageValue b_ADDIDATA_SetTransducerAutoRefreshAverageMode b_ADDIDATA_TransducerAutoRefreshThread b_ADDIDATA_GetTransducerHardwareTriggerInformationEx b_ADDIDATA_EnableDisableTransducerHardwareTriggerEx b_ADDIDATA_Read1TransducerAutoRefreshValue b_ADDIDATA_ReadTransducerAutoRefreshCounterValue

20

Common functions

ADDIDRIVER

Table 2-3: Error number


Constant Return value Meaning

Interrupt errors
ADDIDATA_INTERRUPT_USER_SHARED_MEMORY_SIZE_ERROR ADDIDATA_INTERRUPT_SHARED_MEMORY_MODE_ERROR ADDIDATA_INTERRUPT_USER_CALLING_MODE_ERROR ADDIDATA_INTERRUPT_FUNCTIONALITY_ALREADY_INSTALLED ADDIDATA_INTERRUPT_USER_SHARED_MEMORY_NOT_FOUND ADDIDATA_INTERRUPT_USER_SHARED_MEMORY_ALLOCATION_ERROR ADDIDATA_INTERRUPT_USER_INSTALLATION_FUNCTION_ERROR ADDIDATA_INTERRUPT_PREPARE_FUNCTIONALITY_INTERRUPT_FUNCTION_ERROR ADDIDATA_INTERRUPT_PREPARE_API_INTERRUPT_FUNCTION_ERROR ADDIDATA_INTERRUPT_INSTALL_API_INTERRUPT_FUNCTION_ERROR ADDIDATA_INTERRUPT_NO_INDEX_AVAILABLE ADDIDATA_INTERRUPT_INDEX_NUMBER_ERROR ADDIDATA_INTERRUPT_FUNCTIONALITY_NUMBER_ERROR ADDIDATA_INTERRUPT_FUNCTIONALITY_NOT_INSTALLED ADDIDATA_INTERRUPT_END_FUNCTIONALITY_EXEC_ERROR ADDIDATA_INTERRUPT_API_UNINSTALL_ERROR ADDIDATA_INTERRUPT_END_API_EXEC_ERROR ADDIDATA_INTERRUPT_FUNCTIONALITY_SELECTION_ERROR ADDIDATA_INTERRUPT_API_THREAD_CREATION_ERROR ADDIDATA_INTERRUPT_API_EVENT_CREATION_ERROR ADDIDATA_INTERRUPT_NO_INTERRT_INITIALISED ADDIDATA_INTERRUPT_FLAG_ERROR ADDIDATA_ACPI_ACTIV_AND_USE_OF_WINDOWS_NT4 ADDIDATA_PNP_OS_ACPI_AND_USE_OF_WINDOWS_NT4 -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 Selected size for the user shared memory is wrong Selected mode for the user shared memory is wrong The selected user calling mode is wrong Interrupt for the selected functionality is already installed Cannot find the user shared memory No memory available for the allocation of the user shared memory Error when installing the user function Error by preparing the interrupt function for each functionality Error by preparing the API interrupt function API interrupt installation error. Interrupt already used The selected functionality interrupt cannot be enabled The selected functionality interrupt cannot be disabled The selected functionality number is wrong User interrupt function not installed Error by releasing the functionality interrupt Error when uninstalling the API interrupt Error by releasing the API interrupt The selected interrupt functionality is wrong Error in the creation of the API interrupt thread Error in the creation of the API interrupt event No interrupt initialised Interrupt flag error ACPI mode is set and has conflict with Windows NT 4.0 Plug & Play option and ACPI mode is set: conflict with Windows NT 4.0

Timer errors
ADDIDATA_TIMER_NUMBER_ERROR ADDIDATA_TIMER_RELOAD_VALUE_ERROR ADDIDATA_TIMER_UNIT_ERROR ADDIDATA_TIMER_MODE_ERROR ADDIDATA_TIMER_INTERRUPT_FLAG_ERROR ADDIDATA_TIMER_HARDWARE_GATE_ LEVEL_ERROR ADDIDATA_TIMER_HARDWARE_GATE_LEVEL_SELECTION_ERROR ADDIDATA_TIMER_HARDWARE_GATE_FLAG_ERROR ADDIDATA_TIMER_HARDWARE_TRIGGER_ LEVEL_ERROR ADDIDATA_TIMER_HARDWARE_TRIGGER_LEVEL_SELECTION_ERROR ADDIDATA_TIMER_HARDWARE_TRIGGER_FLAG_ERROR ADDIDATA_TIMER_HARDWARE_OUTPUT_ LEVEL_ERROR ADDIDATA_TIMER_HARDWARE_OUTPUT_LEVEL_SELECTION_ERROR ADDIDATA_TIMER_HARDWARE_OUTPUT_FLAG_ERROR ADDIDATA_TIMER_ALREADY_USED ADDIDATA_TIMER_INFORMATION_STRUCTURE_INVALID_SIZE -200 -201 -202 -203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 The selected timer number is wrong The timer reload value is wrong The selected time unit for the timer is wrong The selected timer mode is wrong Timer interrupt flag is wrong Timer hardware gate not available The selected hardware gate level is wrong The flag of the hardware gate is wrong Timer hardware trigger not available Hardware trigger level selection error The flag of the hardware trigger is wrong Timer output not available Timer output level selection error The flag of the timer output is wrong Timer already used by another process or used as a watchdog The timer struct size is wrong

21

ADDIDRIVER

Common functions

Constant

Return value

Meaning

Watchdog errors
ADDIDATA_WATCHDOG_NUMBER_ERROR ADDIDATA_WATCHDOG_DELAY_VALUE_ERROR ADDIDATA_WATCHDOG_UNIT_ERROR ADDIDATA_WATCHDOG_INTERRUPT_FLAG_ERROR ADDIDATA_WATCHDOG_HARDWARE_GATE_LEVEL_ERROR ADDIDATA_WATCHDOG_HARDWARE_GATE_LEVEL_SELECTION_ERROR ADDIDATA_WATCHDOG_HARDWARE_GATE_FLAG_ERROR ADDIDATA_WATCHDOG_HARDWARE_TRIGGER_ LEVEL_ERROR ADDIDATA_WATCHDOG_HARDWARE_TRIGGER_LEVEL_SELECTION_ERROR ADDIDATA_WATCHDOG_HARDWARE_TRIGGER_FLAG_ERROR ADDIDATA_WARNING_DELAY_VALUE_ERROR ADDIDATA_WARNING_DELAY_TIME_UNIT_ERROR ADDIDATA_WATCHDOG_WARNING_RELAY_FLAG_ERROR ADDIDATA_WATCHDOG_RESET_RELAY_FLAG_ERROR ADDIDATA_ WATCHDOG_ALREADY_USED ADDIDATA_WATCHDOG_INFORMATION_STRUCTURE_INVALID_SIZE ADDIDATA_WATCHDOG_RESET_RELAY_MODE_SELECTION_ERROR ADDIDATA_WATCHDOG_CREATE_THREAD_ERROR ADDIDATA_WATCHDOG_GET_MX_EVENT_IDENTIFIER_ERROR -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 Watchdog number error Watchdog delay selection error Watchdog unit selection error The flag of the watchdog interrupt is wrong Watchdog hardware gate not available Hardware gate level selection error the flag of the hardware gate is wrong Watchdog hardware trigger not available Hardware trigger level selection error The flag of the hardware trigger is wrong The selected warning delay is wrong The selected time unit for the warning delay is wrong The flag of the warning relay is wrong The flag of the reset relay is wrong Watchdog already used by another process or used as a timer The specified size is wrong. The specified reset relay mode is wrong. Creating watchdog thread error Getting watchdog mutex event identifier error

Analog measurement errors


ADDIDATA_ ANALOG_MEASURE_CHANNEL_NUMBER_ERROR ADDIDATA_ANALOG_MEASURE_CONVERSION_STARTED ADDIDATA_ ANALOG_MEASURE_WARNING_FLAG_ERROR ADDIDATA_ ANALOG_MEASURE_CONVERTING_TIME_ERROR ADDIDATA_ ANALOG_MEASURE_CONVERTING_TIME_UNIT_ERROR ADDIDATA_ ANALOG_MEASURE_INTERRUPT_FLAG_ERROR ADDIDATA_ ANALOG_MEASURE_INTERRUPT_NOT_AVAILABLE ADDIDATA_ ANALOG_MEASURE_WARNING_VALUE_ERROR ADDIDATA_ ANALOG_MEASURE_CHANNEL_ALREADY_USED ADDIDATA_ ANALOG_MEASURE_WARNING_ALREADY_USED ADDIDATA_ANALOG_MEASURE_GAIN_ERROR ADDIDATA_ANALOG_MEASURE_POLARITY_PARAMETER_ERROR ADDIDATA_ANALOG_MEASURE_OFFSET_RANGE_ERROR ADDIDATA_ANALOG_MEASURE_CHANNEL_NOT_INITIALISED ADDIDATA_ANALOG_MEASURE_POLARITY_MODE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SCAN_MODE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SCAN_MODE_PARAMETER_ERROR ADDIDATA_ANALOG_MEASURE_EXTERN_TRIGGER_MODE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_EXTERN_TRIGGER_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_EXTERN_TRIGGER_PARAMETER_ERROR ADDIDATA_ANALOG_MEASURE_EXTERN_GATE_MODE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_EXTERN_GATE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_EXTERN_GATE_PARAMETER_ERROR ADDIDATA_ANALOG_MEASURE_COMMON_GAIN_ERROR ADDIDATA_ANALOG_MEASURE_COMMON_POLARITY_ERROR ADDIDATA_ANALOG_MEASURE_COMMON_OFFSET_RANGE_ERROR ADDIDATA_ANALOG_MEASURE_SCAN_DELAY_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SCAN_DELAY_VALUE_ERROR ADDIDATA_ANALOG_MEASURE_INTERRUPT_NOT_INSTALLED ADDIDATA_ANALOG_MEASURE_SCAN_NOT_INITIALISED ADDIDATA_ANALOG_MEASURE_MODULE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SCAN_ALREADY_STARTED ADDIDATA_ANALOG_MEASURE_SCAN_COUNTER_VALUE_ERROR -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 The channel number is wrong Conversion already started. Cannot start a new conversion Warning not available The selected converting time value is wrong The selected converting time unit is wrong Interrupt flag selection error Interrupt not available Warning value selection error Channel already used by another process Warning already used by another process Gain selection is wrong Polarity parameter is wrong Offset range selection is wrong The channel to convert is not initialised Polarity mode is not available The selected SCAN mode is not available The SCAN mode parameter is wrong The external trigger mode is not available The external trigger is not available The external trigger parameter is wrong The external gate mode is not available The external gate is not available The external gate parameter is wrong The gain must be the same for all channels The polarity must be the same for all channels The offset range must be the same for all channels The SCAN delay is not available The value for the SCAN delay cannot be used The interrupt function is not installed The SCAN is not initialised The selected module is not available The selected scan is already started The SCAN counter value is wrong

22

Common functions

ADDIDRIVER

ADDIDATA_ANALOG_MEASURE_SCAN_NOT_STARTED ADDIDATA_ANALOG_MEASURE_SCAN_NOT_STOPPED

-433 -434

The selected SCAN is not started The selected SCAN is not stopped

Analog measurement errors


ADDIDATA_ANALOG_MEASURE_SCAN_SAME_MODULE_REQUIRED ADDIDATA_ANALOG_MEASURE_SCAN_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SCAN_CHANNEL_SELECTION_ERROR -435 -436 -437 All channels for the SCAN process must be from the same module The SCAN functionality is not available Since the SCAN is determined by hardware, the channel selection is wrong. The first channel must be the first channel of the module and the last channel must be the last channel of the module. The selected SCAN delay mode is not available. The coupling mode is not available The coupling mode must be the same for all channels The coupling mode parameter is wrong The module index is not available The conversion cannot be completed The structure passed as a parameter is invalid The sign test parameter is not available The flag of the hardware trigger is wrong The selected counter value for the trigger is wrong Hardware trigger already initialised by another process Hardware trigger not initialised Software trigger not available The selected mode for the software trigger is not available The flag of the software trigger is wrong Software trigger already initialised by another process Software trigger not initialised The flag of the hardware gate is wrong Hardware gate already initialised by another process Hardware gate not initialised All channels for the sequence process must be from the same module The sequence delay is not available The delay value cannot be used for the sequence The selected delay time unit is wrong The selected sequence is already started The number of selected sequences is wrong The number of interrupt sequences is wrong The selected sequence is not started The selected sequence is not stopped Since the sequence is determined by hardware, the channel selection is wrong. The first channel must be the first channel of the module and the last channel must be the last channel of the module. The selected sequence delay mode is not available. No free handle found for the sequence initialisation. Max 10 handles for one module available Sequence memory allocation error. Error in the memory allocation for the sequence description list Selected sequence handle is wrong Error by initialising the sequence delay Error in the initialisation of the sequence description list Error by resetting the sequence description list

ADDIDATA_ANALOG_MEASURE_SCAN_DELAY_MODE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_COUPLING_MODE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_COMMON_COUPLING_ERROR ADDIDATA_ANALOG_MEASURE_COUPLING_PARAMETER_ERROR ADDIDATA_ANALOG_MEASURE_HARDWARE_INDEX_ERROR ADDIDATA_ANALOG_MEASURE_CONVERSION_ERROR ADDIDATA_ANALOG_MEASURE_INVALID_STRUCTURE ADDIDATA_ANALOG_MEASURE_SIGN_TEST_PARAMETER_ERROR ADDIDATA_ANALOG_MEASURE_EXTERN_TRIGGER_FLAG_ERROR ADDIDATA_ANALOG_MEASURE_EXTERN_TRIGGER_COUNTER_ERROR ADDIDATA_ANALOG_MEASURE_EXTERN_TRIGGER_ALREADY_USED ADDIDATA_ANALOG_MEASURE_EXTERN_TRIGGER_NOT_INITIALISED ADDIDATA_ANALOG_MEASURE_SOFTWARE_TRIGGER_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SOFTWARE_TRIGGER_MODE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SOFTWARE_TRIGGER_FLAG_ERROR ADDIDATA_ANALOG_MEASURE_SOFTWARE_TRIGGER_ALREADY_USED ADDIDATA_ANALOG_MEASURE_SOFTWARE_TRIGGER_NOT_INITIALISED ADDIDATA_ANALOG_MEASURE_EXTERN_GATE_FLAG_ERROR ADDIDATA_ANALOG_MEASURE_EXTERN_GATE_ALREADY_USED ADDIDATA_ANALOG_MEASURE_EXTERN_GATE_NOT_INITIALISED ADDIDATA_ANALOG_MEASURE_SEQUENCE_SAME_MODULE_REQUIRED ADDIDATA_ANALOG_MEASURE_SEQUENCE_DELAY_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SEQUENCE_DELAY_VALUE_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_DELAY_TIME_UNIT_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_ALREADY_STARTED ADDIDATA_ANALOG_MEASURE_SEQUENCE_COUNTER_VALUE_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_INTERRUPT_COUNTER_VALUE_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_NOT_STARTED ADDIDATA_ANALOG_MEASURE_SEQUENCE_NOT_STOPPED ADDIDATA_ANALOG_MEASURE_SEQUENCE_CHANNEL_SELECTION_ERROR

-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

ADDIDATA_ANALOG_MEASURE_SEQUENCE_DELAY_MODE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SEQUENCE_NO_FREE_HANDLE_FOUND

-468 -469

ADDIDATA_ANALOG_MEASURE_SEQUENCE_MEMORY_ALLOCATION_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_DESCRIPTION_LIST_CREATION_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_HANDLE_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_DELAY_MODE_SETTING_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_DESCRIPTION_LIST_SETTING_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_RESET_DESCRIPTION_LIST_ERROR

-470 -471 -472 -473 -474 -475

23

ADDIDRIVER

Common functions

ADDIDATA_ANALOG_MEASURE_SEQUENCE_ENABLE_TRANSFER_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_START_TRANSFER_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_STOP_TRANSFER_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_CONTINUE_TRANSFER_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_PAUSE_TRANSFER_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_ABORT_TRANSFER_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_ENABLE_TRANSFER_INTERRUPT_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_DISABLE_TRANSFER_INTERRUPT_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_MODULE_INITIALISATION_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_MODULE_MODE_INITIALISATION_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_MODULE_MODE_CLEAR_INDEX_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_MODULE_START_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_MODULE_PAUSE_ERROR ADDIDATA_ANALOG_MEASURE_SEQUENCE_MODULE_STOP_ERROR ADDIDATA_TRANSDUCER_TYPE_SELECTION_ERROR ADDIDATA_TRANSDUCER_FREQUENCY_SELECTION_ERROR ADDIDATA_TRANSDUCER_PRIMARY_MODULE_CONNECTION_TEST_ALREADY_USED ADDIDATA_TRANSDUCER_PRIMARY_MODULE_CONNECTION_FLAG_ERROR ADDIDATA_TRANSDUCER_NO_SENSOR_CONNECTED ADDIDATA_ANALOG_MEASURE_AUTO_REFRESH_NOT_STARTED ADDIDATA_ANALOG_MEASURE_AUTO_REFRESH_NOT_STOPPED ADDIDATA_TRANSDUCER_PRIMARY_SHORT_CIRCUIT_OCCUR ADDIDATA_ANALOG_MEASURE_SEQUENCE_SAME_FREQUENCY_REQUIRED ADDIDATA_ANALOG_MEASURE_EXTERN_TRIGGER_CYCLE_ERROR ADDIDATA_ANALOG_MEASURE_CONVERT_TIME_DIVISION_FACTOR_ALREADY_USED ADDIDATA_ANALOG_MEASURE_CONVERT_TIME_DIVISION_FACTOR_VALUE_ERROR ADDIDATA_ANALOG_MEASURE_CONVERT_TIME_DIVISION_FACTOR_NOT_INITIALISED ADDIDATA_ANALOG_MEASURE_CREATE_THREAD_ERROR ADDIDATA_ANALOG_MEASURE_CHANNEL_GROUP_INITIALISATION_NOT_THE_SAME ADDIDATA_ANALOG_MEASURE_AVERAGE_VALUE_ERROR

-476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -900 -901 -902 -903 -904 -905

Error for enabling the transfer sequence Error for starting the transfer sequence Error for stopping the transfer sequence Error for continuing the transfer sequence Error by transfer sequence pause Error for aborting the transfer sequence Error by enabling the interrupt of the transfer sequence Error by disabling the interrupt of the transfer sequence Error in the initialisation of the sequence list Error in the initialisation of the sequence mode Error by clearing the sequence index Error by starting the sequence module Error in the pause of the sequence module Error by stopping the sequence module Selected transducer type is not available Selected frequency for the selected transducer is not available Transducer module connection test already initialised by another process The flag of the primary connection test is wrong No transducer connected to the module Auto refresh acquisition not started Auto refresh acquisition not stopped Primary short circuit occurred Same frequency required for all transducers Hardware trigger cycle counter value is wrong Conversion time division factor already initialised by another process Convert time division factor selection is wrong Convert time division factor not initialised Thread error created Channel group initialisation is not the same Average value error

Digital input errors


ADDIDATA_DIGITAL_INPUT_CHANNEL_NUMBER_ERROR ADDIDATA_DIGITAL_INPUT_PORT_NUMBER_ERROR ADDIDATA_DIGITAL_INPUT_ACCESS_ERROR ADDIDATA_DIGITAL_INPUT_INTERRUPT_ALREADY_USED ADDIDATA_DIGITAL_INPUT_INTERRUPT_ALREADY_RELEASED ADDIDATA_DIGITAL_INPUT_INTERRUPT_FLAG_ERROR ADDIDATA_DIGITAL_INPUT_INTERRUPT_LOGIC_ERROR ADDIDATA_DIGITAL_INPUT_INFORMATION_STRUCTURE_INVALID_SIZE ADDIDATA_DIGITAL_INPUT_LEVEL_VALUE_SELECTION_ERROR ADDIDATA_DIGITAL_INPUT_CHANNEL_ARRAY_SIZE_ERROR ADDIDATA_DIGITAL_INPUT_CHANNEL_SELECTION_ERROR ADDIDATA_DIGITAL_INPUT_MODULE_SELECTION_ERROR ADDIDATA_DIGITAL_INPUT_FILTER_UNIT_ERROR ADDIDATA_DIGITAL_INPUT_FILTER_DELAY_VALUE_ERROR ADDIDATA_DIGITAL_INPUT_FILTER_NOT_INITIALISED ADDIDATA_DIGITAL_INPUT_FILTER_FLAG_ERROR ADDIDATA_DIGITAL_INPUT_LEVEL_FLAG_ERROR ADDIDATA_DIGITAL_INPUT_MASK_ERROR -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 The number of the digtal input channel is wrong The number of the digtal input port is wrong No digital input access port is available The digital input interrupt is already used The digital input interrupt is already released The digital input interrupt flag is wrong The digital input interrupt logic is wrong The structure size passed is invalid The selection of the input level value is invalid The channel array size passed is invalid The number of the digtal input channel is wrong The number of the digital input module is wrong The selected time unit for the filter is wrong Error in the filter time selection Digital input filter not initialised The digital input filter flag parameter is wrong The digital input level flag parameter is wrong The set mask for digital input interrupt is wrong

24

Common functions

ADDIDRIVER

Constant

Return value

Meaning

Digital output errors


ADDIDATA_DIGITAL_OUTPUT_CHANNEL_NUMBER_ERROR ADDIDATA_DIGITAL_OUTPUT_PORT_NUMBER_ERROR ADDIDATA_DIGITAL_OUTPUT_VALUE_ERROR ADDIDATA_DIGITAL_OUTPUT_ACCESS_ERROR ADDIDATA_DIGITAL_OUTPUT_MEMORY_ALREADY_ENABLED ADDIDATA_DIGITAL_OUTPUT_MEMORY_ALREADY_DISABLED ADDIDATA_DIGITAL_OUTPUT_INTERRUPT_ALREADY_USED ADDIDATA_DIGITAL_OUTPUT_INTERRUPT_ALREADY_RELEASED ADDIDATA_DIGITAL_OUTPUT_INTERRUPT_FLAG_ERROR -600 -601 -602 -603 -604 -605 -606 -607 -608 The number of the digtal output channel is wrong The number of the digtal output port is wrong The digital output value is wrong No digital output access port is available The digital output memory is already active The digital output memory is already deactivated The digital output interrupt is already used The digital output interrupt is already released The digital output interrupt flag is wrong

Analog output errors


ADDIDATA_ANALOG_OUTPUT_CHANNEL_NUMBER_ERROR ADDIDATA_ANALOG_OUTPUT_VOLTAGE_MODE_ERROR ADDIDATA_ANALOG_OUTPUT_POLARITY_ERROR ADDIDATA_ANALOG_OUTPUT_VALUE_ERROR ADDIDATA_ANALOG_OUTPUT_ENABLE_DISABLE_SYNC_ERROR ADDIDATA_ANALOG_OUTPUT_ALREADY_USED ADDIDATA_ANALOG_OUTPUT_TIMEOUT ADDIDATA_ANALOG_OUTPUT_TIMEOUT_ERROR ADDIDATA_ANALOG_OUTPUT_ALREADY_RELEASED -700 -701 -702 -703 -704 -705 -706 -707 -708 The analog output channel number is wrong The analog output voltage mode is wrong The analog output polarity is wrong The analog output value is wrong No analog output synchronisation is available Analog output channel already used by another process Timeout has occurred Conversion timeout for the analog outputs could not be measured Analog output already released

Error sources Common function errors pdw_ErrorSource Timer errors


ADDIDATA_TIMER_NUMBER_ERROR ADDIDATA_TIMER_RELOAD_VALUE_ERROR ADDIDATA_TIMER_UNIT_ERROR ADDIDATA_TIMER_MODE_ERROR ADDIDATA_TIMER_INTERRUPT_FLAG_ERROR ADDIDATA_TIMER_HARDWARE_GATE_ LEVEL_ERROR ADDIDATA_TIMER_HARDWARE_GATE_LEVEL_SELECTION_ERROR ADDIDATA_TIMER_HARDWARE_GATE_FLAG_ERROR ADDIDATA_TIMER_HARDWARE_TRIGGER_ LEVEL_ERROR ADDIDATA_TIMER_HARDWARE_TRIGGER_LEVEL_SELECTION_ERROR ADDIDATA_TIMER_HARDWARE_TRIGGER_FLAG_ERROR ADDIDATA_TIMER_HARDWARE_OUTPUT_ LEVEL_ERROR ADDIDATA_TIMER_HARDWARE_OUTPUT_LEVEL_SELECTION_ERROR ADDIDATA_TIMER_HARDWARE_OUTPUT_FLAG_ERROR ADDIDATA_TIMER_ALREADY_USED The selected timer number The selected wrong timer reload value The selected wrong time unit The selected wrong timer mode Timer selected wrong interrupt flag Timer selected wrong hardware gate The selected wrong hardware gate level The selected wrong flag of the hardware gate Timer selected wrong hardware trigger level Hardware selected wrong trigger level The selected wrong flag of the hardware trigger Timer selected wrong output level selection Timer selected wrong output level selection The selected wrong flag of the timer output The selected wrong timer number

Pdw_ErrorSource contain

Counter errors
ADDIDATA_COUNTER_NUMBER_ERROR ADDIDATA_COUNTER_RELOAD_VALUE_ERROR ADDIDATA_COUNTER_COUNTER_UP_DOWN_FLAG_ERROR ADDIDATA_COUNTER_INPUT_LEVEL_ERROR ADDIDATA_COUNTER_INTERRUPT_FLAG_ERROR ADDIDATA_COUNTER_HARDWARE_GATE_ LEVEL_ERROR ADDIDATA_COUNTER_HARDWARE_GATE_LEVEL_SELECTION_ERROR ADDIDATA_COUNTER_HARDWARE_GATE_FLAG_ERROR ADDIDATA_COUNTER_HARDWARE_TRIGGER_ LEVEL_ERROR ADDIDATA_COUNTER_HARDWARE_TRIGGER_LEVEL_SELECTION_ERROR The selected wrong counter number The selected wrong counter reload value Counter selected wrong Up/Down selection Counter selected wrong input level selection Counter selected wrong interrupt flag Counter selected wrong hardware gate The selected wrong hardware gate level The selected wrong hardware flag Counter selected wrong hardware trigger Hardware selected wrong trigger level

25

ADDIDRIVER

Common functions

ADDIDATA_COUNTER_HARDWARE_TRIGGER_FLAG_ERROR ADDIDATA_COUNTER_HARDWARE_OUTPUT_ LEVEL_ERROR ADDIDATA_COUNTER_HARDWARE_OUTPUT_LEVEL_SELECTION_ERROR ADDIDATA_COUNTER_HARDWARE_OUTPUT_FLAG_ERROR ADDIDATA_COUNTER_ALREADY_USED

The selected wrong hardware trigger flag Counter selected wrong output level Counter selected wrong output level The selected wrong flag of the counter output The selected wrong counter number

Watchdog errors
ADDIDATA_WATCHDOG_NUMBER_ERROR ADDIDATA_WATCHDOG_DELAY_VALUE_ERROR ADDIDATA_WATCHDOG_UNIT_ERROR ADDIDATA_WATCHDOG_INTERRUPT_FLAG_ERROR ADDIDATA_WATCHDOG_HARDWARE_GATE_LEVEL_ERROR ADDIDATA_WATCHDOG_HARDWARE_GATE_LEVEL_SELECTION_ERROR ADDIDATA_WATCHDOG_HARDWARE_GATE_FLAG_ERROR ADDIDATA_WATCHDOG_HARDWARE_TRIGGER_ LEVEL_ERROR ADDIDATA_WATCHDOG_HARDWARE_TRIGGER_LEVEL_SELECTION_ERRO R ADDIDATA_WATCHDOG_HARDWARE_TRIGGER_FLAG_ERROR ADDIDATA_WARNING_DELAY_VALUE_ERROR ADDIDATA_WARNING_DELAY_TIME_UNIT_ERROR ADDIDATA_WATCHDOG_WARNING_RELAY_FLAG_ERROR ADDIDATA_WATCHDOG_RESET_RELAY_FLAG_ERROR ADDIDATA_ WATCHDOG_ALREADY_USED ADDIDATA_WATCHDOG_RESET_RELAY_MODE_SELECTION_ERROR The selected wrong watchdog number The selected wrong watchdog delay The selected wrong watchdog unit The selected wrong interrupt flag The selected wrong watchdog hardware gate The selected wrong hardware gate level The selected wrong hardware gate flag The selected wrong watchdog hardware trigger The selected wrong hardware trigger level The selected wrong hardware trigger flag The selected wrong warning delay value The selected wrong warning time unit The selected wrong warning relay flag The selected wrong reset relay flag The selected wrong watchdog number The selected wrong reset relay mode.

Analog measure errors


ADDIDATA_ ANALOG_MEASURE_CHANNEL_NUMBER_ERROR ADDIDATA_ANALOG_MEASURE_CONVERSION_STARTED ADDIDATA_ ANALOG_MEASURE_CONVERTING_TIME_ERROR ADDIDATA_ ANALOG_MEASURE_CONVERTING_TIME_UNIT_ERROR ADDIDATA_ ANALOG_MEASURE_INTERRUPT_FLAG_ERROR ADDIDATA_ANALOG_MEASURE_INTERRUPT_NOT_AVAILABLE ADDIDATA_ ANALOG_MEASURE_WARNING_VALUE_ERROR ADDIDATA_ ANALOG_MEASURE_CHANNEL_ALREADY_USED ADDIDATA_ ANALOG_MEASURE_WARNING_ALREADY_USED ADDIDATA_ANALOG_MEASURE_GAIN_ERROR ADDIDATA_ANALOG_MEASURE_POLARITY_PARAMETER_ERROR ADDIDATA_ANALOG_MEASURE_OFFSET_RANGE_ERROR ADDIDATA_ANALOG_MEASURE_CHANNEL_NOT_INITIALISED ADDIDATA_ANALOG_MEASURE_POLARITY_MODE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SCAN_MODE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SCAN_MODE_PARAMETER_ERROR ADDIDATA_ANALOG_MEASURE_EXTERN_TRIGGER_MODE_NOT_AVAILAB LE ADDIDATA_ANALOG_MEASURE_EXTERN_TRIGGER_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_EXTERN_TRIGGER_PARAMETER_ERROR ADDIDATA_ANALOG_MEASURE_EXTERN_GATE_MODE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_EXTERN_GATE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_EXTERN_GATE_PARAMETER_ERROR ADDIDATA_ANALOG_MEASURE_COMMON_GAIN_ERROR ADDIDATA_ANALOG_MEASURE_COMMON_POLARITY_ERROR ADDIDATA_ANALOG_MEASURE_COMMON_OFFSET_RANGE_ERR OR ADDIDATA_ANALOG_MEASURE_SCAN_DELAY_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SCAN_DELAY_VALUE_ERROR ADDIDATA_ANALOG_MEASURE_SCAN_NOT_INITIALISED ADDIDATA_ANALOG_MEASURE_MODULE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SCAN_ALREADY_STARTED ADDIDATA_ANALOG_MEASURE_SCAN_COUNTER_VALUE_ERROR ADDIDATA_ANALOG_MEASURE_SCAN_NOT_STARTED ADDIDATA_ANALOG_MEASURE_SCAN_NOT_STOPPED ADDIDATA_ANALOG_MEASURE_SCAN_SAME_MODULE_REQUIRED ADDIDATA_ANALOG_MEASURE_SCAN_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_SCAN_CHANNEL_SELECTION_ERROR ADDIDATA_ANALOG_MEASURE_SCAN_DELAY_MODE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_COUPLING_MODE_NOT_AVAILABLE ADDIDATA_ANALOG_MEASURE_COMMON_COUPLING_ERROR ADDIDATA_ANALOG_MEASURE_COUPLING_PARAMETER_ERROR ADDIDATA_ANALOG_MEASURE_SIGN_TEST_PARAMETER_ERROR The selected wrong channel number The selected wrong channel number The selected wrong converting time value The selected wrong converting time unit The selected wrong interrupt flag The selected wrong channel number The selected wrong warning value The selected wrong channel number The selected wrong channel number The selected wrong gain The selected wrong polarity The selected wrong offset range The selected wrong channel number The selected wrong polarity mode The selected wrong channel number The selected wrong SCAN mode The selected wrong external trigger mode The selected wrong channel number The selected wrong external trigger parameter The selected wrong external gate mode The selected wrong channel number The selected wrong external gate parameter The selected wrong channel number The selected wrong channel number The selected wrong channel number The selected wrong SCAN delay mode The selected wrong SCAN delay value The selected wrong SCAN handle The selected wrong module number The selected SCAN handle The selected wrong SCAN counter value The selected SCAN handle The selected SCAN handle The selected wrong channel number The selected wrong channel number The selected wrong channel number The selected wrong SCAN delay mode The selected wrong channel number The selected wrong channel number The selected wrong coupling mode parameter The selected wrong sign test parameter

26

Common functions

ADDIDRIVER

Digital input errors


ADDIDATA_DIGITAL_INPUT_CHANNEL_NUMBER_ERROR ADDIDATA_DIGITAL_INPUT_PORT_NUMBER_ERROR The selected wrong digital input channel The selected wrong digital input port The selected wrong digital input channel The selected wrong digital input channel The selected wrong digital input channel The selected wrong digital input channel

ADDIDATA_DIGITAL_INPUT_INTERRUPT_ALREADY_USED ADDIDATA_DIGITAL_INPUT_INTERRUPT_ALREADY_RELEAS ED ADDIDATA_DIGITAL_INPUT_INTERRUPT_FLAG_ERROR ADDIDATA_DIGITAL_INPUT_INTERRUPT_LOGIC_ERROR

Digital output errors


ADDIDATA_DIGITAL_OUTPUT_CHANNEL_NUMBER_ERROR ADDIDATA_DIGITAL_OUTPUT_PORT_NUMBER_ERROR ADDIDATA_DIGITAL_OUTPUT_VALUE_ERROR ADDIDATA_DIGITAL_OUTPUT_INTERRUPT_ALREADY_USED ADDIDATA_DIGITAL_OUTPUT_INTERRUPT_ALREADY_RELEASED ADDIDATA_DIGITAL_OUTPUT_INTERRUPT_FLAG_ERROR The selected wrong digital output channel The selected wrong digital output port The selected wrong digital output channel The selected wrong digital output channel The selected wrong digital output channel The selected wrong digital output channel

Analog output errors


ADDIDATA_ANALOG_OUTPUT_CHANNEL_NUMBER_ERROR ADDIDATA_ANALOG_OUTPUT_VOLTAGE_MODE_ERROR ADDIDATA_ANALOG_OUTPUT_POLARITY_ERROR ADDIDATA_ANALOG_OUTPUT_VALUE_ERROR ADDIDATA_ANALOG_OUTPUT_ALREADY_USED ADDIDATA_ANALOG_OUTPUT_TIMEOUT ADDIDATA_ANALOG_OUTPUT_TIMEOUT_ERROR ADDIDATA_ANALOG_OUTPUT_ALREADY_RELEASED The selected wrong analog output channel The selected wrong analog output channel The selected wrong analog output channel The selected wrong analog output channel The selected wrong analog output channel The selected wrong analog output channel The selected wrong analog output channel The selected wrong analog output channel

Calling convention: ANSI C : WORD w_FunctionNumber; INT i_ErrorCode; INT i_ErrorLevel; INT i_ReturnValue; DWORD dw_ErrorSource; i_ReturnValue = i_ADDIDATA_GetLastErrorAndSource (dw_DriverHandle, &w_FunctionNumber, &i_ErrorCode, &i_ErrorLevel, &dw_ErrorSource); Return value: 0: No error 1: Error message present - 101: Function cannot be called up in the user interrupt routine - 102: Error message not found

27

ADDIDRIVER

Common functions

Counter errors
ADDIDATA_COUNTER_NUMBER_ERROR ADDIDATA_COUNTER_RELOAD_VALUE_ERROR ADDIDATA_COUNTER_COUNTER_UP_DOWN_FLAG_ERROR ADDIDATA_COUNTER_INPUT_LEVEL_ERROR ADDIDATA_COUNTER_INTERRUPT_FLAG_ERROR ADDIDATA_COUNTER_HARDWARE_GATE_ LEVEL_ERROR ADDIDATA_COUNTER_HARDWARE_GATE_LEVEL_SELECTION_ERROR ADDIDATA_COUNTER_HARDWARE_GATE_FLAG_ERROR ADDIDATA_COUNTER_HARDWARE_TRIGGER_ LEVEL_ERROR ADDIDATA_COUNTER_HARDWARE_TRIGGER_LEVEL_SELECTION_ERROR ADDIDATA_COUNTER_HARDWARE_TRIGGER_FLAG_ERROR ADDIDATA_COUNTER_HARDWARE_OUTPUT_ LEVEL_ERROR ADDIDATA_COUNTER_HARDWARE_OUTPUT_LEVEL_SELECTION_ERROR ADDIDATA_COUNTER_HARDWARE_OUTPUT_FLAG_ERROR ADDIDATA_COUNTER_ALREADY_USED ADDIDATA_COUNTER_INFORMATION_STRUCTURE_INVALID_SIZE -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 The selected counter number is wrong The counter reload value is wrong Counter Up/Down selection error Counter input level selection error Counter interrupt flag is wrong Counter hardware gate not available The selected hardware gate level is wrong The flag of the hardware gate is wrong Counter hardware trigger not available Hardware trigger level selection error The flag of the hardware trigger is wrong Counter output not available Counter output level selection error The flag of the counter output is wrong Counter already used by another process or used as a watchdog The specified size is wrong.

Calling convention: ANSI C : WORD INT INT INT w_FunctionNumber; i_ErrorCode; i_ErrorLevel; i_ReturnValue; (dw_DriverHandle, &w_FunctionNumber, &i_ErrorCode, &b_ErrorLevel);

i_ReturnValue = i_ADDIDATA_GetLastError

Return value: 0: No error 1: Error message present - 101: Function cannot be called up in the user interrupt routine - 102: Error message not found

28

Common functions 3) b_ADDIDATA_EnableErrorMessage (...)

ADDIDRIVER

IMPORTANT! This function is only available for 32-bit operating systems


Syntax: <Return value> = b_ADDIDATA_EnableErrorMessage (DWORD dw_DriverHandle, HANDLE h_WndHandle, WORD w_Message) Parameters: - Input: DWORD dw_DriverHandle HANDLE h_WndHandle WORD w_Message - Output: No output has occurred.

Handle of the driver Handle of the process/task Number of the message to be sent

Task: Allows the transmission of a message to a process or task, when an error has occurred by calling up an ADDI-DATA API function. Calling convention: ANSI C : BYTE HANDLE b_ReturnValue; h_WndHandle; (dw_DriverHandle h_WndHandle WM_USER);

b_ReturnValue = b_ADDIDATA_EnableErrorMessage

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

To receive the error message under Visual C++ proceed as follows: In the CALLBACK WndProc(HWND hWnd, UINT nMessage, WPARAM wParam, LPARAM lParam) function, add the case WM_USER.

29

ADDIDRIVER

Common functions

To receive the error message under Delphi proceed as follows:

// Declare the message const CM_ERRORMESSAGE = WM_USER; // Declare the function to be called up when the message occurs TSampleForm = class(TForm) ExecutionBox: TGroupBox; ... protected procedure CMErrorMessage(var Message: TMessage); message CM_ERRORMESSAGE; private { Private-Deklarationen } public { Public-Deklarationen } end; // Delphi will call up this function once the message has occurred procedure TSampleForm.CMErrorMessage(var Message: TMessage); Begin ... inherited; end;

WARNING! Call up the function b_ADDIDATA_EnableErrorMessageEnable only once the window is active.
In the creating method of the window, the windows is active only at the end of the creating method. If you do not proceed in this way, the GetActiveWindow () will return 0. No message can then be returned.

30

Common functions 4) b_ADDIDATA_DisableErrorMessage (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_DisableErrorMessage (DWORD dw_DriverHandle) Parameters: - Input: DWORD dw_DriverHandle - Output: No output has occurred.

Handle of the driver

Task: Disables the transmission of a message to a process or task, when an error has occurred by calling up an ADDI-DATA API function.

IMPORTANT! This function is only available for 32-bit operating systems.


Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_DisableErrorMessage (dw_DriverHandle); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source. To receive the error message under Visual C++ proceed as follows: In the CALLBACK WndProc(HWND hWnd, UINT nMessage, WPARAM wParam, LPARAM lParam) function, add the case WM_USER. To receive the error message under Delphi proceed as follows:

// Declare the message const CM_ERRORMESSAGE = WM_USER; // Declare the function to be called up when the message occurs TSampleForm = class(TForm) ExecutionBox: TGroupBox; ... protected procedure CMErrorMessage(var Message: TMessage); message CM_ERRORMESSAGE; private { Private-Deklarationen } 31

ADDIDRIVER

Common functions

public { Public-Deklarationen } end; // Delphi will call up this function once the message has occurred procedure TSampleForm.CMErrorMessage(var Message: TMessage); Begin ... inherited; end;

WARNING! Call up the function b_ADDIDATA_EnableErrorMessageEnable only once the window is active.
In the creating method of the window, the windows is active only at the end of the creating method. If you do not proceed in this way, the GetActiveWindow () will return 0. No message can then be returned.

32

Common functions 5) b_ADDIDATA_FormatErrorMessage (...) Syntax: <Return value> = b_ADDIDATA_FormatErrorMessage (DWORD INT PCHAR WORD WORD PCHAR WORD Parameters: - Input: DWORD dw_DriverHandle INT i_ErrorNumber WORD WORD w_ErrorStringSize w_FunctionNumber

ADDIDRIVER

dw_DriverHandle i_ErrorNumber, pc_ErrorString, w_ErrorStringSize, w_FunctionNumber, pc_FunctionName, w_FunctionStringSize)

WORD w_FunctionStringSize - Output: PCHAR pc_ErrorString PCHAR pc_FunctionName

Handle of the driver Error code of the function "i_ADDIDATA_GetLastError" Size of the pc_ErrorString parameter. Function number. This information is transmitted through the function "i_ADDIDATA_GetLastError" Size of the pc_FunctionName parameter. Character string including the error Character string including the name of the function which has generated the error.

Task: Returns the character strings of the error and of the function name for the i_ErrorNumber and pc_FunctionName parameters. Calling convention: ANSI C : BYTE CHAR CHAR b_ReturnValue; c_ErrorString[50]; c_FunctionName[50]; (dw_DriverHandle -100, c_ErrorString, sizeof (c_ErrorString), 301, c_FunctionName, sizeof (c_FunctionName));

b_ReturnValue = i_ADDIDATA_FormatErrorMessage

Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

33

DIN EN ISO 9001:2000 certified

ADDI-DATA GmbH Airpark Business Center Airport Boulevard B210 77836 Rheinmnster Germany Phone: +49 7229 18470 Fax: +49 7229 1847222 E-mail: info@addi-data.com

Software description

ADDIDRIVER
Digital input channels

Edition: 07.04 08/2010

Table of contents

ADDIDRIVER

1 2

INTRODUCTION...................................................................................1 DIGITAL INPUT CHANNELS....................................................................2


1) b_ADDIDATA_GetNumberOfDigitalInputs (...).................................................................. 2 2) b_ADDIDATA_GetDigitalInputInformation ()................................................................. 3 3) b_ADDIDATA_GetDigitalInputInformationEx (...) ............................................................. 4 4) b_ADDIDATA_Read1DigitalInput (...) ................................................................................ 6 5) b_ADDIDATA_Read1DigitalInputStatus (...)....................................................................... 7 6) b_ADDIDATA_Read1DigitalInputValue (...)....................................................................... 8 7) b_ADDIDATA_Convert1DigitalInputValueInAnalogValue (...) ......................................... 9 8) b_ADDIDATA_Read2DigitalInputs (...)............................................................................. 10 9) b_ADDIDATA_Read2DigitalInputStatus (...)..................................................................... 11 10) b_ADDIDATA_ReadMoreDigitalInputValue (...) ............................................................ 12 11) b_ADDIDATA_Read4DigitalInputs (...)........................................................................... 13 12) b_ADDIDATA_Read4DigitalInputStatus (...)................................................................... 14 13) b_ADDIDATA_Read8DigitalInputs (...)........................................................................... 15 14) b_ADDIDATA_Read8DigitalInputStatus (...)................................................................... 16 15) b_ADDIDATA_Read16DigitalInputs (...)......................................................................... 17 16) b_ADDIDATA_Read16DigitalInputStatus (...)................................................................. 18 17) b_ADDIDATA_Read32DigitalInputs (...)......................................................................... 19 18) b_ADDIDATA_Init1DigitalInputLevel (...)...................................................................... 20 19) b_ADDIDATA_InitDigitalInputInterrupt (...) ................................................................... 21 20) b_ADDIDATA_ReleaseDigitalInputInterrupt (...) ............................................................ 26 21) b_ADDIDATA_EnableDisableDigitalInputInterrupt (...) ................................................. 27 22) b_ADDIDATA_Init1DigitalInputLevel (...)...................................................................... 28 23) b_ADDIDATA_SaveDigitalInputModuleLevel (...) ......................................................... 29 24) b_ADDIDATA_Read1DigitalInputStatus (...)................................................................... 30 25) b_ADDIDATA_ReadMoreDigitalInputStatus (...)............................................................ 31 26) b_ADDIDATA_Read1DigitalInputValue (...)................................................................... 32 27) b_ADDIDATA_ReadMoreDigitalInputValue (...) ............................................................ 33 28) b_ADDIDATA_Convert1DigitalInputValueInAnalogValue (...) ..................................... 34 29) b_ADDIDATA_GetDigitalInputModuleFilterInformation (...)......................................... 35 30) b_ADDIDATA_InitDigitalInputModuleFilter (...)............................................................ 37 31) b_ADDIDATA_EnableDisableDigitalInputModuleFilter (...) .......................................... 38 32) b_ADDIDATA_SetDigitalInputModuleLevelSelection (...) ............................................. 39 33) b_ADDIDATA_TestDigitalInputAsynchronousFIFOFull () ........................................ 40

Tables
Table 1-1: Type Declaration for Windows 98/NT/2000/XP ........................................................1 Table 2-1: Principle of the AND logic (for 2 channels) ...........................................................24 Table 2-2: Filter timer units Table 2-3: Resolution ................................................................35

Introduction

ADDIDRIVER

INTRODUCTION
IMPORTANT! Please note the following conventions in the text:
Function: Variable "b_ADDIDATA_GetNumberOfAnalogInputs" dw_DriverHandle

Table 1-1: Type Declaration for Windows 98/NT/2000/XP Borland C Microsoft C Borland Pascal pointer byte integer long longint var byte var integer var long var string var longint double Microsoft Visual Basic Windows any integer integer long long integer integer long string long double

VOID BYTE INT WORD DWORD PBYTE PINT PWORD PCHAR PDWORD DOUBLE

void unsigned char int unsigned short int long unsigned char * int *

void unsigned char int unsigned short int long unsigned char * int *

unsigned short int * unsigned short int * char * long * double char * long * double

ADDIDRIVER

Digital input channels

DIGITAL INPUT CHANNELS


1) b_ADDIDATA_GetNumberOfDigitalInputs (...) Syntax: <Return value> = b_ADDIDATA_GetNumberOfDigitalInputs (DWORD dw_DriverHandle, PWORD pw_NumberOfChannels) Parameters: - Input: DWORD dw_DriverHandle - Output: PWORD pw_NumberOfChannels

Driver handle Number of digital input channels

Task: Returns the number of digital input channels. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; WORD w_NumberOfChannels; b_ReturnValue = b_ADDIDATA_GetNumberOfDigitalInput (dw_DriverHandle, &w_NumberOfChannels); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Digital input channels

ADDIDRIVER

2) b_ADDIDATA_GetDigitalInputInformation () Syntax: <Return value> = b_ADDIDATA_ GetDigitalInputInformation (DWORD dw_DriverHandle, WORD w_DigitalInputNumber, PBYTE pb_DigitalInputType, PDWORD pdw_DigitalInputInterrupt) Parameters: - Input: DWORD dw_DriverHandle WORD w_DigitalInputNumber - Output: PBYTE pb_DigitalInputType

Handle of the ADDI-DATA driver Number of the selected digital input Type of the selected input 0x00 Input type not defined 1 15 5V type 16 31 12 type 32 47 24 type 48 255 Any other type Available interrupt for the input

PDWORD pdw_DigitalInputInterrupt

Task: Returns information about the digital input channels. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; BYTE b_DigitalInputType; DWORD dw_DigitalInputInterrupt; b_ReturnValue = b_ADDIDATA_GetDigitalInputInformation (dw_DriverHandle, 0, &b_DigitalInputType, &dw_DigitalInputInterrupt); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER

Digital input channels

3) b_ADDIDATA_GetDigitalInputInformationEx (...) Syntax: <Return value> = b_ADDIDATA_ GetDigitalInputInformationEx (DWORD dw_DriverHandle, WORD w_DigitalInputNumber, pstr_GetDigitalInputInformation ps_DigitalInputInformation, DWORD dw_StructSize) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_DigitalInputNumber Number of the selected digital input DWORD dw_StructSize Size of the Digital Input Information Structure. (In byte) - Output: pstr_GetDigitalInputInformation ps_DigitalInputInformation The digital input information are returned in this structure. The structure contains: BYTE b_DigitalInputType Type of the selected input 0x00 Input type not defined 1 15 5 V type 16 31 12 type 32 47 24 type 48 255 Any other type

DWORD dw_DigitalInputInterrupt Available interrupt for the input BYTE b_InputStatusAvailable 0 : Input status information not available 1 : Input status information available BYTE b_InputStatusResolution Return the resolution of the input status. BYTE b_InputValueAvailable 0 : Input value not available 1 : Input value available BYTE b_InputValueResolution Return the resolution of the input value BYTE b_InputLevelConfigurable 0: Input level not configurable 1: Input level configurable BYTE b_InputLevelNbr Return the number of Input Level. Task: Returns information about the digital input channels. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; str_GetDigitalInputInformation s_DigitalInputInformation; b_ReturnValue = b_ADDIDATA_GetDigitalInputInformationEx (dw_DriverHandle, 0, 4

Digital input channels

ADDIDRIVER

& s_DigitalInputInformation, sizeof(str_GetDigitalInputInformation)); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER 4) b_ADDIDATA_Read1DigitalInput (...)

Digital input channels

Syntax: <Return value> = b_ADDIDATA_Read1DigitalInput (DWORD dw_DriverHandle, WORD w_Channel, PBYTE pb_ChannelStatus) Parameters: - Input: DWORD dw_DriverHandle Driver handle WORD w_Channel Number of the input to be read - Output: PBYTE pb_ChannelStatus Status of the digital input 0 low 1 high Task: Indicates the status of a digital input. The variable b_Channel passes the input to be read. A value is returned through the variable pb_ChannelStatus: 0 (low) or 1 (high). Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_Value; (dw_DriverHandle, 0, &b_Value);

b_ReturnValue = b_ADDIDATA_Read1DigitalInput

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Digital input channels 5) b_ADDIDATA_Read1DigitalInputStatus (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_Read1DigitalInputStatus (DWORD dw_DriverHandle, WORD w_Channel, PWORD pw_ChannelStatus) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_Channel Number of the input to be read - Output: PWORD pw_ChannelStatus Status of the digital input The number of bit is given by the function b_ADDIDATA_GetDigitalInputInformation. Ex : 2 bit : 00 : Voltage < Compare value A 01 : Voltage > Compare value A and Voltage < Compare value B 10 : Voltage > Compare value B Task: Indicates the status of a digital input. The variable b_Channel passes the input to be read (1 to 32). A value is returned through the variable pw_ChannelStatus. Calling convention: ANSI C : BYTE DWORD WORD b_ReturnValue; dw_DriverHandle; w_Value;

b_ReturnValue = b_ADDIDATA_Read1DigitalInputStatus (dw_DriverHandle, 0, &w_Value); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER 6) b_ADDIDATA_Read1DigitalInputValue (...)

Digital input channels

Syntax: <Return value> = b_ADDIDATA_Read1DigitalInputValue (DWORD dw_DriverHandle, WORD w_Channel, PWORD pw_ChannelStatus PDWORD pdw_ChannelValue) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_Channel Number of the input to be read - Output: PWORD pw_ChannelStatus Status of the digital input The number of bit is given by the function b_ADDIDATA_GetDigitalInputInformation. Ex : 2 bit : 00 : Voltage < Compare value A 01 : Voltage > Compare value A and Voltage < Compare value B 10 : Voltage > Compare value B PDWORD pdw_ChannelValue Value of the digital input : Use the convert function to have the value in Volt. Task: Indicates the status of a digital input. The variable b_Channel passes the input to be read (1 to 32). A value is returned through the variable pw_ChannelStatus. The value of the input is returned by the variable pdw_ChannelValue. To become the real voltage value, use the function b_ADDIDATA_Convert1DigitalInputValueInAnalogValue. Calling convention: ANSI C : BYTE DWORD WORD DWORD b_ReturnValue; dw_DriverHandle; w_Value; dw_Value;

b_ReturnValue = b_ADDIDATA_Read1DigitalInputValue (dw_DriverHandle, 0, &w_Value, &dw_Value); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Digital input channels 7) b_ADDIDATA_Convert1DigitalInputValueInAnalogValue (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_Convert1DigitalInputValueInAnalogValue (DWORD dw_DriverHandle, WORD w_Channel, DWORD dw_DigitalValue, DOUBLE *pd_AnalogValue) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_Channel Number of the input to be read DWORD dw_DigitalValue Digital value of the input returned by the b_ADDIDATA_Read1DigitalInputValue or b_ADDIDATA_ReadMoreDigitalInputValue. - Output: DOUBLE *pd_AnalogValue Value in Volt from the input signal. Task: Convert the digital input value in a voltage value.. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; DWORD dw_Value; DOUBLE d_VoltageValue; b_ReturnValue = b_ADDIDATA_Convert1DigitalInputValueInAnalogValue (dw_DriverHandle, 0, dw_Value, &d_VoltageValue); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER

Digital input channels

8) b_ADDIDATA_Read2DigitalInputs (...) Syntax: <Return value> = b_ADDIDATA_Read2DigitalInputs (DWORD dw_DriverHandle, BYTE b_Port, PBYTE pb_PortValue) Parameters: - Input DWORD dw_DriverHandle Driver handle BYTE b_Port Number of the 2-bit input port to be read - Output: PBYTE pb_PortValue Status of the digital input ports (0 to 3) Task: Indicates the status of a 2-bit port. The variable b_Port passes the input to be read. The value is returned through the variable pb_PortValue. The input range of the channels set to "1" is within the high voltage range (See chapter 4 "Limit values" of the technical manual of the board concerned). The input range of the channels set to "1" is within the low voltage range (See chapter 4 "Limit values" of the technical manual of the board concerned). Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_PortValue; (dw_DriverHandle, 0, &b_PortValue);

b_ReturnValue = b_ADDIDATA_Read2DigitalInputs

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

10

Digital input channels 9) b_ADDIDATA_Read2DigitalInputStatus (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_Read2DigitalInputStatus (DWORD dw_DriverHandle, BYTE b_Port, PDWORD pdw_PortStatus) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_Port Number of the 2-Input port to be read - Output: PDWORD pdw_PortStatus Status of the digital input port. The number of bit is given by the function b_ADDIDATA_GetDigitalInputInformation. Ex : 2 bit : 00 : Voltage < Compare value A 01 : Voltage > Compare value A and Voltage < Compare value B 10 : Voltage > Compare value B Task: Indicates the status of a 2-Input port. The variable b_Port passes the input to be read. The value is returned through the variable pdw_PortStatus. Calling convention: ANSI C : BYTE DWORD DWORD b_ReturnValue; dw_DriverHandle; dw_PortStatus;

b_ReturnValue = b_ADDIDATA_Read2DigitalInputStatus (dw_DriverHandle, 0, &dw_PortStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

11

ADDIDRIVER 10) b_ADDIDATA_ReadMoreDigitalInputValue (...)

Digital input channels

Syntax: <Return value> = b_ADDIDATA_ReadMoreDigitalInputValue (DWORD dw_DriverHandle, WORD w_NbrOfChannel, PWORD pw_ChannelArray, PWORD pw_ChannelStatusArray, PDWORD pdw_ChannelValueArray) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_NbrOfChannel Define the Nbr of Channel in the channel array. PWORD pw_ChannelArray Array composed of the number of the input to be read. - Output: PWORD pw_ChannelStatusArray Status of the digital input The number of bit is given by the function b_ADDIDATA_GetDigitalInputInformation. Ex : 2 bit : 00 : Voltage < Compare value A 01 : Voltage > Compare value A and Voltage < Compare value B 10 : Voltage > Compare value B PDWORD pdw_ChannelValueArray Value of the digital input : Use the convert function to have the value in Volt. Task: Read the analog value of several digital input. To become the real voltage value, use the function b_ADDIDATA_Convert1DigitalInputValueInAnalogValue. Calling convention: ANSI C : BYTE DWORD WORD WORD DWORD b_ReturnValue; dw_DriverHandle; w_Channel[10]; w_Value[10]; dw_Value[10];

b_ReturnValue = b_ADDIDATA_ReadMoreDigitalInputValue (dw_DriverHandle, 5, &w_Channel, &w_Value, &dw_Value); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

12

Digital input channels

ADDIDRIVER

11) b_ADDIDATA_Read4DigitalInputs (...) Syntax: <Return value> = b_ADDIDATA_Read4DigitalInputs (DWORD dw_DriverHandle, BYTE b_Port, PBYTE pb_PortValue) Parameters: - Input DWORD dw_DriverHandle Driver handle BYTE b_Port Number of the 4-bit input port to be read - Output: PBYTE pb_PortValue Status of the digital input port (0 to 15) Task: Indicates the status of a 4-bit port. The variable b_Port passes the input to be read. The value is returned through the variable pb_PortValue. The input range of the channels set to "1" is within the high voltage range (se chapter 4 "Limit values" of the technical manual of the board concerned). The input range of the channels set to "1" is within the low voltage range (See chapter 4 "Limit values" of the technical manual of the board concerned). Calling Convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_PortValue; (dw_DriverHandle, 1, &b_PortValue);

b_ReturnValue = b_ADDIDATA_Read4DigitalInputs

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

13

ADDIDRIVER 12) b_ADDIDATA_Read4DigitalInputStatus (...)

Digital input channels

Syntax: <Return value> = b_ADDIDATA_Read4DigitalInputStatus (DWORD dw_DriverHandle, BYTE b_Port, PDWORD pdw_PortStatus) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_Port Number of the 4-Input input port to be read - Output: PDWORD pdw_PortStatus Status of the digital input port. The number of bit is given by the function b_ADDIDATA_GetDigitalInputInformationEx. Ex : 2 bit : 00 : Voltage < Compare value A 01 : Voltage > Compare value A and Voltage < Compare value B 10 : Voltage > Compare value B Task: Indicates the status of a 4-Input port. The variable b_Port passes the input to be read. The value is returned through the variable pdw_PortStatus. Calling convention: ANSI C : BYTE DWORD DWORD b_ReturnValue; dw_DriverHandle; dw_PortStatus;

b_ReturnValue = b_ADDIDATA_Read4DigitalInputStatus (dw_DriverHandle, 0, &dw_PortStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

14

Digital input channels 13) b_ADDIDATA_Read8DigitalInputs (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_Read8DigitalInputs (DWORD dw_DriverHandle, BYTE b_Port, PBYTE pb_PortValue) Parameters: - Input DWORD dw_DriverHandle Driver handle BYTE b_Port Number of the 8-bit input port to be read - Output: PBYTE pb_PortValue Status of the digital input port (0 to 255) Task: Indicates the status of a 8-bit port. The variable b_Port passes the input to be read. The value is returned through the variable pb_PortValue. The input range of the channels set to "1" is within the high voltage range (See chapter 4 "Limit values" of the technical manual of the board concerned). The input range of the channels set to "1" is within the low voltage range (See chapter 4 "Limit values" of the technical manual of the board concerned). Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; BYTE b_PortValue; b_ReturnValue = b_ADDIDATA_Read8DigitalInputs (dw_DriverHandle, 0, &b_PortValue);

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

15

ADDIDRIVER 14) b_ADDIDATA_Read8DigitalInputStatus (...)

Digital input channels

Syntax: <Return value> = b_ADDIDATA_Read8DigitalInputStatus (DWORD dw_DriverHandle, BYTE b_Port, PDWORD pdw_PortStatus) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_Port Number of the 8-Input input port to be read - Output: PDWORD pdw_PortStatus Status of the digital input port. The number of bit is given by the function b_ADDIDATA_GetDigitalInputInformationEx. Ex : 2 bit : 00 : Voltage < Compare value A 01 : Voltage > Compare value A and Voltage < Compare value B 10 : Voltage > Compare value B Task: Indicates the status of a 8-Input port. The variable b_Port passes the input to be read. The value is returned through the variable pdw_PortStatus. Calling convention: ANSI C : BYTE DWORD DWORD b_ReturnValue; dw_DriverHandle; dw_PortStatus;

b_ReturnValue = b_ADDIDATA_Read8DigitalInputStatus (dw_DriverHandle, 0, &dw_PortStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

16

Digital input channels

ADDIDRIVER

15) b_ADDIDATA_Read16DigitalInputs (...) Syntax: <Return value> = b_ADDIDATA_Read16DigitalInputs (DWORD dw_DriverHandle, BYTE b_Port, PWORD pw_PortValue) Parameters: - Input DWORD dw_DriverHandle BYTE b_Port - Output: PWORD pw_PortValue Task: Indicates the status of a 16-bit port. The input range of the channels set to "1" is within the high voltage range (See chapter 4 "Limit values" of the technical manual of the board concerned). The input range of the channels set to "1" is within the low voltage range (See chapter 4 "Limit values" of the technical manual of the board concerned). Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; WORD w_PortValue; b_ReturnValue = b_ADDIDATA_Read16DigitalInputs (dw_DriverHandle, 0, &w_PortValue);

Driver handle Number of the 16-bit input port to be read Status of the digital input port (0 to 65535)

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

17

ADDIDRIVER

Digital input channels

16) b_ADDIDATA_Read16DigitalInputStatus (...) Syntax: <Return value> = b_ADDIDATA_Read16DigitalInputStatus (DWORD dw_DriverHandle, BYTE b_Port, PDWORD pdw_PortStatus) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_Port Number of the 16-Input input port to be read - Output: PDWORD pdw_PortStatus Status of the digital input port. The number of bit is given by the function b_ADDIDATA_GetDigitalInputInformationEx. Ex : 2 bit : 00 : Voltage < Compare value A 01 : Voltage > Compare value A and Voltage < Compare value B 10 : Voltage > Compare value B Task: Indicates the status of a 16-Input port. The variable b_Port passes the input to be read. The value is returned through the variable pdw_PortStatus. Calling convention: ANSI C : BYTE DWORD DWORD b_ReturnValue; dw_DriverHandle; dw_PortStatus;

b_ReturnValue = b_ADDIDATA_Read16DigitalInputStatus(dw_DriverHandle, 0, &dw_PortStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

18

Digital input channels 17) b_ADDIDATA_Read32DigitalInputs (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_Read32DigitalInputs (DWORD dw_DriverHandle, BYTE b_Port, PDWORD pdw_PortValue) Parameters: - Input DWORD dw_DriverHandle BYTE b_Port - Output: PDWORD pw_PortValue Task: Indicates the status of a 32-bit port. The input range of the channels set to "1" is within the high voltage range (See chapter 4 "Limit values" of the technical manual of the board concerned). The input range of the channels set to "1" is within the low voltage range (See chapter 4 "Limit values" of the technical manual of the board concerned). Calling convention: ANSI C : BYTE DWORD DWORD b_ReturnValue; dw_DriverHandle; dw_PortValue; (dw_DriverHandle, 0, &dw_PortValue);

Driver handle Number of the 32-bit input port to be read Status of the digital input port (0 to 232-1)

b_ReturnValue = b_ADDIDATA_Read32DigitalInputs

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

19

ADDIDRIVER

Digital input channels

18) b_ADDIDATA_Init1DigitalInputLevel (...) Syntax: <Return value> = b_ADDIDATA_Init1DigitalInputLevel (DWORD dw_DriverHandle, WORD w_DigitalInput, DOUBLE *pd_VoltageValueArray);

Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_DigitalInput Number of the digital input to configure. DOUBLE *pd_VoltageValueArray Array witch contains the voltage value for the level. pd_VoltageValueArray [0] : Determines level A pd_VoltageValueArray [1] : Determines level B pd_VoltageValueArray [2] : Determines level C, usw. - Output: No output signal has occurred. Task: Initialise the input level voltage of the digital input. Calling convention: ANSI C : BYTE DWORD DOUBLE b_ReturnValue; dw_DriverHandle; d_VoltageValue[2];

d_VoltageValue[0] = 10.0; d_VoltageValue[1] = 15.0; b_ReturnValue = b_ADDIDATA_Init1DigitalInputLevel (dw_DriverHandle, 0, d_VoltageValue); Return value: 1: No error 0: Error by calling up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

20

Digital input channels 19) b_ADDIDATA_InitDigitalInputInterrupt (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_InitDigitalInputInterrupt (DWORD dw_DriverHandle, WORD w_FirstDigitalInput, WORD w_LastDigitalInput, BYTE b_InterruptLogic, PDWORD pdw_DigitalInputArrayMode1, PDWORD pdw_DigitalInputArrayMode2); Parameters: - Input: DWORD dw_DriverHandle Driver handle WORD w_FirstDigitalInput Number of the first digital input to be initialised. WORD w_LastDigitalInput Number of the last digital input to be initialised. BYTE b_InterruptLogic Interrupt logic for the inputs (0= no, 1= OR, 2= AND). PDWORD pdw_DigitalInputArrayMode1 Mask of Mode 1 (see table below). PDWORD pdw_DigitalInputArrayMode2 Mask of Mode 2 (see table below). - Output: No output signal has occurred. Task: Initialises the digital input interrupt.

IMPORTANT! The user has to set only the bits of the inputs which are contained in the range between " w_FirstDigitalInput" and " w_LastDigitalInput".
If the user sets other bits out of the defined range, an error is returned. The OR logic (for edge only) is defined as follows: If one of the selected edges occurs on the inputs, the interrupt is generated. The AND logic (status) is defined as follows: Each time a logic is true (when the rising or falling edge of the last input which verifies the logic occurs), the interrupt is generated. The AND logic and the OR logic have the same action when both modes (mode1 and mode2) are set to 1 for all inputs (rising or falling edge for OR logic; low and high status for AND logic). The AND logic and the OR logic have the same action when only one input is considered.

21

ADDIDRIVER

Digital input channels

Table 2-1: Overview: Table Index 0 Table Index Mode_1 table values Mode_2 table values 0 MSB 0000 0000 0000 0000 0000 0000 0000 0000 LSB MSB 0000 0000 0000 0000 0000 0000 0000 0000 LSB

Table 2-2: Overview: Table Index 1 Table Index Mode_1 table values Mode_2 table values 1 MSB 0000 0000 0000 0000 0000 0000 0000 0000 LSB MSB 0000 0000 0000 0000 0000 0000 0000 0000 LSB

The Mode_X table values are binary. Each bit defines the interrupt mask of one input. One channel is defined with 2 bit, the one bit is from Mode_1 and the other bit is from Mode_2. The combination of both bits is shown in the table below: Table 2-3: Definition of interrupt logic OR logic AND logic Mode_1 Mode_2 Disable Disable 0 0 Rising edge High level 1 0 Falling edge Low level 0 1 Rising/falling edge High/low level 1 1

Example: If you want to use the OR logic with 2 boards of each 32 inputs and you want to have a rising edge on input Index 2, then input Index 36 must react with a falling edge and all other inputs must be disabled. The inputs Index begin with 0. Table 2-4: Example: Table Index 0 Table Index Mode_1 table values Mode_2 table values 0 MSB 0000 0000 0000 0000 0000 0000 0000 0100 LSB MSB 0000 0000 0000 0000 0000 0000 0000 0000 LSB

In the tables the first bit at the left (in italics) stands for channel 31 and the first bit at the right (in italics) stands for channel 0.

22

Digital input channels

ADDIDRIVER

Table 2-5: Example: Table Index 1 Table Index Mode_1 table values Mode_2 table values 1 MSB 0000 0000 0000 0000 0000 0000 0000 0000 LSB MSB 0000 0000 0000 0000 0000 0000 0001 0000 LSB

The OR logic reacts to rising or falling edges. An interrupt is generated if an edge modification occurs on an interruptible input and fulfils the interrupt conditions set by Mode_1 and Mode_2. Table 2-6: Principle of the OR logic (for 2 channels)
INPUT 1 MODE2, MODE1 INPUT 0 MODE2, MODE1 Input 0 Input 1 0,0 1,0 0,1 1,1 0,0 1,0 0,1 1,1 0,0 1,0 0,1 1,1 0,0 1,0 0,1 1,1 0,0 0,0 0,0 0,0 1,0 1,0 1,0 1,0 0,1 0,1 0,1 0,1 1,1 1,1 1,1 1,1 01 01 01 01 01 01 01 01 10 10 10 10 01 01 01 01 10 10 10 10 10 10 No interrupt 10* 10 10 01** 01 01 01 10 10 10 10 01 01 10 01 10 01 01 01 10 01 10 01 01 01 10 01 01 10 10 10 10 10 10 01 01 10 01 01 10 10 10

* 10: Interrupt source: the 2nd input (Channel 1) has generated an interrupt. ** 01: Interrupt source: the 1st input (Channel 0) has generated an interrupt.

23

ADDIDRIVER

Digital input channels

AND Logic
The AND logic reacts to a change in the level of the selected inputs. An interrupt is generated each time when the following conditions are fulfilled: - the interruptible inputs fulfil the conditions set in Mode 1 and Mode 2. - the IRQ condition must be fulfilled during a determined time interval (differs according to the board specifications: see in the corresponding board manual). Possible bounce pulses are thus eliminated. - after an interrupt, a level modification is to occur on the interruptible inputs so that the interrupt logic is released. Table 2-1: Principle of the AND logic (for 2 channels)
INPUT 1 MODE2, MODE1 INPUT 0 MODE2, MODE1 Input 0 Input 1 0,0 1,0 0,1 1,1 0,0 1,0 0,1 1,1 0,0 1,0 0,1 1,1 0,0 1,0 0,1 1,1 0,0 0,0 0,0 0,0 1,0 1,0 1,0 1,0 0,1 0,1 0,1 0,1 1,1 1,1 1,1 1,1 Kein Interrupt

24

Digital input channels

ADDIDRIVER

Calling convention: ANSI C : BYTE DWORD DWORD b_ReturnValue; dw_DriverHandle; dw_DigitalInputArrayMode1[2]; dw_DigitalInputArrayMode2[2]; dw_DigitalInputArrayMode 1 [0] = 4;
(virtual bit 31 0000 0000 0000 0000 0000 0000 000 0100 virtual bit 0

dw_DigitalInputArrayMode1 [1] = 0
virtual bit 63 0000 0000 0000 0000 0000 0000 0000 0000 virtual bit 32

dw_DigitalInputArrayMode2 [0] = 0
virtual bit 31 0000 0000 0000 0000 0000 0000 0000 0000 virtual bit 0

dw_DigitalInputArrayMode2 [1] = 16
virtual bit 63 0000 0000 0000 0000 0000 0000 0001 0000 virtual bit 32

b_ReturnValue = b_ADDIDATA_InitDigitalInputInterrupt (dw_DriverHandle, 0, 63, ADDIDATA_OR, dw_DigitalInputArrayMode1, dw_DigitalInputArrayMode2);

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

IMPORTANT! The interrupt mask for the functionality is detailed in the "Interrupt" function description. (Tables 2-1 and 2-2).

25

ADDIDRIVER 20) b_ADDIDATA_ReleaseDigitalInputInterrupt (...)

Digital input channels

Syntax: <Return value> = b_ADDIDATA_ReleaseDigitalInputInterrupt (DWORD dw_DriverHandle, WORD w_FirstDigitalInput, WORD w_LastDigitalInput); Parameters: - Input: DWORD dw_DriverHandle WORD w_FirstDigitalInput WORD w_LastDigitalInput - Output: No output signal has occurred. Task: Releases the digital input interrupt. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

Driver handle Number of the first digital input to be released. Number of the last digital input to be released.

b_ReturnValue = b_ADDIDATA_ReleaseDigitalInputInterrupt (dw_DriverHandle, 0, 15); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

26

Digital input channels 21) b_ADDIDATA_EnableDisableDigitalInputInterrupt (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_EnableDisableDigitalInputInterrupt (DWORD dw_DriverHandle, WORD w_FirstDigitalOutput, WORD w_LastDigitalOutput, BYTE b_InterruptFlag); Parameters: - Input: DWORD dw_DriverHandle WORD w_FirstDigitalInput WORD w_LastDigitalInput

BYTE b_InterruptFlag - Output: No output signal has occurred.

Driver handle Number of the first digital input to be enabled or disabled Number of the last digital input to be enabled or disabled Interrupt flag (0 = disable, 1 = enable).

Task: Enables or disables the digital input interrupt. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_EnableDisableDigitalInputInterrupt (dw_DriverHandle, 0, 64, ADDIDATA_ENABLE); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

27

ADDIDRIVER 22) b_ADDIDATA_Init1DigitalInputLevel (...)

Digital input channels

Syntax: <Return value> = b_ADDIDATA_Init1DigitalInputLevel (DWORD dw_DriverHandle, WORD w_DigitalInput, DOUBLE *pd_VoltageValueArray) Parameters: - Input: DWORD dw_DriverHandle Driver handle WORD w_DigitalInput Number of the digital input to be configured. DOUBLE *pd_VoltageValueArray Array to determine the voltage value of the levels. pd_VoltageValueArray [0] : Determines level A pd_VoltageValueArray [1] : Determines level B pd_VoltageValueArray [2] : Determines level C - Output: No output signal has occurred. Task: Initialises the input voltage level of the digital input. Calling convention: ANSI C : BYTE DWORD DOUBLE b_ReturnValue; dw_DriverHandle; d_VoltageValue[2] = {10.0, 15.0};

b_ReturnValue = b_ADDIDATA_Init1DigitalInputLevel (dw_DriverHandle, 0, d_VoltageValue); Return value: 1: No error 0: Error by calling up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

28

Digital input channels 23) b_ADDIDATA_SaveDigitalInputModuleLevel (...) Syntax: <Return value> = b_ADDIDATA_SaveDigitalInputModuleLevel (DWORD dw_DriverHandle, DWORD dw_DigitalModuleNumber) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver DWORD dw_DigitalModuleNumber Number of the digital input module - Output: No output signal has occurred. Task: Saves the selected level configuration to the hardware. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

ADDIDRIVER

b_ReturnValue = b_ADDIDATA_SaveDigitalInputLevelModule (dw_DriverHandle, 0); Return value: 1: No error 0: Error by callup of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER 24) b_ADDIDATA_Read1DigitalInputStatus (...)

Digital input channels

Syntax: <Return value> = b_ADDIDATA_Read1DigitalInputStatus (DWORD dw_DriverHandle, WORD w_Channel, PWORD pw_ChannelStatus) Parameters: - Input: DWORD dw_DriverHandle Driver handle WORD w_Channel Number of the input to be read - Output: PWORD pw_ChannelStatus Status of the digital input The number of bits is given by the function b_ADDIDATA_GetDigitalInputInformationEx. Task: Indicates the status of a digital input. The variable w_Channel passes the input to be read. A value is returned through the variable pw_ChannelStatus.The value is coded on 2 bits. Ex : 2 bit : 00 : Voltage <= Compare value A 01 : Voltage > Compare value A and Voltage < Compare value B 11 : Voltage >= Compare value B Calling convention: ANSI C : BYTE DWORD WORD b_ReturnValue; dw_DriverHandle; w_ChannelStatus;

b_ReturnValue = b_ADDIDATA_Read1DigitalInputStatus (dw_DriverHandle, 0, &w_ChannelStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

30

Digital input channels 25) b_ADDIDATA_ReadMoreDigitalInputStatus (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_ReadMoreDigitalInputStatus (DWORD dw_DriverHandle, WORD w_NbrOfChannel, PWORD pw_ChannelArray, PWORD pw_ChannelArrayStatus) Parameters: - Input: DWORD dw_DriverHandle Driver handle WORD w_NbrOfChannel Defines the number of channels in the channel array. PWORD pw_ChannelArray Array composed of the number of inputs to be read. - Output: PWORD pw_ChannelArrayStatus Status of the selected digital input channels. pw_ChannelArrayStatus [0]: Returns the status of the first selected channel pw_ChannelArrayStatus [1]: Returns the status of the second selected channel pw_ChannelArrayStatus [w_NbrOfChannel - 1]: Returns the status of the last selected channel The number of bits is given by the function b_ADDIDATA_GetDigitalInputInformationEx. 0 low 1 high Task: Reads the status of several digital inputs. Calling convention: ANSI C : BYTE DWORD WORD WORD b_ReturnValue; dw_DriverHandle; w_ChannelArray[3]; w_ChannelArrayStatus [3];

w_ChannelArray [0] = 0; // Select channel 0 w_ChannelArray [1] = 3; // Select channel 3 w_ChannelArray [2] = 5; // Select channel 5 b_ReturnValue = b_ADDIDATA_ReadMoreDigitalInputStatus (dw_DriverHandle, 3, w_ChannelArray, w_ChannelArrayStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER 26) b_ADDIDATA_Read1DigitalInputValue (...)

Digital input channels

Syntax: <Return value> = b_ADDIDATA_Read1DigitalInputValue (DWORD dw_DriverHandle, WORD w_Channel, PWORD pw_ChannelStatus, PDWORD pdw_ChannelValue) Parameters: - Input: DWORD dw_DriverHandle Driver handle WORD w_Channel Number of the input to be read - Output: PWORD pw_ChannelStatus Status of the digital input The number of bits is given by the function b_ADDIDATA_GetDigitalInputInformationEx. PDWORD pdw_ChannelValue Value of the digital input: Use the conversion function to obtain the value in Volt. Task: Indicates the status of a digital inputs. The variable w_Channel passes the input to be read. A value is returned through the variable pw_ChannelStatus. The value of the inputs is returned by the variable pdw_ChannelValue. To obtain the real voltage value, please use the function b_ADDIDATA_Convert1DigitalInputValueInAnalogValue. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; WORD w_Value; DWORD dw_Value; b_ReturnValue = b_ADDIDATA_Read1DigitalInputValue (dw_DriverHandle, 0, &w_Value, &dw_Value); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

32

Digital input channels 27) b_ADDIDATA_ReadMoreDigitalInputValue (...) Syntax: <Return value> = b_ADDIDATA_ReadMoreDigitalInputValue (DWORD dw_DriverHandle, WORD w_NbrOfChannel, PWORD pw_ChannelArray, PWORD pw_ChannelStatusArray, PDWORD pdw_ChannelValueArray) Parameters: - Input: DWORD dw_DriverHandle WORD w_NbrOfChannel PWORD pw_ChannelArray

ADDIDRIVER

Driver handle Defines the number of channels in the channel array. Array containing the number of the inputs to be read.

- Output: PWORD pw_ChannelStatusArray Status of the digital input. The number of bit is given by the function b_ADDIDATA_GetDigitalInputInformationEx. PDWORD pdw_ChannelValueArray Value of the digital input: Use the conversion function to obtain the value in Volt. Task: Reads the analog value of several digital inputs. To obtain the real voltage value, use the function b_ADDIDATA_Convert1DigitalInputValueInAnalogValue. Calling convention: ANSI C : BYTE DWORD WORD WORD DWORD b_ReturnValue; dw_DriverHandle; w_Channel[10]; w_Value[10]; dw_Value[10];

b_ReturnValue = b_ADDIDATA_ReadMoreDigitalInputValue (dw_DriverHandle, 5, w_Channel, w_Value, dw_Value); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER

Digital input channels

28) b_ADDIDATA_Convert1DigitalInputValueInAnalogValue (...) Syntax: <Return value> = b_ADDIDATA_Convert1DigitalInputValueInAnalogValue (DWORD dw_DriverHandle, WORD w_Channel, DWORD dw_DigitalValue, DOUBLE *pd_AnalogValue) Parameters: - Input: DWORD dw_DriverHandle Driver handle WORD w_Channel Number of the input to be read DWORD dw_DigitalValue Digital value of the input returned by the b_ADDIDATA_Read1DigitalInputValue or b_ADDIDATA_ReadMoreDigitalInputValue. - Output: DOUBLE *pd_AnalogValue Value of the input signal in V. Task: Converts the digital input value in a voltage value. Calling convention: ANSI C : BYTE DWORD DWORD DOUBLE b_ReturnValue; dw_DriverHandle; dw_Value; d_VoltageValue;

b_ReturnValue = b_ADDIDATA_Convert1DigitalInputValueInAnalogValue (dw_DriverHandle, 0, dw_Value, &d_VoltageValue); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

34

Digital input channels 29) b_ADDIDATA_GetDigitalInputModuleFilterInformation (...) Syntax: <Return value> = b_ADDIDATA_GetDigitalInputModuleFilterInformation (DWORD dw_DriverHandle, DWORD dw_ModuleNumber, DWORD dw_StructSize pstr_DigitalInputModuleFilterInf ps_DigitalInputModuleFilterInf) Parameters: - Input: DWORD dw_DriverHandle DWORD dw_ModuleNumber DWORD dw_StructSize

ADDIDRIVER

Driver handle Digital input module number. The first module begins from 0. Size of the digital input module filter Information structure. (In bytes)

- Output: pstr_DigitalInputModuleFilterInf ps_DigitalInputModuleFilterInf The digital input module filter information are returned in this structure. The structure contains : BYTE b_FilterTimeUnit Time units available. See Table 2-2. WORD w_FilterTimeStep Possible time steps for the filter BYTE b_Resolution Selection of the resolution for the filter. See Table 2-2. Task: Returns the time units (b_FilterTimeUnit), the time steps (w_FilterTimeStep) and the resolution (b_Resolution) which can be used for the selected digital input module. Table 2-2: Filter timer units Value 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Description ns s ns und s ms ns und ms s und ms ns und s und ms s ns und s s und s ns und ms und s ms und s ns und ms und s s und ms und s ns und s und ms und s Table 2-3: Resolution Value 8 12 16 24 32 Resolution 8-bit 12-bit 16-bit 24-bit 32-bit

ADDIDRIVER

Digital input channels

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; str_DigitalInputModuleFilterInf s_DigitalInputModuleFilterInf b_ReturnValue = b_ADDIDATA_GetDigitalInputModuleFilterInformation (dw_DriverHandle, 0, &b_FilterTimeUnit, sizeof (s_DigitalInputModuleFilterInf), &s_DigitalInputModuleFilterInf); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

36

Digital input channels 30) b_ADDIDATA_InitDigitalInputModuleFilter (...) Syntax: <Return value> = b_ADDIDATA_InitDigitalInputModuleFilter (DWORD dw_DriverHandle, DWORD dw_ModuleNumber, BYTE b_DelayTimeUnit, DWORD dw_DelayValue) Parameters: - Input: DWORD dw_DriverHandle Driver handle DWORD dw_ModuleNumber Digital input module number. The first module begins from 0. BYTE b_DelayTimeUnit Selection of the time unit 0: ns 1: s 2: ms 3: s DWORD dw_DelayValue Filter time - Output: No output signal has occurred. Task: Initialises the digital input filter. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle;

ADDIDRIVER

b_ReturnValue = b_ADDIDATA_InitDigitalInputModuleFilter (dw_DriverHandle, 0, 0, 1000); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER

Digital input channels

31) b_ADDIDATA_EnableDisableDigitalInputModuleFilter (...)

Syntax: <Return value> = b_ADDIDATA_EnableDisableDigitalInputModuleFilter (DWORD dw_DriverHandle, DWORD dw_ModuleNumber, BYTE b_FilterFlag) Parameters: - Input: DWORD dw_DriverHandle DWORD dw_ModuleNumber BYTE b_FilterFlag

Driver handle Module number. The first begins from 0. ADDIDATA_ENABLE or ADDIDATA_DISABLE

- Ausgabe: No output signal has occurred. Task: Activates or deactivates the filter for the selected digital input module. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableDigitalInputModuleFilter (dw_DriverHandle, 0, ADDIDATA_ENABLE); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

38

Digital input channels 32) b_ADDIDATA_SetDigitalInputModuleLevelSelection (...) Syntax: <Return value> = b_ADDIDATA_SetDigitalInputModuleLevelSelection (DWORD dw_DriverHandle, DWORD dw_ModuleNumber, BYTE b_LevelFlag) Parameters: - Input: DWORD dw_DriverHandle Driver handle DWORD dw_ModuleNumber Module number. The first module begins from 0. BYTE b_LevelFlag ADDIDATA_NOT_INVERTED or ADDIDATA_INVERTED - Output: No output signal has occurred. Task: Inverts or not the level of the digital inputs of the selected module. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_SetDigitalInputModuleLevelSelection (dw_DriverHandle, 0, ADDIDATA_INVERTED);

ADDIDRIVER

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER

Digital input channels

33) b_ADDIDATA_TestDigitalInputAsynchronousFIFOFull () Syntax: <Return value> = b_ ADDIDATA_TestDigitalInputAsynchronousFIFOFull (DWORD dw_DriverHandle, PBYTE pb_Full) Parameters: - Input: DWORD dw_DriverHandle - Output: PBYTE pb_Full

Driver handle 0: Asynchronous interrupt FIFO memory not full 1: Asynchronous interrupt FIFO memory is full

Task: Tests if the asynchronous interrupt FIFO memory is full or not. The asynchronous interrupt FIFO memory is the FIFO memory in which the asynchronous events generated by the asynchronous interrupt are stored. Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_FIFOFull

b_ReturnValue = b_ ADDIDATA_TestDigitalInputAsynchronousFIFOFull (dw_DriverHandle, &b_FIFOFull); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

40

DIN EN ISO 9001:2000 certified

ADDI-DATA GmbH Airpark Business Center Airport Boulevard B210 77836 Rheinmnster Germany Phone: +49 7229 18470 Fax: +49 7229 1847222 E-mail: info@addi-data.com

Software description

ADDIDRIVER
Analog output channels

Edition: 06.02 - 08/2010

Table of contents

ADDIDRIVER

1 2

INTRODUCTION...................................................................................1 ANALOG OUTPUT CHANNELS ...............................................................2


1) b_ADDIDATA_GetNumberOfAnalogOutputs (...)............................................................... 2 2) b_ADDIDATA_GetAnalogOutputInformation (...) .............................................................. 3 3) b_ADDIDATA_Init1AnalogOutput (...)................................................................................ 6 4) b_ADDIDATA_InitMoreAnalogOutputs (...) ....................................................................... 7 5) b_ADDIDATA_Write1AnalogOutput (...) ............................................................................ 9 6) b_ADDIDATA_WriteMoreAnalogOutputs (...).................................................................. 10 7) b_ADDIDATA_Release1AnalogOutput (...)....................................................................... 11 8) b_ADDIDATA_ReleaseMoreAnalogOutputs (...) .............................................................. 12 9) b_ADDIDATA_EnableDisable1AnalogOutputSync (...).................................................... 13 10) b_ADDIDATA_EnableDisableMoreAnalogOutputsSync (...).......................................... 14 11) b_ADDIDATA_TriggerAnalogOutput (...) ....................................................................... 15

Tables
Table 1-1: Type Declaration for Windows 98/NT/2000/XP ........................................................1 Table 2-1: Type of analog output ...........................................................................................2 Table 2-2: Output voltage range (high and low) ....................................................................3 Table 2-3: Output software and hardware polarity .................................................................4 Table 2-4: Resolution ..............................................................................................................4

Introduction

ADDIDRIVER

INTRODUCTION
IMPORTANT! Note the following conventions in the text:

Function: Variable

"b_ADDIDATA_GetNumberOfAnalogInputs" dw_DriverHandle

Table 1-1: Type Declaration for Windows 98/NT/2000/XP Borland C Microsoft C Borland Pascal pointer byte integer long longint var byte var integer var long var string var longint double Microsoft Visual Basic Windows any integer integer long long integer integer long string long double

VOID BYTE INT WORD DWORD PBYTE PINT PWORD PCHAR PDWORD DOUBLE

void unsigned char int unsigned short int long unsigned char * int *

void unsigned char int unsigned short int long unsigned char * int *

unsigned short int * unsigned short int * char * long * double char * long * double

ADDIDRIVER

Analog output channels

ANALOG OUTPUT CHANNELS


1) b_ADDIDATA_GetNumberOfAnalogOutputs (...) Syntax: <Return value> = b_ADDIDATA_GetNumberOfAnalogOutputs (DWORD dw_DriverHandle, PWORD pw_NumberOfChannels, PBYTE pb_AnalogOutputType) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver - Output: PWORD pw_NumberOfChannels Number of the analog output channels PBYTE pb_AnalogOutputType Type Array. Gives the type of each analog output. See Table 2-1 pb_AnalogOutputType [0]: Type of the first analog output. pb_AnalogOutputType [1]: Type of the second analog output. ... pb_AnalogOutputType [*pb_AnalogOutputNumber 1]: Type of the last analog output Task: Returns the number of analog outputs and the type of each analog output. Table 2-1: Type of analog output Define ADDIDATA_ANALOG_OUTPUT_DIRECT ADDIDATA_ANALOG_OUTPUT_SYNC Value 0 1 Definition Analog output is immediately written Analog output can be written later

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; WORD w_NumberOfChannels; BYTE b_AnalogOutputType [12]; b_ReturnValue = b_ADDIDATA_GetNumberOfAnalogOutput (dw_DriverHandle, &w_NumberOfChannels, b_AnalogOutputType); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source. 2

Analog output channels 2) b_ADDIDATA_GetAnalogOutputInformation (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_GetAnalogOutputInformation (DWORD dw_DriverHandle, WORD w_ChannelNumber, PBYTE pb_NumberOfVoltageMode, PBYTE pb_HighVoltageRange, PBYTE pb_LowVoltageRange, PBYTE pb_SWPolarity, PBYTE pb_HWPolarity, PBYTE pb_Resolution, PDWORD pdw_Synchronisation) Parameters: - Input: DWORD dw_DriverHandle WORD w_ChannelNumber

Handle of the ADDI-DATA driver Analog output number. The first analog output begins from 0.

- Output: PBYTE pb_NumberOfVoltageMode Number of voltage modes which can be used for the channel PBYTE pb_HighVoltageRange Possible voltage range for the analog output in V. See Table 2-2. PBYTE pb_LowVoltageRange Possible voltage range for the analog output in hundredths of V. See Table 2-2. PBYTE pb_SWPolarity Table 2-3. PBYTE pb_HWPolarity Table 2-3. PBYTE pb_Resolution PDWORD pdw_Synchronisation Possible hardware polarity for the analog output. See Possible resolution for the analog output. See Table 2-4. If = 1, synchronisation is available for the analog output. Possible software polarity for the analog output. See

Task: Gives the number of modes (pb_NumberOfVoltageMode), the voltage range (pb_HighVoltageRange and pb_HighVoltageRange), the polarity (pb_SWPolarity and pb_SWPolarity), the synchronisation (pb_Synchronisation) and the resolution (pb_Resolution) which can be set for the selected analog output (b_AnalogOutputNumber). Table 2-2: Output voltage range (high and low) Define ADDIDATA_RANGE_0 ADDIDATA_RANGE_1 ADDIDATA_RANGE_2 ADDIDATA_RANGE_3 Value 0 1 2 3 Definition First output range supported by the board Second output range supported by the board Third output range supported by the board Fourth output range supported by the board 3

ADDIDRIVER

Analog output channels

IMPORTANT! Please refer to the specific technical manual of the used board (Software functions and samples) to know the correct range for your board.
Table 2-3: Output software and hardware polarity Define ADDIDATA_NONE ADDIDATA_UNIPOLAR ADDIDATA_BIPOLAR ADDIDATA_BOTH Value 0 1 2 3 Definition No polarity available. 0 V to Max Voltage Range* - Max Voltage Range* to + Max Voltage Range* Both are available

* Max voltage range = High voltage range + (Low voltage range x 0,01) Table 2-4: Resolution Value 10 11 12 13 14 15 16 24 32 Calling convention: ANSI C : BYTE DWORD BYTE BYTE BYTE BYTE BYTE DWORD b_ReturnValue; dw_DriverHandle; b_NumberOfMode; b_HighRange[4]; b_LowRange[4]; b_Polarity[4]; b_Resolution[4]; dw_Synchronisation; Resolution 10-bit 11-bit 12-bit 13-bit 14-bit 15-bit 16-bit 24-bit 32-bit

b_ReturnValue = b_ADDIDATA_AnalogOutputInformation (dw_DriverHandle, 0, &b_NumberOfVoltageMode, &b_HighRange[0], &b_LowRange[0], &b_Polarity[0], &b_Resolution[0], &dw_Synchronisation) 4

Analog output channels

ADDIDRIVER

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER 3) b_ADDIDATA_Init1AnalogOutput (...)

Analog output channels

Syntax: <Return Value> = b_ADDIDATA_Init1AnalogOutput (DWORD dw_DriverHandle, WORD w_ChannelNumber, BYTE b_VoltageMode, BYTE b_Polarity) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD Number of the analog output to be initialised The first analog output begins from 0. BYTE b_VoltageMode Selected voltage range. See Table 2-2. BYTE b_Polarity Selected polarity. See

w_ChannelNumber

Table 2-3. - Output: No output signal has occurred. Task: Initialises the selected analog output with the given range and polarity. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_Init1AnalogOutput (dw_DriverHandle, 0, ADDIDATA_RANGE_0, ADDIDATA_UNIPOLAR); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Analog output channels 4) b_ADDIDATA_InitMoreAnalogOutputs (...)

ADDIDRIVER

Syntax: <Return Value> = b_ADDIDATA_InitMoreAnalogOutputs (DWORD dw_DriverHandle, WORD w_NumberOfChannels, PWORD pw_ChannelNumber, PBYTE pb_VoltageMode, PBYTE pb_Polarity) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_NumberOfChannels Number of the analog outputs to be initialised. The first analog output begins from 0. pw_ChannelNumber Analog output array. PWORD PBYTE pb_VoltageMode Voltage or current range array. See Table 2-2. PBYTE pb_Polarity Polarity array. See Table 2-3. - Output: No output signal has occurred. Task: Initialises the analog outputs in the selected range and polarity. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; WORD w_ChannelNumber[4]; BYTE b_VoltageMode[4]; BYTE b_Polarity[4]; w_ChannelNumber[0] = 0; w_ChannelNumber [1] = 2; w_ChannelNumber [2] = 5; w_ChannelNumber [3] = 8; b_ VoltageMode [0] = ADDIDATA_RANGE_0; b_ VoltageMode [1] = ADDIDATA_RANGE_0; b_ VoltageMode [2] = ADDIDATA_RANGE_1; b_ VoltageMode [3] = ADDIDATA_RANGE_1; b_Polarity[0] = ADDIDATA_UNIPOLAR; b_Polarity[1] = ADDIDATA_BIPOLAR; b_Polarity[2] = ADDIDATA_UNIPOLAR; b_Polarity[3] = ADDIDATA_BIPOLAR; b_ReturnValue = b_ADDIDATA_InitMoreAnalogOutputs (dw_DriverHandle, 4, w_ChannelNumber, b_VoltageMode, b_Polarity);

Return value: 7

ADDIDRIVER

Analog output channels

1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Analog output channels 5) b_ADDIDATA_Write1AnalogOutput (...)

ADDIDRIVER

Syntax: <Return Value> = b_ADDIDATA_Write1AnalogOutput (DWORD dw_DriverHandle, WORD w_ChannelNumber, DWORD dw_ValueToWrite) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_ChannelNumber Number of the analog output to be written. The first analog output begins from 0. DWORD dw_ValueToWrite Value to be written on the selected analog output. - Output: No output signal has occurred. Task: Writes a value on 1 analog output. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_Write1AnalogOutput (dw_DriverHandle, 0, 1000); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER 6) b_ADDIDATA_WriteMoreAnalogOutputs (...)

Analog output channels

Syntax: <Return Value> = b_ADDIDATA_WriteMoreAnalogOutputs (DWORD dw_DriverHandle, w_NumberOfChannels, WORD PWORD pw_ChannelNumber PDWORD pdw_ValueToWrite) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_NumberOfChannels Number of analog outputs to be written PWORD pw_ChannelNumber Analog output array. The first analog output begins from 0. PDWORD pb_ValueToWrite Array of the values to be written. - Output: No output signal has occurred. Task: Write a value on each of the selected channels. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; WORD w_ChannelNumber[4]; DWORD b_ValueToWrite[4]; w_ChannelNumber[0] = 0; w_ChannelNumber [1] = 2; w_ChannelNumber [2] = 5; w_ChannelNumber [3] = 8; b_ValueToWrite [0] = 500; b_ValueToWrite [1] = 1000; b_ValueToWrite [2] = 1500; b_ValueToWrite [3] = 2000; b_ReturnValue = b_ADDIDATA_WriteMoreAnalogOutputs (dw_DriverHandle, 4, w_ChannelNumber, b_ValueToWrite); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

10

Analog output channels 7) b_ADDIDATA_Release1AnalogOutput (...)

ADDIDRIVER

Syntax: <Return Value> = b_ADDIDATA_Release1AnalogOutput (DWORD dw_DriverHandle, WORD w_ChannelNumber) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_ChannelNumber Number of the analog output number to be released. The first analog output begins from 0. - Output: No output signal has occurred. Task: Releases the analog output channel. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_Release1AnalogOutput (dw_DriverHandle, 0); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

11

ADDIDRIVER 8) b_ADDIDATA_ReleaseMoreAnalogOutputs (...)

Analog output channels

Syntax: <Return Value> = b_ADDIDATA_ReleaseMoreAnalogOutputs dw_DriverHandle, (DWORD w_NumberOfChannels, WORD pw_ChannelNumber) PWORD Parameters: - Input: DWORD dw_DriverHandle WORD w_NumberOfChannels PWORD pw_ChannelNumber - Output: No output signal has occurred. Task: Releases several analog output channels. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; WORD w_ChannelNumber[4]; w_ChannelNumber [0] = 0; w_ChannelNumber [1] = 2; w_ChannelNumber [2] = 5; w_ChannelNumber [3] = 8; b_ReturnValue = b_ADDIDATA_ReleaseMoreAnalogOutputs (dw_DriverHandle, 4, w_ChannelNumber); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Handle of the ADDI-DATA driver Number of analog outputs to be released. Analog output array. The first analog output begins from 0.

12

Analog output channels 9) b_ADDIDATA_EnableDisable1AnalogOutputSync (...)

ADDIDRIVER

Syntax: <Return Value> = b_ADDIDATA_EnableDisable1AnalogOutputSync (DWORD dw_DriverHandle, WORD w_ChannelNumber, DWORD dw_EnableDisableSync) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_ChannelNumber Number of the analog output to be synchronised. The first analog output begins from 0. DWORD dw_EnableDisableSync If = 1, the analog output is synchronised and written with all other analog outputs. See function: b_ADDIDATA_TriggerAnalogOutput() - Output: No output signal has occurred. Task: Synchronises the analog output to be written with all other synchronised analog outputs. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisable1AnalogOutputSync (dw_DriverHandle, 0, 1); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

13

ADDIDRIVER

Analog output channels

10) b_ADDIDATA_EnableDisableMoreAnalogOutputsSync (...) Syntax: <Return Value> = b_ADDIDATA_EnableDisableMoreAnalogOutputsSync dw_DriverHandle, (DWORD WORD w_NumberOfChannels, PWORD pw_ChannelNumber, PDWORD pdw_EnableDisableSync) Parameters: - Input: DWORD dw_DriverHandle WORD w_ NumberOfChannels PWORD pw_ChannelNumber

Handle of the ADDI-DATA driver Number of analog outputs to be released. Analog output array. The first analog output begins from 0. PDWORD pdw_EnableDisableSync If = 1 the analog output is synchronised and written with all other analog outputs. See function: b_ADDIDATA_TriggerAnalogOutput() - Output: No output signal has occurred. Task: Synchronises the selected analog outputs (pw_ChannelNumber).

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; WORD w_ChannelNumber[4]; DWORD dw_EnableDisableSync [4]; w_ChannelNumber[0] = 0; w_ChannelNumber[1] = 2; w_ChannelNumber[2] = 5; w_ChannelNumber[3] = 8; b_EnableDisableSync [0] = 0; b_EnableDisableSync [1] = 1; b_EnableDisableSync [2] = 0; b_EnableDisableSync [3] = 1; b_ReturnValue = b_ADDIDATA_EnableDisableMoreAnalogOutputsSync (dw_DriverHandle, 4, w_ChannelNumber, dw_EnableDisableSync); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

14

Analog output channels 11) b_ADDIDATA_TriggerAnalogOutput (...)


12B

ADDIDRIVER

Syntax: <Return Value> = b_ADDIDATA_TriggerAnalogOutput (DWORD dw_DriverHandle) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver - Output: No output signal has occurred. Task: Triggers the writing on all synchronised analog output channels. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle;
U U

b_ReturnValue = b_ADDIDATA_TriggerAnalogOutput (dw_DriverHandle); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

15

DIN EN ISO 9001:2000 certified

ADDI-DATA GmbH Airpark Business Center Airport Boulevard B210 77836 Rheinmnster Germany Phone: +49 7229 18470 Fax: +49 7229 1847222 E-mail: info@addi-data.com

Software description

ADDIDRIVER
Analog inputs

Edition: 07.06- 08/2010

Table of contents

ADDIDRIVER

1 2
2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9

INTRODUCTION...................................................................................3 ANALOG INPUTS ..................................................................................4


General information .............................................................................................4 Initialisation........................................................................................................31 Single acquisition...............................................................................................34 Autorefresh acquisition ......................................................................................40 SCAN acquisition................................................................................................45 Sequence acquisition ........................................................................................58 Hardware trigger ................................................................................................69 Software trigger functions ..................................................................................75 Other functions...................................................................................................81

Tables
Table 1-1: Type Declaration for Windows 98/NT/2000/XP ........................................................3 Table 2-1: Gain/Polarity for a max. voltage of 5 V ................................................................32 Table 2-2: Selection of the conversion time .........................................................................35 Table 2-3: Time selection of a SCAN.....................................................................................46 Table 2-4: SCAN time mode.................................................................................................46 Table 2-5: SCAN mode.........................................................................................................47 Table 2-6: Trigger mode .......................................................................................................47

ADDIDRIVER

Introduction

INTRODUCTION

IMPORTANT! Note the following conventions in the text:

Function: Variable

"b_ADDIDATA_GetNumberOfAnalogInputs" dw_DriverHandle

Table 1-1: Type Declaration for Windows 98/NT/2000/XP Borland C Microsoft C Borland Pascal pointer byte integer long longint var byte var integer var long var string var longint double Microsoft Visual Basic Windows any integer integer long long integer integer long string long double

VOID BYTE INT WORD DWORD PBYTE PINT PWORD PCHAR PDWORD DOUBLE

void unsigned char int unsigned short int long unsigned char * int *

void unsigned char int unsigned short int long unsigned char * int *

unsigned short int * unsigned short int * char * long * double char * long * double

Analog inputs

ADDIDRIVER

2
2.1

ANALOG INPUTS
General information
1) b_ADDIDATA_GetNumberOfAnalogInputs (..) Syntax: <Return value> = b_ADDIDATA_GetNumberOfAnalogInputs (DWORD dw_DriverHandle, PWORD pw_ChannelNbr) Parameters: - Input: DWORD dw_DriverHandle - Output: PWORD pw_ChannelNbr Task: Returns the number of analog inputs. Calling convention: ANSI C : BYTE DWORD WORD b_ReturnValue; dw_DriverHandle; w_ChannelNbr; (dw_DriverHandle, &w_ChannelNbr);

Driver handle Returns the number of analog inputs

b_ReturnValue = b_ADDIDATA_GetNumberOfAnalogInputs

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER

Analog inputs

2)

b_ADDIDATA_GetNumberOfAnalogInputModules (..) Syntax: <Return value> = b_ADDIDATA_GetNumberOfAnalogInputModules (DWORD dw_DriverHandle, PWORD pw_ModuleNbr) Parameter: - Input: DWORD dw_DriverHandle Driver handle - Output: PWORD pw_ModuleNbr Returns the number of analog input modules. Task: Returns the number of analog input modules. Calling convention: ANSI C : BYTE DWORD WORD b_ReturnValue; dw_DriverHandle; w_ModuleNbr;

b_ReturnValue = b_ADDIDATA_GetNumberOfAnalogInputModules (dw_DriverHandle, &w_ModuleNbr); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Analog inputs

ADDIDRIVER

3)

b_ADDIDATA_GetNumberOfAnalogInputsForTheModule (..) Syntax: <Return value> = b_ADDIDATA_GetNumberOfAnalogInputsForTheModule (DWORD dw_DriverHandle, WORD w_Module, PWORD pw_ChannelNbr) Parameters: - Input: DWORD dw_DriverHandle Driver handle WORD w_Module Analog input module - Output: PWORD pw_ChannelNbr Returns the number of analog input channels for the selected module. Task: Returns the number of analog input channels for the module selected with w_Module. Calling convention: ANSI C : BYTE DWORD WORD b_ReturnValue; dw_DriverHandle; w_ChannelNbr;

b_ReturnValue = b_ADDIDATA_GetNumberOfAnalogInputsForTheModule (dw_DriverHandle, 0, &w_ChannelNbr); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER

Analog inputs

4)

b_ADDIDATA_GetAnalogInputModuleNumber (..) Syntax: <Return value> = b_ADDIDATA_GetAnalogInputModuleNumber (DWORD dw_DriverHandle, WORD w_Channel, PWORD pw_Module) Input: DWORD WORD dw_DriverHandle w_Channel Driver handle Analog input channel Returns the analog input module number from selected channel.

Output: PWORD pw_Module

Task: Return the analog input module index (pw_Module) from selected channel (w_Channel) Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; WORD w_Module; b_ReturnValue = b_ADDIDATA_b_ADDIDATA_GetAnalogInputModuleNumber (dw_DriverHandle, 0, &w_Module); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Analog inputs

ADDIDRIVER

5)

b_ADDIDATA_GetAnalogInputInformation (..)

IMPORTANT! This function is only available for old user applications (up to version 2132-0304 of ADDIPACK).
If you develop new applications with ADDIDRIVER, please use the following functions: b_ADDIDATA_GetAnalogInputModuleGeneralInformation b_ADDIDATA_GetAnalogInputModuleSingleAcquisitionInformation, b_ADDIDATA_GetAnalogInputModuleAutoRefreshInformation, b_ADDIDATA_GetAnalogInputModuleSCANInformation and b_ADDIDATA_GetAnalogInputModuleSequenceInformation. Syntax: <Return value> = b_ADDIDATA_GetAnalogInputInformation (DWORD dw_DriverHandle, WORD w_Channel, pstr_GetAnalogMesureInformation ps_ChannelInformation, DWORD dw_StructSize) Parameters: - Input: DWORD dw_DriverHandle Driver handle WORD w_Channel Number of the analog input DWORD dw_StructSize Size of the structure entered in the pointer. - Output: pstr_GetAnalogMesureInformation ps_ChannelInformation Channel information. structure returned : typedef struct { BYTE b_InputsResolution;

BYTE BYTE

BYTE BYTE BYTE

Returns the input resolution 8: 8-bit resolution 16: 16-bit resolution, ... b_CanUsedInterrupt; 0: No interrupt can be generated 1: Interrupt can be generated b_UnipolarBipolarConfigurable 0: Unipolar/bipolar hardware configurable 1: Unipolar/bipolar configurable b_UnipolarAvailable; 0: Cannot configure in unipolar 1: Can configure in unipolar b_BipolarAvailable; 0: Cannot configure in bipolar 1: Can configure in bipolar b_SingleDifferenceSelected; 0: Single mode selected 1: Differential mode selected

ADDIDRIVER

Analog inputs

BYTE

BYTE BYTE BYTE

BYTE

BYTE DWORD DOUBLE BYTE BYTE WORD

BYTE BYTE BYTE BYTE DOUBLE DOUBLE BYTE

BYTE

WORD

b_DCCouplingAvailable; 0: Cannot configure the direct coupling (DC) 1: Can configure direct coupling (DC) b_ACCouplingAvailable; 0: Cannot configure alternative coupling (AC) 1: Can configure alternative coupling (AC) b_BufferAvailable; 0: No hardware buffer available 1: Hardware buffer available b_CanGerenatedWarning; 0: Alarm not available 1: Alarm available b_CurrentSourceSetBySoft; 0: The current source must not be activated by software 1: The current source must be activated by software. b_NbrOfGain; Returns the number of gain values available dw_ModuleNumber Module number d_GainAvailable[255]; Defines the available gain value b_OffsetRangeAvailable; 0: Offset not allowed 1: Offset allowed b_Reserved2; w_OffsetRangeResolution; Offset resolution 8: 8-bit resolution 16: 16-bit resolution, ... b_OffsetRangeDenominator; Offset denominator step value b_OffsetRangeNumerator; Offset numerator step value b_OpenInputDetection; 0: Open input detection not available 1: Open input detection available b_ShortCircuitDetection; 0: Short-circuit detection not available 1: Short-circuit detection available d_Umax; Returns the maximum input voltage value in V or A d_URef; Returns the reference input voltage value in V or A b_InputType; Selected user input type ADDIDATA_RTD ADDIDATA_THERMOCOUPLE ADDIDATA_TEMPERATURE_ON_BOARD ADDIDATA_OHM ADDIDATA_ANALOG_INPUT b_TypePrecision; Precision of the input ADDIDATA_THERMOCOUPLE_TYPE_B ADDIDATA_THERMOCOUPLE_TYPE_E ADDIDATA_THERMOCOUPLE_TYPE_J ADDIDATA_THERMOCOUPLE_TYPE_K ADDIDATA_THERMOCOUPLE_TYPE_N ADDIDATA_THERMOCOUPLE_TYPE_R ADDIDATA_THERMOCOUPLE_TYPE_S ADDIDATA_THERMOCOUPLE_TYPE_T or ADDIDATA_RTD_TYPE_PT ADDIDATA_RTD_TYPE_Ni w_InputTypeValue; If a Pt sensor is connected type of the sensor 100 Pt100 9

Analog inputs

ADDIDRIVER

Module Information BYTE b_AutoCalibration; BYTE

BYTE

BYTE

BYTE BYTE

WORD WORD

WORD

BYTE BYTE BYTE BYTE

0: Auto-calibration not available 1: Auto-calibration available b_CJCAvailable; 0: Without CJC (cold junction compensation) 1: With CJC b_ConversionMustSetting; 0: The conversion time for a single acquisition is determined by hardware (jumper) 1: The conversion time for a single acquisition is determined by software b_ConversionCalcType; 0: Binary type (XX000,XX001,XX010,XX011,XX100) 1: Multiple type (60, 120, 240, 480, 960, ...) b_ConversionUnitType; 0: Time unit (ns, s, ms, s, ...) 1: Frequency unit (MHz, kHz, Hz, mHz, ...) b_AvailableConversionUnit; For time unit: D0: 0: ns not available 1: ns available D1: 0: s not available 1: s available D2: 0: ms not available 1: ms available D3: 0: s not available 1: s available For frequency unit: D0: 0: MHz not available 1: MHz available D1: 0: kHz not available 1: kHz available D2: 0: Hz not available 1: Hz available D3: 0: mHz not available 1: mHz available w_ConversionResolution; 8 : 8-bit resolution 16: 16-bit resolution, ... w_MinConversionTime; Minimum conversion time. 7000: 7000(ns) 10000: 10000(ns), ... w_ConversionStep; Conversion time steps 20: 20 steps 50: 50 steps, ... b_SEQArrayAvailable; 0: Sequence array not available 1: Sequence array available b_SEQConfigurable; 0: Sequence fixed 1: Sequence configurable b_SEQHardwareTriggerAvailable; 0: Hardware trigger not available 1: Hardware trigger available b_SEQHardwareTriggerHighAvailable; 0: Hardware high trigger level not available 1: Hardware high trigger level available

10

ADDIDRIVER

Analog inputs

BYTE

BYTE

BYTE BYTE

BYTE

BYTE

WORD

BYTE BYTE BYTE BYTE

BYTE

BYTE

BYTE

BYTE WORD

BYTE

b_SEQHardwareTriggerLowAvailable; 0: Low level not available for hardware trigger 1: Low level available for hardware trigger b_SEQHardwareTriggerAvailableMode; 001: External trigger start a 1 DMA cycle 010: Each trigger starts a sequence 100: Each trigger starts a DMA cycle b_SEQHardwareGateAvailable; 0: Hardware gate not available 1: Hardware gate available b_SEQHardwareGateHighAvailable; 0: High level not available for hardware gate 1: High level available for hardware gate b_SEQHardwareGateLowAvailable; 0: Low level not available for hardware gate 1: Low level available for hardware gate b_SEQClrIndexAvailable; 0: It is not possible to restart the acquisition with the next selected channel in the sequence 1: It's possible to restart the acquisition with the next selected channel in the sequence w_SEQAcquisitionMode; 00: The acquisition can operate in single mode 01: The acquisition can operate in continuous mode 11: The acquisition can operate in single and continuous mode b_DMAAvailable; 0: Board cannot use the DMA 1: Board can use the DMA b_DualDMAChannel; 0: Only 1 DMA channel can be used 1: Board can use 2 DMA channels b_SEQCounterAvailable; 0: DMA conversion counter not available 1: DMA conversion counter available b_SEQCounterMode; 01: Counter can count the number of sequences 10: Counter can count the number of DMA cycles 11: Counter can count the number of DMA cycles or the number of sequences b_SEQCommonGain; Defines if the gain can differ for each input 0: Gain is the same for each input 1: Gain can differ for each input. b_SEQCommonPolarity; Defines if the polarity can differ for each input 0: Polarity is the same for each input 1: Polarity can differ for each input. b_SEQCommonOffsetRange; Defines if the offset can differ for each input 0: Offset is the same for each input 1: Offset can differ for each input. b_SEQCommonCoupling; w_SEQCounterResolution; Counter resolution 8 : 8-bit resolution 16: 16-bit resolution, ... b_SEQDelayTimeConfigurable; 0: Delay after each sequence not available 1: Delay after each sequence available 11

Analog inputs

ADDIDRIVER

BYTE BYTE

BYTE BYTE

BYTE

WORD

WORD

WORD

BYTE

BYTE BYTE BYTE

BYTE

BYTE

b_SEQDelayMode; b_SEQDelayCalcType; 0: Binary type (XX000,XX001,XX010,XX011,XX100) 1: Multiple type (60,120,240,480,960, ...) b_SEQDelayTimeUnitType; 0: Time unit (ns, s, ms, s, ...) 1: Frequency unit (MHz, kHz, Hz, mHz, ...) b_SEQDelayValueType; 0: Value to write in the register is in s or in Hz 1: The step multiplier is to be written in the register b_SEQDelayTimeUnit; For time unit: D0: 0: ns not available 1: ns available D1: 0: s not available 1: s available D2: 0: ms not available 1: ms available D3: 0: s not available 1: s available For frequency unit: D0: 0: MHz not available 1: MHz available D1: 0: kHz not available 1: kHz available D2: 0: Hz not available 1: Hz available D3: 0: mHz not available 1: mHz available w_SEQDelayTimeResolution; Delay time resolution 8: 8-bit resolution 16: 16-bit resolution, ... w_SEQMinDelayTime; Minimum delay time. 7000: 7000(ns) 10000: 10000(ns), ... w_SEQDelayTimeStep; Conversion delay time steps 20: 20 steps 50: 50 steps, ... b_SEQUnipolarBipolarConfigurable; 0: Unipolar/Bipolar hardware configurable 1: Unipolar/Bipolar configurable b_SEQUnipolarAvailable; 0: Cannot configure in unipolar 1: Can configure in unipolar b_SEQBipolarAvailable; 0: Cannot configure in bipolar 1: Can configure in bipolar b_SEQDCCouplingAvailable; 0: Cannot configure the direct coupling (DC) 1: Can configure direct coupling (DC) b_SEQACCouplingAvailable; 0: Cannot configure alternative coupling (AC) 1: Can configure alternative coupling (AC) b_SEQBufferAvailable; 0: No hardware buffer available 1: Hardware buffer available

12

ADDIDRIVER

Analog inputs

BYTE BYTE WORD DWORD DOUBLE BYTE

BYTE WORD

BYTE BYTE BYTE BYTE

BYTE

BYTE

BYTE

BYTE

BYTE

BYTE

BYTE

BYTE

WORD

b_SEQNbrOfGain; Returns the number of gain values available b_Reserved3; w_Reserved4; dw_Reserved5; d_SEQGainAvailable[255]; Defines the available gain value b_SEQOffsetRangeAvailable; 0: Offset not allowed 1: Offset allowed b_Reserved6; w_SEQOffsetRangeResolution; Offset resolution 8 : 8-bit resolution 16: 16-bit resolution, ... b_SEQOffsetRangeDenominator; Offset denominator step value b_SEQOffsetRangeNumerator; Offset numerator step value b_SCANAvailable; 0: SCAN not available 1: SCAN available b_SCANConfigurable; 0: SCAN fixed 1: SCAN configurable (The first and the last channel can be given) b_SCANHardwareTriggerAvailable; 0: Hardware trigger not available 1: Hardware trigger available b_SCANHardwareTriggerHighAvailable; 0: Hardware high trigger level not available 1: Hardware high trigger level available b_SCANHardwareTriggerLowAvailable; 0: Hardware low trigger level not available 1: Hardware low trigger level available b_SCANHardwareTriggerAvailableMode; 0001: External trigger starts each acquisition from a SCAN 0010: Each trigger starts each SCAN 1000: the first Trigger starts the SCAN cycle b_SCANHardwareGateAvailable; 0: Hardware gate not available 1: Hardware gate available b_SCANHardwareGateHighAvailable; 0: Hardware high gate level not available 1: Hardware high gate level available b_SCANHardwareGateLowAvailable; 0: Low level not available for hardware gate 1: Low level available for hardware gate b_SCANClrIndexAvailable; 0: It is not possible to restart the acquisition with the next selected channel of SCAN 1: It is possible to restart the acquisition with the next selected channel of SCAN w_SCANAcquisitionMode; 00: The acquisition can operate in single mode 01: The acquisition can operate in continuous mode 11: The acquisition can operate in single and continuous mode 13

Analog inputs

ADDIDRIVER

BYTE BYTE BYTE

BYTE

BYTE

BYTE WORD

BYTE

BYTE BYTE

BYTE BYTE

BYTE

WORD

b_SCANCounterAvailable; 0: SCAN conversion counter not available 1: SCAN conversion counter available b_SCANCounterMode; 01: Counter can count the number of SCANs b_SCANCommonGain; Defines if the gain can differ for each input 0: Gain is the same for each input 1: Gain can differ for each input. b_SCANCommonPolarity; Defines if the polarity can differ for each input 0: Polarity is the same for each input 1: Polarity can be differ for each input. b_SCANCommonOffsetRange;Defines if the offset can differ for each input 0: Offset is the same for each input 1: Offset can differ for each input. b_SCANCommonCoupling; w_SCANCounterResolution; Counter resolution 8: 8-bit resolution 16: 16-bit resolution, ... b_SCANDelayTimeConfigurable; 0: Delay after each sequence not available 1: Delay after each sequence available b_SCANDelayMode; b_SCANDelayCalcType; 0: Binary type (XX000,XX001,XX010,XX011,XX100) 1: Multiple type (60,120,240,480,960, ...) b_SCANDelayTimeUnitType; 0: Time unit (ns, s, ms, s, ...) 1: Frequency unit (MHz, kHz, Hz, mHz, ...) b_SCANDelayValueType; 0: Value to write in the register is the value in s or in Hz 1: The step multiplier is to be written in the register b_SCANDelayTimeUnit; For time unit: D0: 0: ns not available 1: ns available D1: 0: s not available 1: s available D2: 0: ms not available 1: ms available D3: 0: s not available 1: s available For frequency unit: D0: 0: MHz not available 1: MHz available D1: 0: kHz not available 1: kHz available D2: 0: Hz not available 1: Hz available D3: 0: mHz not available 1: mHz available w_SCANDelayTimeResolution; Delay time resolution 8: 8-bit resolution 16: 16-bit resolution, ...

14

ADDIDRIVER

Analog inputs

w_SCANMinDelayTime; Minimum delay time. 7000: 7000(ns) 10000: 10000(ns), ... WORD w_SCANDelayTimeStep; Conversion delay time steps 20: 20 steps 50: 50 steps, ... BYTE b_SCANUnipolarBipolarConfigurable; 0: Unipolar/bipolar hardware configurable 1: Unipolar/bipolar configurable BYTE b_SCANUnipolarAvailable; 0: Cannot configure in unipolar 1: Can configure in unipolar BYTE b_SCANBipolarAvailable; 0: Cannot configure in bipolar 1: Can configure in bipolar BYTE b_SCANDCCouplingAvailable; 0: Cannot configure the direct coupling (DC) 1: Can configure direct coupling (DC) BYTE b_SCANACCouplingAvailable; 0: Cannot configure alternative coupling (AC) 1: Can configure alternative coupling (AC) BYTE b_SCANBufferAvailable; 0: No hardware buffer available 1: Hardware buffer available BYTE b_SCANNbrOfGain; Returns the number of gain values available BYTE b_Reserved7; WORD w_Reserved8; DOUBLE d_SCANGainAvailable[255]; Defines the available gain values BYTE b_SCANOffsetRangeAvailable; 0: Offset not allowed 1: Offset allowed BYTE b_Reserved9; WORD w_SCANOffsetRangeResolution; Offset resolution 8 : 8-bit resolution 16: 16-bit resolution, ... BYTE b_SCANOffsetRangeDenominator; Offset denominator step value BYTE b_SCANOffsetRangeNumerator; Offset numerator step value WORD w_Reserved10; }str_GetAnalogMesureInformation,*pstr_GetAnalogMesureInformation; Task: Returns information about the selected analog input channels. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; WORD w_ChannelNbr; str_GetAnalogMesureInformation s_ChannelInformation; b_ReturnValue = b_ADDIDATA_GetAnalogInputInformation (dw_DriverHandle, 0, &s_ChannelInformation, sizeof (str_GetAnalogMesureInformation)); 15

WORD

Analog inputs

ADDIDRIVER

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

16

ADDIDRIVER

Analog inputs

6)

b_ADDIDATA_GetAnalogInputModuleGeneralInformation (..) Syntax: <Return value> = b_ADDIDATA_GetAnalogInputModuleGeneralInformation (DWORD dw_DriverHandle, WORD w_Module, pstr_AnalogInputModuleInformation ps_ModuleInformation, DWORD dw_StructSize) Input: DWORD DWORD dw_DriverHandle dw_StructSize Driver handle Size of the structure entered in the pointer. ps_ModuleInformation Module information.

Output: pstr_AnalogInputModuleInformation

structure returned : typedef struct { BYTE b_InputsResolution;

BYTE

b_UnipolarBipolarConfigurable;

BYTE

b_UnipolarAvailable;

BYTE BYTE BYTE BYTE BYTE

b_BipolarAvailable; b_SingleDifferenceSelected; b_ACAvailable; b_DCAvailable; b_AutoCalibration;

DOUBLE

d_UMax;

BYTE

b_ConversionCalcType;

Returns the input resolution 8: 8-bit resolution 16: 16-bit resolution, ... 0: Unipolar/Bipolar hardware configurable 1: Unipolar/Bipolar software configurable 0: Unipolar mode not available 1: Unipolar mode available 0: Bipolar mode not available 1: Bipolar mode available 0: Single mode selected 1: Difference mode selected 0: AC available 1: AC not available 0: DC available 1: DC not available 0: Auto calibration not available 1: Auto calibration available Return the maximal input voltage value in V or A 0: Binary type

(XX000,XX001,XX010,XX011) 1: Multiple type (60,120,240,480, ...) 17

Analog inputs

ADDIDRIVER

BYTE

b_ConversionUnitType;

BYTE

b_AvailableConversionUnit;

0: Time unit (ns, s, ms, s, ...) 1: Frequency unit (MHz, KHz, Hz, etc.) For time unit: D0: 0: ns not available 1: ns available D1: 0: s not available 1: s available D2: 0: ms not available 1: ms available D3: 0: s not available 1 : s available For frequency unit:: D0: 0: MHz not available 1: MHz available D1: 0: KHz not available 1: KHz available D2: 0: Hz not available 1: Hz available D3: 0: mHz not available 1: mHz available Convert time resolution 8: 8-bit resolution 16: 16-bit resolution, ... Minimum conversion time. 7000 : 7000(ns) 10000 : 10000(ns), ... Conversion time steps 20: 20 steps 50: 50 steps, ... 0: Single acquisition not 1: Single acquisition available 0: Auto refresh acquisition not available 1: Auto refresh acquisition available 0: Scan acquisition not available 1: Scan acquisition available 0: Sequence acquisition not available 1: Sequence acquisition available

BYTE WORD

b_Reserved2[5]; w_ConversionResolution;

WORD

w_MinConversionTime;

WORD

w_ConversionStep;

BYTE BYTE available BYTE

b_Reserved3[2]; b_SingleAcquisition;

b_AutoRefreshAcquisition;

BYTE

b_ScanAcquisition;

BYTE

b_SequenceAcquisition;

BYTE 18

b_Reserved4[4];

ADDIDRIVER

Analog inputs

WORD

w_FirstChannelNumber;

WORD

w_LastChannelNumber;

Return the number from first channel number Return the number from last channel number

BYTE b_Reserved5[4]; }str_AnalogInputModuleInformation, *pstr_AnalogInputModuleInformation; Task: Returns information about the analog input module (input resolution, convert time, available acquisition modes, ) Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; str_AnalogInputModuleInformation s_ModuleInformation; b_ReturnValue = b_ADDIDATA_GetAnalogInputModuleGeneralInformation (dw_DriverHandle, 0, &s_ModuleInformation, sizeof (s_ModuleInformation)); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

19

Analog inputs

ADDIDRIVER

7)

b_ADDIDATA_GetAnalogInputModuleSingleAcquisitionInformation (..) Syntax: <Return value> = b_ADDIDATA_GetAnalogInputModuleSingleAcquisitionInformation (DWORD dw_DriverHandle, WORD w_Module, pstr_AnalogInputSingleAcquisitionInformation ps_ModuleInformation, DWORD dw_StructSize) Input: DWORD DWORD dw_DriverHandle dw_StructSize Driver handle Size of the structure entered in the pointer. ps_ModuleInformation

Output: pstr_AnalogInputSingleAcquisitionInformation Module information. structure returned : typedef struct { BYTE b_Interrupt; BYTE BYTE BYTE BYTE b_SoftwareTrigger; b_HardwareTrigger; b_HardwareGate; b_NbrOfGain;

0: No interrupt can by generated 1: Interrupt can by generated 0: Software trigger not available 1: Software trigger available 0: Hardware trigger not available 1: Hardware trigger available 0: Hardware gate not available 1: Hardware gate available Returns the number of gain values available

BYTE b_Reserved1[3]; DOUBLE d_GainAvailable[255]; Defines the available gain value }str_AnalogInputSingleAcquisitionInformation, *pstr_AnalogInputSingleAcquisitionInformation; Task: Returns information about the analog input module for the single acquisition mode. (b_ADDIDATA_Read1AnalogInput and b_ADDIDATA_ReadMoreAnalogInputs)

20

ADDIDRIVER

Analog inputs

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; str_AnalogInputSingleAcquisitionInformation s_ModuleInformation; b_ReturnValue = b_ADDIDATA_GetAnalogInputModuleSingleAcquisitionInformation (dw_DriverHandle, 0, &s_ModuleInformation, sizeof (s_ModuleInformation)); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

21

Analog inputs

ADDIDRIVER

8)

b_ADDIDATA_GetAnalogInputModuleAutoRefreshInformation (..) Syntax: <Return value> = b_ADDIDATA_GetAnalogInputModuleAutoRefreshInformation (DWORD dw_DriverHandle, WORD w_Module, pstr_AnalogInputAutoRefreshInformation ps_ModuleInformation, DWORD dw_StructSize) Input: DWORD DWORD pointer. dw_DriverHandle dw_StructSize Driver handle Size of the structure entered in the

Output: pstr_AnalogInputAutoRefreshInformation ps_ModuleInformation Module information. structure returned : typedef struct { BYTE b_Interrupt; BYTE BYTE BYTE BYTE b_SoftwareTrigger; b_HardwareTrigger; b_HardwareGate; b_AccessMode;

BYTE

b_CommonGain;

BYTE

b_CommonPolarity;

0: No interrupt can by generated 1: Interrupt can by generated 0: Software trigger not available 1: Software trigger available 0: Hardware trigger not available 1: Hardware trigger available 0: Hardware gate not available 1: Hardware gate available Auto refresh buffer access mode 8: 8-bit access mode 16: 16-bit access mode 32: 32-bit access mode Define if the gain can be different for each input 0: Gain is common on each input 1: Gain can be different for each input. Define if the polarity can be different for each input 0: Polarity is common on each input 1: Polarity can be different for each input. Returns the number of gain values available

BYTE BYTE

b_Reserved1 [1]; b_NbrOfGain;

BYTE b_Reserved2 [7]; DOUBLE d_GainAvailable[255]; Defines the available gain value } str_AnalogInputAutoRefreshInformation,*pstr_AnalogInputAutoRefreshInformation 22

ADDIDRIVER

Analog inputs

Task: Returns information about the analog input module for the auto refresh acquisition mode (b_ADDIDATA_GetAnalogInputAutoRefreshChannelPointer and b_ADDIDATA_StartAnalogInputAutoRefresh). The auto refresh mode acquire continually the analog inputs and give the values via a memory space. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; str_AnalogInputAutoRefreshInformation s_ModuleInformation; b_ReturnValue = b_ADDIDATA_GetAnalogInputModuleAutoRefreshInformation (dw_DriverHandle, 0, &s_ModuleInformation, sizeof (s_ModuleInformation)); Note: All channels of a module must be initialised to run the auto refresh acquisition. Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

23

Analog inputs

ADDIDRIVER

9)

b_ADDIDATA_GetAnalogInputModuleSCANInformation (..) Syntax: <Return value> = b_ADDIDATA_GetAnalogInputModuleSCANInformation (DWORD dw_DriverHandle, WORD w_Module, pstr_AnalogInputSCANInformation ps_ModuleInformation, DWORD dw_StructSize) Input: DWORD DWORD pointer. dw_DriverHandle dw_StructSize Driver handle Size of the structure entered in the

Output: pstr_AnalogInputSCANInformation

ps_ModuleInformation information.

Module

structure returned : typedef struct { BYTE b_SCANConfigurable;

BYTE BYTE BYTE BYTE

b_SoftwareTrigger; b_HardwareTrigger; b_HardwareGate; b_CommonGain;

BYTE

b_CommonPolarity;

0: SCAN fixed. User must pass the first and last channel from the selected module 1: SCAN configurable User is free to define the first and last channel 0: Software trigger not available 1: Software trigger available 0: Hardware trigger not available 1: Hardware trigger available 0: Hardware gate not available 1: Hardware gate available Define if the gain can be different for each input 0: Gain is common on each input 1: Gain can be different for each input. Define if the polarity can be different for each input 0: Polarity is common on each input 1: Polarity can be different for each input.

BYTE BYTE DOUBLE BYTE

BYTE 24

Returns the number of gain values available d_GainAvailable[255]; Defines the available gain value b_DelayTimeConfigurable; 0: Delay after each SCAN not available 1: Delay after each SCAN available b_DelayAvailableMode; D0: 0: Mode 1 not available

b_Reserved1; b_NbrOfGain;

ADDIDRIVER

Analog inputs

D1: BYTE b_DelayCalcType; (XX000,XX001,XX010) (60,120,240,480,960, ...) BYTE b_DelayTimeUnitType; (MHz,kHz,Hz,mHz, ...) BYTE b_DelayTimeUnit;

1: Mode 1 available 0: Mode 2 not available 1: Mode 2 available 0: Binary type

1: Multiple type 0: Time unit (ns,s,ms,s, ...) 1: Frequency unit For time unit: D0: 0: ns not available 1: ns available D1: 0: s not available 1: s available D2: 0: ms not available 1: ms available D3: 0: s not available 1 : s available For frequency unit: D0: 0: MHz not available 1: MHz available D1: 0: KHz not available 1: KHz available D2: 0: Hz not available 1: Hz available D3: 0: mHz not available 1: mHz available

BYTE WORD

Delay time resolution 8: 8-bit resolution 16: 16-bit resolution, ... WORD w_MinDelayTime; Minimum delay time. 7000 : 7000(ns) 10000: 10000(ns), ... WORD w_DelayTimeStep; Conversion delay time steps 20: 20 steps 50: 50 steps, ... WORD w_AcquisitionMode; XX1: The acquisition can work in Single mode X11: The acquisition can work in continuous mode 1XX: The acquisition can work in counting mode DWORD dw_MaxNumberOfAcquisition; Return the max number of acquisition for the counting acquisition SCAN mode BYTE b_Reserved4 [4]; } str_AnalogInputSCANInformation,*pstr_AnalogInputSCANInformation

b_Reserved2 [3]; w_DelayTimeResolution;

Task: Returns information about the analog input module for the SCAN acquisition mode (b_ADDIDATA_InitAnalogInputSCANAcquisition and 25

Analog inputs

ADDIDRIVER

b_ADDIDATA_StartAnalogInputSCAN). Into the SCAN mode the user define the first and last channel to acquire. After each SCAN a interrupt is generated and the user receive the analog input values. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; pstr_AnalogInputSCANInformation s_ModuleInformation; b_ReturnValue = b_ADDIDATA_GetAnalogInputModuleSCANInformation (dw_DriverHandle, 0, &s_ModuleInformation, sizeof (s_ModuleInformation)); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

26

ADDIDRIVER

Analog inputs

10) b_ADDIDATA_GetAnalogInputModuleSequenceInformation (..) Syntax: <Return value> = b_ADDIDATA_GetAnalogInputModuleSequenceInformation (DWORD dw_DriverHandle, WORD w_Module, pstr_AnalogInputSequenceInformation ps_ModuleInformation, DWORD dw_StructSize) Input: DWORD DWORD dw_DriverHandle dw_StructSize Driver handle Size of the structure entered in the pointer.

Output: pstr_AnalogInputSequenceInformation Module information. structure returned : typedef struct { BYTE b_SequenceConfigurable;

ps_ModuleInformation

BYTE BYTE BYTE BYTE

b_SoftwareTrigger; b_HardwareTrigger; b_HardwareGate; b_CommonGain;

BYTE

b_CommonPolarity;

0: Sequence fixed. User muss pass the first and last channel from the selected module 1: Sequence configurable User is free to define the first and last channel 0: Software trigger not available 1: Software trigger available 0: Hardware trigger not available 1: Hardware trigger available 0: Hardware gate not available 1: Hardware gate available Define if the gain can be different for each input 0: Gain is common on each input 1: Gain can be different for each input. Define if the polarity can be different for each input 0: Polarity is common on each input 1: Polarity can be different for each input. 27

BYTE

b_Reserved1;

Analog inputs

ADDIDRIVER

Returns the number of gain values available DOUBLE d_GainAvailable[255]; Defines the available gain value BYTE b_DelayTimeConfigurable; 0: Delay after each sequence not available 1: Delay after each sequence available BYTE b_DelayAvailableMode; D0: 0: Mode 1 not available 1: Mode 1 available D1: 0: Mode 2 not available 1: Mode 2 available BYTE b_DelayCalcType; 0: Binary type (XX000,XX001,XX010) 1: Multiple type (60,120,240,480,960, ...) BYTE b_DelayTimeUnitType; 0: Time unit (ns,s,ms,s, ...) 1: Frequency unit (MHz,kHz,Hz,mHz, ...) BYTE b_DelayTimeUnit; For time unit: D0: 0: ns not available 1: ns available D1: 0: s not available 1: s available D2: 0: ms not available 1: ms available D3: 0: s not available 1 : s available For frequency unit: D0: 0: MHz not available 1: MHz available D1: 0: KHz not available 1: KHz available D2: 0: Hz not available 1: Hz available D3: 0: mHz not available 1: mHz available BYTE b_Reserved2 [3]; WORD w_DelayTimeResolution; Delay time resolution 8: 8-bit resolution 16: 16-bit resolution, ... WORD w_MinDelayTime; Minimum delay time. 7000: 7000 (ns) 10000: 10000 (ns), ... WORD w_DelayTimeStep; Conversion delay time steps 20: 20 steps 50: 50 steps, ... WORD w_AcquisitionMode; XX1: The acquisition can work in Single mode X11: The acquisition can work in continuous mode 1XX: The acquisition can work in counting mode 28

BYTE

b_NbrOfGain;

ADDIDRIVER

Analog inputs

DWORD dw_MaxNumberOfAcquisition; Return the max number of acquisition for the counting acquisition SCAN mode BYTE b_Reserved4 [4]; } str_AnalogInputSequenceInformation,*pstr_AnalogInputSequenceInformation

29

Analog inputs

ADDIDRIVER

Task: Returns information about the analog input module for the SCAN acquisition mode (b_ADDIDATA_InitAnalogInputSequenceAcquisition and b_ADDIDATA_StartAnalogInputSequenceAcquisition). The sequence mode use the DMA. This give the possibility to acquire in background. Into the sequence mode the user define a channel sequence to acquire. After each X sequence a interrupt is generated and the user receive the analog input values via a buffer. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; str_AnalogInputSequenceInformation s_ModuleInformation; b_ReturnValue = b_ADDIDATA_GetAnalogInputModuleSequenceInformation (dw_DriverHandle, 0, &s_ModuleInformation, sizeof (s_ModuleInformation)); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

30

ADDIDRIVER

Analog inputs

2.2

Initialisation
1) b_ADDIDATA_InitAnalogInput (..) Syntax: <Return value> = b_ADDIDATA_InitAnalogInput (DWORD dw_DriverHandle, WORD w_Channel, pstr_InitAnalogInput ps_InitParameters, DWORD dw_StructSize) Driver handle Number of the analog input channel to be initialised pstr_InitAnalogInputChannel ps_InitParameters DWORD dw_StructSize Size of the structure entered in the pointer. The structure must contain the following information: typedef struct { DOUBLE d_Gain BYTE b_Polarity Input: DWORD WORD dw_DriverHandle w_Channel

Gain of the channel (Refer to table 2-1) Polarity of the selected channel ADDIDATA_UNIPOLAR for unipolar and ADDIDATA_BIPOLAR for bipolar (see table 2-1) Offset range of the channel. Not used for the moment. Set it to 0. Select the coupling: ADDIDATA_AC_COUPLING : Alternative coupling ADDIDATA_DC_COUPLING : Direct coupling

BYTE WORD BYTE

b_Reserved1 w_OffsetRange b_Coupling

BYTE b_Reserved2 WORD w_Reserved3 }str_InitAnalogInput,*pstr_InitAnalogInput Output: No output signal has occurred. Task: Initialises the selected analog input channel.

31

Analog inputs

ADDIDRIVER

Table 2-1: Gain/Polarity for a max. voltage of 5 V Gain selection Polarity selection Min. voltage Max. voltage 1 ADDIDATA_UNIPOLAR 0V 5V ADDIDATA_BIPOLAR -5V 5V 2 ADDIDATA_UNIPOLAR 0V 2.5V ADDIDATA_BIPOLAR - 2.5V 2.5V 4 ADDIDATA_UNIPOLAR 0V 1.25 V ADDIDATA_BIPOLAR - 1.25 V 1.25 V 5 ADDIDATA_UNIPOLAR 0V 1V ADDIDATA_BIPOLAR -1V 1V 8 ADDIDATA_UNIPOLAR 0V 0.625 V ADDIDATA_BIPOLAR - 0.625 V 0.625 V 10 ADDIDATA_UNIPOLAR 0V 0.5 V ADDIDATA_BIPOLAR - 0.5 V 0.5 V 16 ADDIDATA_UNIPOLAR 0V 0.3125 V ADDIDATA_BIPOLAR - 0.3125 V 0.3125 V 20 ADDIDATA_UNIPOLAR 0V 0.250 V ADDIDATA_BIPOLAR - 0.250 V 0.250 V 32 ADDIDATA_UNIPOLAR 0V 156.25 mV ADDIDATA_BIPOLAR - 156.25 mV 156.25 mV 50 ADDIDATA_UNIPOLAR 0V 100 mV ADDIDATA_BIPOLAR - 100 mV 100 mV 64 ADDIDATA_UNIPOLAR 0V 78.125 mV ADDIDATA_BIPOLAR - 78.125 mV 78.125 mV 100 ADDIDATA_UNIPOLAR 0V 50 mV ADDIDATA_BIPOLAR - 50 mV 50 mV 128 ADDIDATA_UNIPOLAR 0V 39,0625 mV ADDIDATA_BIPOLAR - 39,0625 mV 39,0625 mV ...

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; str_InitAnalogInputChannel s_InitParameters; b_ReturnValue = b_ADDIDATA_ InitAnalogInput (dw_DriverHandle, 0, &s_InitParameters, sizeof (str_InitAnalogInputChannel)); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source. 32

ADDIDRIVER

Analog inputs

2)

b_ADDIDATA_ReleaseAnalogInput (..) Syntax: <Return value> = b_ADDIDATA_ReleaseAnalogInput (DWORD WORD Parameters: - Input: DWORD dw_DriverHandle WORD w_Channel - Output: No output signal has occurred. Task: Releases the analog input logic for the selected channel (w_Channel) to allow a new initialisation. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

dw_DriverHandle, w_Channel)

Driver handle Number of the analog input channel to be released before a new initialisation.

b_ReturnValue = b_ADDIDATA_ReleaseAnalogInput (dw_DriverHandle, 0); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

33

Analog inputs

ADDIDRIVER

2.3

Single acquisition
1) b_ADDIDATA_Read1AnalogInput (..) Syntax: <Return value> = b_ADDIDATA_Read1AnalogInput (DWORD dw_DriverHandle, WORD w_Channel, DWORD dw_ConvertingTime, BYTE b_ConvertingTimeUnit, BYTE b_InterruptFlag, PDWORD pdw_ChannelValue) Input: DWORD DWORD DWORD BYTE BYTE dw_DriverHandle w_Channel dw_ConvertingTime b_ConvertingTimeUnit b_InterruptFlag Driver handle Number of the analog input channel to be read Conversion time. Refer to table 2-2 Determines the conversion time unit. Refer to table 2-2 ADDIDATA_DISABLE: No interrupt is generated after the conversion and the variable pdw_ChannelValue returns the digital value. ADDIDATA_ENABLE: An interrupt is generated after the conversion. The digital value of the selected channel is returned through the interrupt function. Refer to the chapter "Interrupt" Returns the digital value of the selected channel *pdw_ChannelValue[0] = digital value of the channel *pdw_ChannelValue[1] = digital value of the calibration offset (if available) *pdw_ChannelValue[2] = digital value of the calibration gain (if available)

Output: PDWORD pdw_ChannelValue

Task: Returns the digital value (pdw_ChannelValue) of the selected channel (w_Channel). To obtain the real analog input value, you must call up the "b_ADDIDATA_ConvertDigitalToRealAnalogValue (...)" function. dw_ConvertingTime and b_ConvertingTimeUnit determine the conversion time.

IMPORTANT! The interrupt mask for the function is detailed in the "Interrupt" function description. (Tables 2-1).
34

ADDIDRIVER

Analog inputs

Table 2-2: Selection of the conversion time b_ConvertingTimeUnit Unit selection dw_ConvertingTime 10 20 300 1000 22222 10 20 300 1000 22222 10 20 300 1000 22222 10 20 300 1000 22222 Conversion time 10 ns / MHz 20 ns / MHz 300 ns / MHz 1000 ns / MHz 22222 ns / MHz 10 s / KHz 20 s / KHz 300 s / KHz 1000 s / KHz 22222 s / KHz 10 ms / Hz 20 ms / Hz 300 ms / Hz 1000 ms / Hz 22222 ms / Hz 10 s / mHz 20 s / mHz 300 s / mHz 1000 s / mHz 22222 s / mHz

ns / MHz

s / KHz

ms / Hz

s / mHz

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; DWORD dw_ChannelValue[4]; b_ReturnValue = b_ADDIDATA_Read1AnalogInput (dw_DriverHandle, 0, 10, 1, ADDIDATA_DISABLE, dw_ChannelValue); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

35

Analog inputs

ADDIDRIVER

2)

b_ADDIDATA_ReadMoreAnalogInputs (..) Syntax: <Return value> = b_ADDIDATA_ReadMoreAnalogInputs (DWORD dw_DriverHandle, WORD w_FirstChannel, WORD w_LastChannel, DWORD dw_ConvertingTime, BYTE b_ConvertingTimeUnit, BYTE b_InterruptFlag, PDWORD pdw_ChannelArrayValue) Input: DWORD WORD WORD DWORD BYTE BYTE dw_DriverHandle w_FirstChannel w_LastChannel dw_ConvertingTime b_ConvertingTimeUnit b_InterruptFlag Driver handle Selection of the first channel to be read Selection of the last channel to be read Conversion time. Refer to table 2-2 Determines the unit of the conversion time. Refer to table 2-2 ADDIDATA_DISABLE: No interrupt is generated after the last conversion and the variable pdw_ChannelArrayValue returns the digital value. ADDIDATA_ENABLE: An interrupt is generated after the last conversion. The digital value of all selected channels is returned through the interrupt function. Refer to the chapter "Interrupt"

Output: PDWORD pdw_ChannelArrayValue Returns the digital value of all selected channels *pdw_ChannelValue[0] = digital value of the first channel *pdw_ChannelValue[1] = digital value of the calibration offset (if available) *pdw_ChannelValue[2] = digital value of the calibration gain (if available) *pdw_ChannelValue[3] = digital value of the next channel *pdw_ChannelValue[4] = digital value of the calibration offset (if available) *pdw_ChannelValue[5] = digital value of the calibration gain (if available) ... Task: Returns the digital value (pdw_ChannelValue) of all selected channels (w_FirstChannel, w_LastChannel). To obtain the real analog input value, you must call up the "b_ADDIDATA_ConvertDigitalToRealAnalogValue (...)" function. 36

ADDIDRIVER

Analog inputs

dw_ConvertingTime and b_ConvertingTimeUnit determine the conversion time. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; DWORD dw_ChannelArrayValue [48]; b_ReturnValue = b_ADDIDATA_ReadMoreAnalogInputs (dw_DriverHandle, 0, 11, 10, 1, ADDIDATA_DISABLE, dw_ChannelArrayValue); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

37

Analog inputs

ADDIDRIVER

3)

b_ADDIDATA_ConvertDigitalToRealAnalogValue (..) Syntax: <Return value> = b_ADDIDATA_ConvertDigitalToRealAnalogValue (DWORD dw_DriverHandle, WORD w_Channel, PDWORD pdw_DigitalValue, PDOUBLE pd_RealValue) Input: DWORD WORD PDWORD dw_DriverHandle w_Channel pdw_DigitalValue Driver handle Number of the channel to be converted Digital analog input value (composed of the digital value of the channel, the calibration offset and of the calibration gain if available) Returns the real analog input value

Output: PDOUBLE pd_RealValueArray

Task: Converts the digital analog input value (pdw_DigitalValue) into a real analog input value (pd_RealValue) for the selected channel (w_Channel). Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; DWORD dw_DigitalValue[4]; DOUBLE d_RealValue;

b_ReturnValue = b_ADDIDATA_ConvertDigitalToRealAnalogValue (dw_DriverHandle, 0, dw_DigitalValue, &d_RealValue); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

38

ADDIDRIVER

Analog inputs

4)

b_ADDIDATA_ConvertMoreDigitalToRealAnalogValues (..) Syntax: <Return value> = b_ADDIDATA_ConvertMoreDigitalToRealAnalogValues (DWORD dw_DriverHandle, WORD w_FirstChannel, WORD w_LastChannel, PDWORD pdw_DigitalValue, PDOUBLE pd_RealValue) Input: DWORD dw_DriverHandle WORD w_FirstChannel WORD w_LastChannel PDWORD pdw_DigitalValue Driver handle Selection of the first channel Selection of the last channel Digital value of the analog input (composed of the digital value of the channel, of the calibration offset and of the calibration gain if

available) Output: PDOUBLE pd_RealValueArray Returns the real analog value of the input channel

Task: Converts the digital value (pdw_DigitalValue) into a real analog value (pd_RealValue) for the selected channels. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; DWORD dw_DigitalValue[4]; DOUBLE d_RealValue;

b_ReturnValue = b_ADDIDATA_ConvertMoreDigitalToRealAnalogValues (dw_DriverHandle, 0, 3, dw_DigitalValue, &d_RealValue); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

39

Analog inputs

ADDIDRIVER

2.4

Autorefresh acquisition
1) b_ADDIDATA_GetAnalogInputAutoRefreshChannelPointer (..) Syntax: <Return value> = b_ADDIDATA_GetAnalogInputAutoRefreshChannelPointer (DWORD dw_DriverHandle, DWORD dw_Channel, VOID **ppv_ChannelValueApplicationLevelPointer, VOID **ppv_ChannelValueKernelLevelPointer) Input: DWORD DWORD dw_DriverHandle dw_Channel Driver handle Channel Index

Output: VOID **ppv_ChannelValueApplicationLevelPointer Return the pointer of the value from the selected channel in the application level. VOID **ppv_ChannelValueKernelLevelPointer Return the pointer of the value from the selected channel in the kernel level. Task: Return the pointer of the value from the selected channel. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; PDWORD pdw_ChannelValueRing0; PDWORD pdw_ChannelValueRing3; b_ReturnValue = b_ADDIDATA_GetAnalogInputAutoRefreshChannelPointer(dw_DriverHandle,0, (VOID **)&pdw_ChannelValueRing3, (VOID **)&pdw_ChannelValueRing0); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

40

ADDIDRIVER

Analog inputs

2)

b_ADDIDATA_GetAnalogInputAutoRefreshModulePointer (..) Syntax: <Return value> = b_ADDIDATA_GetAnalogInputAutoRefreshModulePointer (DWORD dw_DriverHandle, WORD w_Module, VOID **ppv_ModuleValueApplicationLevelPointer, VOID **ppv_ModuleValueKernelLevelPointer) Input: DWORD WORD dw_DriverHandle w_Module Driver handle Module index

Output: VOID **ppv_ModuleValueApplicationLevelPointer Returns the pointer of the values from the selected module in the application level. VOID **ppv_ModuleValueKernelLevelPointer Returns the pointer of the values from the selected module in the kernel level. Task: Return the pointer of the value from the selected module. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; PDWORD pdw_ModuleValueRing0; PDWORD pdw_ModuleValueRing3; b_ReturnValue = b_ADDIDATA_GetAnalogInputAutoRefreshModulePointer(dw_DriverHandle,0, (VOID **)&pdw_ChannelValueRing3, (VOID **)&pdw_ChannelValueRing0); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

41

Analog inputs

ADDIDRIVER

3)

b_ADDIDATA_GetAnalogInputAutoRefreshModuleCounterPointer (..) Syntax: <Return value> = b_ADDIDATA_GetAnalogInputAutoRefreshModuleCounterPointer (DWORD dw_DriverHandle, DWORD dw_Channel, VOID **ppv_ApplicationLevelPointer, VOID **ppv_KernelLevelPointer) Input: DWORD DWORD Output: VOID dw_DriverHandle dw_Channel Driver handle Channel Index

VOID

**ppv_ApplicationLevelPointer Return the pointer of the counter from the selected module in the application level. **ppv_KernelLevelPointer Return the pointer of the counter from the selected module in the kernel level.

Task: Return the pointer of the auto refresh counter from the selected module. After each auto refresh cycle, the counter is incremented from 1. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; PDWORD pdw_CounterValueRing0; PDWORD pdw_CounterValueRing3; b_ReturnValue = b_ADDIDATA_GetAnalogInputAutoRefreshModuleCounterPointer (dw_DriverHandle,0, (VOID **)&pdw_CounterValueRing3, (VOID **)&pdw_CounterValueRing0); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

42

ADDIDRIVER

Analog inputs

4)

b_ADDIDATA_StartAnalogInputAutoRefresh (..) Syntax: <Return value> = b_ADDIDATA_StartAnalogInputAutoRefresh (DWORD dw_DriverHandle, WORD w_Module, DWORD dw_ConvertingTime, BYTE b_ConvertingTimeUnit) Parameters: - Input: DWORD dw_DriverHandle WORD w_Module

Driver handle Index of the module for which the auto refresh acquisition must be started DWORD dw_ConvertingTime Conversion time. See table 2-2 BYTE b_ConvertingTimeUnit Determines the conversion time unit. See table 2-2 - Output: No output signal has occurred.

Task: Starts the auto refresh acquisition on the selected module. dw_ConvertingTime and b_ConvertingTimeUnit determines the conversion time.

IMPORTANT! Do initialise all analog input channels of the module to run an acquisition in the auto refresh mode.

Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_StartAnalogInputAutoRefresh (dw_DriverHandle, 0, 10, 1); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

43

Analog inputs

ADDIDRIVER

5)

b_ADDIDATA_StopAnalogInputAutoRefresh(..) Syntax: <Return value> = b_ADDIDATA_StopAnalogInputAutoRefresh (DWORD dw_DriverHandle, WORD w_Module) Parameters: - Input: DWORD dw_DriverHandle WORD w_Module - Output: No output signal has occurred. Task: Stops an auto refresh acquisition on the selected module. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

Driver handle Index of the module for which the auto refresh acquisition must be stopped

b_ReturnValue = b_ADDIDATA_StopAnalogInputAutoRefresh(dw_DriverHandle,0); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

44

ADDIDRIVER

Analog inputs

2.5

SCAN acquisition

IMPORTANT! The SCAN acquisition functions can only be operated on one module (group of channels). Please check that all selected channels are on the same module.

1)

b_ADDIDATA_InitAnalogInputSCAN (...)

IMPORTANT! This function is only available for old user applications (up to version 2132-0304 of ADDIPACK).
If you develop new applications with ADDIDRIVER, please use the following functions: b_ADDIDATA_InitAnalogInputSCANAcquisition Syntax: <Return value> = b_ADDIDATA_InitAnalogInputSCAN (DWORD dw_DriverHandle, pstr_InitAnalogInputSCAN ps_InitParameters, DWORD dw_StructSize, PDWORD pdw_SCANHandle) Parameters: - Input: DWORD dw_DriverHandle Driver handle pstr_InitAnalogInput s_InitParameters pointer on a structure which contains the initialisation parameters DWORD dw_StructSize Size of the structure The structure must contain the following information: WORD w_FirstChannel First channel to be converted. WORD w_LastChannel Last channel to be converted DWORD dw_ConvertingTime Conversion time. Refer to Table 2-2 BYTE b_ConvertingTimeUnit Conversion time unit. Refer to Table 2-2 BYTE b_SCANTimeMode Determines the mode of the delay. Refer to Table 2-4 DWORD dw_SCANTime Total time of the SCAN. Refer to Table 2-3 and Table 2-4 BYTE b_SCANTimeUnit Unit used for the total time. Refer to Table 2-3 and Table 2-4 BYTE b_SCANMode SCAN mode. Refer to Table 2-5 BYTE b_ExternTriggerMode External trigger action. Refer to Table 2-6

45

Analog inputs

ADDIDRIVER

BYTE

b_ExternGateMode

DWORD dw_SCANCounter - Output: PDWORD pdw_SCANHandle

External gate action. ADDIDATA_DISABLE: External gate not used ADDIDATA_LOW_LEVEL: The SCAN is activated when the external gate is low ADDIDATA_HIGH_LEVEL: The SCAN is activated when the external gate is high Number of SCAN. Refer to Table 2-5 Handle of the initialised SCAN. This handle is used for all SCAN functions.

Task: Initialises the SCAN function for the acquisition of analog inputs. Table 2-3: Time selection of a SCAN b_SCANTimeUnit Unit selection dw_SCANTime 10 20 300 1000 22222 10 20 300 1000 22222 10 20 300 1000 22222 10 20 300 1000 22222 Total time of the SCAN 10 ns / MHz 20 ns / MHz 300 ns / MHz 1000 ns / MHz 22222 ns / MHz 10 s / KHz 20 s / KHz 300 s / KHz 1000 s / KHz 22222 s / KHz 10 ms / Hz 20 ms / Hz 300 ms / Hz 1000 ms / Hz 22222 ms / Hz 10 s / mHz 20 s / mHz 300 s / mHz 1000 s / mHz 22222 s / mHz

ns or MHz

s or KHz

ms or Hz

s or mHz

Table 2-4: SCAN time mode b_SequenceTimeMode Mode description ADDIDATA_DELAY_NOT_USED The delay between two SCAN is not used ADDIDATA_DELAY_MODE1_USED The delay between two SCAN is used. The conversion is started at once, and the delay is used after the first SCAN. ADDIDATA_DELAY_MODE2_USED The delay between two SCANs is used. The conversion is started after a delay.

46

ADDIDRIVER

Analog inputs

Table 2-5: SCAN mode dw_SCANCounter SCAN description Not used Only one SCAN is started after calling up the function "b_ADDIDATA_StartAnalogInputSCAN" ADDIDATA_DEFINED_SCAN_NUMBER Determines the A predefined number of SCANs is started number of SCAN after calling up the function "b_ADDIDATA_StartAnalogInputSCAN" ADDIDATA_CONTINUOUS_SCAN Not used An undefined number of SCANs is started after calling up the function "b_ADDIDATA_StartAnalogInputSCAN"
ADDIDATA_SINGLE_SCAN

b_SCANMode

Table 2-6: Trigger mode


ADDIDATA_DISABLE ADDIDATA_FIRST_LOW_EDGE_START_ALL_SCAN ADDIDATA_FIRST_HIGH_EDGE_START_ALL_SCAN ADDIDATA_FIRST_EDGE_START_ALL_SCAN ADDIDATA_EACH_LOW_EDGE_START_A_SCAN ADDIDATA_EACH_HIGH_EDGE_START_A_SCAN ADDIDATA_EACH_EDGE_START_A_SCAN ADDIDATA_EACH_LOW_EDGE_START_A_SINGLE_ACQUISITION ADDIDATA_EACH_HIGH_EDGE_START_A_SINGLE_ACQUISITION ADDIDATA_EACH_EDGE_START_A_SINGLE_ACQUISITION

External trigger not used The first low edge starts all SCANs The first high edge starts all SCANs The first low/high edge starts all SCANs The first low edge starts a single SCAN The first high edge starts a single SCAN Each edge starts a single SCAN Each low edge starts a single acquisition of the SCAN Each high edge starts a single acquisition of the SCAN Each edge starts a single acquisition of the SCAN

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; DWORD dw_SCANHandle; str_InitAnalogInputSCAN s_InitParameters; . . . b_ReturnValue = b_ADDIDATA_ InitAnalogInputSCAN (dw_DriverHandle, &s_InitParameters, sizeof (str_InitAnalogInputSCAN), &dw_SCANHandle); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

47

Analog inputs

ADDIDRIVER

2)

b_ADDIDATA_InitAnalogInputSCANAcquisition (..) Syntax: <Return value> = b_ADDIDATA_InitAnalogInputSCANAcquisition (DWORD dw_DriverHandle, pstr_InitAnalogInputSCANAcquisition ps_InitParameters, DWORD dw_StructSize, PDWORD pdw_SCANHandle) Input: DWORD dw_DriverHandle pstr_InitAnalogInputSCANAcquisition DWORD dw_StructSize Driver handle ps_InitParameters Size of the structure

The structure must contain the following information: typedef struct { WORD w_FirstChannel; First SCAN channel selection WORD w_LastChannel; Last SCAN channel selection DWORD dw_ConversionTime; Selected conversion time BYTE b_ConversionTimeUnit; Selected conversion time unit For time unit: 0: ns selected 1: s selected 2: ms selected 3: s selected For frequency unit: 0: MHz selected 1: KHz selected 2: Hz selected 3: mHz selected BYTE b_DelayTimeMode; Delay mode selection Refer to table 2-1 and sample1 and sample 2 BYTE b_DelayTimeUnit; Delay time unit selection Refer to sample 1 and sample 2 For time unit: 0: ns selected 1: s selected 2: ms selected 3: s selected For frequency unit: 0: MHz selected 1: KHz selected 2: Hz selected 3: mHz selected BYTE b_Reserved1[5]; DWORD dw_DelayTime; Delay time DWORD dw_SCANCounter; Define the number of SCAN cycles if the SCAN mode (b_SCANMode) is setting to 48

ADDIDRIVER

Analog inputs

ADDIDATA_DEFINED_SCAN_NUMBER

BYTE

b_SCANMode;

Refer to table 2-2 , sample1 and sample2

BYTE b_Reserved2[7]; } str_InitAnalogInputSCANAcquisition,*pstr_InitAnalogInputSCANAcquisition Output: PDWORD pdw_SCANHandle Handle of the initialised SCAN. This handle is used for all SCAN functions.

Task: Initialises the analog input acquisition SCAN. This can by combined with the hardware or software trigger. See the functions b_ADDIDATA_EnableDisableAnalogInputHardwareTrigger and b_ADDIDATA_EnableDisableAnalogInputSoftwareTrigger Table 2-1: SCAN delay time mode b_DelayTimeMode
ADDIDATA_DELAY_NOT_USED ADDIDATA_DELAY_MODE1_USED

Mode description

The delay between two SCANs is not used The delay between two SCAN cycles is used. The delay is started after the first acquisition. After this delay a new SCAN cycle is started ADDIDATA_DELAY_MODE2_USED The delay between two SCAN cycles is used. The delay is started after the last SCAN channel acquisition. After this delay a new SCAN cycle is started

Table 2-2: SCAN mode b_SCANMode


ADDIDATA_SINGLE_SCAN ADDIDATA_DEFINED_SCAN_NUMBER

dw_SCANCounter
Not used Determines the number of SCAN Not used

SCAN description
Only one SCAN is started after calling up the function "b_ADDIDATA_StartAnalogInputSCAN" A predefined number of SCANs is started after calling up the function "b_ADDIDATA_StartAnalogInputSCAN" An undefined number of SCANs is started after calling up the function "b_ADDIDATA_StartAnalogInputSCAN"

ADDIDATA_CONTINUOUS_SCAN

49

Analog inputs

ADDIDRIVER

Samples Sample 1 : w_FirstChannel w_LastChannel b_ConvertingTimeUnit dw_ConvertingTime b_DelayTimeMode b_SCANMode dw_SCANCounter =0 =5 = 1 (s) = 10 = ADDIDATA_DELAY_NOT_USED = ADDIDATA_DEFINED_SCAN_NUMBER =3

An interrupt occur after each end of SCAN (5 acquisitions) and the acquisition is stopped after 3 SCAN cycles Sample 2 : w_FirstChannel w_LastChannel b_ConvertingTimeUnit dw_ConvertingTime b_DelayTimeMode b_SCANMode =0 =4 = 1 (s) = 10 = ADDIDATA_DELAY_NOT_USED = ADDIDATA_CONTINUOUS_SCAN

An interrupt occurs after each SCAN (5 acquisitions) and the acquisition is stopped via the function b_ADDIDATA_StopAnalogInputSCAN 50

ADDIDRIVER

Analog inputs

Sample 3 : w_FirstChannel w_LastChannel b_ConvertingTimeUnit dw_ConvertingTime b_DelayTimeUnit; dw_DelayTime b_DelayTimeMode b_SCANMode dw_SCANCounter =0 =4 = 1 (s) = 10 = 1 (s) = 20 = ADDIDATA_DELAY_MODE2_USED = ADDIDATA_DEFINED_SCAN_NUMBER =2

An interrupt occurs after each SCAN (5 acquisitions) and the acquisition is stopped after 2 SCAN cycles. A Delay from 20 s is respected between 2 SCAN cycles. The SCAN total time is 70 s. Sample 4 : w_FirstChannel w_LastChannel b_ConvertingTimeUnit dw_ConvertingTime b_DelayTimeUnit; dw_DelayTime b_DelayTimeMode b_SCANMode dw_SCANCounter =0 =4 = 1 (s) = 10 = 1 (s) = 20 = ADDIDATA_DELAY_MODE1_USED = ADDIDATA_DEFINED_SCAN_NUMBER =2

51

Analog inputs

ADDIDRIVER

An interrupt occurs after each SCAN (5 acquisitions) and the acquisition is stopped after 2 SCAN cycles. The SCAN total time is 100s. Calling convention: ANSI C : BYTE DWORD DWORD str_InitAnalogInputChannelSCANAcquisition b_ReturnValue; dw_DriverHandle; dw_SCANHandle; s_InitParameters;

b_ReturnValue = b_ADDIDATA_InitAnalogInputSCANAcquisition (dw_DriverHandle, &s_InitParameters, sizeof (str_InitAnalogInputChannelSCANAcquisition), &dw_SCANHandle); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

52

ADDIDRIVER

Analog inputs

3)

b_ADDIDATA_StartAnalogInputSCAN (..) Syntax: <Return value> = b_ADDIDATA_StartAnalogInputSCAN (DWORD dw_DriverHandle, DWORD dw_SCANHandle) Parameters: - Input: DWORD dw_DriverHandle DWORD dw_SCANHandle - Output: No output signal has occurred. Task: Starts the selected SCAN (dw_SCANHandle). Calling convention: ANSI C : BYTE DWORD DWORD b_ReturnValue; dw_DriverHandle; dw_SCANHandle;

Driver handle SCAN handle. This handle is returned by function "b_ADDIDATA_InitAnalogInputSCAN"

b_ReturnValue = b_ADDIDATA_StartAnalogInputSCAN (dw_DriverHandle, dw_SCANHandle); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

53

Analog inputs

ADDIDRIVER

4)

b_ADDIDATA_GetAnalogInputSCANStatus (..) Syntax: <Return value> = b_ADDDATA_GetAnalogInputSCANStatus (DWORD dw_DriverHandle, DWORD dw_SCANHandle, PBYTE pb_SCANStatus) Parameters: - Input: DWORD dw_DriverHandle DWORD dw_SCANHandle

Driver handle SCAN handle. This handle is returned by the "b_ADDIDATA_InitAnalogInputSCAN" function Status of the SCAN. 0: SCAN not started 1: SCAN started 2: SCAN completed 3: SCAN completed and new SCAN started

- Output: PBYTE

pb_SCANStatus

Task: Returns the status (pb_SCANStatus) of the selected SCAN (dw_SCANHandle). Calling convention: ANSI C : BYTE DWORD DWORD BYTE b_ReturnValue; dw_DriverHandle; dw_SCANHandle; b_SCANStatus;

b_ReturnValue = b_ADDDATA_GetAnalogInputSCANStatus (dw_DriverHandle, dw_SCANHandle, &b_SCANStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

54

ADDIDRIVER

Analog inputs

5)

b_ADDIDATA_ConvertDigitalToRealAnalogValueSCAN (..) Syntax: <Return value> = b_ADDIDATA_ConvertDigitalToRealAnalogValueSCAN (DWORD dw_DriverHandle, DWORD dw_SCANHandle, PDWORD pdw_DigitalValueArray, PDOUBLE pd_RealValueArray) Parameters: - Input: DWORD dw_DriverHandle DWORD dw_SCANHandle

Driver handle SCAN handle. This handle is returned by the "b_ADDIDATA_InitAnalogInputSCAN" function PDWORD pdw_DigitalValueArray Digital value array of the analog input - Output: PDOUBLE pd_RealValueArray Real analog value array Task: Converts the digital value array of the analog input into a real analog value array. Calling convention: ANSI C : BYTE DWORD DWORD DWORD DOUBLE b_ReturnValue; dw_DriverHandle; dw_SCANHandle; dw_DigitalValueArray [600]; d_RealValueArray [600];

b_ReturnValue = b_ADDIDATA_ConvertDigitalToRealAnalogValueSCAN (dw_DriverHandle, dw_SCANHandle, dw_DigitalValueArray, d_RealValueArray); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

55

Analog inputs

ADDIDRIVER

6)

b_ADDIDATA_StopAnalogInputSCAN (..) Syntax: <Return value> = b_ADDIDATA_StopAnalogInputSCAN (DWORD dw_DriverHandle, DWORD dw_SCANHandle) Parameters: - Input: DWORD dw_DriverHandle DWORD dw_SCANHandle - Output: No output signal has occurred. Task: Stops the selected SCAN (dw_SCANHandle). Calling convention: ANSI C : BYTE DWORD DWORD b_ReturnValue; dw_DriverHandle; dw_SCANHandle;

Driver handle SCAN handle. This handle is returned by the "b_ADDIDATA_InitAnalogInputSCAN" function

b_ReturnValue = b_ADDIDATA_StopAnalogInputSCAN (dw_DriverHandle, dw_SCANHandle); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

56

ADDIDRIVER

Analog inputs

7)

b_ADDIDATA_CloseAnalogInputSCAN (..) Syntax: <Return value> = b_ADDIDATA_CloseAnalogInputSCAN (DWORD dw_DriverHandle, DWORD dw_SCANHandle) Parameters - Input: DWORD dw_DriverHandle DWORD dw_SCANHandle

Driver handle SCAN handle. This handle is returned by the "b_ADDIDATA_InitAnalogInputSCAN" function

- Output: No output signal has occurred. Task: Closes the selected SCAN (dw_SCANHandle) and releases the SCAN handle. Calling convention: ANSI C : BYTE DWORD DWORD b_ReturnValue; dw_DriverHandle; dw_SCANHandle;

b_ReturnValue = b_ADDIDATA_CloseAnalogInputSCAN (dw_DriverHandle, dw_SCANHandle); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

57

Analog inputs

ADDIDRIVER

2.6

Sequence acquisition

i
1)

IMPORTANT! This functionality can only be operated on one module.


b_ADDIDATA_InitAnalogInputSequenceAcquisition (..) Syntax: <Return value> = b_ADDIDATA_InitAnalogInputSequenceAcquisition (DWORD dw_DriverHandle, DWORD dw_NbrOfChannel, PWORD pw_SequenceChannelArray, str_InitAnalogMeasureSequenceAcquisition ps_InitParam, DWORD dw_StructSize, PDWORD pd_SEQHandle) Input: DWORD DWORD PDWORD dw_DriverHandle dw_NbrOfChannel pdw_SequenceChannelArray Driver handle Number of channel in the sequence. Array of index of the channel to be converted.

str_InitAnalogMeasureSequenceAcquisition ps_InitParam Typedef struct { BYTE

b_ConvertingTimeUnit;

BYTE

b_DelayTimeMode;

BYTE

b_DelayTimeUnit;

Selected conversion time unit For time unit: 0: ns selected 1: s selected 2: ms selected 3: s selected For frequency unit: 0: MHz selected 1: KHz selected 2: Hz selected 3: mHz selected Delay mode selection Refer to table 2-3, sample 7 and sample 8 Delay time unit selection Refer to sample 7 and sample 8 For time unit: 0: ns selected 1: s selected 2: ms selected 3: s selected

58

ADDIDRIVER

Analog inputs

For frequency unit: 0: MHz selected 1: KHz selected 2: Hz selected 3: mHz selected

BYTE DWORD DWORD DWORD DWORD

b_Reserved [5]; dw_DelayTime; dw_ConvertingTime; dw_SequenceCounter; dw_InterruptSequenceCounter;

Delay time Selected conversion time Number of sequences. Refer to table 2-4 Number of sequences before an interrupt is generated.

}str_InitAnalogMeasureSequenceAcquisition, *pstr_InitAnalogMeasureSequenceAcquisition DWORD dw_StructSize Size of the structure.

Output: PDWORD pdw_SEQHandle Task:

Return the Sequence Handle.

Initialises the analog input acquisition sequence. dw_SequenceCounter defines the number of sequences. A sequence is composed of the channels that are defined in the pdw_SequenceChannelArray. dw_InterruptSequenceCounter defines the number of sequences before an interrupt is generated.

IMPORTANT! In the sequence mode only an even number of acquisitions can be initialised and executed (see examples below).
Examples for acquisitions that are not possible in the sequence mode (odd numbers) Dw_NbrOfChannel = 3, dw_InterruptSequenceCounter = 11 => Number of acquisitions = 3 * 11 = 33 dw_NbrOfChannel = 1, dw_InterruptSequenceCounter = 7 => Number of acquisitions = 1 * 7 = 7

Examples for possible acquisitions in the sequence mode (even numbers) dw_NbrOfChannel = 3, dw_InterruptSequenceCounter = 10 => Number of acquisitions = 3 * 10 = 30 dw_NbrOfChannel = 1, dw_InterruptSequenceCounter = 8 => Number of acquisitions = 1 * 8 = 8 dw_NbrOfChannel = 2, dw_InterruptSequenceCounter = 5 => Number of acquisitions = 2 * 5 = 10

59

Analog inputs Table 2-3: Delay time mode b_DelayTimeMode


ADDIDATA_DELAY_NOT_USED ADDIDATA_DELAY_MODE1_USED

ADDIDRIVER

Mode description

The delay between two SCAN is not used The delay between two SCAN cycles is used. The delay is started after the first acquisition. After this delay a new SCAN cycle is started ADDIDATA_DELAY_MODE2_USED The delay between two SCAN cycles is used. The delay is started after the last SCAN channel acquisition. After this delay a new SCAN cycle is started

Table 2-4: Sequence mode dw_SequenceCou nter


>0

Sequence description
A predefined number of sequences is started after calling up the function "b_ADDIDATA_StartAnalogInputSequenceAcquisition" An undefined number of sequences is started after calling up the function "b_ADDIDATA_StartAnalogInputSequenceAcquisition"

Samples Sample 1 : dw_NbrOfChannel =5 dw_SequenceChannelArray = 0,1,2,3,4 b_ConvertingTimeUnit = 1 (s) b_DelayTimeMode = ADDIDATA_DELAY_NOT_USED dw_ConvertingTime = 10 dw_SequenceCounter =3 dw_InterruptSequenceCounter =1

Sequence 0 0 1 2 3 4 0

Sequence 1 1 2 3 4 0

Sequence 2 1 2 3 4 t

10s Interrupt Interrupt Interrupt End acquisition

An interrupt occurs after each end of sequence (5 acquisitions) and the acquisition is stopped after 3 sequences. Sample 2 : dw_NbrOfChannel dw_SequenceChannelArray b_ConvertingTimeUnit b_DelayTimeMode dw_ConvertingTime 60 =5 = 0,1,2,3,4 = 1 (s) = ADDIDATA_DELAY_NOT_USED = 10

ADDIDRIVER

Analog inputs

dw_SequenceCounter =0 dw_InterruptSequenceCounter

=2

Sequence 0 0 1 2 3 4 0

Sequence 1 1 2 3 4 0

Sequence 2 1 2 3 4 t

10s Interrupt

An interrupt occurs after 2 end of sequence (10 acquisitions) and the acquisition is stopped via the function b_ADDIDATA_StopAnalogInputSequenceAcquisition Sample 3 : dw_NbrOfChannel =5 dw_SequenceChannelArray = 0,1,2,3,4 b_ConvertingTimeUnit = 1 (s) b_DelayTimeMode = ADDIDATA_DELAY_MODE2_USED b_DelayTimeUnit; = 1 (s) dw_DelayTime = 20 dw_ConvertingTime = 10 dw_SequenceCounter =2 dw_InterruptSequenceCounter =2

Sequence 0 0 1 2 3 4 0

Sequence 1 1 2 3 4 t

10s

20s delay

Interrupt

End acquisition

An interrupt occurs after 2 end of sequence (10 acquisitions) and the acquisition is stopped after 2 sequences. A delay from 20 s is respected between 2 sequences.

61

Analog inputs

ADDIDRIVER

Sample 4 : dw_NbrOfChannel =5 dw_SequenceChannelArray = 0,1,2,3,4 b_ConvertingTimeUnit = 1 (s) b_DelayTimeMode = ADDIDATA_DELAY_MODE1_USED b_DelayTimeUnit; = 1 (s) dw_DelayTime = 100 dw_ConvertingTime = 10 dw_SequenceCounter =2 dw_InterruptSequenceCounter =2

Sequence 0 0 1 2 3 4 0

Sequence 1 1 2 3 4 t

10s 100s delay Interrupt End acquisition

An interrupt occurs after 2 end of sequence (10 acquisitions) and the acquisition is stopped after 2 sequences. The sequence total time is 100 s. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; DWORD dw_Channel[10]; DWORD dw_SEQHandle; str_InitAnalogMeasureSequenceAcquisition s_InitParameters; b_ReturnValue = b_ADDIDATA_ InitAnalogInputSequenceAcquisition (dw_DriverHandle, 5, dw_Channel, s_InitParameters, sizeof (str_InitAnalogMeasureSequenceAcquisition), & dw_SEQHandle); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

62

ADDIDRIVER

Analog inputs

2)

b_ADDIDATA_StartAnalogInputSequenceAcquisition (..) Syntax: <Return value> = b_ADDIDATA_StartAnalogInputSequenceAcquisition (DWORD dw_DriverHandle, DWORD dw_SEQHandle) Parameters: - Input: DWORD dw_DriverHandle DWORD dw_SEQHandle

Driver handle Sequence handle. This handle is returned by the "b_ADDIDATA_InitAnalogInputSequenceAcquisition" function

- Output: No output signal has occurred. Task: Starts the selected sequence (dw_SEQHandle). Calling convention: ANSI C : BYTE DWORD DWORD b_ReturnValue; dw_DriverHandle; dw_SEQHandle;

b_ReturnValue = b_ADDIDATA_StartAnalogInputSequenceAcquisition (dw_DriverHandle, dw_SEQHandle); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

63

Analog inputs

ADDIDRIVER

3)

b_ADDIDATA_ConvertDigitalToRealAnalogValueSequence(..) Syntax: <Return value> = b_ADDIDATA_ConvertDigitalToRealAnalogValueSequence (DWORD dw_DriverHandle, DWORD dw_SEQHandle, PDWORD pdw_DigitalValueArray, PDOUBLE pd_RealValueArray) Parameters: - Input: DWORD dw_DriverHandle DWORD dw_SEQHandle

Driver handle Sequence handle. This handle is returned by the "b_ADDIDATA_InitAnalogInputSequenceAcquisition" function PDWORD pdw_DigitalValueArray Digital value array for the analog input - Output: PDOUBLE pd_RealValueArray Real analog input value array Task: Converts the digital analog input value array into a real analog input value array. Calling convention: ANSI C : BYTE DWORD DWORD DWORD DOUBLE b_ReturnValue; dw_DriverHandle; dw_SEQHandle; dw_DigitalValueArray [600]; d_RealValueArray [600];

b_ReturnValue = b_ADDIDATA_ConvertDigitalToRealAnalogValueSequenceAcquisition (dw_DriverHandle, dw_SEQHandle, dw_DigitalValueArray, d_RealValueArray); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

64

ADDIDRIVER

Analog inputs

4)

b_ADDIDATA_GetAnalogInputSequenceAcquisitionHandleStatus (..) Syntax: <Return value> = b_ADDIDATA_GetAnalogInputSequenceAcquisitionHandleStatus (DWORD dw_DriverHandle, WORD w_Module, PBYTE pb_InitialisationStatus, PDWORD pdw_LastInitialisedSEQHandle, PBYTE pb_CurrentSEQStatus PDWORD pdw_CurrentSEQHandle) Parameters: - Input: DWORD dw_DriverHandle WORD w_Module DWORD dw_SEQHandle

Driver handle AnalogInput module index Sequence handle. This handle is returned by the "b_ADDIDATA_InitAnalogInputSequenceAcquisition" function

-Output: PBYTE

: 0: No sequence initialised >0: Number of initialised sequence PDWORD pdw_LastInitialisedSEQ Handle: Last initialised sequence handle PBYTE pb_CurrentSEQStatus : Current sequence status 0: No sequence started 1: Sequence started 2: Sequence pause 3: Sequence ended PDWORD pdw_CurrentSEQHandle: Current sequence handle PDWORD pdw_SequenceCounter Returns the number of acquired sequences Task: Gets the sequence handle status. Returns the last initialised sequence status, the selected acquisition sequence handle and the status. Returns the current number of acquired sequences. Calling convention: ANSI C : BYTE WORD BYTE DWORD BYTE DWORD b_ReturnValue; w_Module; b_InitialisationStatus; dw_LastInitialisedSEQHandle; b_CurrentSEQStatus; dw_CurrentSEQHandle;

pb_InitialisationStatus

b_ReturnValue = b_ADDIDATA_GetAnalogInputSequenceAcquisitionHandleStatus (dw_DriverHandle, w_Module, 65

Analog inputs

ADDIDRIVER

&b_InitialisationStatus, &dw_LastInitialisedSEQHandle, &b_CurrentSEQStatus &dw_CurrentSEQHandle); Return Value: 1: No error 0: Error by calling up the function. Call the function "i_ADDIDATA_GetLastError", to find the error number.

66

ADDIDRIVER

Analog inputs

5)

b_ADDIDATA_StopAnalogInputSequenceAcquisition (..) Syntax: <Return value> = b_ADDIDATA_StopAnalogInputSequenceAcquisition (DWORD dw_DriverHandle, DWORD dw_SEQHandle) Parameters: - Input: DWORD dw_DriverHandle DWORD dw_SEQHandle

Driver handle Sequence handle. This handle is returned by the "b_ADDIDATA_InitAnalogInputSequenceAcquisition" function

- Output: No output signal has occurred. Task: Stops the selected sequence (dw_SEQHandle). Calling convention: ANSI C : BYTE DWORD DWORD b_ReturnValue; dw_DriverHandle; dw_SEQHandle;

b_ReturnValue = b_ADDIDATA_StopAnalogInputSequenceAcquisition (dw_DriverHandle, dw_SEQHandle); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

67

Analog inputs

ADDIDRIVER

6)

b_ADDIDATA_ReleaseAnalogInputSequenceAcquisition (..) Syntax: <Return value> = b_ADDIDATA_ReleaseAnalogInputSequenceAcquisition (DWORD dw_DriverHandle, DWORD dw_SEQHandle) Parameters: - Input: DWORD dw_DriverHandle DWORD dw_SEQHandle

Driver handle Sequence handle. This handle is returned by the "b_ADDIDATA_InitAnalogInputSequenceAcquisition" function

- Output: No output signal has occurred. Task: Releases the selected sequence (dw_SEQHandle) and lets the resources free for another process. Calling convention: ANSI C: BYTE DWORD DWORD b_ReturnValue; dw_DriverHandle; dw_SEQHandle;

b_ReturnValue = b_ADDIDATA_ReleaseAnalogInputSequenceAcquisition (dw_DriverHandle, dw_SEQHandle); Return Value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

68

ADDIDRIVER

Analog inputs

2.7

Hardware trigger
1) b_ADDIDATA_GetAnalogInputHardwareTriggerInformation (...) Syntax: <Return Value> = b_ADDIDATA_GetAnalogInputHardwareTriggerInformation (DWORD dw_DriverHandle, WORD w_Module, pstr_AnalogInputHardwareTriggerInformation ps_TriggerInformation, DWORD dw_StructSize) Parameters: - Input: DWORD dw_DriverHandle WORD w_Module DWORD dw_StructSize Handle of the ADDI-DATA driver Index of the analog input module Size of the structure.

- Output: pstr_AnalogInputHardwareTriggerInformation ps_TriggerInformation Returned structure: typedef struct { BYTE b_LowLevelTrigger; Hardware trigger information.

BYTE

BYTE

BYTE

BYTE

0: Hardware low trigger level not available 1: Hardware low trigger level available b_HighLevelTrigger; 0: Hardware high trigger level not available 1: Hardware high trigger level available b_HardwareTriggerCount; 0: Hardware trigger counter not available 1: Hardware trigger counter available b_HardwareTriggerAutoRefreshAvailableMode; D3 to D0 XXX1 : One shot trigger available XX1X : Single auto refresh trigger available X1XX : X auto refresh trigger available b_HardwareTriggerSCANAvailableMode; XXX1 : One shot trigger available 69

Analog inputs

ADDIDRIVER

XX1X : Single scan trigger available X1XX : X scan trigger available XXX1 : One shot trigger available XX1X : Single sequence trigger available X1XX : X sequence trigger available

BYTE b_HardwareTriggerSequenceAvailableMode;

BYTE b_Reserverd1 [2]; DWORD dw_MaxTriggerCountValue; Max number of trigger pulses before the hardware trigger action occurs BYTE b_Reserverd2 [4]; } str_AnalogInputHardwareTriggerInformation, *pstr_AnalogInputHardwareTriggerInformation; Task: Return the hardware trigger available trigger actions and the available configuration mode Calling convention: ANSI C : BYTE DWORD str_AnalogInputHardwareTriggerInformation

b_ReturnValue; dw_DriverHandle; s_TriggerInformation;

b_ReturnValue = b_ADDIDATA_GetAnalogInputHardwareTriggerInformation (dw_DriverHandle, 0, & s_TriggerInformation, sizeof(s_TriggerInformation); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

70

ADDIDRIVER

Analog inputs

2)

b_ADDIDATA_EnableDisableAnalogInputHardwareTrigger (...) Syntax: <Return Value> = b_ADDIDATA_EnableDisableAnalogInputHardwareTrigger (DWORD dw_DriverHandle, WORD w_Module, BYTE b_HardwareTriggerFlag, BYTE b_HardwareTriggerLevel, BYTE b_HardwareTriggerAction, DWORD dw_HardwareTriggerCycleCount DWORD dw_HardwareTriggerCount, DWORD dw_TimeOut) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_Module Index of the module BYTE b_HardwareTriggerFlag ADDIDATA_ENABLE: Enables the hardware trigger. ADDIDATA_DISABLE: Hardware trigger disabled by triggering the analog input module BYTE b_HardwareTriggerLevel ADDIDATA_LOW: If the hardware trigger is ued, it triggers from "1" to "0" ADDIDATA_HIGH: If the hardware trigger is used, it triggers from "0" to "1" ADDIDATA_HIGH_LOW: If the hardware trigger is used, it triggers from "0" to "1" or from "1" to "0" BYTE b_HardwareTriggerAction Trigger action selection Refer to table 2-5 DWORD dw_HardwareTriggerCycleCount Define the number of sequences, auto refresh cycles or SCAN cycles to trigger Refer to table 2-5 DWORD dw_HardwareTriggerCount Hardware trigger counter. Define the number of trigger events before the action occur (> 0) DWORD dw_TimeOut Define the time out for the
ADDIDATA_TRIGGER_START_A_SINGLE_CONVERSION

mode. Unit is ms. 0: no time out used - Output: No output signal has occurred. Task: Releases or blocks the action of the hardware trigger.

71

Analog inputs

ADDIDRIVER

Table 2-5: Hardware trigger action


Mode description ADDIDATA_TRIGGER_START_A_SINGLE_CONVERSION After each dw_HardwareTriggerCount trigger a single conversion is started ADDIDATA_ONE_SHOT_TRIGGER After the first dw_HardwareTriggerCount trigger the conversion are started. All next trigger have not effect. The trigger are rearmed after the next call from the function b_ADDIDATA_StartAnalogInputSequenceAcquisition or b_ADDIDATA_StartAnalogInputSCAN b_ADDIDATA_StartAnalogInputAutoRefreshAcquisition ADDIDATA_TRIGGER_START_A_SINGLE_AUTO_REFRES After dw_HardwareTriggerCount trigger a single auto H refresh cycle is started ADDIDATA_TRIGGER_START_A_AUTO_REFRESH_SERIES After each dw_HardwareTriggerCount trigger a series of dw_HardwareTriggerCycleCount auto refresh cycles is started. ADDIDATA_TRIGGER_START_A_SINGLE_SCAN After dw_HardwareTriggerCount trigger a single SCAN is started ADDIDATA_TRIGGER_START_A_ SCAN_SERIES After each dw_HardwareTriggerCount trigger a series of dw_HardwareTriggerCycleCount SCAN is started. ADDIDATA_TRIGGER_START_A_SINGLE_SEQUENCE After dw_HardwareTriggerCount trigger a single sequence is started ADDIDATA_TRIGGER_START_A_SEQUENCE_SERIES After each dw_HardwareTriggerCount trigger a series of dw_HardwareTriggerCycleCount sequences is started.

b_HardwareTriggerAction

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableAnalogInputHardwareTrigger (dw_DriverHandle, 0, ADDIDATA_ENABLE, ADDIDATA_HIGH, ADDIDATA_TRIGGER_START_A_SINGLE_CONVERSION, 0, 1, 0); Return value: 1: No error 0:Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

72

ADDIDRIVER

Analog inputs

3)

b_ADDIDATA_GetAnalogInputHardwareTriggerStatus (...) Syntax: <Return Value> = b_ADDIDATA_GetAnalogInputHardwareTriggerStatus (DWORD dw_DriverHandle, WORD w_Module, PBYTE pb_HardwareTriggerFlag, PBYTE pb_HardwareTriggerStatus, PDWORD pdw_HardwareTriggerCount, PBYTE pb_HardwareTriggerState) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_Module Index of the analog input module - Output: PBYTE pb_HardwareTriggerFlag ADDIDATA_ENABLE: The hardware trigger is enabled. ADDIDATA_DISABLE: The hardware trigger is disabled PBYTE pb_HardwareTriggerStatus 0: Hardware trigger did not occur 1: Hardware trigger occurred PDWORD pdw_HardwareTriggerCount Number of pulses that fail before the next trigger occurs PBYTE pb_HardwareTriggerState 0: Hardware trigger is not active (Low state) 1: Hardware trigger is active (High state) Task: Returns the status (occur or not), the state from input (active or not) and the number of that fail before the next trigger occur. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; BYTE b_HardwareTriggerFlag; BYTE b_HardwareTriggerStatus; BYTE b_HardwareTriggerState; DWORD dw_HardwareTriggerCount; b_ReturnValue = b_ADDIDATA_GetAnalogInputHardwareTriggerStatus (dw_DriverHandle, 0, &b_HardwareTriggerFlag, &b_HardwareTriggerStatus, &dw_HardwareTriggerCount, &b_HardwareTriggerState);

73

Analog inputs

ADDIDRIVER

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

74

ADDIDRIVER

Analog inputs

2.8

Software trigger functions


1) b_ADDIDATA_GetAnalogInputSoftwareTriggerInformation (...) Syntax: <Return Value> = b_ADDIDATA_GetAnalogInputSoftwareTriggerInformation (DWORD dw_DriverHandle, WORD w_Module, pstr_AnalogInputSoftwareTriggerInformation ps_TriggerInformation, DWORD dw_StructSize) Parameters: - Input: DWORD dw_DriverHandle WORD w_Module DWORD dw_StructSize

Handle of the ADDI-DATA driver Index of the analog input module Size of the structure.

- Output: pstr_AnalogInputSoftwareTriggerInformation Software trigger

ps_TriggerInformation

information. Returned structure: typedef struct { BYTE b_SoftwareTriggerAutoRefreshAvailableMode;

BYTE

BYTE

BYTE

D3 to D0 XXX1 : One shot trigger available XX1X : Single auto refresh trigger available X1XX : X autorefresh trigger available b_SoftwareTriggerSCANAvailableMode; XXX1 : One shot trigger available XX1X : Single scan trigger available X1XX : X scan trigger available b_SoftwareTriggerSequenceAvailableMode; XXX1 : One shot trigger available XX1X : Single sequence trigger available X1XX : X sequence trigger available b_Reserverd1 [5]; 75

Analog inputs

ADDIDRIVER

} str_AnalogInputSoftwareTriggerInformation, *pstr_AnalogInputSoftwareTriggerInformation; Task: Return the software trigger available actions. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; str_AnalogInputSoftwareTriggerInformation s_TriggerInformation; b_ReturnValue = b_ADDIDATA_GetAnalogInputSoftwareTriggerInformation (dw_DriverHandle, 0, & s_TriggerInformation, sizeof(s_TriggerInformation); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

76

ADDIDRIVER

Analog inputs

2)

b_ADDIDATA_EnableDisableAnalogInputSoftwareTrigger (...) Syntax: <Return Value> = b_ADDIDATA_EnableDisableAnalogInputSoftwareTrigger (DWORD dw_DriverHandle, WORD w_Module, BYTE b_SoftwareTriggerFlag, BYTE b_SoftwareTriggerAction) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_Module Index of the module BYTE b_SoftwareTriggerFlag ADDIDATA_ENABLE: Enables the Software trigger. ADDIDATA_DISABLE: Software trigger disabled by triggering the analog input module BYTE b_SoftwareTriggerAction Trigger action selection Refer to table 2-6 - Output: No output signal has occurred. Task: Releases or blocks the action of the Software trigger. The software trigger are making via the function b_ADDIDATA_AnalogInputSoftwareTrigger Table 2-6: Software trigger action

Mode description ADDIDATA_TRIGGER_START_A_SINGLE_CONVERSION After each software trigger a single conversion is started ADDIDATA_ONE_SHOT_TRIGGER After the first software trigger the conversion is started. All next triggers have not effect. The trigger are read after the next call from the function b_ADDIDATA_StartAnalogInputSequenceAcquisition or b_ADDIDATA_StartAnalogInputSCAN b_ADDIDATA_StartAnalogInputAutoRefreshAcquisition ADDIDATA_TRIGGER_START_A_SINGLE_AUTO_REFRES After software trigger a single auto refresh cycle is H started ADDIDATA_TRIGGER_START_A_AUTO_REFRESH_SERIES After each software trigger a series of dw_HardwareTriggerCycleCount auto refresh cycles are started. ADDIDATA_TRIGGER_START_A_SINGLE_SCAN After software trigger a single SCAN is started ADDIDATA_TRIGGER_START_A_ SCAN_SERIES After each software trigger a series of dw_HardwareTriggerCycleCount SCAN are started. ADDIDATA_TRIGGER_START_A_SINGLE_SEQUENCE After software trigger a single sequence is started ADDIDATA_TRIGGER_START_A_SEQUENCE_SERIES After each software trigger a series of dw_HardwareTriggerCycleCount sequence are started.

b_HardwareTriggerAction

77

Analog inputs

ADDIDRIVER

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableAnalogInputSoftwareTrigger (dw_DriverHandle, 0, ADDIDATA_ENABLE, ADDIDATA_TRIGGER_START_A_SINGLE_CONVERSION); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

78

ADDIDRIVER

Analog inputs

3)

b_ADDIDATA_GetAnalogInputSoftwareTriggerStatus (...) Syntax: <Return Value> = b_ADDIDATA_GetAnalogInputSoftwareTriggerStatus (DWORD dw_DriverHandle, WORD w_Module, PBYTE pb_SoftwareTriggerFlag, PBYTE pb_SoftwareTriggerStatus) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_Module Index of the analog input module - Output: PBYTE pb_SoftwareTriggerFlag ADDIDATA_ENABLE: The software trigger is enabled. ADDIDATA_DISABLE: The software trigger is disabled PBYTE pb_SoftwareTriggerStatus 0: Software trigger did not occur 1: Software trigger occurred Task: Returns the status (occur or not) of the selected analog input software trigger. Calling convention: ANSI C : BYTE DWORD BYTE BYTE b_ReturnValue; dw_DriverHandle; b_SoftwareTriggerFlag; b_SoftwareTriggerStatus;

b_ReturnValue = b_ADDIDATA_GetAnalogInputSoftwareTriggerStatus (dw_DriverHandle, 0, &b_SoftwareTriggerFlag, &b_SoftwareTriggerStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

79

Analog inputs

ADDIDRIVER

4)

b_ADDIDATA_AnalogInputSoftwareTrigger (...) Syntax: <Return Value> = b_ADDIDATA_AnalogInputSoftwareTrigger (DWORD dw_DriverHandle, WORD w_Module) Parameters: - Input: DWORD dw_DriverHandle WORD w_Module - Output: No output signal has occurred. Task: Make a software trigger. The action depends from the initialisation. Refer to the function b_ADDIDATA_EnableDisableAnalogInputSoftwareTrigger Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_AnalogInputSoftwareTrigger (dw_DriverHandle, 0,); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Handle of the ADDI-DATA driver Index of the analog input module

80

ADDIDRIVER

Analog inputs

2.9

Other functions
1) b_ADDIDATA_TestAnalogInputAsynchronousFIFOFull Syntax: <Return value> = b_ ADDIDATA_TestAnalogInputAsynchronousFIFOFull (DWORD dw_DriverHandle, PBYTE pb_Full) Parameters: - Input: DWORD dw_DriverHandle - Output: PBYTE pb_Full

Driver handle 0: Asynchronous interrupt FIFO memory not full 1: Asynchronous interrupt FIFO memory is full

Task: Tests if the asynchronous interrupt FIFO memory is full or not. The asynchronous interrupt FIFO memory is the FIFO memory in which the asynchronous events generated by the asynchronous interrupt are stored. Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_FIFOFull

b_ReturnValue = b_ ADDIDATA_TestAnalogInputAsynchronousFIFOFull (dw_DriverHandle, &b_FIFOFull); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

81

DIN EN ISO 9001:2000 certified

ADDI-DATA GmbH Airpark Business Center Airport Boulevard B210 77836 Rheinmnster Germany Phone: +49 7229 18470 Fax: +49 7229 1847222 E-mail: info@addi-data.com

Software description

ADDIDRIVER
Digital output channels

Edition: 07.03 08/2010

Table of contents

ADDIDRIVER

1 2

INTRODUCTION...................................................................................1 DIGITAL OUTPUT CHANNELS.................................................................2


1) b_ADDIDATA_GetNumberOfDigitalOutputs(...) ................................................................ 2 2) b_ADDIDATA_GetDigitalOutputInformation (...) ............................................................... 3 3) b_ADDIDATA_SetDigitalOutputMemoryOn (...) ................................................................ 5 4)b_ADDIDATA_SetDigitalOutputMemoryOff (...) ................................................................ 6 4) b_ADDIDATA_SetDigitalOutputMemoryOnEx (...)............................................................ 6 5) b_ADDIDATA_Set1DigitalOutputOn (...)............................................................................ 8 6) b_ADDIDATA_Set1DigitalOutputOff (...) ........................................................................... 9 7) b_ADDIDATA_Set2DigitalOutputsOn (...) ........................................................................ 10 8) b_ADDIDATA_Set2DigitalOutputsOff (...)........................................................................ 11 9) b_ADDIDATA_Set4DigitalOutputsOn (...) ........................................................................ 12 10) b_ADDIDATA_Set4DigitalOutputsOff (...)...................................................................... 13 11) b_ADDIDATA_Set8DigitalOutputsOn (...) ...................................................................... 14 12) b_ADDIDATA_Set8DigitalOutputsOff (...)...................................................................... 16 13) b_ADDIDATA_Set16DigitalOutputsOn (...) .................................................................... 17 14) b_ADDIDATA_Set16DigitalOutputsOff (...).................................................................... 18 15) b_ADDIDATA_Set32DigitalOutputsOn (...) .................................................................... 19 16) b_ADDIDATA_Set32DigitalOutputsOff (...).................................................................... 20 17) b_ADDIDATA_Get1DigitalOutputStatus (...) .................................................................. 21 18) b_ADDIDATA_Get2DigitalOutputStatus (...) .................................................................. 22 19) b_ADDIDATA_Get4DigitalOutputStatus (...) .................................................................. 23 20) b_ADDIDATA_Get8DigitalOutputStatus (...) .................................................................. 24 21) b_ADDIDATA_Get16DigitalOutputStatus (...) ................................................................ 25 22) b_ADDIDATA_Get32DigitalOutputStatus (...) ................................................................ 26 23) b_ADDIDATA_InitDigitalOutputInterrupt (...) ................................................................ 27 24) b_ADDIDATA_ReleaseDigitalOutputInterrupt (...) ......................................................... 29 25) b_ADDIDATA_EnableDisableDigitalOutputInterrupt (...)............................................... 30

Tables
Table 1-1: Type Declaration for Windows 98/NT/2000/XP ........................................................1

Introduction

ADDIDRIVER

INTRODUCTION
IMPORTANT! Note the following conventions in the text:
Function: Variable "b_ADDIDATA_GetNumberOfAnalogInputs" dw_DriverHandle

Table 1-1: Type Declaration for Windows 98/NT/2000/XP Borland C Microsoft C Borland Pascal pointer byte integer long longint var byte var integer var long var string var longint double Microsoft Visual Basic Windows any integer integer long long integer integer long string long double

VOID BYTE INT WORD DWORD PBYTE PINT PWORD PCHAR PDWORD DOUBLE

void unsigned char int unsigned short int long unsigned char * int *

void unsigned char int unsigned short int long unsigned char * int *

unsigned short int * unsigned short int * char * long * double char * long * double

ADDIDRIVER

Digital outputs

DIGITAL OUTPUT CHANNELS


1) b_ADDIDATA_GetNumberOfDigitalOutputs(...) Syntax: <Return value> = b_ADDIDATA_GetNumberOfDigitalOutputs (DWORD dw_DriverHandle, PWORD pw_NumberOfChannels) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver - Output: PWORD pw_NumberOfChannels Number of digital output channels Task: Returns the number of available digital output channels. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; WORD w_NumberOfChannels; b_ReturnValue = b_ADDIDATA_GetNumberOfDigitalOutput (dw_DriverHandle, &w_NumberOfChannels); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Digital outputs 2) b_ADDIDATA_GetDigitalOutputInformation (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_ GetDigitalOutputInformation (DWORD dw_DriverHandle, WORD w_DigitalOutputNumber, PBYTE pb_DigitalOutputType PBYTE pb_DigitalOutputInterrupt) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_DigitalOutputNumber Number of the selected digital output - Output: PBYTE pb_DigitalOutputType Type of the selected input 0 Output type not defined. 1 15 5V Type 1 Differential RS485/422 2 Open drain, low-side, load at default voltage 3 TTL 16 31 12 Type 32 47 24 Type 32 High-side, load at ground 33 Open drain, low side, load at default voltage 34 24 V direct optocoupler output / drain source) 48 255 any other type 64-79 Relay 65 Relay 1C (change-over contacts) PBYTE pb_DigitalOutputInterrupt Type of the possible interrupt 1 = Vcc diagnostic, 2 = CC-diagnostic. Task: Returns information about the digital output channels. Calling convention: ANSI C : BYTE DWORD BYTE BYTE b_ReturnValue; dw_DriverHandle; b_DigitalOutputType b_DigitalOutputInterrupt;

b_ReturnValue = b_ADDIDATA_GetDigitalOutputInformation (dw_DriverHandle, 0, &b_DigitalOutputType &b_DigitalOutputInterrupt); Return value: 1: No error 3

ADDIDRIVER

Digital outputs

0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Digital outputs 3) b_ADDIDATA_SetDigitalOutputMemoryOn (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_SetDigitalOutputMemoryOn (DWORD dw_DriverHandle) Parameters: - Input: DWORD dw_DriverHandle - Output: No output signal has occurred.

Handle of the ADDI-DATA driver

Task: Activates the digital output memory and sets all digital outputs off. After calling up this function, the outputs you have previously activated with the function "i_ADDIDATA_SetXDigitalOutputOn" are not reset. You can reset them with the function "i_ADDIDATA_SetXDigitalOutputOff". Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_SetDigitalOutputMemoryOn (dw_DriverHandle); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER

Digital outputs

4)b_ADDIDATA_SetDigitalOutputMemoryOff (...) Syntax: <Return value> = b_ADDIDATA_SetDigitalOutputMemoryOff (DWORD dw_DriverHandle) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver - Output: No output signal has occurred. Task: Deactivates the digital output memory. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_SetDigitalOutputMemoryOff (dw_DriverHandle); Return value: 1: No error 0: Error by calling up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

4) b_ADDIDATA_SetDigitalOutputMemoryOnEx (...) Syntax: <Return value> = b_ADDIDATA_SetDigitalOutputMemoryOnEx (DWORD dw_DriverHandle) Parameters: - Input: DWORD dw_DriverHandle - Output: No output signal has occurred.

Handle of the ADDI-DATA driver

Task: Activates the digital output memory and save the state from all digital outputs. After calling up this function, the outputs you have previously activated with the function "i_ADDIDATA_SetXDigitalOutputOn" are not reset. You can reset them with the function "i_ADDIDATA_SetXDigitalOutputOff".

Digital outputs

ADDIDRIVER

!!! Attention The digital outputs state from the APCI-1500/APCI-3120/APCI-3001/APCI3200/APCI-3300 can not be read. This function call set the outputs from this board to off.

Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_SetDigitalOutputMemoryOnEx (dw_DriverHandle); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER 5) b_ADDIDATA_Set1DigitalOutputOn (...) Syntax: <Return value> = b_ADDIDATA_Set1DigitalOutputOn (DWORD WORD Parameters: - Input: DWORD dw_DriverHandle WORD w_Channel - Output: No output signal has occurred.

Digital outputs

dw_DriverHandle, w_Channel)

Handle of the ADDI-DATA driver Number of the output to be set.

Task: Sets the output which was passed through the variable b_Channel. Setting one output means setting the output to "High". If you have switched on the digital output memory (ON), the selected outputs channels are set to "1". The other channels hold their state. If you have switched off the digital output memory (OFF), the selected outputs are set to "1". The other channels are reset. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle; (dw_DriverHandle,0);

b_ReturnValue = b_ADDIDATA_Set1DigitalOutputOn

Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Digital outputs 6) b_ADDIDATA_Set1DigitalOutputOff (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_Set1DigitalOutputOff (DWORD dw_DriverHandle, WORD w_Channel) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE w_Channel Number of the ouptut to be reset (0 to 31) - Output: No output signal has occurred. Task: Resets the ouptut which was passed with the Variable w_Channel. Resetting an output means setting this ouptut to "Low".

IMPORTANT! You can use this function only if the digital output memory is ON. See function b_ADDIDATA_SetDigitalOutputMemoryOn (..).
Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_Set1DigitalOutputOff (dw_DriverHandle,1);

Return value: 1: No error 0: Error by callup of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER

Digital outputs

7) b_ADDIDATA_Set2DigitalOutputsOn (...) Syntax: <Return value> = b_ADDIDATA_Set2DigitalOutputsOn (DWORD dw_DriverHandle, BYTE b_Port, BYTE b_PortValue) Parameters: - Input: DWORD dw_DriverHandle BYTE b_Port BYTE b_PortValue - Output: No output signal has occurred.

Handle of the ADDI-DATA driver Number of the output port Output value (0 to 3)

Task: Sets one or several outputs of a port. Setting one output means setting the output to "High". If you have switched on the digital ouput memory (ON), the selected outputs channels are set to "1". The other channels hold their state. If you have switched off the digital output memory (OFF), the selected outputs are set to "1". The other channels are reset. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle; (dw_DriverHandle,0,3);

b_ReturnValue = b_ADDIDATA_Set2DigitalOutputsOn

Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

10

Digital outputs 8) b_ADDIDATA_Set2DigitalOutputsOff (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_Set2DigitalOutputsOff (DWORD dw_DriverHandle, BYTE b_Port, BYTE b_PortValue) Parameters: - Input: DWORD dw_DriverHandle BYTE b_Port BYTE b_PortValue - Output: No output signal has occurred.

Handle of the ADDI-DATA driver Number of the output port Output value (0 to 3)

Task: Resets one or several outputs of a port. Resetting one output means setting the output to "Low" (0). The other channels hold their state.

IMPORTANT! You can use this function only if the digital output memory is ON. See function b_ADDIDATA_SetDigitalOutputMemoryOn (..).
Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle; (dw_DriverHandle,0,3);

b_ReturnValue = b_ADDIDATA_Set2DigitalOutputsOff

Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

11

ADDIDRIVER 9) b_ADDIDATA_Set4DigitalOutputsOn (...)

Digital outputs

Syntax: <Return value> = b_ADDIDATA_Set4DigitalOutputsOn (DWORD dw_DriverHandle, BYTE b_Port, BYTE b_PortValue) Parameters: - Input: DWORD dw_DriverHandle BYTE b_Port BYTE b_PortValue - Output: No output signal has occurred.

Handle of the ADDI-DATA driver Number of the output port Output value (0 to 15)

Task: Sets one or several outputs of a port. Setting one output means setting the output to "High". If you have switched on the digital output memory (ON), the selected outputs channels are set to "1". The other channels hold their state. If you have switched off the digital output memory (OFF), the selected outputs are set to "1". The other channels are reset. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle; (dw_DriverHandle,0,3);

b_ReturnValue = b_ADDIDATA_Set4DigitalOutputsOn

Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

12

Digital outputs 10) b_ADDIDATA_Set4DigitalOutputsOff (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_Set4DigitalOutputsOff (DWORD dw_DriverHandle, BYTE b_Port, BYTE b_PortValue) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_Port Number of the output port BYTE b_PortValue Output value (0 to 15) - Output: No output signal has occurred. Task: Resets one or several outputs of a port. Resetting one output means setting the output to "Low" (0). The other channels hold their state.

IMPORTANT! You can use this function only if the digital output memory is ON. See function b_ADDIDATA_SetDigitalOutputMemoryOn (..).
Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle; (dw_DriverHandle,0,3);

b_ReturnValue = b_ADDIDATA_Set4DigitalOutputsOff

Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

13

ADDIDRIVER 11) b_ADDIDATA_Set8DigitalOutputsOn (...) Syntax: <Return value> = b_ADDIDATA_Set8DigitalOutputsOn (DWORD BYTE BYTE Parameters: - Input: DWORD dw_DriverHandle BYTE b_Port BYTE b_PortValue - Output: No output signal has occurred.

Digital outputs

dw_DriverHandle, b_Port, b_PortValue)

Handle of the ADDI-DATA driver Number of the output port Output value (0 to 255)

Task: Sets one or several outputs of a port. Setting one output means setting the output to "High". If you have switched on the digital output memory (ON), the selected outputs channels are set to "1". The other channels hold their state. If you have switched off the digital output memory (OFF), the selected outputs are set to "1". The other channels are reset. Example: Switching on the digital output memory (ON) see function "b_ ADDIDATA_SetDigitalOutputMemoryOn (...) b_Port = 1 b_PortValue = 55 Hex

The outputs 1, 3, 5, 7 are set. The others outputs are hold their status. Switching off the digital output memory (OFF) see function "b_ ADDIDATA _SetDigitalOutputMemoryOff (...) b_Port = 1 b_PortValue = 55 Hex

14

Digital outputs

ADDIDRIVER

The outputs 1, 3, 5, 7 are set. The others are reset. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_Set8DigitalOutputsOn

(dw_DriverHandle,1,1);

Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

15

ADDIDRIVER 12) b_ADDIDATA_Set8DigitalOutputsOff (...)

Digital outputs

Syntax: <Return value> = b_ADDIDATA_Set8DigitalOutputsOff (DWORD dw_DriverHandle, BYTE b_Port, BYTE b_PortValue) Parameters: - Input: DWORD dw_DriverHandle BYTE b_Port BYTE b_PortValue - Output: No output signal has occurred.

Handle of the ADDI-DATA driver Number of the output port Output value (0 to 255)

Task: Resets one or several outputs of a port. Resetting one output means setting the output to "Low" (0). The other channels hold their state.

IMPORTANT! You can use this function only if the digital output memory is ON. See function b_ADDIDATA_SetDigitalOutputMemoryOn (..).
Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle; (dw_DriverHandle,1,1);

b_ReturnValue = b_ADDIDATA_Set8DigitalOutputsOff

Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

16

Digital outputs 13) b_ADDIDATA_Set16DigitalOutputsOn (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_Set16DigitalOutputsOn (DWORD dw_DriverHandle, BYTE b_Port, WORD w_PortValue) Parameters: - Input: DWORD dw_DriverHandle BYTE b_Port WORD w_PortValue - Output: No output signal has occurred.

Handle of the ADDI-DATA driver Number of the output port Output value (0 to 65535)

Task: Sets one or several outputs of a port. Setting one output means setting the output to "High". If you have switched on the digital ouput memory (ON), the selected outputs channels are set to "1". The other channels hold their state. If you have switched off the digital output memory (OFF), the selected outputs are set to "1". The other channels are reset. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_Set16DigitalOutputsOn(dw_DriverHandle,0,1); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

17

ADDIDRIVER 14) b_ADDIDATA_Set16DigitalOutputsOff (...)

Digital outputs

Syntax: <Return value> = b_ADDIDATA_Set16DigitalOutputsOff (DWORD dw_DriverHandle, BYTE b_Port, WORD w_PortValue) Parameters: - Input: DWORD dw_DriverHandle BYTE b_Port WORD w_PortValue - Output: No output signal has occurred.

Handle of the ADDI-DATA driver Number of the output port Output value (0 to 65535)

Task: Resets one or several outputs of a port. Resetting one output means setting the output to "Low" (0). The other channels hold their state.

IMPORTANT! You can use this function only if the digital output memory is ON. See function b_ADDIDATA_SetDigitalOutputMemoryOn (..).
Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_Set16DigitalOutputsOff (dw_DriverHandle,1,1); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

18

Digital outputs 15) b_ADDIDATA_Set32DigitalOutputsOn (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_Set32DigitalOutputsOn (DWORD dw_DriverHandle, BYTE b_Port, DWORD dw_PortValue) Parameters: - Input: DWORD dw_DriverHandle BYTE b_Port DWORD dw_PortValue - Output: No output signal has occurred.

Handle of the ADDI-DATA driver Number of the output port Output value (0 to 232-1)

Task: Sets one or several outputs of a port. Setting one output means setting the output to "High". If you have switched on the digital ouput memory (ON), the selected outputs channels are set to "1". The other channels hold their state. If you have switched off the digital output memory (OFF), the selected outputs are set to "1". The other channels are reset. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_Set32DigitalOutputsOn(dw_DriverHandle,0,1); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

19

ADDIDRIVER 16) b_ADDIDATA_Set32DigitalOutputsOff (...) Syntax: <Return value> = b_ADDIDATA_Set32DigitalOutputsOff (DWORD dw_DriverHandle, BYTE b_Port, DWORD dw_PortValue) Parameters: - Input: DWORD dw_DriverHandle BYTE b_Port DWORD dw_PortValue - Output: No output signal has occurred.

Digital outputs

Handle of the ADDI-DATA driver Number of the output port Output value (0 to 232-1)

Task: Resets one or several outputs of a port. Resetting one output means setting the output to "Low" (0). The other channels hold their state.

IMPORTANT! You can use this function only if the digital output memory is ON. See function b_ADDIDATA_SetDigitalOutputMemoryOn (..).
Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_Set32DigitalOutputsOff(dw_DriverHandle,0,1); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

20

Digital outputs 17) b_ADDIDATA_Get1DigitalOutputStatus (...) Syntax: <Return value> = b_ADDIDATA_Get1DigitalOutputStatus (DWORD WORD PBYTE Parameters: - Input: DWORD dw_DriverHandle WORD w_Channel - Output: PBYTE pb_ChannelStatus

ADDIDRIVER

dw_DriverHandle, w_Channel, pb_ChannelStatus)

Handle of the ADDI-DATA driver Number of the output to be read Status of the digital output 0 -> low 1 -> high

Task: Return the status of a digital output. The variable w_Channel passes the output to be read (0 to 31). A value is returned through the variable pb_ChannelStatus: 0 (low) or 1 (high). Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_ChannelStatus;

b_ReturnValue = b_ADDIDATA_Get1DigitalOutputStatus (dw_DriverHandle, 0, &b_ChannelStatus); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

21

ADDIDRIVER 18) b_ADDIDATA_Get2DigitalOutputStatus (...) Syntax: <Return value> = b_ADDIDATA_Get2DigitalOutputStatus (DWORD BYTE PBYTE Parameters: - Input: DWORD dw_DriverHandle BYTE b_Port - Output: PBYTE pb_PortValue

Digital outputs

dw_DriverHandle, b_Port, pb_PortValue)

Handle of the ADDI-DATA driver Number of the 2-bit output port to be read Status of the digital output port (0 to 3)

Task: Returns the status of a 2-bit port. The variable b_Port passes the port to be read. A value is returned through the variable pb_PortValue. Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_PortValue;

b_ReturnValue = b_ADDIDATA_Get2DigitalOutputStatus (dw_DriverHandle, 0, &b_PortValue); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

22

Digital outputs 19) b_ADDIDATA_Get4DigitalOutputStatus (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_Get8DigitalOutputStatus (DWORD dw_DriverHandle, BYTE b_Port, PBYTE pb_PortValue) Parameters: - Input: DWORD dw_DriverHandle BYTE b_Port - Output: PBYTE pb_PortValue

Handle of the ADDI-DATA driver Number of the 4-bit output port to be read Status of the digital output port (0 to 15)

Task: Returns the status of a 4-bit port. The variable b_Port passes the port to be read. A value is returned through the variable pb_PortValue. Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_PortValue;

b_ReturnValue = b_ADDIDATA_Get4DigitalOutputStatus (dw_DriverHandle, 1, &b_PortValue); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

23

ADDIDRIVER 20) b_ADDIDATA_Get8DigitalOutputStatus (...)

Digital outputs

Syntax: <Return value> = b_ADDIDATA_Get8DigitalOutputStatus (DWORD dw_DriverHandle, BYTE b_Port, PBYTE pb_PortValue) Parameters: - Input: DWORD dw_DriverHandle BYTE b_Port - Output: PBYTE pb_PortValue

Handle of the ADDI-DATA driver Number of the 8-bit output port to be read Status of the digital output port (0 to 255)

Task: Returns the status of an 8-bit port. The variable b_Port passes the port to be read. A value is returned through the variable pb_PortValue. Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_PortValue;

b_ReturnValue = b_ADDIDATA_Get8DigitalOutputStatus (dw_DriverHandle, 0, &b_PortValue); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

24

Digital outputs 21) b_ADDIDATA_Get16DigitalOutputStatus (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_Get16DigitalOutputStatus (DWORD dw_DriverHandle, BYTE b_PortNbr, PWORD pw_PortValue) Parameters: - Input: DWORD dw_DriverHandle BYTE b_PortNbr - Output: PWORD pw_InputValue Task: Returns the status of a 16-bit port. Calling convention: ANSI C : BYTE DWORD WORD b_ReturnValue; dw_DriverHandle; w_PortValue;

Handle of the ADDI-DATA driver Number of the 16-bit output port to be read Digital output status of a port (0 to 65535)

b_ReturnValue = b_ADDIDATA_Get16DigitalOutputStatus (dw_DriverHandle, 0, &w_PortValue); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

25

ADDIDRIVER 22) b_ADDIDATA_Get32DigitalOutputStatus (...)

Digital outputs

Syntax: <Return value> = b_ADDIDATA_Get32DigitalOutputStatus (DWORD dw_DriverHandle, BYTE b_PortNbr, PDWORD pdw_PortValue) Parameters: - Input: DWORD dw_DriverHandle BYTE b_PortNbr - Output: PDWORD pdw_InputValue Task: Returns the status of a 32-bit port. Calling convention: ANSI C : BYTE DWORD DWORD b_ReturnValue; dw_DriverHandle; dw_PortValue;

Handle of the ADDI-DATA driver Number of the 32-bit output port to be read (1 or 2) Digital output status of a port (0 to 232-1)

b_ReturnValue = b_ADDIDATA_Get32DigitalOutputStatus (dw_DriverHandle, 0, &dw_PortValue); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

26

Digital outputs

ADDIDRIVER

23) b_ADDIDATA_InitDigitalOutputInterrupt (...) Syntax: <Return value> = b_ADDIDATA_InitDigitalOutputInterrupt (DWORD dw_DriverHandle, WORD w_FirstDigitalOutput, WORD w_LastDigitalOutput, BYTE b_CCInterruptFlag, BYTE b_VCCInterruptFlag, PDWORD pdw_DigitalOutputArrayForInterruptCC, PDWORD pdw_DigitalOutputArrayForInterruptVCC);

Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_FirstDigitalOutput Number of the first digital output to be initialised. WORD w_LastDigitalOutput Number of the last digital output to be initialised. BYTE b_CCInterruptFlag Flag for the CC (short-circuit) Interrupt (0 or 1). BYTE b_VCCInterruptFlag Flag for the VCC (voltage drop) interrupt (0 or 1). - Output: PDWORD pdw_DigitalOutputArrayForInterruptCC Mask of the digital output set for the CC Interrupt (bits set to 1: enable, bit set to 0: disabled). PDWORD pdw_DigitalOutputArrayForInterruptVCC Mask of the digital output set for the VCC Interrupt (bits set to 1: enabled; bit set to 0: disabled). Task: Initialises the digital output interrupt. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; DWORD dw_DigitalOutputArrayForInterruptCC; DWORD dw_DigitalOutputArrayForInterruptVCC; b_ReturnValue = b_ADDIDATA_InitDigitalOutputInterrupt (dw_DriverHandle, 0, 15, ADDIDATA_ENABLE, ADDIDATA_ENABLE, 27

ADDIDRIVER

Digital outputs

&dw_DigitalOutputArrayForInterruptCC, &dw_DigitalOutputArrayForInterruptVCC); Return value: 1: No error 0: Error by calling up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

28

Digital outputs

ADDIDRIVER

24) b_ADDIDATA_ReleaseDigitalOutputInterrupt (...) Syntax: <Return value> = b_ADDIDATA_ReleaseDigitalOutputInterrupt (DWORD dw_DriverHandle, WORD w_FirstDigitalOutput, WORD w_LastDigitalOutput);

Parameters: - Input: DWORD dw_DriverHandle WORD w_FirstDigitalOutput WORD w_LastDigitalOutput - Output: No output signal has occurred. Task: Releases the digital output interrupt. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

Handle of the ADDI-DATA driver Number of the first digital output to be released. Number of the last digital output to be released.

b_ReturnValue = b_ADDIDATA_ReleaseDigitalOutputInterrupt (dw_DriverHandle, 0, 15); Return value: 1: No error 0: Error by call-up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

IMPORTANT! The interrupt mask for the function is detailled in the "Interrupt" function description. (Tables 2-1 and 2-2).

29

ADDIDRIVER

Digital outputs

25) b_ADDIDATA_EnableDisableDigitalOutputInterrupt (...) Syntax: <Return value> = b_ADDIDATA_EnableDisableDigitalOutputInterrupt (DWORD dw_DriverHandle, WORD w_FirstDigitalOutput, WORD w_LastDigitalOutput, BYTE b_VCCInterruptFlag, BYTE b_CCInterruptFlag); Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver WORD w_FirstDigitalOutput Number of the first digital output to be enabled/disabled. WORD w_LastDigitalOutput Number of the last digital output to be enabled/disabled BYTE b_VCCInterruptFlag Flag for the VCC Interrupt (0 or 1). BYTE b_CCInterruptFlag Flag for the CC Interrupt (0 or 1). - Output: No output signal has occurred. Task: Enables or disables the digital output interrupt.

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableDigitalOutputInterrupt (dw_DriverHandle, 0, 15, ADDIDATA_ENABLE, ADDIDATA_ENABLE); Return value: 1: No error 0: Error by calling up of the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

30

DIN EN ISO 9001:2000 certified

ADDI-DATA GmbH Airpark Business Center Airport Boulevard B210 77836 Rheinmnster Germany Phone: +49 7229 18470 Fax: +49 7229 1847222 E-mail: info@addi-data.com

Software description

ADDIDRIVER
Watchdog

Edition: 07.04 08/2010

Table of contents

ADDIDRIVER

1 2
2.1

INTRODUCTION...................................................................................3 WATCHDOG ........................................................................................4


List of possible watchdog states ..........................................................................4

2.2 List of events that may change the state of the diagram ....................................4 2.2.2 ADDIPACK Application Programming Interface function calls .....................................4 2.2.3 Hardware Events..........................................................................................................4 2.3 Description ...........................................................................................................5 1) b_ADDIDATA_GetNumberOfWatchdogs (...) ..................................................................... 7 2) b_ADDIDATA_GetWatchdogInformation (...)..................................................................... 8 3) b_ADDIDATA_GetWatchdogInformationEx (...) .............................................................. 10 4) b_ADDIDATA_InitWatchdog (...) ...................................................................................... 12 5) b_ADDIDATA_EnableDisableWatchdogInterrupt (...) ...................................................... 13 6) b_ADDIDATA_StartWatchdog (...) .................................................................................... 14 7) b_ADDIDATA_StartAllWatchdogs (...) ............................................................................. 15 8) b_ADDIDATA_TriggerWatchdog (...)................................................................................ 16 9) b_ADDIDATA_TriggerAllWatchdogs (...) ......................................................................... 17 10) b_ADDIDATA_StopWatchdog (...) .................................................................................. 18 11) b_ADDIDATA_StopAllWatchdogs (...)............................................................................ 19 12) b_ADDIDATA_ReleaseWatchdog (...) ............................................................................. 20 13) b_ADDIDATA_ReadWatchdogStatus (...)........................................................................ 21 14) b_ADDIDATA_EnableDisableWatchdogHardwareGate (...) ........................................... 22 15) b_ADDIDATA_GetWatchdogHardwareGateStatus (...)................................................... 23 16) b_ADDIDATA_EnableDisableWatchdogHardwareTrigger (...)....................................... 24 17) b_ADDIDATA_GetWatchdogHardwareTriggerStatus (...) .............................................. 25 18) b_ADDIDATA_GetWarningDelayInformation (...).......................................................... 26 19) b_ADDIDATA_InitWarningDelay (...) ............................................................................. 27 20) b_ADDIDATA_EnableDisableWatchdogWarningRelay (...) ........................................... 28 21) b_ADDIDATA_EnableDisableWatchdogResetRelay (...) ................................................ 29 22) b_ADDIDATA_SetWatchdogResetRelayMode (...) ......................................................... 30 23) b_ADDIDATA_EnableDisableWatchdogOutput (...) ....................................................... 31 24) b_ADDIDATA_GetWatchdogHardwareOutputStatus (...) ............................................... 32 25) b_ADDIDATA_TestWatchdogAsynchronousFIFOFull ................................................... 33

Tables
Table 1-1: Type Declaration for Windows 98/NT/2000/XP ........................................................3 Table 2-1: Watchdog type......................................................................................................7 Table 2-2: Watchdog timer units.............................................................................................9 Table 2-3: Resolution ..............................................................................................................9

ADDIDRIVER

Introduction

INTRODUCTION
IMPORTANT! Note the following conventions in the text:
Function: "b_ADDIDATA_GetNumberOfAnalogInputs" Variable dw_DriverHandle

Table 1-1: Type Declaration for Windows 98/NT/2000/XP Borland C Microsoft C Borland Pascal pointer byte integer long longint var byte var integer var long var string var longint double Microsoft Visual Basic Windows any integer integer long long integer integer long string long double

VOID BYTE INT WORD DWORD PBYTE PINT PWORD PCHAR PDWORD DOUBLE

void unsigned char int unsigned short int long unsigned char * int *

void unsigned char int unsigned short int long unsigned char * int *

unsigned short int * unsigned short int * char * long * double char * long * double

Watchdog

ADDIDRIVER

WATCHDOG
The watchdog is a downward counter, which resets the outputs after the reload value has run down (timeout). The watchdog status can be read back at any time through a function call. This section describes how the watchdog functions in terms of states, events (ADDIPACK function calls or hardware events) and transitions between the states under the action of the events.

2.1

List of possible watchdog states


UNINITIALISED This is the default state. INITIALISED The software has configured the hardware, but the watchdog has no action on the outputs yet. ENABLED The watchdog hardware is ready to start counting, but has no action on the outputs yet. RUNNING The watchdog has been switched on by a trigger. It must be regularly triggered, or the software will be considered faulty and a timeout event is generated. ALARM The watchdog has encountered a timeout and resets all the outputs.

2.2
2.2.2

List of events that may change the state of the diagram


ADDIPACK Application Programming Interface function calls
b_ADDIDATA_InitWatchdog() b_ADDIDATA_StartWatchdog () b_ADDIDATA_TriggerWatchdog (), also named software trigger b_ADDIDATA_StopWatchdog () b_ADDIDATA_ReleaseWatchdog ()

2.2.3

Hardware Events
The state of an output is changed, also named hardware trigger. A watchdog timeout happens.

As the software and hardware trigger have the same effect, both events are referred to as trigger (trigger = software trigger or hardware trigger).

ADDIDRIVER

Watchdog

2.3

Description
The watchdog starts in the state UNINITIALISED. The call b_ADDIDATA_InitWatchdog() changes its state into INITIALISED. From this moment on, only the process that called this function can change the initialisation of the watchdog. That is, the calls b_ADDIDATA_InitWatchdog() and b_ADDIDATA_ReleaseWatchdog() are restricted to the process and the threads belonging to this process that made the first call. All other watchdog-related calls are allowed for other processes. The call b_ADDIDATA_StartWatchdog() changes the state of the watchdog to ENABLED. In this state, the watchdog is not yet started and the value of the counter does not change. A trigger event must happen for the timeout count to begin. Only in this state, the watchdog can be started by a hardware or software trigger. A hardware trigger happens when one of the outputs is set. A software trigger results from the call b_ADDIDATA_TriggerWatchdog(). The watchdog then goes in the state RUNNING. As long as hardware or software triggers happen in the state RUNNING, the counter is reloaded and the count starts anew. If a timeout happens (the counter reaches 0), the watchdog enters the state ALARM. The predefined action relating to the outputs is then executed by the board electronic, for example setting the outputs to 0 V. The watchdog can re-enter the state RUNNING through a hardware or software trigger. The states ENABLED, RUNNING and ALARM can be left with the function call b_ADDIDATA_StopWatchdog(). As a result, the watchdog goes back in the state INITIALISED.

Watchdog

ADDIDRIVER

ADDIDRIVER

Watchdog 1) b_ADDIDATA_GetNumberOfWatchdogs (...) Syntax: <Return value> = b_ADDIDATA_GetNumberOfWatchdogs (DWORD dw_DriverHandle, PBYTE pb_WatchdogNumber, PBYTE pb_WatchdogType) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver - Output: PBYTE pb_WatchdogNumber Number of watchdogs PBYTE pb_WatchdogType Returns the type of each watchdog. See table 2-1 pb_WatchdogType [0]: Type of the first watchdog pb_WatchdogType [1]: Type of the 2nd watchdog ... pb_WatchdogType [*pb_WatchdogNumber - 1]: Type of the last watchdog Task: Returns the number of watchdogs and the type of each watchdog. Table 2-1: Watchdog type

Constant ADDIDATA_DIGITAL_OUTPUT_WATCHDOG

Value Description 1 Watchdog for the digital outputs After running-down of the watchdog, the outputs are reset. ADDIDATA_ANALOG_OUTPUT_WATCHDOG 2 Watchdog for the analog outputs After running-down of the watchdog, the outputs are reset. ADDIDATA_ANA_DIG_OUTPUT_WATCHDOG 3 Watchdog for the digital/analog outputs. After running-down of the watchdog, the digital/analog outputs are reset. ADDIDATA_SYSTEM_WATCHDOG 4 System watchdog. This watchdog can be used for the system control. Calling convention: ANSI C: BYTE b_ReturnValue; DWORD dw_DriverHandle; BYTE b_WatchdogNumber; BYTE b_WatchdogType [12]; b_ReturnValue = b_ADDIDATA_GetNumberOfWatchdog (dw_DriverHandle, &b_WatchdogNumber, b_WatchdogType); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source. 7

Watchdog 2) b_ADDIDATA_GetWatchdogInformation (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_GetWatchdogInformation (DOWRD dw_DriverHandle, BYTE b_WatchdogNumber, PBYTE pb_WatchdogTimeUnit, PBYTE pb_WatchdogTimeStep, PBYTE pb_Resolution, PDWORD pdw_HardwareGateAvailable, PDWORD pdw_HardwareTriggerAvailable, PDWORD pdw_WarningRelayAvailable, PDWORD pdw_ResetRelayAvailable, PDWORD pdw_WarningDelayAvailable) Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0.

- Output: PBYTE pb_TimerTimeUnit Time units available. See table 2-2. PWORD pw_WatchdogTimeStep Possible time steps for the watchdog PBYTE pb_Resolution Selection of the resolution for the watchdog. See table 2-3. PDWORD pdw_HardwareGateAvailable 0: Hardware gate not available. 1: Hadrware gate available. PDWORD pdw_HardwareTriggerAvailable 0: Hardware trigger not available. 1: Hadrware trigger available. PDWORD pdw_WarningRelayAvailable 0: Warning relay not available 1: Warning relay available PDWORD pdw_ResetRelayAvailable 0: Reset relay not available 1: Reset relay available PDWORD pdw_WarningDelayAvailable 0: Waiting time between the warning relay and the activation of the reset relay is not available 1: Waiting time between the warning relay and the activation of the reset relay is available. Task: Returns the time units (pb_WatchdogTimeUnit), the time steps (pw_WatchdogTimeStep) and the resolution (pb_Resolution) which can be used for the selected timer (b_TimerNumber).

ADDIDRIVER

Watchdog

Table 2-2: Watchdog timer units Value 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Description ns s ns und s ms ns und ms s und ms ns und s und ms s ns und s s und s ns und ms und s ms und s ns und ms und s s und ms und s ns und s und ms und s

Table 2-3: Resolution Value 8 12 16 24 32 Resolution 8-bit 12-bit 16-bit 24-bit 32-bit

Calling convention: ANSI C: BYTE DWORD BYTE BYTE BYTE DWORD DWORD DWORD DWORD DWORD b_ReturnValue; dw_DriverHandle; b_WatchdogTimeUnit; b_WatchdogTimeStep; b_Resolution; dw_HardwareGateAvailable; dw_HadwareTriggerAvailable; dw_WarningRelayAvailable; dw_ResetRelayAvailable; dw_WarningDelayAvailable;

b_ReturnValue = b_ADDIDATA_GetWatchdogInformation (dw_DriverHandle, 0, &b_WatchdogTimeUnit, &b_WatchdogTimeStep, &b_Resolution, &dw_HardwareGateAvailable, &dw_HadwareTriggerAvailable, &dw_WarningRelayAvailable, &dw_ResetRelayAvailable, &dw_WarningDelayAvailable); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source. 9

Watchdog 3) b_ADDIDATA_GetWatchdogInformationEx (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_GetWatchdogInformationEx (DWORD dw_DriverHandle, BYTE b_WatchdogNumber, pstr_GetWatchdogInformation ps_WatchdogInformation, DWORD dw_StructSize) Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber

DWORD dw_StructSize - Output: pstr_GetWatchdogInformation ps_WatchdogInformation Watchdog information. Returned structure: typedef struct { BYTE b_WatchdogTimeUnit; Available time unit BYTE b_Resolution; Watchdog resolution. See table 2-3 BYTE b_InterruptAvailable; FALSE: Interrupt not available TRUE: Interrupt available BYTE b_WatchdogType; Type of watchdog. See table 2-1 WORD w_WatchdogTimeStep; Time step of the watchdog BYTE b_Reserved1; reserved for alignment DWORD dw_HardwareGateAvailable; FALSE: Hardware gate not available TRUE: Hardware gate available DWORD dw_HardwareGateHighAvailable; FALSE: Hardware gate high not available TRUE: Hardware gate high available DWORD dw_HardwareGateLowAvailable; FALSE: Hardware gate low not available TRUE: Hardware gate low available DWORD dw_HardwareTriggerAvailable; FALSE: Hardware trigger not available TRUE: Hardware trigger available DWORD dw_HardwareTriggerHighAvailable; FALSE: Hardware trigger high not available TRUE: Hardware trigger high available DWORD dw_HardwareTriggerLowAvailable; FALSE: Hardware trigger low not available TRUE: Hardware trigger low available DWORD dw_WarningRelayAvailable; FALSE: Warning relay not available TRUE: Warning relay available DWORD dw_ResetRelayAvailable; FALSE: Reset relay not available TRUE: Reset relay available 10

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0. Size of the structure.

ADDIDRIVER

Watchdog

BYTE

BYTE BYTE DWORD

DWORD

DWORD

DWORD

WORD

b_ResetRelayModeConfigurable; 0: Reset mode cannot be configured 1: Reset mode can be configured b_Reserved2; b_Reserved3; dw_WarningDelayAvailable; FALSE: Warning for reset delay not available TRUE: Warning for reset delay available dw_HardwareOutputAvailable; FALSE: Output not available TRUE: Output available dw_HardwareOutputHighAvailable; FALSE: Output high not available TRUE: Output high available dw_HardwareOutputLowAvailable; FALSE: Output Low not available TRUE: Output Low available w_Reserved4;

}str_GetWatchdogInformation,*pstr_GetWatchdogInformation;

Task: Returns the time units (pb_WatchdogTimeUnit), the time steps (pw_WatchdogTimeStep) and the resolution (pb_Resolution) which can be used for the selected watchdog (b_WatchdogNumber).

Calling convention: ANSI C: BYTE b_ReturnValue; DWORD dw_DriverHandle; str_GetWatchdogInformation s_WatchdogInformation; b_ReturnValue = b_ADDIDATA_GetWatchdogInformation (dw_DriverHandle, 0, &s_WatchdogInformation, sizeof (str_GetWatchdogInformation)); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

11

Watchdog

ADDIDRIVER

4) b_ADDIDATA_InitWatchdog (...) Syntax: <Return value> = b_ADDIDATA_InitWatchdog (DWORD BYTE BYTE DWORD Parameters: - Input: DOWRD dw_DriverHandle BYTE b_WatchdogNumber BYTE b_DelayTimeUnit

dw_DriverHandle, b_WatchdogNumber, b_WatchdogTimeUnit, dw_DelayValue)

DWORD dw_DelayValue

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0. Selection of the time unit 0: ns 1: s 2: ms 3: s 4: min Start value or watchdog time (depends from the used ADDI-DATA board) see function "b_ADDIDATA_GetWatchdogInformation"

- Output: No output signal has occurred.

Task: Initialises the watchdog. Calling convention: ANSI C: BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_InitWatchdog (dw_DriverHandle, 0, 0, 1000 ); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

12

ADDIDRIVER

Watchdog

5) b_ADDIDATA_EnableDisableWatchdogInterrupt (...) Syntax: <Return value> = b_ADDIDATA_EnableDisableWatchdogInterrupt (DWORD dw_DriverHandle, BYTE b_WatchdogNumber, BYTE b_InterruptFlag) Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber BYTE b_InterruptFlag

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0. ADDIDATA_ENABLE or ADDIDATA_DISABLE

- Output: No output signal has occurred. Task: Activates or deactivates the IRQ for the watchdog process Calling convention: ANSI C: BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_EnableDisableWatchdogInterrupt (dw_DriverHandle, 0, ADDIDATA_ENABLE); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

IMPORTANT! The interrupt mask for the function is detailed in the "Interrupt" function description. (Tables 2-1).

13

Watchdog 6) b_ADDIDATA_StartWatchdog (...) Syntax: <Return value> = b_ADDIDATA_StartWatchdog Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber - Output: No output signal has occurred.

ADDIDRIVER

(DWORD dw_DriverHandle, BYTE b_WatchdogNumber)

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0.

Task: Starts the watchdog.

Calling convention: ANSI C: BYTE DWORD b_ReturnValue; dw_DriverHandle; (dw_DriverHandle, 0);

b_ReturnValue = b_ADDIDATA_StartWatchdog

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

14

ADDIDRIVER

Watchdog

7) b_ADDIDATA_StartAllWatchdogs (...) Syntax: <Return value> = b_ADDIDATA_StartAllWatchdogs (DWORD dw_DriverHandle) Parameters: - Input: DWORD dw_DriverHandle - Output: No output signal has occurred.

Handle of the ADDI-DATA driver

Task: Start all watchdogs of all boards.

Calling convention: ANSI C: BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_StartAllWatchdogs (dw_DriverHandle);

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

15

Watchdog

ADDIDRIVER

8) b_ADDIDATA_TriggerWatchdog (...) Syntax: <Return value> = b_ADDIDATA_TriggerWatchdog (DWORD dw_DriverHandle, BYTE b_WatchdogNumber) Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0.

- Output: A trigger has occurred on the watchdog

Task: Trigger the watchdog.

Calling convention: ANSI C: BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_TriggerWatchdog (dw_DriverHandle, 0);

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

16

ADDIDRIVER

Watchdog

9) b_ADDIDATA_TriggerAllWatchdogs (...) Syntax: <Return value> = b_ADDIDATA_TriggerAllWatchdogs (DWORD dw_DriverHandle) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver - Output: A trigger has occurred on the watchdog.

Task: Triggert all watchdogs on all boards.

Calling convention: ANSI C: BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_TriggerAllWatchdogs (dw_DriverHandle);

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

17

Watchdog

ADDIDRIVER

10) b_ADDIDATA_StopWatchdog (...) Syntax: <Return value> = b_ADDIDATA_StopWatchdog (DWORD BYTE Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber - Output: No output signal has occurred. dw_DriverHandle, b_WatchdogNumber)

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0.

Task: Stops the watchdog.

Calling convention: ANSI C: BYTE DWORD b_ReturnValue; dw_DriverHandle; (dw_DriverHandle, 0);

b_ReturnValue = b_ADDIDATA_StopWatchdog

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

18

ADDIDRIVER

Watchdog

11) b_ADDIDATA_StopAllWatchdogs (...) Syntax: <Return value> = b_ADDIDATA_StopAllWatchdogs (DWORD dw_DriverHandle) Parameters: - Input: DWORD dw_DriverHandle - Output: No output signal has occurred.

Handle of the ADDI-DATA driver

Task: Stops all watchdogs on all boards.

Calling convention: ANSI C: BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_StopAllWatchdogs (dw_DriverHandle);

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

19

Watchdog

ADDIDRIVER

12) b_ADDIDATA_ReleaseWatchdog (...) Syntax: <Return value> = b_ADDIDATA_ReleaseWatchdog (DWORD dw_DriverHandle, BYTE b_WatchdogNumber) Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber - Output: No output signal has occurred.

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0.

Task: Releases the watchdog for a new initialisation.

Calling convention: ANSI C: BYTE DWORD b_ReturnValue; dw_DriverHandle; (dw_DriverHandle, 0);

b_ReturnValue = b_ADDIDATA_ReleaseWatchdog

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

20

ADDIDRIVER

Watchdog

13) b_ADDIDATA_ReadWatchdogStatus (...) Syntax: <Return Value> = b_ADDIDATA_ReadWatchdogStatus (DWORD dw_DriverHandle, BYTE b_WatchdogNumber, PBYTE pb_WatchdogStatus, PBYTE pb_SoftwareTriggerStatus, PBYTE pb_HardwareTriggerStatus) Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber - Output: PBYTE pb_WatchdogStatus

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0.

0: Watchdog has run down or did not start 1: Watchdog is running PBYTE pb_SoftwareTriggerStatus 0: Software trigger did not occur 1: Software trigger occurred When the status of the software trigger is read, it is automatically reset. By the next calling of the parameter, 0 is returned if no trigger occurred during this period. PBYTE pb_HardwareTriggerStatus 0: Hardware trigger did not occur 1: Hardware trigger occurred

Task: Returns the status of the watchdog, the software trigger and the hardware trigger. Calling convention: ANSI C: BYTE DWORD BYTE BYTE BYTE b_ReturnValue; dw_DriverHandle; b_WatchdogStatus; b_SoftwareTriggerStatus; b_HardwareTriggerStatus;

b_ReturnValue = b_ADDIDATA_ReadWatchdogStatus (dw_DriverHandle, 0, &b_WatchdogStatus, &b_SoftwareTriggerStatus, &b_HardwareTriggerStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source. 21

Watchdog 14) b_ADDIDATA_EnableDisableWatchdogHardwareGate (...)

ADDIDRIVER

Syntax: <Return Value> = b_ADDIDATA_EnableDisableWatchdogHardwareGate (DWORD dw_DriverHandle, BYTE b_WatchdogNumber, BYTE b_HardwareGateFlag, BYTE b_HardwareGateLevel) Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber BYTE

BYTE

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0. b_ExternGateFlag ADDIDATA_ENABLE: enables the hardware gate. ADDIDATA_DISABLE: Hardware gate disabled by starting the watchdog b_HardwareGateLevel ADDIDATA_LOW: If the hardware gate is enabled, it is active at "0" ADDIDATA_HIGH: If the hardware gate is enabled, it is active at "1"

- Output: No output signal has occurred.

Task: Releases or blocks the action of the hardware gate. Calling convention: ANSI C: BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_EnableDisableWatchdogHardwareGate (dw_DriverHandle, 0, ADDIDATA_ENABLE, ADDIDATA_HIGH); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

22

ADDIDRIVER 15) b_ADDIDATA_GetWatchdogHardwareGateStatus (...)

Watchdog

Syntax: <Return Value> = b_ADDIDATA_GateWatchdogHardwareGateStatus (DWORD dw_DriverHandle, BYTE b_WatchdogNumber, PBYTE pb_HardwareGateStatus)

Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0.

- Output: PBYTE pb_HardwareGateStatus 0: Hardware gate is not active (low status) 1: Hardware gate is active (high status)

Task: Returns the status of the watchdog hardware gate (active or not).

Calling convention: ANSI C: BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_HardwareGateStatus;

b_ReturnValue = b_ADDIDATA_GateWatchdogHardwareGateStatus (dw_DriverHandle, 0, &b_HardwareGateStatus);

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

23

Watchdog

ADDIDRIVER

16) b_ADDIDATA_EnableDisableWatchdogHardwareTrigger (...) Syntax: <Return Value> = b_ADDIDATA_EnableDisableWatchdogHardwareTrigger (DWORD dw_DriverHandle, BYTE b_WatchdogNumber, BYTE b_HardwareTriggerFlag, BYTE b_HardwareTriggerLevel) Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber BYTE

BYTE

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0. b_HardwareTriggerFlag ADDIDATA_ENABLE: Enables the hardware trigger. ADDIDATA_DISABLE: Hardware trigger disabled by triggering the watchdog b_HardwareTriggerLevel ADDIDATA_LOW: If the hardware trigger is used, it triggers from "1" to "0" ADDIDATA_HIGH: If the hardware trigger is used, it triggers from "0" to "1" ADDIDATA_HIGH_LOW: If the hardware trigger is used, it triggers from "0" to "1" and from "1" to "0"

- Output: No output signal has occurred.

Task: Releases or blocks the action of the hardware trigger. Calling convention: ANSI C: BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_EnableDisableWatchdogHardwareTrigger (dw_DriverHandle, 0, ADDIDATA_ENABLE, ADDIDATA_HIGH); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source. 24

ADDIDRIVER

Watchdog

17) b_ADDIDATA_GetWatchdogHardwareTriggerStatus (...) Syntax: <Return Value> = b_ADDIDATA_GateWatchdogHardwareTriggerStatus (DWORD dw_DriverHandle, BYTE b_WatchdogNumber, PBYTE pb_HardwareTriggerStatus)

Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0.

- Output: PBYTE pb_HardwareTriggerStatus 0: Hardware trigger is not active (low status) 1: Hardware trigger is active (high status)

Task: Returns the status of the watchdog hardware trigger (active or not).

Calling convention: ANSI C: BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_HardwareTriggerStatus;

b_ReturnValue = b_ADDIDATA_GateWatchdogHardwareTriggerStatus (dw_DriverHandle, 0, &b_HardwareTriggerStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

25

Watchdog

ADDIDRIVER

18) b_ADDIDATA_GetWarningDelayInformation (...) Syntax: <Return value> = b_ADDIDATA_GetWarningDelayInformation (DWORD dw_DriverHandle, BYTE b_WatchdogNumber, PBYTE pb_WarningDelayTimeUnit, PBYTE pb_WarningDelayTimeStep, PBYTE pb_WarningDelayResolution) Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0.

- Output: PBYTE pb_WarningDelayTimeUnit Possible time units for the waiting time between the warning relay and the activation of the reset relay. See table 2-2. PBYTE pb_WarningDelayTimeStep Timer steps for the waiting time between the warning relay and the activation of the reset relay. PBYTE pb_WarningDelayResolution Resolution of the waiting time between the the warning relay and the activation of the reset relay. Task: Returns the time units (pb_WarningDelayTimeUnit)and the time steps (pb_WarningDelayTimeStep) which can be set for the waiting time between the warning relay and the activation of the reset relay for the selected watchdog (b_WatchdogNumber) Calling convention: ANSI C: BYTE DWORD BYTE BYTE BYTE b_ReturnValue; dw_DriverHandle; b_WarningDelayTimeUnit; b_WarningDelayTimeStep; b_WarningDelayResolution;

b_ReturnValue = b_ADDIDATA_GetWarningDelayInformation (dw_DriverHandle, 0, &b_WarningDelayTimeUnit, &b_WarningDelayTimeStep, &b_WarningDelayResolution); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source. 26

ADDIDRIVER 19) b_ADDIDATA_InitWarningDelay (...) Syntax: <Return value> = b_ADDIDATA_InitWarningDelay (DWORD BYTE BYTE DWORD

Watchdog

dw_DriverHandle, b_WatchdogNumber, b_DelayTimeUnit, dw_DelayValue)

Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_WatchdogNumber Watchdog number. The first watchdog begins from 0. BYTE b_DelayTimeUnit Time unit 0: ns 1: s 2: ms 3: s DWORD dw_DelayValue Start value or watchdog time between the warning relay and the activation of the reset delay (depends from the used ADDI-DATA board) see function "b_ADDIDATA_GetWatchdogInformation" - Output: No output signal has occurred.

Task: Initialises the waiting timer between the warning relay and the activation of the reset relay. Calling convention: ANSI C: BYTE DWORD b_ReturnValue; dw_DriverHandle;

b_ReturnValue = b_ADDIDATA_InitWarningDelay (dw_DriverHandle, 0, 0, 1000 ); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

27

Watchdog

ADDIDRIVER

20) b_ADDIDATA_EnableDisableWatchdogWarningRelay (...) Syntax: <Return Value> = b_ADDIDATA_EnableDisableWatchdogWarningRelay (DWORD dw_DriverHandle, BYTE b_WatchdogNumber, BYTE b_WarningFlag) Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber BYTE b_WarningFlag

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0. ADDIDATA_ENABLE: Enables the switching on of the warning relay after running down of the watchdog ADDIDATA_DISABLE: The warning relay is not activated after running down of the watchdog

- Output: No output signal has occurred.

Task: Releases or blocks the activation of the warning relay after running down of the watchdog.

Calling convention: ANSI C: BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableWatchdogWarningRelay (dw_DriverHandle, ADDIDATA_ENABLE); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

28

ADDIDRIVER

Watchdog

21) b_ADDIDATA_EnableDisableWatchdogResetRelay (...) Syntax: <Return Value> = b_ADDIDATA_EnableDisableWatchdogResetRelay (DWORD dw_DriverHandle, BYTE b_WatchdogNumber, BYTE b_ResetFlag) Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber BYTE b_WarningFlag

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0. ADDIDATA_ENABLE: Enables the switching on of the reset relay after running down of the watchdog ADDIDATA_DISABLE: The reset relay is not activated after running down of the watchdog

- Output: No output signal has occurred.

Task: Releases or blocks the activation of the reset relay after running down of the watchdog.

Calling convention: ANSI C: BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableWatchdogResetRelay (dw_DriverHandle, ADDIDATA_ENABLE); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

29

Watchdog

ADDIDRIVER

22) b_ADDIDATA_SetWatchdogResetRelayMode (...) Syntax: <Return Value> = b_ADDIDATA_SetWatchdogResetRelayMode (DWORD dw_DriverHandle, BYTE b_WatchdogNumber, BYTE b_ResetRelayMode) Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber BYTE b_ResetRelayMode

Handle of the ADDI-DATA driver Watchdog number. The first watchdog begins from 0. ADDIDATA_ENABLE: Reset relay is set when watchdog has run down. ADDIDATA_DISABLE: Reset relay is reset when watchdog has run down.

- Output: No output signal has occurred.

Task: Sets the mode of the reset relay during and after the running down of the watchdog.

Calling convention: ANSI C: BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableWatchdogResetRelay (dw_DriverHandle, 0, ADDIDATA_ENABLE); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

30

ADDIDRIVER

Watchdog

23) b_ADDIDATA_EnableDisableWatchdogOutput (...) Syntax: <Return value> = b_ADDIDATA_EnableDisableWatchdogOutput (DWORD dw_DriverHandle, BYTE b_WatchdogNumber, BYTE b_OutputFlag, BYTE b_OutputLevel)

Parameters: - Input: DWORD dw_DriverHandle BYTE b_WatchdogNumber BYTE BYTE b_OutputFlag b_OutputInverted

Handle of the ADDI-DATA driver Number of the watchdog The first watchdog begins from 0. ADDIDATA_ENABLE or ADDIDATA_DISABLE ADDIDATA_DISABLE: the watchdog output is not inverted. ADDIDATA_ENABLE: The watchdog output is inverted.

- Output: No output signal has occurred.

Task: Activates or deactivates the watchdog output.

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableWatchdogOutput (dw_DriverHandle, 0, ADDIDATA_ENABLE, ADDIDATA_DISABLE); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

31

Watchdog

ADDIDRIVER

24) b_ADDIDATA_GetWatchdogHardwareOutputStatus (...) Syntax: <Return Value> = b_ADDIDATA_GateWatchdogHardwareOutputStatus (DWORD dw_DriverHandle, BYTE b_WatchdogNumber, PBYTE pb_HardwareOutputStatus)

Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_WatchdogNumber Number of the watchdog The first watchdog begins from 0. - Output: PBYTE pb_HardwareOutputStatus 0: Hardware output is not active (low status) 1: Hardware output is active (high status)

Task: Returns the status of the watchdog hardware output (active or not).

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; BYTE b_HardwareOutputStatus; b_ReturnValue = b_ADDIDATA_GateWatchdogHardwareOutputStatus (dw_DriverHandle, 0, &b_HardwareOutputStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

32

ADDIDRIVER

Watchdog

25) b_ADDIDATA_TestWatchdogAsynchronousFIFOFull Syntax: <Return value> = b_ ADDIDATA_TestWatchdogAsynchronousFIFOFull (DWORD dw_DriverHandle, PBYTE pb_Full)

Parameters: - Input: DWORD dw_DriverHandle - Output: PBYTE pb_Full

Driver handle 0: Asynchronous interrupt FIFO memory not full 1: Asynchronous interrupt FIFO memory is full

Task: Tests if the asynchronous interrupt FIFO memory is full or not. The asynchronous interrupt FIFO memory is the FIFO memory in which the asynchronous events generated by the asynchronous interrupt are stored.

Calling convention: ANSI C: BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_FIFOFull

b_ReturnValue = b_ ADDIDATA_TestWatchdogAsynchronousFIFOFull (dw_DriverHandle, &b_FIFOFull); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

33

DIN EN ISO 9001:2000 certified

ADDI-DATA GmbH Airpark Business Center Airport Boulevard B210 77836 Rheinmnster Germany Phone: +49 7229 18470 Fax: +49 7229 1847222 E-mail: info@addi-data.com

Software description

ADDIDRIVER
Timer

Edition: 04.02 08/2010

Table of contents

ADDIDRIVER

1 2

INTRODUCTION...................................................................................1 SOFTWARE FUNCTIONS........................................................................2


1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) 20) 21) b_ADDIDATA_GetNumberOfTimers(...) ....................................................................... 2 b_ADDIDATA_GetTimerInformation (...) ...................................................................... 3 b_ADDIDATA_GetTimerInformationEx (...).................................................................. 6 b_ADDIDATA_InitTimer (...).......................................................................................... 8 b_ADDIDATA_EnableDisableTimerInterrupt (...)........................................................ 11 b_ADDIDATA_StartTimer (...)...................................................................................... 12 b_ADDIDATA_StartAllTimers (...) ............................................................................... 13 b_ADDIDATA_TriggerTimer (...) ................................................................................. 14 b_ADDIDATA_TriggerAllTimers (...) .......................................................................... 15 b_ADDIDATA_StopTimer (...)...................................................................................... 16 b_ADDIDATA_StopAllTimers (...) ............................................................................... 17 b_ADDIDATA_ReleaseTimer (...)................................................................................. 18 b_ADDIDATA_ReadTimerValue .................................................................................. 19 b_ADDIDATA_ReadTimerStatus (...) ........................................................................... 20 b_ADDIDATA_EnableDisableTimerHardwareGate (...) .............................................. 21 b_ADDIDATA_GetTimerHardwareGateStatus (...) ...................................................... 22 b_ADDIDATA_EnableDisableTimerHardwareTrigger (...) .......................................... 23 b_ADDIDATA_GetTimerHardwareTriggerStatus (...).................................................. 24 b_ADDIDATA_EnableDisableHardwareTimerOutput (...) ........................................... 25 b_ADDIDATA_GetTimerHardwareOutputStatus (...)................................................... 26 b_ADDIDATA_TestTimerAsynchronousFIFOFull (...) ................................................ 27

Tables
Table 1-1: Type Declaration for Windows 98/NT/2000/XP ........................................................1 Table 2-1: Timer modes..........................................................................................................4 Table 2-2: Resolution ..............................................................................................................4 Table 2-3: Time units ...............................................................................................................5 Table 2-4: Timer mode description.........................................................................................9

Introduction

ADDIDRIVER

INTRODUCTION
IMPORTANT! Note the following conventions in the text:
Function: Variable "b_ADDIDATA_GetNumberOfAnalogInputs" dw_DriverHandle

Table 1-1: Type Declaration for Windows 98/NT/2000/XP Borland C Microsoft C Borland Pascal pointer byte integer long longint var byte var integer var long var string var longint double Microsoft Visual Basic Windows any integer integer long long integer integer long string long double

VOID BYTE INT WORD DWORD PBYTE PINT PWORD PCHAR PDWORD DOUBLE

void unsigned char int unsigned short int long unsigned char * int *

void unsigned char int unsigned short int long unsigned char * int *

unsigned short int * unsigned short int * char * long * double char * long * double

ADDIDRIVER

Software functions

SOFTWARE FUNCTIONS
1) b_ADDIDATA_GetNumberOfTimers(...) Syntax: <Return value> = b_ADDIDATA_GetNumberOfTimers (DWORD dw_DriverHandle, PBYTE pb_TimerNumber) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver - Output: PBYTE pb_TimerNumber Number of timers Task: Returns the number of timers available on the board. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; BYTE b_TimerNumber; b_ReturnValue = b_ADDIDATA_GetNumberOfTimer (dw_DriverHandle, &b_TimerNumber); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Software functions

ADDIDRIVER

2) b_ADDIDATA_GetTimerInformation (...) Syntax: <Return value> = b_ADDIDATA_GetTimerInformation (DWORD dw_DriverHandle, BYTE b_TimerNumber, PBYTE pb_TimerMode, PBYTE pb_TimerTimeUnit, PWORD pw_TimerTimeStep, PBYTE pb_Resolution, PDWORD pdw_HardwareGateAvailable, PDWORD pdw_HardwareTriggerAvailable, PDWORD pdw_OutputAvailable) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_TimerNumber Number of the timer. The first timer begins from 0. - Output: PBYTE pb_TimerMode Modes available for the timer See table 3-1. PBYTE pb_TimerTimeUnit Time units available. See table 3-3. PWORD pw_TimerTimeStep Possible time steps for the timer PBYTE pb_Resolution Selection of the resolution for the timer. See table 3-2. PDWORD pdw_HardwareGateAvailable 0: Hardware gate not available. 1: Hadrware gate available. PDWORD pdw_HardwareTriggerAvailable 0: Hardware trigger not available. 1: Hadrware trigger available. PDWORD pdw_OutputAvailable 0: Hardware output not available 1: Hardware output available Task: Returns the time units (pb_TimerTimeUnit), the time steps (pw_TimerTimeStep) and the resolution (pb_Resolution) which can be used for the selected timer (b_TimerNumber)

ADDIDRIVER

Software functions

Table 2-1: Timer modes

Wert (Dec) 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

Wert (hex) 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F

Selectable modes Mode 0 available Mode 1 available Mode 0, 1 available Mode 2 available Mode 0, 2 available Mode 1, 2 available Mode 0,1,2 available Mode 3 available Mode 0, 3 available Mode 1, 3 available Mode 0,1, 3 available Mode 2, 3 available Mode 0, 2, 3 available Mode 1, 2, 3 available Mode 0, 1, 2, 3 available Mode 4 available Mode 0, 4 available Mode 1, 4 available Mode 0, 1, 4 available Mode 2, 4 available Mode 0, 2, 4 available Mode 1, 2, 4 available Mode 0, 1, 2, 4 available Mode 3, 4 available Mode 0, 3, 4 available Mode 1, 3, 4 available Mode 0, 1, 3, 4 available Mode 2, 3, 4 available Mode 0, 2, 3, 4 available Mode 1, 2, 3, 4 available Mode 0, 1, 2, 3, 4 available

Wert (Dec) 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

Wert (hex) 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F

Selectable modes Mode 5 available Mode 0, 5 available Mode 1, 5 available Mode 0, 1, 5 available Mode 2, 5 available Mode 0, 2, 5 available Mode 1, 2, 5 available Mode 0,1,2,5 available Mode 3, 5 available Mode 0, 3, 5 available Mode 1, 3, 5 available Mode 0,1, 3, 5 available Mode 2, 3, 5 available Mode 0, 2, 3, 5 available Mode 1, 2, 3, 5 available Mode 0, 1, 2, 3, 5 available Mode 4, 5 available Mode 0, 4, 5 available Mode 1, 4, 5 available Mode 0, 1, 4, 5 available Mode 2, 4, 5 available Mode 0, 2, 4, 5 available Mode 1, 2, 4, 5 available Mode 0, 1, 2, 4, 5 available Mode 3, 4, 5 available Mode 0, 3, 4, 5 available Mode 1, 3, 4, 5 available Mode 0, 1, 3, 4, 5 available Mode 2, 3, 4, 5 available Mode 0, 2, 3, 4, 5 available Mode 1, 2, 3, 4, 5 available Mode 0, 1, 2, 3, 4, 5 available

Table 2-2: Resolution Value 8 12 16 24 32 Resolution 8-bit 12-bit 16-bit 24-bit 32-bit

Software functions

ADDIDRIVER

Table 2-3: Time units Value 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Description ns s ns und s ms ns und ms s und ms ns und s und ms s ns und s s und s ns und ms und s ms und s ns und ms und s s und ms und s ns und s und ms und s

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; BYTE b_TimerMode; BYTE b_TimerTimeUnit; WORD w_TimerTimeStep; BYTE b_Resolution; DWORD dw_HardwareGateAvailable; DWORD dw_HardwareTriggerAvailable; DWORD dw_OutputAvailable; b_ReturnValue = b_ADDIDATA_GetTimerInformation (dw_DriverHandle, 0, &b_TimerMode, &b_TimerTimeUnit &w_TimerTimeStep, &b_Resolution, &dw_HardwareGateAvailable, &dw_HardwareTriggerAvailable, &dw_OutputAvailable); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER

Software functions

3) b_ADDIDATA_GetTimerInformationEx (...) Syntax: <Return value> = b_ADDIDATA_GetTimerInformationEx (DWORD dw_DriverHandle, BYTE b_TimerNumber, pstr_GetTimerInformation ps_TimerInformation, DWORD dw_StructSize) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_TimerNumber Timer number. The first timer begins from 0. DWORD dw_StructSize Size of the structure. - Output: pstr_GetTimerInformation ps_TimerInformation Timer information. structure returned : typedef struct { BYTE BYTE BYTE BYTE b_TimerMode; b_TimerTimeUnit; b_Resolution; b_InterruptAvailable; Available timer mode Available time unit Timer resolution. See table 2-3

WORD WORD DWORD

DWORD

DWORD

DWORD

DWORD

DWORD

DWORD

DWORD

FALSE : Interrupt not available TRUE : Interrupt available w_TimerTimeStep; Time step of the timer w_Reserved1; dw_HardwareGateAvailable; FALSE :Hardware gate not available TRUE : Hardware gate available dw_HardwareGateLowAvailable; FALSE :Hardware gate low not available TRUE : Hardware gate low available dw_HardwareGateHighAvailable; FALSE :Hardware gate high not available TRUE : Hardware gate high available dw_HardwareTriggerAvailable; FALSE :Hardware trigger not available TRUE : Hardware trigger available dw_HardwareTriggerLowAvailable; FALSE :Hardware trigger low not available TRUE : Hardware trigger low available dw_HardwareTriggerHighAvailable; FALSE :Hardware trigger high not available TRUE : Hardware trigger high available dw_HardwareOutputAvailable; FALSE :Hardware output not available TRUE : Hardware output available dw_HardwareOutputLowAvailable; FALSE :Hardware output low not available TRUE : Hardware output low available

Software functions

ADDIDRIVER

DWORD dw_HardwareOutputHighAvailable; FALSE :Hardware output high not available TRUE : Hardware output high available DWORD dw_Reserved3; }str_GetTimerInformation,*pstr_GetTimerInformation; Task: Returns the time units (pb_TimerTimeUnit), the time steps (pw_TimerTimeStep) and the resolution (pb_Resolution) which can be used for the selected timer (b_TimerNumber) Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; str_GetTimerInformation s_TimerInformation; b_ReturnValue = b_ADDIDATA_GetTimerInformation (dw_DriverHandle, 0, &s_TimerInformation, sizeof (str_GetTimerInformation)); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER

Software functions

4) b_ADDIDATA_InitTimer (...) Syntax: <Return value> = b_ADDIDATA_InitTimer (DWORD BYTE BYTE BYTE DWORD Parameters: - Input: DWORD dw_DriverHandle BYTE b_TimerNumber BYTE BYTE b_TimerMode b_TimerTimeUnit dw_DriverHandle, b_TimerNumber, b_TimerMode, b_TimerTimeUnit, dw_ReloadValue)

DWORD

dw_ReloadValue

Handle of the ADDI-DATA driver Number of the timer The first timer begins from 0. Selection of the timer mode. See table 3-4 Selection of the time unit 0: ns 1: s 2: ms 3: s 4: min Start value or time interval (depends from the used ADDI-DATA board) see function "b_ADDIDATA_GetTimerInformation"

- Output: No output signal has occurred. Task: Initialises the timer.

Software functions

ADDIDRIVER

Table 2-4: Timer mode description Selected mode 0 Mode description dw_ReloadValue description Start counting value
Hardware gate input action

Mode 0 is typically used for event counting. After the initialisation, OUT is initially low, and remains low until the counter reaches 0. OUT goes high and remains high until a new count is written. See "b_ADDIDATA_WriteTimerValue" function. Mode 1 is similar to mode 0 except for the gate input action. The gate input is not used to enable or disable the timer (like in Mode 0), but to trigger it.

Hardware gate

Start counting value

Hardware trigger

This mode functions like a divide-byDivider factor ul_ReloadValue counter. It is used to generate a real time clock interrupt. OUT is initially high after the initialisation. When the initial count has decremented to 1, OUT goes low for one CLK pulse. OUT then goes high again, the counter reloads the initial count (ul_ReloadValue) and the process is repeated. This action can generate an interrupt. See function "b_ADDIDATA_SetFunctionalityIntRoutine" and "b_ADDIDATA_EnableDisableTimerInterrupt" Mode 3 is typically used for baud rate generation. This mode is similar to mode 2 except for the duty cycle of OUT. OUT will initially be high after the initialisation. When half the initial count (ul_ReloadValue) has expired, OUT goes low for the remainder of the count. The mode is periodic; the sequence above is repeated indefinitely. OUT is initially high after the initialisation. When the initial count expires, OUT will go low for one CLK pulse and then go high again. The counting sequence is triggered by writing a new value. See "i_ADDIDATA_WriteTimerValue" function. If a new count is written during counting, it will be loaded on the next CLK pulse. Divider factor

Hardware gate

Hardware gate

Start counting value

Hardware gate

Mode 5 is similar to mode 4 except for the gate input Start counting action. value The gate input is not used to enable or disable the timer, but to trigger it.

Hardware trigger

ADDIDRIVER

Software functions

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_InitTimer (dw_DriverHandle, 0, 0, 0, 1000 ); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

10

Software functions

ADDIDRIVER

5) b_ADDIDATA_EnableDisableTimerInterrupt (...) Syntax: <Return value> = b_ADDIDATA_EnableDisableTimerInterrupt (DWORD dw_DriverHandle, BYTE b_TimerNumber, BYTE b_InterruptFlag) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_TimerNumber Number of the timer The first timer begins from 0. BYTE b_InterruptFlag ADDIDATA_ENABLE or ADDIDATA_DISABLE - Output: No output signal has occurred. Task: Enables or disables the IRQ for the timer process. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableTimerInterrupt (dw_DriverHandle, 0, ADDIDATA_ENABLE); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

IMPORTANT! The interrupt mask for the function is detailled in the "Interrupt" function description. (Tables 2-1 and 2-2).

11

ADDIDRIVER

Software functions

6) b_ADDIDATA_StartTimer (...) Syntax: <Return value> = b_ADDIDATA_StartTimer (DWORD dw_DriverHandle, BYTE b_TimerNumber)

Parameters: - Input: DWORD dw_DriverHandle BYTE b_TimerNumber - Output: No output signal has occurred. Task: Starts the timer. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

Handle of the ADDI-DATA driver Number of the timer The first timer begins from 0.

b_ReturnValue = b_ADDIDATA_StartTimer

(dw_DriverHandle, 0);

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

12

Software functions

ADDIDRIVER

7) b_ADDIDATA_StartAllTimers (...) Syntax: <Return value> = b_ADDIDATA_StartAllTimers Parameters: - Input: DWORD dw_DriverHandle - Output: No output signal has occurred. Task: Starts all timers of the board. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle; (DWORD dw_DriverHandle)

Handle of the ADDI-DATA driver

b_ReturnValue = b_ADDIDATA_StartAllTimers (dw_DriverHandle); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

13

ADDIDRIVER

Software functions

8) b_ADDIDATA_TriggerTimer (...) Syntax: <Return value> = b_ADDIDATA_TriggerTimer (DWORD dw_DriverHandle, BYTE b_TimerNumber)

Parameters: - Input: DWORD dw_DriverHandle BYTE b_TimerNumber - Output: A trigger occurs on the timer. Task: Triggers the timer. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

Handle of the ADDI-DATA driver Number of the timer The first timer begins from 0.

b_ReturnValue = b_ADDIDATA_TriggerTimer

(dw_DriverHandle, 0);

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

14

Software functions

ADDIDRIVER

9) b_ADDIDATA_TriggerAllTimers (...) Syntax: <Return value> = b_ADDIDATA_TriggerAllTimers (DWORD dw_DriverHandle) Parameters: - Input: DWORD dw_DriverHandle - Output: A trigger occurs on the timer. Task: Triggers all timers of all boards. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle; (dw_DriverHandle);

Handle of the ADDI-DATA driver

b_ReturnValue = b_ADDIDATA_TriggerAllTimers

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

15

ADDIDRIVER

Software functions

10) b_ADDIDATA_StopTimer (...) Syntax: <Return value> = b_ADDIDATA_StopTimer (DWORD dw_DriverHandle, BYTE b_TimerNumber)

Parameters: - Input: DWORD dw_DriverHandle BYTE b_TimerNumber - Output: No output signal has occurred. Task: Stops the timer. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle;

Handle of the ADDI-DATA driver Number of the timer The first timer begins from 0.

b_ReturnValue = b_ADDIDATA_StopTimer

(dw_DriverHandle, 0);

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

16

Software functions

ADDIDRIVER

11) b_ADDIDATA_StopAllTimers (...) Syntax: <Return value> = b_ADDIDATA_StopAllTimers Parameters: - Input: DWORD dw_DriverHandle - Output: No output signal has occurred. Task: Stops all timers of all boards. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle; (DWORD dw_DriverHandle)

Handle of the ADDI-DATA driver

b_ReturnValue = b_ADDIDATA_StopAllTimers (dw_DriverHandle); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

17

ADDIDRIVER

Software functions

12) b_ADDIDATA_ReleaseTimer (...) Syntax: <Return value> = b_ADDIDATA_ReleaseTimer (DWORD dw_DriverHandle, BYTE b_TimerNumber)

Parameters: - Input: DWORD dw_DriverHandle BYTE b_TimerNumber - Output: No output signal has occurred.

Handle of the ADDI-DATA driver Number of the timer The first timer begins from 0.

Task: Releases the timer for a new initialisation. Calling convention: ANSI C : BYTE DWORD b_ReturnValue; dw_DriverHandle; (dw_DriverHandle, 0);

b_ReturnValue = b_ADDIDATA_ReleaseTimer

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

18

Software functions

ADDIDRIVER

13) b_ADDIDATA_ReadTimerValue <Return value> = b_ADDIDATA_ReadTimerValue (DWORD dw_DriverHandle, BYTE b_TimerNumber, PDWORD pdw_TimerValue)

Parameters: - Input: DWORD dw_DriverHandle BYTE b_TimerNumber - Output: PDWORD pdw_TimerValue Task: Reads the timer value. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; DWORD dw_TimerValue;

Handle of the ADDI-DATA driver Number of the timer The first timer begins from 0. Timer value.

b_ReturnValue = b_ADDIDATA_ReadTimerValue (dw_DriverHandle, 0, &dw_TimerValue); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

19

ADDIDRIVER

Software functions

14) b_ADDIDATA_ReadTimerStatus (...) Syntax: <Return Value> = b_ADDIDATA_ReadTimerStatus (DWORD dw_DriverHandle, BYTE b_TimerNumber, PBYTE pb_TimerStatus, PBYTE pb_SoftwareTriggerStatus, PBYTE pb_HardwareTriggerStatus) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_TimerNumber Number of the timer. The first timer begins from 0. - Output: PBYTE pb_TimerStatus 0: Timer ran down or did not start 1: Timer is running PBYTE pb_SoftwareTriggerStatus 0: Software trigger did not occur 1: Software trigger occurred When the status of the software trigger is read, it is automatically reset. By the next calling of the parameter, 0 is returned if no trigger occurred during this period. PBYTE pb_HardwareTriggerStatus 0: Hardware trigger did not occur 1: Hardware trigger occurred Task: Returns the status of the timer, the software trigger and the hardware trigger. Calling convention: ANSI C : BYTE DWORD BYTE BYTE BYTE b_ReturnValue; dw_DriverHandle; b_TimerStatus; b_SoftwareTriggerStatus; b_HardwareTriggerStatus;

b_ReturnValue = b_ADDIDATA_ReadTimerStatus (dw_DriverHandle, 0, &b_TimerStatus, &b_SoftwareTriggerStatus, &b_HardwareTriggerStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

20

Software functions

ADDIDRIVER

15) b_ADDIDATA_EnableDisableTimerHardwareGate (...) Syntax: <Return Value> = b_ADDIDATA_EnableDisableTimerHardwareGate (DWORD dw_DriverHandle, BYTE b_TimerNumber, BYTE b_HardwareGateFlag, BYTE b_HardwareGateLevel) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_TimerNumber Number of the timer The first timer begins from 0. BYTE b_ExternGateFlag ADDIDATA_ENABLE: enables the Hardware Gate. ADDIDATA_DISABLE: Hardware Gate disabled by starting the timer BYTE b_HardwareGateLevel ADDIDATA_LOW: If the hardware gate is enabled, it is active at "0" ADDIDATA_HIGH: If the hardware gate is enabled, it is active at "1" - Output: No output signal has occurred Task: Releases or blocks the action of the hardware gate. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableTimerHardwareGate (dw_DriverHandle, 0, ADDIDATA_ENABLE, ADDIDATA_HIGH); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

21

ADDIDRIVER

Software functions

16) b_ADDIDATA_GetTimerHardwareGateStatus (...) Syntax: <Return Value> = b_ADDIDATA_GateTimerHardwareGateStatus (DWORD dw_DriverHandle, BYTE b_TimerNumber, PBYTE pb_HardwareGateStatus) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_TimerNumber Number of the timer The first timer begins from 0. - Output: PBYTE pb_HardwareGateStatus 0: Hardware gate is not active (Low status) 1: Hardware gate is active (High status) Task: Returns the status of the timer hardware gate (Active or not). Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_HardwareGateStatus;

b_ReturnValue = b_ADDIDATA_GateTimerHardwareGateStatus (dw_DriverHandle, 0, &b_HardwareGateStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

22

Software functions

ADDIDRIVER

17) b_ADDIDATA_EnableDisableTimerHardwareTrigger (...) Syntax: <Return Value> = b_ADDIDATA_EnableDisableTimerHardwareTrigger (DWORD dw_DriverHandle, BYTE b_TimerNumber, BYTE b_HardwareTriggerFlag, BYTE b_HardwareTriggerLevel) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_TimerNumber Number of the timer The first timer begins from 0. BYTE b_HardwareTriggerFlag ADDIDATA_ENABLE: Enables the hardware trigger. ADDIDATA_DISABLE: Hardware trigger disabled by triggering the timer BYTE b_HardwareTriggerLevel ADDIDATA_LOW: If the hardware trigger is used, it triggers from "1" to "0" ADDIDATA_HIGH: If the hardware trigger is used, it triggers from "0" to "1" ADDIDATA_HIGH_LOW: If the hardware trigger is used, it triggers from "0" to "1" and from "1" to "0" - Output: No output signal has occurred. Task: Releases or blocks the action of the hardware trigger. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableTimerHardwareTrigger (dw_DriverHandle, 0, ADDIDATA_ENABLE, ADDIDATA_HIGH); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

23

ADDIDRIVER

Software functions

18) b_ADDIDATA_GetTimerHardwareTriggerStatus (...) Syntax: <Return Value> = b_ADDIDATA_GateTimerHardwareTriggerStatus (DWORD dw_DriverHandle, BYTE b_TimerNumber, PBYTE pb_HardwareTriggerStatus) Parameters: - Input: DWORD dw_DriverHandle BYTE b_TimerNumber

Handle of the ADDI-DATA driver Number of the timer The first timer begins from 0.

- Output: PBYTE pb_HardwareTriggerStatus 0: Hardware trigger is not active (Low status) 1: Hardware trigger is active (High status) Task: Returns the status of the hardware trigger (Active or not). Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_HardwareTriggerStatus;

b_ReturnValue = b_ADDIDATA_GateTimerHardwareTriggerStatus (dw_DriverHandle, 0, &b_HardwareTriggerStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

24

Software functions

ADDIDRIVER

19) b_ADDIDATA_EnableDisableHardwareTimerOutput (...) Syntax: <Return value> = b_ADDIDATA_EnableDisableTimerHardwareOutput (DWORD dw_DriverHandle, BYTE b_TimerNumber, BYTE b_OutputFlag, BYTE b_OutputLevel) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_TimerNumber Number of the timer The first timer begins from 0. BYTE b_OutputFlag ADDIDATA_ENABLE or ADDIDATA_DISABLE BYTE b_OutputInverted ADDIDATA_DISABLE: the timer output is not inverted. ADDIDATA_ENABLE: The timer output is inverted. - Output: No output signal has occurred. Task: Activates or deactivates the timer output. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableTimerHardwareOutput (dw_DriverHandle, 0, ADDIDATA_ENABLE, ADDIDATA_DISABLE); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

25

ADDIDRIVER

Software functions

20) b_ADDIDATA_GetTimerHardwareOutputStatus (...) Syntax: <Return Value> = b_ADDIDATA_GateTimerHardwareOutputStatus (DWORD dw_DriverHandle, BYTE b_TimerNumber, PBYTE pb_HardwareOutputStatus) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_TimerNumber Number of the timer The first timer begins from 0. - Output: PBYTE pb_HardwareOutputStatus 0: Hardware output is not active (Low status) 1: Hardware output is acticve (High status) Task: Returns the status of the timer hardware output (Active or not). Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_HardwareOutputStatus;

b_ReturnValue = b_ADDIDATA_GateTimerHardwareOutputStatus (dw_DriverHandle, 0, &b_HardwareOutputStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

26

Software functions

ADDIDRIVER

21) b_ADDIDATA_TestTimerAsynchronousFIFOFull (...) Syntax: <Return value> = b_ ADDIDATA_TestTimerAsynchronousFIFOFull (DWORD dw_DriverHandle, PBYTE pb_Full) Parameters: - Input: DWORD dw_DriverHandle - Output: PBYTE pb_Full

Driver handle 0: Asynchronous interrupt FIFO memory not full 1: Asynchronous interrupt FIFO memory is full

Task: Tests if the asynchronous interrupt FIFO memory is full or not. The asynchronous interrupt FIFO memory is the FIFO memory in which the asynchronous events generated by the asynchronous interrupt are stored. Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_FIFOFull

b_ReturnValue = b_ ADDIDATA_TestTimerAsynchronousFIFOFull (dw_DriverHandle, &b_FIFOFull); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

27

DIN EN ISO 9001:2000 certified

ADDI-DATA GmbH Airpark Business Center Airport Boulevard B210 77836 Rheinmnster Germany Phone: +49 7229 18470 Fax: +49 7229 1847222 E-mail: info@addi-data.com

Software description

ADDIDRIVER
Counter

Edition: 05.02 - 08/2010

Table of contents

ADDIDRIVER

1 2

INTRODUCTION...................................................................................1 COUNTER FUNCTIONS .........................................................................2


1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14) 15) 16) 17) 18) 19) 20) 21) 22) 23) b_ADDIDATA_GetNumberOfCounters(...) .................................................................... 2 b_ADDIDATA_GetCounterInformation (...) ................................................................... 3 b_ADDIDATA_GetCounterInformationEx (...)............................................................... 5 b_ADDIDATA_InitCounter (...) ...................................................................................... 7 b_ADDIDATA_SetCounterDirection (...)........................................................................ 8 b_ADDIDATA_EnableDisableCounterInterrupt (...)....................................................... 9 b_ADDIDATA_StartCounter (...) .................................................................................. 10 b_ADDIDATA_StartAllCounters (...)............................................................................ 11 b_ADDIDATA_ClearCounter (...) ................................................................................. 12 b_ADDIDATA_TriggerCounter (...) .............................................................................. 13 b_ADDIDATA_TriggerAllCounters (...) ....................................................................... 14 b_ADDIDATA_StopCounter (...)................................................................................... 15 b_ADDIDATA_StopAllCounters (...) ............................................................................ 16 b_ADDIDATA_ReleaseCounter (...).............................................................................. 17 b_ADDIDATA_ReadCounterValue ............................................................................... 18 b_ADDIDATA_ReadCounterStatus (...) ........................................................................ 19 b_ADDIDATA_EnableDisableCounterHardwareGate (...) ........................................... 21 b_ADDIDATA_GetCounterHardwareGateStatus (...) ................................................... 22 b_ADDIDATA_EnableDisableCounterHardwareTrigger (...) ....................................... 23 b_ADDIDATA_GetCounterHardwareTriggerStatus (...)............................................... 24 b_ADDIDATA_EnableDisableCounterHardwareOutput (...)........................................ 25 b_ADDIDATA_GetCounterHardwareOutputStatus (...)................................................ 26 b_ADDIDATA_TestCounterAsynchronousFIFOFull ()............................................ 27

Tables
Table 1-1: Type Declaration for Windows 98/NT/2000/XP ........................................................1 Table 2-1: Resolution ..............................................................................................................4

Introduction

ADDIDRIVER

INTRODUCTION
IMPORTANT! Note the following conventions in the text:
Function: Variable "b_ADDIDATA_GetNumberOfAnalogInputs" dw_DriverHandle

Table 1-1: Type Declaration for Windows 98/NT/2000/XP Borland C Microsoft C Borland Pascal pointer byte integer long longint var byte var integer var long var string var longint double Microsoft Visual Basic Windows any integer integer long long integer integer long string long double

VOID BYTE INT WORD DWORD PBYTE PINT PWORD PCHAR PDWORD DOUBLE

void unsigned char int unsigned short int long unsigned char * int *

void unsigned char int unsigned short int long unsigned char * int *

unsigned short int * unsigned short int * char * long * double char * long * double

ADDIDRIVER

Counter

COUNTER FUNCTIONS
1) b_ADDIDATA_GetNumberOfCounters(...) Syntax: <Return value> = b_ADDIDATA_GetNumberOfCounters (DWORD dw_DriverHandle, PBYTE pb_CounterNumber) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver - Output: PBYTE pb_CounterNumber Number of counters Task: Returns the number of counters available on the board. Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_CounterNumber;

b_ReturnValue = b_ADDIDATA_GetNumberOfCounters (dw_DriverHandle, &b_CounterNumber); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Counter 2) b_ADDIDATA_GetCounterInformation (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_GetCounterInformation (DWORD dw_DriverHandle, BYTE b_CounterNumber, PBYTE pb_Resolution, PBYTE pb_InterruptAvailable, PDWORD pdw_InputLevelSelection, PDWORD pdw_HardwareGateAvailable, PDWORD pdw_HardwareTriggerAvailable, PDWORD pdw_OutputAvailable, PDWORD pdw_UpDownSelection) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_CounterNumber Number of the counter. The first counter begins from 0. - Output: PBYTE pb_Resolution Selection of the resolution for the counter. See table 2-1. PBYTE pb_InterruptAvailable 0 : Counter cannot generate an interrupt 1 : Counter can generate an interrupt PDWORD pdw_InputLevelSelection 1 : Counter only counts low pulses 2 : Counter only counts high pulses 3 : Counter can count low and high pulses PDWORD pdw_HardwareGateAvailable 0: Hardware gate not available. 1: Hadrware gate available. PDWORD pdw_HardwareTriggerAvailable 0: Hardware trigger not available. 1: Hadrware trigger available. PDWORD pdw_OutputAvailable 0: Hardware output not available 1: Hardware output available PDWORD pdw_UpDownSelection 0: Up/Down selection not available and counter counts down 1: Up/Down selection not available and counter counts upwards 2: Up/Down selection available

ADDIDRIVER

Counter

Task: Returns the hardware gate (pdw_HardwareGateAvailable), the hardware trigger (pdw_HardwareTriggerAvailable), the up/down selection (pdw_UpDownSelection) and the resolution (pb_Resolution) which can be used for the selected counter (b_CounterNumber). Table 2-1: Resolution Value 8 12 16 24 32 Resolution 8-bit 12-bit 16-bit 24-bit 32-bit

Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; BYTE b_Resolution; BYTE b_InterruptAvailable; DWORD dw_InputLevelSelection; DWORD dw_HardwareGateAvailable; DWORD dw_HardwareTriggerAvailable; DWORD dw_OutputAvailable; DWORD dw_UpDownSelection; b_ReturnValue = b_ADDIDATA_GetCounterInformation (dw_DriverHandle, 0, &b_Resolution, &b_InterruptAvailable, &dw_InputLevelSelection, &dw_HardwareGateAvailable, &dw_HardwareTriggerAvailable, &dw_OutputAvailable, &dw_UpDownSelection); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Counter 3) b_ADDIDATA_GetCounterInformationEx (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_GetCounterInformationEx (DWORD dw_DriverHandle, BYTE b_CounterNumber, pstr_GetCounterInformation ps_CounterInformation, DWORD dw_StructSize) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_CounterNumber Counter number. The first counter begins from 0. DWORD dw_StructSize Size of the structure. - Output: pstr_GetCounterInformation ps_CounterInformation Counter information. structure returned : typedef struct { BYTE BYTE b_Resolution; b_InterruptAvailable; Counter resolution. See table 2-3 FALSE : Interrupt not available TRUE : Interrupt available WORD w_Reserved1; DWORD dw_InputLevelSelection; Level selection of the counter DWORD dw_HardwareGateAvailable; FALSE :Hardware gate not available TRUE : Hardware gate available DWORD dw_HardwareGateLowAvailable; FALSE :Hardware gate low not available TRUE : Hardware gate low available DWORD dw_HardwareGateHighAvailable; FALSE :Hardware gate high not available TRUE : Hardware gate high available DWORD dw_HardwareTriggerAvailable; FALSE :Hardware trigger not available TRUE : Hardware trigger available DWORD dw_HardwareTriggerLowAvailable; FALSE :Hardware trigger low not available TRUE : Hardware trigger low available DWORD dw_HardwareTriggerHighAvailable; FALSE :Hardware trigger high not available TRUE : Hardware trigger high available DWORD dw_HardwareOutputAvailable; FALSE :Hardware output not available TRUE : Hardware output available DWORD dw_HardwareOutputLowAvailable; FALSE :Hardware output low not available TRUE : Hardware output low available 5

ADDIDRIVER

Counter

DWORD dw_HardwareOutputHighAvailable; FALSE :Hardware output high not available TRUE : Hardware output high available DWORD dw_UpDownSelection; Up/down counting selection of the counter

}str_GetCounterInformation,*pstr_GetCounterInformation; Task: Returns the time units (pb_CounterTimeUnit), the time steps (pw_CounterTimeStep) and the resolution (pb_Resolution) which can be used for the selected counter (b_CounterNumber) Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; str_GetCounterInformation s_CounterInformation; b_ReturnValue = b_ADDIDATA_GetCounterInformation (dw_DriverHandle, 0, &s_CounterInformation, sizeof (str_GetCounterInformation)); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Counter 4) b_ADDIDATA_InitCounter (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_InitCounter (DWORD dw_DriverHandle, BYTE b_CounterNumber, BYTE b_LevelSelection DWORD dw_ReloadValue) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_CounterNumber Number of the counter The first counter begins from 0. BYTE b_LevelSelection ADDIDATA_LOW : Counter counts low levels ADDIDATA_HIGH : Counter counts high levels ADDIDATA_LOW_HIGH: Counter counts high and low levels This parameter has no influence if the selection of the counter direction is not possible. See the function b_ADDIDATA_GetCounterInformation DWORD dw_ReloadValue Reload or overflow value (depends from the used ADDI-DATA board) see function "b_ADDIDATA_SetCounterDirection" - Output: No output signal has occurred. Task: Initialises the counter. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_InitCounter (dw_DriverHandle, 0, ADDIDATA_HIGH, 1000); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

ADDIDRIVER 5) b_ADDIDATA_SetCounterDirection (...)

Counter

IMPORTANT! The function b_ADDIDATA_SetCounterDirection must be called up before calling up the function b_ADDIDATA_StartCounter.
The function b_ADDIDATA_SetCounterDirection generates a software trigger which loads the initialisation values necessary for the function b_ADDIDATA_StartCounter. Syntax: <Return value> = b_ADDIDATA_SetCounterDirection (DWORD dw_DriverHandle, BYTE b_CounterNumber, BYTE b_DirectionSelection) Parameters: - Input: DWORD dw_DriverHandle BYTE b_CounterNumber BYTE b_DirectionSelection

Handle of the ADDI-DATA driver Number of the counter The first counter begins from 0. ADDIDATA_UP: Selects the counter for up-counting ADDI_DATA_DOWN : Selects the counter for down-counting

Output: No output signal has occurred. Task: Sets the counting direction (upward or downward) Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_SetCounterDirection (dw_DriverHandle, 0, ADDIDATA_DOWN); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

Counter 6) b_ADDIDATA_EnableDisableCounterInterrupt (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_EnableDisableCounterInterrupt (DWORD dw_DriverHandle, BYTE b_CounterNumber, BYTE b_InterruptFlag) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_CounterNumber Number of the counter The first counter begins from 0. BYTE b_InterruptFlag ADDIDATA_ENABLE or ADDIDATA_DISABLE - Output: No output signal has occurred. Task: Enables or disables the IRQ for the counter process. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableCounterInterrupt (dw_DriverHandle, 0, ADDIDATA_ENABLE); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

IMPORTANT! The interrupt mask for the function is detailed in the "Interrupt" function description. (Tables 2-1 and 2-2).

ADDIDRIVER 7) b_ADDIDATA_StartCounter (...)

Counter

IMPORTANT! The function b_ADDIDATA_SetCounterDirection must be called up before calling up the function b_ADDIDATA_StartCounter.
The function b_ADDIDATA_SetCounterDirection generates a software trigger which loads the initialisation values necessary for the function b_ADDIDATA_StartCounter. Syntax: <Return value> = b_ADDIDATA_StartCounter (DWORD dw_DriverHandle, BYTE b_CounterNumber) Parameters: - Input: DWORD dw_DriverHandle BYTE b_CounterNumber - Output: No output signal has occurred. Task: Starts the counter. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_StartCounter (dw_DriverHandle, 0);

Handle of the ADDI-DATA driver Number of the counter The first counter begins from 0.

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

10

Counter 8) b_ADDIDATA_StartAllCounters (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_StartAllCounters (DWORD dw_DriverHandle) Parameters: - Input: DWORD dw_DriverHandle - Output: No output signal has occurred. Task: Starts all counters of the board. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_StartAllCounters (dw_DriverHandle);

Handle of the ADDI-DATA driver

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

11

ADDIDRIVER 9) b_ADDIDATA_ClearCounter (...)

Counter

Syntax: <Return value> = b_ADDIDATA_ClearCounter (DWORD dw_DriverHandle, BYTE b_CounterNumber) Parameters: - Input: DWORD dw_DriverHandle BYTE b_CounterNumber - Output: A clear action occurs on the counter. Task: Clear the counter. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_ClearCounter (dw_DriverHandle, 0);

Handle of the ADDI-DATA driver Number of the counter The first counter begins from 0.

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

12

Counter 10) b_ADDIDATA_TriggerCounter (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_TriggerCounter (DWORD dw_DriverHandle, BYTE b_CounterNumber) Parameters: - Input: DWORD dw_DriverHandle BYTE b_CounterNumber

Handle of the ADDI-DATA driver Number of the counter First counter begins from 0.

- Output: A trigger action occurs on the counter. Task: Trigger the counter. If you have selected ADDIDATA_DOWN for the function b_ADDIDATA_SetCounterDirection, the counter reloads the start value. If you have selected ADDIDATA_UP for the function b_ADDIDATA_SetCounterDirection, the counter is cleared. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_TriggerCounter (dw_DriverHandle, 0); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

13

ADDIDRIVER 11) b_ADDIDATA_TriggerAllCounters (...)

Counter

Syntax: <Return value> = b_ADDIDATA_TriggerAllCounters (DWORD dw_DriverHandle) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver - Output: A trigger action occurs on the counter. Task: Trigger all counters of the board. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_TriggerAllCounters (dw_DriverHandle);

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

14

Counter 12) b_ADDIDATA_StopCounter (...) Syntax: <Return value> = b_ADDIDATA_StopCounter (DWORD BYTE

ADDIDRIVER

dw_DriverHandle, b_CounterNumber)

Parameters: - Input: DWORD dw_DriverHandle BYTE b_CounterNumber - Output: No output signal has occurred. Task: Stops the counter. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle;

Handle of the ADDI-DATA driver Number of the counter The first counter begins from 0.

b_ReturnValue = b_ADDIDATA_StopCounter

(dw_DriverHandle, 0);

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

15

ADDIDRIVER 13) b_ADDIDATA_StopAllCounters (...) Syntax: <Return value> = b_ADDIDATA_StopAllCounters Parameters: - Input: DWORD dw_DriverHandle - Output: No output signal has occurred. Task: Stops all counters of the board. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_StopAllCounters(dw_DriverHandle);

Counter

(DWORD dw_DriverHandle)

Handle of the ADDI-DATA driver

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

16

Counter 14) b_ADDIDATA_ReleaseCounter (...) Syntax: <Return value> = b_ADDIDATA_ReleaseCounter

ADDIDRIVER

(DWORD dw_DriverHandle, BYTE b_CounterNumber)

Parameters: - Input: DWORD dw_DriverHandle BYTE b_CounterNumber - Output: No output signal has occurred.

Handle of the ADDI-DATA driver Number of the counter First counter begins from 0.

Task: Releases the counter for a new initialisation. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_ReleaseCounter (dw_DriverHandle, 0); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

17

ADDIDRIVER 15) b_ADDIDATA_ReadCounterValue Syntax: <Return value> = b_ADDIDATA_ReadCounterValue (DWORD dw_DriverHandle, BYTE b_CounterNumber, PDWORD pdw_CounterValue) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_CounterNumber Number of the counter The first counter begins from 0. - Output: PDWORD pdw_CounterValue Counter value. Task: Reads the counter value. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; DWORD dw_CounterValue; b_ReturnValue = b_ADDIDATA_ReadCounterValue (dw_DriverHandle, 0, &dw_CounterValue);

Counter

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

18

Counter 16) b_ADDIDATA_ReadCounterStatus (...)

ADDIDRIVER

Syntax: <Return Value> = b_ADDIDATA_ReadCounterStatus (DWORD dw_DriverHandle, BYTE b_CounterNumber, PBYTE pb_CounterStatus, PBYTE pb_SoftwareTriggerStatus, PBYTE pb_HardwareTriggerStatus, PBYTE pb_SoftwareClearStatus) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_CounterNumber Number of the counter. The first counter begins from 0. - Output: PBYTE pb_CounterStatus 0: Counter ran down or did not start 1: Counter is running PBYTE pb_SoftwareTriggerStatus 0: Software trigger did not occur 1: Software trigger occurred When the status of the software trigger is read, it is automatically reset. By the next calling of the parameter, 0 is returned if no trigger occurred during this period. PBYTE pb_HardwareTriggerStatus 0: Hardware trigger did not occur 1: Hardware trigger occurred PBYTE pb_SoftwareClearStatus 0: Software clear did not occur 1: Software clear occurred Task: Returns the status of the counter, the software trigger, the hardware trigger and the software clear. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; BYTE b_CounterStatus; BYTE b_SoftwareTriggerStatus; BYTE b_HardwareTriggerStatus; BYTE b_SoftwareClearStatus; b_ReturnValue = b_ADDIDATA_ReadCounterStatus (dw_DriverHandle, 0, &b_CounterStatus, &b_SoftwareTriggerStatus, &b_HardwareTriggerStatus, &b_SoftwareClearStatus);

19

ADDIDRIVER

Counter

Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

20

Counter 17) b_ADDIDATA_EnableDisableCounterHardwareGate (...)

ADDIDRIVER

Syntax: <Return Value> = b_ADDIDATA_EnableDisableCounterHardwareGate (DWORD dw_DriverHandle, BYTE b_CounterNumber, BYTE b_HardwareGateFlag, BYTE b_HardwareGateLevel) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_CounterNumber Number of the counter The first counter begins from 0. BYTE b_ExternGateFlag ADDIDATA_ENABLE: enables the hardware gate. ADDIDATA_DISABLE: Hardware gate disabled by starting the counter BYTE b_HardwareGateLevel ADDIDATA_LOW: If the hardware gate is enabled, it is active at "0" ADDIDATA_HIGH: If the hardware gate is enabled, it is active at "1" - Output: No output signal has occurred Task: Releases or blocks the action of the hardware gate. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableCounterHardwareGate (dw_DriverHandle, 0, ADDIDATA_ENABLE, ADDIDATA_HIGH); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

21

ADDIDRIVER 18) b_ADDIDATA_GetCounterHardwareGateStatus (...)

Counter

Syntax: <Return Value> = b_ADDIDATA_GetCounterHardwareGateStatus (DWORD dw_DriverHandle, BYTE b_CounterNumber, PBYTE pb_HardwareGateStatus) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_CounterNumber Number of the counter The first counter begins from 0. - Output: PBYTE pb_HardwareGateStatus 0: Hardware gate is not active (low status) 1: Hardware gate is active (high status) Task: Returns the status of the counter hardware gate (Active or not). Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; BYTE b_HardwareGateStatus; b_ReturnValue = b_ADDIDATA_GetCounterHardwareGateStatus (dw_DriverHandle, 0, &b_HardwareGateStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

22

Counter 19) b_ADDIDATA_EnableDisableCounterHardwareTrigger (...)

ADDIDRIVER

Syntax: <Return Value> = b_ADDIDATA_EnableDisableCounterHardwareTrigger (DWORD dw_DriverHandle, BYTE b_CounterNumber, BYTE b_HardwareTriggerFlag, BYTE b_HardwareTriggerLevel) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_CounterNumber Number of the counter The first counter begins from 0. BYTE b_HardwareTriggerFlagADDIDATA_ENABLE: Enables the hardware trigger. ADDIDATA_DISABLE: Hardware trigger disabled by triggering the counter BYTE b_HardwareTriggerLevel ADDIDATA_LOW: If the hardware trigger is used, it triggers from "1" to "0" ADDIDATA_HIGH: If the hardware trigger is used, it triggers from "0" to "1" ADDIDATA_HIGH_LOW: If the hardware trigger is used, it triggers from "0" to "1" or from "1" to "0" - Output: No output signal has occurred. Task: Releases or blocks the action of the hardware trigger. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableCounterHardwareTrigger (dw_DriverHandle, 0, ADDIDATA_ENABLE, ADDIDATA_HIGH); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

23

ADDIDRIVER 20) b_ADDIDATA_GetCounterHardwareTriggerStatus (...)

Counter

Syntax: <Return Value> = b_ADDIDATA_GetCounterHardwareTriggerStatus (DWORD dw_DriverHandle, BYTE b_CounterNumber, PBYTE pb_HardwareTriggerStatus) Parameters: - Input: DWORD dw_DriverHandle BYTE b_CounterNumber

Handle of the ADDI-DATA driver Number of the counter First counter begins from 0.

- Output: PBYTE pb_HardwareTriggerStatus 0: Hardware trigger is not active (low status) 1: Hardware trigger is active (high status) Task: Returns the status of the hardware trigger (active or not). Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; BYTE b_HardwareTriggerStatus; b_ReturnValue = b_ADDIDATA_GetCounterHardwareTriggerStatus (dw_DriverHandle, 0, &b_HardwareTriggerStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

24

Counter 21) b_ADDIDATA_EnableDisableCounterHardwareOutput (...)

ADDIDRIVER

Syntax: <Return value> = b_ADDIDATA_EnableDisableCounterHardwareOutput (DWORD dw_DriverHandle, BYTE b_CounterNumber, BYTE b_OutputFlag, BYTE b_OutputLevel) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_CounterNumber Number of the counter The first counter begins from 0. BYTE b_OutputFlag ADDIDATA_DISABLE: the counter output is not used. ADDIDATA_ENABLE: The counter output is used. BYTE b_OutputLevel ADDIDATA_HIGH: If the counter overflows, output is set to high ADDIDATA_LOW: If the counter overflows the output is set to low - Output: No output signal has occurred. Task: Activates or deactivates the counter output. Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; b_ReturnValue = b_ADDIDATA_EnableDisableCounterHardwareOutput (dw_DriverHandle, 0, ADDIDATA_ENABLE, ADDIDATA_HIGH); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

25

ADDIDRIVER 22) b_ADDIDATA_GetCounterHardwareOutputStatus (...)

Counter

Syntax: <Return Value> = b_ADDIDATA_GetCounterHardwareOutputStatus (DWORD dw_DriverHandle, BYTE b_CounterNumber, PBYTE pb_HardwareOutputStatus) Parameters: - Input: DWORD dw_DriverHandle Handle of the ADDI-DATA driver BYTE b_CounterNumber Number of the counter The first counter begins from 0. - Output: PBYTE pb_HardwareOutputStatus 0: Hardware output is not active (Low status) 1: Hardware output is active (High status) Task: Returns the status of the counter hardware output (active or not). Calling convention: ANSI C : BYTE b_ReturnValue; DWORD dw_DriverHandle; BYTE b_HardwareOutputStatus; b_ReturnValue = b_ADDIDATA_GateCounterHardwareOutputStatus (dw_DriverHandle, 0, &b_HardwareOutputStatus); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

26

Counter 23) b_ADDIDATA_TestCounterAsynchronousFIFOFull ()

ADDIDRIVER

Syntax: <Return value> = b_ ADDIDATA_TestCounterAsynchronousFIFOFull (DWORD dw_DriverHandle, PBYTE pb_Full) Parameters: - Input: DWORD dw_DriverHandle - Output: PBYTE pb_Full

Driver handle 0: Asynchronous interrupt FIFO memory not full 1: Asynchronous interrupt FIFO memory is full

Task: Tests if the asynchronous interrupt FIFO memory is full or not. The asynchronous interrupt FIFO memory is the FIFO memory in which the asynchronous events generated by the asynchronous interrupt are stored. Calling convention: ANSI C : BYTE DWORD BYTE b_ReturnValue; dw_DriverHandle; b_FIFOFull;

b_ReturnValue = b_ ADDIDATA_TestCounterAsynchronousFIFOFull (dw_DriverHandle, &b_FIFOFull); Return value: 1: No error 0: Error by calling up the function. Use the function "i_ADDIDATA_GetLastError", to find the error source.

27