Summary of Contents for Addi-Data ADDINUM CPCI-1500
Page 1
DIN EN ISO 9001 certified Technical support: +49 (0)7223 / 9493-0 Technical description ADDINUM APCI-/CPCI-1500 Digital inputs and outputs for the PCI / CompactPCI bus edition 04/2002...
Page 2
- this software can only be used for configuring ADDI-DATA boards. - copying the software is forbidden (except for archiving/ saving data and for replacing defective data carriers).
Page 3
W A R N I N G In case of improper handling and if the board is not used for the purpose it is intended for: people may be the board, PC and the environment injured peripheral devices may be may be damaged polluted...
Page 4
PCI-board for 32-bit data bus 16 digital inputs, (14 interruptible) 16 digital outputs, 24V, opto-isolated It is made by ADDI-DATA GmbH Meß- und Steuerungstechnik Dieselstraße 3 D-77833 Ottersweier in sole responsibility and is valid on the understanding that the product is competently installed, used and maintained, according to the respective security regulations as well as to the manufacturer's instructions regarding its intended use.
Table of contents APCI-/CPCI-1500 INTENDED PURPOSE OF THE BOARD.............1 Limits of use......................1 USER ....................2 Qualification ......................2 Personal protection....................2 HANDLING THE BOARD ................3 TECHNICAL DATA.................4 Electromagnetic compatibility (EMC) ..............4 Physical set-up of the board ................4 Options .........................5 Limit values......................5 Component scheme.....................8 INSTALLATION..................10 Installing an APCI-1500 board................11 5.1.1 Selecting a free slot ....................11...
Page 6
APCI-/CPCI-1500 Table of contents CONNECTING THE PERIPHERAL............26 Connector pin assignment.................26 Connection principle ..................27 Connection examples..................27 FUNCTIONS OF THE BOARD ...............29 Description of the board ..................29 8.1.1 Block diagrams......................29 8.1.2 Description.........................30 Functions ......................30 8.2.1 Digital input s ......................30 Special input functions ....................31 1) Interrupt:..........................
Page 8
APCI-/CPCI-1500 Table of contents 10.2.2 Timer interrupt ......................103 a) Flow chart......................103 b) Example in C for DOS ..................104 c) Example in C for Windows 3.1x................105 d) Example in C for Windows NT/95/98 (in asynchronous mode) ......106 e) Example in C for Windows NT/95/98 (in synchronous mode) .......107 INDEX ......................A...
Page 9
Figures and tables APCI-/CPCI-1500 Figures Fig. 3-1: Correct handling of the CPCI-1500 ................3 Fig. 3-2: Correct handling of the APCI-1500................3 Fig. 4-1: Component scheme of the APCI-1500 board ............8 Fig. 4-2: Component scheme of the CPCI-1500 board............9 Fig. 5-1: Opening the blister packing ...................10 Fig.
Technical description Chapter 1 APCI-/CPCI-1500 INTENDED PURPOSE OF THE BOARD The APCI-/CPCI-1500 board is the interface between an industrial process and a personal computer (PC). It is to be used in a free PCI slot. The PC is to comply with the EU directive 89/336/EEC and the specifications for EMC protection.
APCI-/CPCI-1500 Technical description Chapter 2 USER Qualification Only persons trained in electronics are entitled to perform the following works: installation, • use, • maintenance. • Personal protection Consider the country-specific regulations about the prevention of accidents • electrical and mechanical installations •...
Technical description Chapter 3 APCI-/CPCI-1500 HANDLING THE BOARD Fig. 3-1: Correct handling of the CPCI-1500 Fig. 3-2: Correct handling of the APCI-1500...
APCI-/CPCI-1500 Technical description Chapter 4 TECHNICAL DATA Electromagnetic compatibility (EMC) The board has been subjected to EMC tests in an accredited laboratory in accordance with the norms EN50082-2, EN55011, EN55022 The board complies as follows with the limit values set by the norm EN50082-2: True value Set value...
Technical description Chapter 4 APCI-/CPCI-1500 Options The board CPCI-1500 is available in 2 versions: - CPCI-1500-3U: 3U front plane - CPCI-1500-6U: 6U front plane Limit values Operating temperature: ........0 to 60°C Storage temperature: ......... -25 to 70°C Relative humidity: ..........30% to 99% non condensing Minimum PC requirements (APCI-1500): - PCI BIOS - operating system: ...........
Page 15
APCI-/CPCI-1500 Technical description Chapter 4 Logic input level:..........APCI-1500 CPCI-1500 max.: 30 V 30 V U H min.: 19 V 17 V max.: 17 V 15 V U L min.: Signal delay: ............. 70 µs, (at nominal voltage) Maximum input frequency: ......5 kHz (at nominal voltage) 24 V digital output channels Output type: ............
Page 16
Technical description Chapter 4 APCI-/CPCI-1500 Safety Optical isolation (DIN VDE 0411-100): ........1000 V (from the PC to the external peripheral). Logic: ..............positive ϑ Shut down logic: See -diagnostic Watchdog: ............resets all the output channels, if no software trigger has happened. Times from 10 µs to 37 s are available.
APCI-/CPCI-1500 Technical description Chapter 5 INSTALLATION IMPORTANT ! If you want to install several ADDI-DATA boards simultaneously, consider the following procedure: Install and configure the boards one after the other. You will thus avoid • configuration errors. Install and configure the boards one after the other.
Technical description Chapter 5 APCI-/CPCI-1500 IMPORTANT! Do observe the safety instructions. Switch off your PC and all the units connected to the PC. • Pull the PC mains plug from the socket. • Open your PC as described in the manual of the PC manufacturer. •...
APCI-/CPCI-1500 Technical description Chapter 5 5.1.2 Plugging the board into the slot Discharge yourself from electrostatic charges • Insert the board vertically into the chosen slot. • Fig. 5-3: Inserting the board Fasten the board to the rear of the PC housing with the screw •...
Technical description Chapter 5 APCI-/CPCI-1500 Installing a CPCI-1500 board The following Compact PCI slot types are available for 5V systems: CPCI-5V (32-bit) and CPCI-5V (64-bit) See in the computer manual which types of slots are free. Fig. 5-5: Types of slots for CompactPCI boards Discharge yourself from electrostatic charges as described in the leaflet •...
APCI-/CPCI-1500 Technical description Chapter 5 Fig. 5-7: Connector keying If there is a screw at the upper part of the front plate, use this screw to fasten • the board. Note: In order to pull the board out of the rack, pull it to the front at its grip. In some cases the grip has to be tilted upwards first.
You can download the latest version of the ADDIREG program from the Internet: http://www.addi-data.de http://www.addi-data.com The CD also contains standard software for the ADDI-DATA boards: - 16-bit for MS-DOS and Windows 3.11 - 32-bit for Windows NT/XP/2000/98 Board configuration with ADDIREG The ADDIREG registration program is a 32-bit program for Windows NT 4.0 and...
6.1.2 Program description IMPORTANT! Insert the ADDI-DATA boards to be registered before starting the ADDIREG program. If the board is not inserted, the user cannot test the registration. Once the program is called up, the following dialog box appears.
Page 26
Technical description Chapter 6 APCI-/CPCI-1500 Access: Selection of the access mode for the ADDI-DATA digital boards. Access in 8-bit or 16-bit. PCI bus/device/(slot): Used PCI slot. If the board is no PCI board, the message "NO" is displayed. Interrupt: Used interrupt of the board. If the board uses no interrupt, the message "Not available"...
APCI-/CPCI-1500 Technical description Chapter 6 Buttons: Edit Selection of the highlighted board with the different parameters set in the text boxes. Click on "Edit" to activate the data or click twice on the selected board. Insert: When you want to insert a new board, click on "Insert". The following dialog window appears: Fig.
Technical description Chapter 6 APCI-/CPCI-1500 Fig. 6-4: PCI Boards With this option you can select the identifier string by entering the corresponding number and activating with "OK". With one click on "cancel" you can select the former string. Save: Saves the parameters and registers the board. Restore: Reactivates the last saved parameters and registration.
APCI-/CPCI-1500 Technical description Chapter 6 6.1.3 Registering a new board IMPORTANT! To register a new board, you must have administrator rights. Only an administrator is allowed to register a new board or change a registration. • Call up the ADDIREG program. The Fig. 6-2 is displayed on the screen. Click on "Insert".
Technical description Chapter 6 APCI-/CPCI-1500 Driver installation Remark: The CPCI-1500 board is entirely compatible with the APCI-1500 board regarding the software installation and the device driver. The program ADDIREG will thus make no difference between the systems (PCI board or Compact PCI board).
The .inf files contains: – the name of the board – the name of the manufacturer – the hardware type of the board (all ADDI-DATA boards are considered as multifunction boards) The inf files are stored on the CD-ROM in the directory CD/INF...
Technical description Chapter 6 APCI-/CPCI-1500 Installation of the software samples 6.3.1 Installation under DOS The software samples for DOS are automatically installed with the driver. 6.3.2 Installation under Windows 3.11 and Windows NT/XP/2000/98 - Change to the CD drive. The files for the required samples are to be found as follows: Fig.
APCI-/CPCI-1500 Technical description Chapter 6 The ADDI-UNINSTALL program 6.4.1 Installation of ADDI-UNINSTALL The ADDI-UNINSTALL program is delivered on the CD-ROM. - Change to the CD drive and start the set-up file under ADDIUNINSTALL/Disk1 (double click). Fig. 6-8: Installation of the ADDI-UNINSTALL program - Proceed as indicated on the screen.
You can also download the program from the Internet. Software downloads from the Internet You can download the latest version of the device driver for the APCI-/CPCI-1500 board. http://www.addi-data.de. or http://www.addi-data.com If you have any questions, do not hesitate to send us an e-mail to info@addi-data.de...
Technical description Chapter 7 APCI-/CPCI-1500 Connection principle Fig. 7-2: Connection principle of the input and output channels Connection examples Fig. 7-3: Connection examples for the input and output channels...
Technical description Chapter 8 APCI-/CPCI-1500 FUNCTIONS OF THE BOARD Description of the board 8.1.1 Block diagrams Fig. 8-1: Block diagram of the APCI-1500 Fig. 8-2: Block diagram of the CPCI-1500...
Technical description Chapter 8 APCI-/CPCI-1500 8.1.2 Description The board APCI-/CPCI-1500 is intended for parallel input/output for digital signals in 24 V industrial environment. The peripheral and the system have a simultaneous optical isolation. The board offers: - 16 digital inputs: 14 are interruptible. - 3 counters (or timers): programmable by software - 1 timer: can be used as a watchdog for the outputs.
Technical description Chapter 8 APCI-/CPCI-1500 WARNING! Do you operate all inputs with the same voltage supply? The voltage supply must deliver at least 16 x 6 = 96 mA. The maximum input voltage is 30 V. Transil diodes, Z diodes, C filters and optical couplers protect the system bus from noise emitted by the peripheral.
Technical description Chapter 8 APCI-/CPCI-1500 8.2.2 Digital outputs The board supplies 16 optically isolated outputs. The outputs comply with the 24 V industry standard (IEC1131-2): The positive logic is used - logic "1": sets the output by software (switch on ON), - logic "0": resets the output (switch on OFF).
Technical description Chapter 8 APCI-/CPCI-1500 These error data are available through an interrupt routine. See API functions: i_APCI1500_SetBoardIntRoutineXX, i_APCI1500_ResetBoardIntRoutine. Fig. 8-4: Protection circuitry for the outputs 8.2.3 Interrupt The board has an interrupt line. An interrupt line of the PCI bus is allocated to the board through the BIOS.
Technical description Chapter 8 APCI-/CPCI-1500 8.2.4 Counter/timer On the board three 16-bit counters/timers are available in the component Z8536 (downwards counting). Each counter/timer can be programmed by software. If the component Z8536 operates as a counter, the corresponding inputs are used as follows: Counter Counter 1: Input 14 signal input.
Technical description Chapter 8 APCI-/CPCI-1500 Input frequencies The input frequency for the timer is selected through the software function i_APCI1500_InitTimerInputClock (...) Available frequencies: 111.86 kHz ± 100 ppm, 3.49 kHz ± 100 ppm, 1.747 kHz ± 100 ppm. IMPORTANT! The timer component internally operates with half of the input frequency. Data Approximate watchdog times: Input frequency...
APCI-/CPCI-1500 Technical description Chapter 9 STANDARD SOFTWARE Introduction IMPORTANT! Note the following conventions in the text: Function: "i_APCI1500_SetBoardAddress" Variable ui_Address Table 9-1: Type Declaration for Dos and Windows 3.1X Borland C Microsoft C Borland Microsoft Microsoft Pascal Visual Basic Visual Basic Windows VOID void...
Technical description Chapter 9 APCI-/CPCI-1500 DIN 66001- Graphical symbols In this chapter are all the software functions (API) necessary for the operation of the APCI-/CPCI-1500 board. To illustrate these functions, we designed diagrams with the graphical symbols listed below. The user will hence have a quick outlook of the hierarchy between the different functions.
APCI-/CPCI-1500 Technical description Chapter 9 Software functions (API) Remark: The CPCI-1500 board is entirely compatible with the APCI-1500 board regarding the software installation and the device driver. The program ADDIREG will thus make no difference between the systems (PCI board or Compact PCI board).
Page 48
Technical description Chapter 9 APCI-/CPCI-1500 Input b_Compilerdefine Function diagram i_APCI1500_InitCompiler Begin b_CompilerDefine correct ? Save b_CompilerDefine i_APCI1500_InitCompiler i_APCI1500_InitCompiler Error Output <Return value>...
APCI-/CPCI-1500 Technical description Chapter 9 2) i_APCI1500_CheckAndGetPCISlotNumber (...) Syntax: <Return value> = i_APCI1500_CheckAndGetPCISlotNumber (PBYTE pb_SlotNumberArray) Parameters: - Input: No input signal has to occur. - Output: PBYTE pb_SlotNumberArray List of the slot numbers. Task: Checks all xPCI-1500 and returns the slot number of each xPCI-1500 board. Each pb_SlotNumberArray parameter contains the slot number (1 to 10) of one xPCI-1500 board.
Page 50
Technical description Chapter 9 APCI-/CPCI-1500 Input Function diagram i_APCI1500_CheckAndGetPCISlotNumber Begin Search next PCI board i_APCI1500_CheckAndGetPCISlotNumber board found? Returns the number of APCI-1500 APCI-1500 Board ? - Save slot number - Save base address - Save interrupt Output pb_SlotNumberArray <Return value>...
APCI-/CPCI-1500 Technical description Chapter 9 3) i_APCI1500_SetBoardInformation (...) Syntax: <Return value> = i_APCI1500_SetBoardInformation (BYTE b_SlotNumber, PBYTE pb_BoardHandle) Parameters: - Input: BYTE b_SlotNumber: Slot number of the xPCI-1500 board - Output: PBYTE pb_BoardHandle: Handle of board xPCI-1500 for using the functions Task: Checks if the board xPCI-1500 is present and stores the slot number.
APCI-/CPCI-1500 Technical description Chapter 9 5) i_APCI1500_CloseBoardHandle (..) IMPORTANT! Call up this function each time you want to leave the user program! Syntax: <Return value> = i_APCI1500_CloseBoardHandle (BYTE b_BoardHandle) Parameters: - Input: BYTE b_BoardHandle Handle of board xPCI-1500 - Output: No output signal has occurred.
Page 56
Technical description Chapter 9 APCI-/CPCI-1500 Input b_BoardHandle Function diagram i_APCI1500_CloseBoardHandle Begin b_BoardHandle OK ? Interrupt routine installed ? i_APCI1500_ResetBoardIntRoutine Release b_BoardHandle i_APCI1500_CloseBoardHandle i_APCI1500_CloseBoardHandle Error Output <Return value>...
Technical description Chapter 9 APCI-/CPCI-1500 The following errors are possible - overtemperature - short-circuit - no voltage is available If several boards are operated and if they have to react to interrupts, the variable b_BoardHandle returns the identification number (handle) of the board which has generated the interrupt.
Page 59
APCI-/CPCI-1500 Technical description Chapter 9 Calling convention: ANSI C : void v_FunctionName (unsigned char b_BoardHandle, unsigned char b_InterruptMask, unsigned int b_InputChannelNumber) i_ReturnValue; unsigned char b_BoardHandle; i_ReturnValue = i_APCI1500_SetBoardIntRoutineDos (b_BoardHandle, v_FunctionName ); Return value: 0: No error -1: The handle parameter of the board is wrong -2: Interrupt already installed...
Page 60
Technical description Chapter 9 APCI-/CPCI-1500 Input b_BoardHandle v_FunctionName Function diagram i_APCI1500_SetBoardIntRoutineDos Begin b_BoardHandle OK ? Board interrupt installed ? Save old interrupt routine Set API interrupt routine First interrupt installation ? Save v_FunktionName i_APCI1500_SetBoardIntRoutineDos i_APCI1500_SetBoardIntRoutineDos Error Output <Return value>...
APCI-/CPCI-1500 Technical description Chapter 9 IMPORTANT! This function is only available for Visual Basic DOS. 2) i_APCI1500_SetBoardIntRoutineVBDos (..) Syntax: <Return value> = i_APCI1500_SetBoardIntRoutineVBDos (BYTE b_BoardHandle) Parameters: - Input: BYTE b_BoardHandle Handle of board xPCI-1500 - Output: No output signal has occurred. Task: This function must be called up for each xPCI-1500 on which an interrupt action is to be enabled.
Page 62
Technical description Chapter 9 APCI-/CPCI-1500 Calling convention: Visual Basic DOS: Dim Shared i_ReturnValue As Integer Dim Shared i_BoardHandle As Integer Dim Shared i_InterruptMask As Integer Dim Shared l_InputChannelNbr As Integer IntLabel: i_ReturnValue = i_APCI1500_TestInterrupt (i_BoardHandle, _ i_InterruptMask, _ i_InputChannelNbr) Return ON UEVENT GOSUB IntLabel UEVENT ON i_ReturnValue = i_APCI1500_SetBoardIntRoutineVBDos (b_BoardHandle)
Page 63
APCI-/CPCI-1500 Technical description Chapter 9 Input b_BoardHandle Function diagram i_APCI1500_SetBoardIntRoutineVBDos Begin b_BoardHandle OK ? Board interrupt installed ? Save old interrupt routine Set API interrupt routine First interrupt installation ? Save v_FunktionName i_APCI1500_SetBoardIntRoutineVBDos i_APCI1500_SetBoardIntRoutineVBDos Error Output <Return value>...
Technical description Chapter 9 APCI-/CPCI-1500 IMPORTANT! This function is only available for Windows 3.1 and Windows 3.11 3) i_APCI1500_SetBoardIntRoutineWin16 (..) Syntax: <Return value> = i_APCI1500_SetBoardIntRoutineWin16 (BYTE b_BoardHandle, VOID v_FunctionName (BYTE b_BoardHandle, BYTE b_InterruptMask, BYTE InputChannelNbr)) Parameters: - Input: BYTE b_BoardHandle Handle of board xPCI-1500 VOID v_FunctionName...
Page 65
APCI-/CPCI-1500 Technical description Chapter 9 The following errors are possible - overtemperature - short-circuit - no voltage is available If several boards are operated and if they have to react to interrupts, the variable b_BoardHandle returns the identification number (handle) of the board which has generated the interrupt.
Page 66
Technical description Chapter 9 APCI-/CPCI-1500 IMPORTANT! If you use Visual Basic for Windows the following parameters have no signification. You must use "i_APCI1500_TestInterrupt". VOID v_FunctionName (BYTE b_BoardHandle, BYTE b_InterruptMask, BYTE b_InputChannelNbr) Calling convention: ANSI C : void v_FunctionName (unsigned char b_BoardHandle, unsigned char b_InterruptMask, unsigned char b_InputChannelNbr) i_ReturnValue;...
Page 67
APCI-/CPCI-1500 Technical description Chapter 9 Input b_BoardHandle v_FunctionName Function diagram i_APCI1500_SetBoardIntRoutineWin16 Begin b_BoardHandle OK ? Board interrupt installed ? Save old interrupt routine Set API interrupt routine First interrupt installation ? Save v_FunktionName i_APCI1500_SetBoardIntRoutineWin16 i_APCI1500_SetBoardIntRoutineWin16 Error Output <Return value>...
Technical description Chapter 9 APCI-/CPCI-1500 IMPORTANT! This function is only available for Windows NT and Windows 2000/9x. 4) i_APCI1500_SetBoardIntRoutineWin32 (..) Syntax: <Return value> = i_APCI1500_SetBoardIntRoutineWin32 (BYTE b_BoardHandle, BYTE b_UserCallingMode, ULONG ul_UserSharedMemorySize, VOID ** ppv_UserSharedMemory, VOID v_FunctionName (BYTE b_BoardHandle, BYTE b_InterruptMask, BYTE b_InputChannelNbr, BYTE...
Page 69
APCI-/CPCI-1500 Technical description Chapter 9 Task: Windows 32-bit information For Windows NT and Windows 2000/9x, 4 running rings (ring 0 to ring 3) are available. - The user application operates in ring 3. This ring gives no access to hardware. - VXD and SYS driver operate in ring 0 and give access to hardware.
Page 70
Technical description Chapter 9 APCI-/CPCI-1500 User interrupt routine can be called : - directly by the driver interrupt routine (Synchronous mode). The code of the user interrupt routine directly operates in ring 0. - by the driver interrupt thread (Asynchronous mode). An event is generated and the interrupt thread calls up the user interrupt routine.
Page 71
APCI-/CPCI-1500 Technical description Chapter 9 ASYNCHRONOUS-MODE The user can debug the user interrupt routine provided he has not programmed in Visual Basic 5 The user routine can call Windows API functions. ADVANTAGE The user routine can call functions which give access to global variables. The user routine can call all xPCI-1500 driver functions with the following extension: "i_APCI1500_XXXX"...
Page 72
Technical description Chapter 9 APCI-/CPCI-1500 Mask Meaning 0000 0001 Event 1 has occurred 0000 0010 Event 2 has occurred 0000 0100 Counter/timer 1 has run down 0000 1000 Counter/timer 2 has run down 0001 0000 Counter 3 has run down 0010 0000 Watchdog has run down 0100 0000...
Page 74
Technical description Chapter 9 APCI-/CPCI-1500 Input b_BoardHandle ul_UserSharedMemorySize b_UserCallingMode v_FunctionName Function diagram i_APCI1500_SetBoardintRoutineWin32 Begin b_BoardHandle OK ? Board interrupt installed ? Set API interrupt routine First interrupt installation ? Save v_FunktionName User shared Asynchronous memory mode ? size > 0 ? Set API interrupt Create user thread...
APCI-/CPCI-1500 Technical description Chapter 9 5) i_APCI1500_TestInterrupt (..) Syntax: <Return value> = i_APCI1500_TestInterrupt (PBYTE pb_BoardHandle, PBYTE pb_InterruptMask, PBYTE pb_ChannelNbr) Parameters: - Input: No input signal is to occur. - Output: PBYTE pb_BoardHandle Handle of the board PCI-1500 which has generated the interrupt, PBYTE pb_InterruptMask Error mask of the event which has generated the interrupt.
Page 76
Technical description Chapter 9 APCI-/CPCI-1500 Return value: -1: No interrupt > 0: IRQ number Input Function diagram i_APCI1500_TestInterrupt Begin Interrupt occurred? - Get pb_BoardHandle - Get pb_InterruptMask - Get pb_ChannelNbr i_APCI1500_TestInterrupt i_APCI1500_TestInterrupt Error Output b_BoardHandle pb_ChannelNbr b_InterruptMask <Return value>...
APCI-/CPCI-1500 Technical description Chapter 9 6) i_APCI1500_ResetBoardIntRoutine (..) Syntax: <Return value> = i_APCI1500_ResetBoardIntRoutine (BYTE b_BoardHandle) Parameters: - Input: BYTE b_BoardHandle Handle of board xPCI-1500 - Output: No output signal has occurred. Task: Stops the interrupt management of board xPCI-1500. Deinstalls the interrupt routine if the management of interrupts of all xPCI-1500 is stopped.
Page 78
Technical description Chapter 9 APCI-/CPCI-1500 Input b_BoardHandle Function diagram i_APCI1500_ResetBoardIntRoutine Begin b_BoardHandle OK ? Board interrupt installed? Restore old interrupt and disable APCI-1500 interrupt i_APCI1500_ResetBoardIntRoutine i_APCI1500_ResetBoardIntRoutine Error Output <Return value>...
APCI-/CPCI-1500 Technical description Chapter 9 9.3.3 Kernel functions 1) i_APCI1500_KRNL_Read16DigitalInput (...) Syntax: <Return value> = i_APCI1500_KRNL_Read16DigitalInput (UINT ui_BaseAddress, PLONG pl_InputValue) Parameters: - Input: UINT ui_BaseAddress xPCI-1500 base address - Output: PLONG pl_InputValue State of the digital input channels of both ports (0 to 65535) Task: Indicates the state of both ports.
Technical description Chapter 9 APCI-/CPCI-1500 2) v_APCI1500_KRNL_Set16DigitalOutputOn (...) Syntax: <Return value> = v_APCI1500_KRNL_Set16DigitalOutputOn (UINT ui_BaseAddress, LONG l_Value) Parameters: - Input: UINT ui_BaseAddress xPCI-1500 base address LONG l_Value Output value (0 to 65535) - Output: No output signal has occurred. Task: Sets one or several output channels of board xPCI-1500 Example: l_Value = 5555 Hex...
Technical description Chapter 9 APCI-/CPCI-1500 Example: b_Port = 1 pb_PortValue = 55 Hex A voltage is present on the input channels 1, 3, 5, 7 A voltage is not present on the input channels 2, 4, 6, 8. Return value: 0: No error -1: Handle parameter of the board is wrong -2: The parametered port number is wrong (parameter 1 or 2)
APCI-/CPCI-1500 Technical description Chapter 9 9.3.5 Digital input channel - events 1) i_APCI1500_SetInputEventMask (...) Syntax: <Return value> = i_APCI1500_SetInputEventMask (BYTE b_BoardHandle, BYTE b_PortNbr, BYTE b_Logik, PCHAR pc_EventMask) Parameters: BYTE b_BoardHandle Handle of board xPCI-1500 BYTE b_Port Number of the input port to be masked (1 or 2) BYTE b_Logik...
Page 84
Technical description Chapter 9 APCI-/CPCI-1500 IMPORTANT! If you use the APCI1500_OR_PRIORITY logic, you cannot use edge events. If you use the APCI1500_AND logic, you can only use one edge event. Task: An event can be generated for each port. The first event is related to the first 8 input channels (port 1). The second event is related to the next 6 input channels (port 2).
Page 85
APCI-/CPCI-1500 Technical description Chapter 9 Input 8 Input 7 Input 6 Input 5 Input 4 Input 3 Input 2 Inputl 1 1st event on input 1 2nd event on input 3 3rd event on input 8 4th event on input 2 5th event on input 4 6th event...
Technical description Chapter 9 APCI-/CPCI-1500 2) i_APCI1500_StartInputEvent (...) Syntax : <Return value> = i_APCI1500_StartInputEvent (BYTE b_BoardHandle, BYTE b_PortNbr) Parameters: BYTE b_BoardHandle Handle of the xPCI-1500 BYTE b_Port Number of the input port (1 or 2) Task: As soon as the function is called, it is possible to process an event on one port. First mask the input channels with the following function i_APCI1500_SetInputEventMask .
APCI-/CPCI-1500 Technical description Chapter 9 9.3.6 Digital output channel 1) i_APCI1500_SetOutputMemoryOn (...) Syntax: <Return value> = i_APCI1500_SetOutputMemoryOn (BYTE b_BoardHandle) Parameters: BYTE b_BoardHandle Handle of the xPCI-1500 Task: Activates the digital output memory. After calling this function, the output channels you have previously activated with the functions "i_APCI1500_SetXDigitalOutputOn"...
Technical description Chapter 9 APCI-/CPCI-1500 Task: Sets the output channel which has been passed with b_Channel. Setting an output channel means setting an output channel on high. Switching on the digital output memory (ON) see function "i_APCI1500_SetOutputMemoryOn (...) b_Channel= 1 The output channel 1 is set.
APCI-/CPCI-1500 Technical description Chapter 9 5) i_APCI1500_Set8DigitalOutputOn (...) Syntax: <Return value> = i_APCI1500_Set8DigitalOutputOn (BYTE b_BoardHandle, BYTE b_Port, BYTE b_Value) Parameters: BYTE b_BoardHandle Handle of the board xPCI-1500 BYTE b_Port Number of the output port (1 or 2) BYTE b_Value Output value (0 to 255) Task: Sets one or several output channels of a port.
Technical description Chapter 9 APCI-/CPCI-1500 6) i_APCI1500_Set8DigitalOutputOff (...) Syntax: <Return value> = i_APCI1500_Set8DigitalOutputOff (BYTE b_BoardHandle, BYTE b_Port, BYTE b_Value) Parameters: BYTE b_BoardHandle Handle of the xPCI-1500 BYTE b_Port Number of the output port (1 or 2) BYTE b_Value Output value (0 to 255) Task: Resets one or several output channels of one port.
APCI-/CPCI-1500 Technical description Chapter 9 Example: Switching on the digital output memory (ON) see function "i_APCI1500_SetOutputMemoryOn (...) l_Value = 5555 Hex The output channels 1, 3, 5, 7, 9, 11, 13, 15 are set. The other output channels hold their state. Switching off the digital output memory (OFF) see function "i_APCI1500_SetOutputMemoryOff (...) l_Value = 5555 Hex...
Technical description Chapter 9 APCI-/CPCI-1500 IMPORTANT! You can use this function only if the digital output memory is ON. See function i_APCI1500_SetOutputMemoryOn (..). Return value: 0: No error -1: The handle parameter of the board is wrong -2: The digital output memory is OFF. Please first use the function "i_APCI1500_SetOutputMemoryOn"...
APCI-/CPCI-1500 Technical description Chapter 9 2) i_APCI1500_InitTimerCounter1 (...) Syntax: <Return value> = i_APCI1500_InitTimerCounter1 (BYTE b_BoardHandle, BYTE b_CounterOrTimerSelect, LONG_ l_ReloadValue, BYTE b_ContinuousOrSingleCycleSelect, BYTE b_InterruptHandling) Parameters: BYTE b_BoardHandle: Handle of the xPCI-1500 BYTE b_CounterOrTimerSelect: Select the mode of the first counter/timer - APCI1500_TIMER : The first counter/timer is used as timer - APCI1500_COUNTER : The first counter/timer is used as counter...
Technical description Chapter 9 APCI-/CPCI-1500 3) i_APCI1500_InitTimerCounter2 (...) Syntax: <Return value> = i_APCI1500_InitTimerCounter2 (BYTE b_BoardHandle, BYTE b_CounterOrTimerSelect, LONG l_ReloadValue, BYTE b_ContinuousOrSingleCycleSelect, BYTE b_HardwareOrSoftwareTriggerSelect, BYTE b_HardwareOrSoftwareGateSelect, BYTE b_InterruptHandling) Parameters: BYTE b_BoardHandle Handle of the xPCI-1500 BYTE b_CounterOrTimerSelect Selects the mode of the 2 counter/timer - APCI1500_TIMER : The 2nd counter/timer is used as a timer...
Page 95
APCI-/CPCI-1500 Technical description Chapter 9 BYTE b_InterruptHandling Interrupts can be generated, when the counter has run down, or when the timer output is on high. With this parameter the user decides if interrupts are used or not. - APCI1500_ENABLE: Interrupts are enabled. - APCI1500_DISABLE: Interrupts are disabled.
Technical description Chapter 9 APCI-/CPCI-1500 4) i_APCI1500_InitWatchdogCounter3 (...) Syntax: <Return value> = i_APCI1500_InitWatchdogCounter3 (BYTE b_BoardHandle, BYTE b_WatchdogOrCounterSelect, LONG l_ReloadValue, BYTE b_ContinuousOrSingleCycleSelect, BYTE b_HardwareOrSoftwareGateSelect, BYTE b_InterruptHandling) Parameters: BYTE b_BoardHandle Handle of the xPCI-1500 BYTE b_WatchdogOrCounterSelect Selects the mode of the third counter/watchdog - APCI1500_WATCHDOG : The third counter/watchdog is used as a...
APCI-/CPCI-1500 Technical description Chapter 9 Task: Selects the operating mode of the third counter/watchdog. Enter its limit. You have to decide: - if the counter must execute once or several times the counting operation, - if the counter/watchdog is used as a counter or a watchdog, - if an interrupt must be generated when the counter/watchdog has run down, - and if the external gate is used (if it is used as a counter).
Technical description Chapter 9 APCI-/CPCI-1500 6) i_APCI1500_StartTimerCounter2 (...) Syntax: <Return value> = i_APCI1500_StartTimerCounter2 (BYTE b_BoardHandle) Parameters: BYTE b_BoardHandle Handle of the xPCI-1500 Task: Starts the second counter/timer, Please initialise it previously with the function "i_APCI1500_InitTimerCounter2". If the counter is used, it is now ready for counting. If the timer is used, it is now running.
APCI-/CPCI-1500 Technical description Chapter 9 8) i_APCI1500_StopTimerCounter1 (...) Syntax: <Return value> = i_APCI1500_StopTimerCounter1 (BYTE b_BoardHandle) Parameters: BYTE b_BoardHandle Handle of the xPCI-1500 Task: Stops the first counter/timer. The timer counter value is freezed. It has the same influence as a hardware gate. Input Clock Timer...
Technical description Chapter 9 APCI-/CPCI-1500 10) i_APCI1500_StopCounter3 (...) Syntax: <Return value> = i_APCI1500_StopCounter3 (BYTE b_BoardHandle) Parameters: BYTE b_BoardHandle Handle of the xPCI-1500 Task: Stops the third counter. The counter value is freezed. Return value: 0: No error -1: The handle parameter of the board is wrong -2: The counter has not been initialised -3: The counter/watchdog has been initialised as a watchdog.
APCI-/CPCI-1500 Technical description Chapter 9 13) i_APCI1500_TriggerCounter3 (...) Syntax: <Return value> = i_APCI1500_TriggerCounter3 (BYTE b_BoardHandle) Parameters: BYTE b_BoardHandle Handle of the xPCI-1500 Task: Triggers the third counter. The start value is loaded in the counter. Return value: 0: No error -1: The handle parameter of the board is wrong -2: The counter has not been initialised -3: The counter/watchdog has been initialised as a watchdog.
Technical description Chapter 9 APCI-/CPCI-1500 Counter: the counter value is decremented each time the input channel changes from low to high. This counter value can be read with this function. Timer: the timer value is decremented each time the input clock changes from low to high.
APCI-/CPCI-1500 Technical description Chapter 9 17) i_APCI1500_ReadCounter3 (...) Syntax: <Return value> = i_APCI1500_ReadCounter3 (BYTE b_BoardHandle, PLONG_ pl_ReadValue) Parameters: BYTE b_BoardHandle Handle of the xPCI-1500 PLONG pl_ReadValue When the counter/watchdog is used as a counter, it returns the current value of the counter. Task: Reads the current value of the third counter/watchdog if used as a counter.
Technical description Chapter 10 APCI-/CPCI-1500 EXAMPLES 10.1 Initialisation 10.1.1 Initialisation of one xPCI-1500 board a) Flow chart Initialisation Begin If Windows program then i_APCI1500_InitCompiler i_APCI1500_CheckAndGetPCISlotNumber APCI-1500 board found ? (return value > 0 ?) i_APCI1500_SetBoardInformation Initialisation OK ? (return value = 0 ?) Initialisation Initialisation Error...
APCI-/CPCI-1500 Technical description Chapter 10 b) Example in C int Initialisation(unsigned char *pb_BoardHandle) unsigned char b_SlotNumberArray [8]; #if defined (_Windows) || defined (_WINDOWS) || defined (_WIN32) i_APCI1500_InitCompiler (DLL_COMPILER_C); #endif if(i_PCI1710_CheckAndGetPCISlotNumber (b_SlotNumberArray)) if(i_APCI1500_SetBoardInformation (b_SlotNumberArray pb_BoardHandle) == 0) return (0); /* OK */ else return (-1);...
Technical description Chapter 10 APCI-/CPCI-1500 10.1.2 Initialisation of several xPCI-1500 boards a) Flow chart Initialisation Begin If Windows program then i_APCI1500_InitCompiler i_APCI1500_CheckAndGetPCISlotNumber APCI-1500 board found ? (return value > 0 ?) i_APCI1500_SetBoardInformation Initialisation OK ? (return value = 0 ?) Initialisation Initialisation Error...
APCI-/CPCI-1500 Technical description Chapter 10 b) Example in C for DOS and Windows 3.1x unsigned char b_EventCpt [2], b_TimerCounterCpt [3]; /* Global buffer unsigned char b_WatchdogCpt, b_VoltageErrorCpt; _VOID_ v_InterruptRoutine (BYTE_ b_BoardHandle, BYTE_ b_InterruptMask, BYTE_b_InputChannelNbr) if (b_InterruptMask & 0x1) /**************************/ b_EventCpt [0] = b_EventCpt [0] + 1; /* Event port 1 interrupt */ /**************************/ if (b_InterruptMask &...
Technical description Chapter 10 APCI-/CPCI-1500 c) Example in C for Windows NT and Windows 95/98 (in asynchronous mode) unsigned char b_EventCpt [2], b_TimerCounterCpt [3]; /* Global buffer unsigned char b_WatchdogCpt, b_VoltageErrorCpt; _VOID_ v_InterruptRoutine (BYTE_ b_BoardHandle, BYTE_ b_InterruptMask, BYTE_ b_InputChannelNbr, BYTE_ b_UserCallingMode, VOID *pv_UserSharedMemory) if (b_InterruptMask &...
Technical description Chapter 10 APCI-/CPCI-1500 10.2.2 Timer interrupt a) Flow chart Timer 1 interrupt test Loop Begin Write Initialisation number of interrupt Until a key is Return value = 0 pressed i_APCI1500_SetBoardIntRoutine i_APCI1500_StopTimerCounter1 Return value = 0 i_APCI1500_ResetBoardIntRoutine i_APCI1500_CloseBoardHandle i_APCI1500_InitTimerCounter1 Timer 1 interrupt test i_APCI1500_StartTimerCounter1...
APCI-/CPCI-1500 Technical description Chapter 10 b) Example in C for DOS void main (void) i_ReturnValue; unsigned char b_BoardHandle; if (Initialisation (&b_BoardHandle) == 0) if (i_APCI1500_SetBoardIntRoutineDos (b_BoardHandle, v_InterruptRoutine) == 0) i_ReturnValue = i_APCI1500_InitTimerInputClock (b_BoardHandle, APCI1500_1_8_KHZ); printf ("\nTimer input clock initialisation return value = %d", i_ReturnValue); i_ReturnValue = i_APCI1500_InitTimerCounter1 (b_BoardHandle, APCI1500_TIMER,...
Technical description Chapter 10 APCI-/CPCI-1500 c) Example in C for Windows 3.1x void main (void) i_ReturnValue; unsigned char b_BoardHandle; if (Initialisation (&b_BoardHandle) == 0) if (i_APCI1500_SetBoardIntRoutineWin16 (b_BoardHandle, v_InterruptRoutine) == 0) i_ReturnValue = i_APCI1500_InitTimerInputClock (b_BoardHandle, APCI1500_1_8_KHZ); printf ("\nTimer input clock initialisation return value = %d", i_ReturnValue); i_ReturnValue = i_APCI1500_InitTimerCounter1 (b_BoardHandle, APCI1500_TIMER,...
Need help?
Do you have a question about the ADDINUM CPCI-1500 and is the answer not in the manual?
Questions and answers