background image

Technical description    Chapter 10 

APCI-/CPCI-1500 

 

99 

10.2 Interrupt 

10.2.1 Interrupt 

routine 

 

a) Flow chart 

Interrupt mask

Interrupt routine

Begin

Interrupt routine

End

Increment the event 
counter of port 1

Increment the event 
counter of port 2

Mask interrupt = 0x1

Mask interrupt = 0x2

Increment the 
counter of 
timer/counter 1

Mask interrupt = 0x4

Increment the
counter of 
timer/counter 2

Mask interrupt = 0x8

Increment the 
counter of counter 3

Increment the 
counter of 
Watchdog

Increment the 
counter for voltage 
error

Mask interrupt = 0xC0

Mask interrupt = 0x10

Mask interrupt = 0x20

 

Содержание ADDINUM APCI-1500

Страница 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 9th edition 04 2002 ...

Страница 2: ...ct to wear disasters caused by the intrusion of foreign bodies and by influence beyond the user s control Licence for ADDI DATA software products Read carefully this licence before using the standard software The right for using this software is given to the customer if he she agrees to the conditions of this licence this software can only be used for configuring ADDI DATA boards copying the softw...

Страница 3: ...ly If this leaflet is not with the documentation please contact us Observe the instructions in the manual Make sure that you do not forget or skip any step We are not liable for damage resulting from a wrong use of the board Symbols used WARNING designates a possibly dangerous situation If the instructions are ignored the board PC and or peripheral devices may be damaged IMPORTANT designates hints...

Страница 4: ...ferences listed in the form TDI1500 020 Following norms have been applied to test the product regarding electromagnetic compatibility z EN55011 1998 z EN55022 1998 z EN61000 6 2 1999 We point out that z the conformity and herewith the permission of use expire if the user alters the product without consulting with the manufacturer z non skilled users are to have the operational area of the product ...

Страница 5: ... SOFTWARE 15 6 1 Board configuration with ADDIREG 15 6 1 1 Installing ADDIREG 15 6 1 2 Program description 16 6 1 3 Registering a new board 20 6 1 4 Changing the registration of a board 20 6 2 Driver installation 21 6 2 1 Driver installation under MS DOS 21 6 2 2 Driver installation under Windows 3 11 und Windows NT 21 6 2 3 Driver installation under Windows XP 2000 98 22 6 3 Installation of the s...

Страница 6: ... 2 DIN 66001 Graphical symbols 37 9 3 Software functions API 38 9 3 1 Base address and interrupt 38 1 i_APCI1500_InitCompiler 38 2 i_APCI1500_CheckAndGetPCISlotNumber 40 3 i_APCI1500_SetBoardInformation 42 4 i_APCI1500_GetHardwareInformation 44 5 i_APCI1500_CloseBoardHandle 46 9 3 2 Interrupt 48 1 i_APCI1500_SetBoardIntRoutineDos 48 2 i_APCI1500_SetBoardIntRoutineVBDos 52 3 i_APCI1500_SetBoardIntR...

Страница 7: ...CI1500_StartTimerCounter1 88 6 i_APCI1500_StartTimerCounter2 89 7 i_APCI1500_StartCounter3 89 8 i_APCI1500_StopTimerCounter1 90 9 i_APCI1500_StopTimerCounter2 90 10 i_APCI1500_StopCounter3 91 11 i_APCI1500_TriggerTimerCounter1 91 12 i_APCI1500_TriggerTimerCounter2 91 13 i_APCI1500_TriggerCounter3 92 14 i_APCI1500_Watchdog 92 15 i_APCI1500_ReadTimerCounter1 92 16 i_APCI1500_ReadTimerCounter2 93 17 ...

Страница 8: ... 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 ...

Страница 9: ...am 16 Fig 6 3 Configuring a new board 18 Fig 6 4 PCI Boards 19 Fig 6 5 Driver installation 21 Fig 6 6 Inquiry of the inf files German version 22 Fig 6 7 Installation of the samples 23 Fig 6 8 Installation of the ADDI UNINSTALL program 24 Fig 6 9 The ADDI UNINSTALL program 24 Fig 7 1 37 pin SUB D male connector 26 Fig 7 2 Connection principle of the input and output channels 27 Fig 7 3 Connection e...

Страница 10: ...tion is to be effected competently Check the shielding capacity of the PC housing and of the cable prior to putting the device into operation The connection with our standard cable ST010 complies with the specifications metallized plastic hoods shielded cable cable shield folded back and firmly screwed to the connector housing Uses beyond these specifications are not allowed The manufacturer is no...

Страница 11: ...ly persons trained in electronics are entitled to perform the following works installation use maintenance 2 2 Personal protection Consider the country specific regulations about the prevention of accidents electrical and mechanical installations radio interference suppression ...

Страница 12: ...Technical description Chapter 3 APCI CPCI 1500 3 3 HANDLING THE BOARD Fig 3 1 Correct handling of the CPCI 1500 Fig 3 2 Correct handling of the APCI 1500 ...

Страница 13: ...C tests have been carried out in a specific appliance configuration We guarantee these limit values only in this configuration Consider the following aspects your test program must be able to detect operation errors your system must be set up so that you can find out what caused errors 4 2 Physical set up of the board The board is assembled on a 4 layer printed circuit card APCI 1500 CPCI 1500 Dim...

Страница 14: ... 3 1 NT 95 98 bus speed 33 MHz Minimum system requirements CPCI 1500 32 bit CompactPCI bus 5 V PCI BIOS PCI 2 1 specification and complying with CompactPCI 2 1 operating system MS DOS 3 3 or Windows 3 1 NT 95 98 bus speed 33 MHz Energy requirements operating voltage of the PC 5V 5 current consumption in mA without load typ See table 10 APCI 1500 CPCI 1500 5 V of the PC 320 mA 250 mA 24 V extern 10...

Страница 15: ...ent output channel 500 mA Short circuit current output channel at 24 V APCI 1500 Rload 0 1 R 1 5 A max switches off the output channel CPCI 1500 Rload 0 01 R 2 5 A max switches off the output channel ON resistor of the output channel RDS ON resistor 0 4 R max Overtemperature 170 C switches off the component i e the 4 output channels Temperature hysteresis 20 C Switch ON time at 24 V Rload 500 mA 1...

Страница 16: ...own logic See ϑ diagnostic Watchdog resets all the output channels if no software trigger has happened Times from 10 µs to 37 s are available Counter input channels max 10 kHz 24 V APCI 1500 Option fast counter input channels max 140 kHz 24 V CPCI 1500 Status LEDs on front connector Green LED on ext voltage supply 8 V Red LED on error signal from the outputs ...

Страница 17: ...APCI CPCI 1500 Technical description Chapter 4 8 4 5 Component scheme Fig 4 1 Component scheme of the APCI 1500 board ...

Страница 18: ...Technical description Chapter 4 APCI CPCI 1500 9 Fig 4 2 Component scheme of the CPCI 1500 board ...

Страница 19: ...uration errors 1 Switch off the PC 2 Install the first board 3 Start the PC 4 Install ADDIREG once is enough 5 Configure the board 6 Install the driver and the samples if necessary 7 Switch off the PC 8 Install the second board 9 Start the PC 10 Configure the board 11 Install the driver and the samples if necessary etc IMPORTANT To install the new version of ADDIREG please uninstall first the curr...

Страница 20: ...APCI 1500 board 5 1 1 Selecting a free slot The following PCI slot types are available for 5V systems PCI 5V 32 bit and PCI 5V 64 bit Fig 5 2 Types of slots for PCI boards See in the PC manual which types of slots are free Decide in which type of slot to insert the board Remove the back cover of the selected slot according to the instructions of the PC manufacturer Keep the back cover You will nee...

Страница 21: ...s 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 which was fixed on the back cover Fig 5 4 Fastening the board at the back cover Tighten all the loosen screws 5 1 3 Closing the PC Close your PC as described in the manual of the PC manufacturer ...

Страница 22: ...ourself from electrostatic charges as described in the leaflet Safety precautions Hold the board at its grip See board handling in chapter 3 Insert the board into the guiding rails and push it to the back cover of the rack In order to fully insert the board a small resistance has to be overcome Fig 5 6 Pushing a CPCI board into a rack Make sure that the board is correctly connected by connecting t...

Страница 23: ...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 ...

Страница 24: ...indows 3 11 32 bit for Windows NT XP 2000 98 6 1 Board configuration with ADDIREG The ADDIREG registration program is a 32 bit program for Windows NT 4 0 and Windows XP 2000 98 The user can register all hardware information necessary to operate the ADDI DATA PC boards IMPORTANT If you use one or several resources of the board you cannot start the ADDIREG program 6 1 1 Installing ADDIREG IMPORTANT ...

Страница 25: ...r Kernel jetzt gestartet werden Problem when installing the system is displayed by starting the program deinstall the ADDIREG program and install it anew 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...

Страница 26: ... PCI1500 50 or the installed COM interfaces Text boxes Under the table you will find 6 text boxes in which you can change the parameters of the board Base address name Description of the used base addresses for the board Select a name though the pull down menu The corresponding address range is displayed in the field below Base address Interrupt name Description of the used IRQ lines for the board...

Страница 27: ... read technical information about the board s Activate with OK You come back to the former screen Clear You can delete the registration of a board Select the board to be deleted and click on Clear Set Sets the parametered board configuration The configuration should be set before you save it Cancel Reactivates the former parameters of the saved configuration Default Sets the standard parameters of...

Страница 28: ...Under Edit ADDIDriver Board Manager you can check or change the current settings of the board set through the ADDEVICE Manager ADDevice Manager starts The windows displayed lists all resources available for the virtual board Test registration Controls if there is a conflict between the board and other devices A message indicates the parameter which has generated the conflict If there is no conflic...

Страница 29: ...be modified it is necessary to boot your PC again A message asks you to do so When it is not necessary you can quit the ADDIREG program and directly begin with your application 6 1 4 Changing the registration of a board IMPORTANT To change the registration of a board you must have administrator rights Only an administrator is allowed to register a new board or change a registration Call up the ADD...

Страница 30: ...ory content is stored in several sub directories Disk1 Disk2 Disk3 Insert the first disk into a driver and change to this drive Enter INSTALL The installation program gives you further instructions 6 2 2 Driver installation under Windows 3 11 und Windows NT Change to the CD drive Fig 6 5 Driver installation Select the directory APCI1500 Win XP 2000 NT 98 driver Disk1 or APCI1500 Win311 driver Disk...

Страница 31: ...ardware 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 IMPORTANT Make sure you also indicated the directory for the used operating system In case you only enter the path to the INF directory the operating system may randomly choose one directory and thus install the wrong INF files Fig 6 6 Inquiry of the ...

Страница 32: ...und as follows Fig 6 7 Installation of the samples Select the required programming language Start the set up program setup exe double click Select one of the 3 parameters 1 typical all files are installed Samples source code and exe files 2 compact only the source code is installed 3 custom you can select which files are to be installed Proceed as indicated on the screen and read attentively the S...

Страница 33: ...file under ADDIUNINSTALL Disk1 double click Fig 6 8 Installation of the ADDI UNINSTALL program Proceed as indicated on the screen 6 4 2 Software uninstalling with ADDI UNINSTALL Start the ADDI UNINSTALL program Fig 6 9 The ADDI UNINSTALL program Select the software or the driver to be deinstalled Click within the corresponding check box Click on Remove Proceed as indicated until the complete remov...

Страница 34: ...TALL program on your computer Start the ADDIREG program and click on Deinstall registration Quit ADDIREG Start the ADDI_UNINSTALL program Proceed as indicated until the complete removing of ADDIREG You can also download the program from the Internet 6 5 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 o...

Страница 35: ...Technical description Chapter 7 APCI CPCI 1500 26 7 CONNECTING THE PERIPHERAL 7 1 Connector pin assignment Fig 7 1 37 pin SUB D male connector ...

Страница 36: ...description Chapter 7 APCI CPCI 1500 27 7 2 Connection principle Fig 7 2 Connection principle of the input and output channels 7 3 Connection examples Fig 7 3 Connection examples for the input and output channels ...

Страница 37: ...Technical description Chapter 7 APCI CPCI 1500 28 Fig 7 4 Connection examples ...

Страница 38: ...Technical description Chapter 8 APCI CPCI 1500 29 8 FUNCTIONS OF THE BOARD 8 1 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 ...

Страница 39: ...limit value 5 V The base address and the interrupt lines are automatically set through the BIOS EMC design in accordance with CE regulations 8 2 Functions 8 2 1 Digital input s WARNING Do not operate the board simultaneously in several modes Otherwise you may damage the board PC and or the peripheral The board APCI CPCI 1500 supplies 16 optically isolated inputs The inputs comply with the 24 V ind...

Страница 40: ...After successful power ON reset data is immediately available on the board Special input functions 1 Interrupt The inputs 1 to 14 can generate an interrupt Inputs 1 to 8 It is possible to declare an OR or AND event to generate an interrupt Inputs 9 to 14 It is possible to declare an OR event to generate an interrupt Inputs 15 16 are not interruptible and are not used in events 2 Counter Counter 1 ...

Страница 41: ...utputs Protection against overtemperature shut down logic Each group of 4 outputs is switched off 1 to 4 5 to 8 9 to 12 13 to 16 The outputs are switched off if the ext supply voltage drops below 5 V Diagnostic report through status register or interrupt to the PC in case of short circuit overtemperature voltage drop or watchdog Transil diodes C filters and optical couplers filter noise from the p...

Страница 42: ...ent 2 has occurred input 9 14 Counter Timer 1 has run down Counter Timer 2 has run down Counter Timer 3 has run down Watchdog has run down the outputs are reset Voltage error the external voltage supply has dropped below 5 V Short circuit error overtemperature error The interrupt source information are available on the user program through an interrupt routine See API functions i_APCI1500_SetBoard...

Страница 43: ...ftware or an input can be set The polarity of the input can be programmed This gate stops counting when it is set Trigger can be driven by software or an input can be set The polarity of the input can be programmed This trigger re loads the counter timer with the initial counter value The following functionalities are available Initialising the counters timers Starting the counters timers Stopping...

Страница 44: ...0 ppm 1 747 kHz 100 ppm IMPORTANT The timer component internally operates with half of the input frequency Data Approximate watchdog times Input frequency 17 9 µs Æ 1175 ms 111 86 kHz 574 µs Æ 37 65 s 3 49 kHz 1 14 ms Æ 74 9 s 1 747 kHz Option only implemented for the APCI 1500 The counter input channels 1 2 and 3 can be equipped with fast optical couplers The maximum input frequency is then 140 k...

Страница 45: ...ong long PBYTE unsigned char unsigned char var byte integer integer PINT int int var integer integer integer PUINT unsigned int unsigned int var word long long PCHAR char char var string string string Table 9 2 Type Declaration for Windows 95 98 NT Borland C Microsoft C Borland Pascal Microsoft Visual Basic Dos Microsoft Visual Basic Windows VOID void void pointer any BYTE unsigned char unsigned c...

Страница 46: ... 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 Process general including input channels and output channels Decision Selection unit e g switch Loop limit Beginning Loop limit End ...

Страница 47: ...oose the language under Windows in which he she wants to program DLL_COMPILER_C The user programs in C DLL_COMPILER_VB The user programs in Visual Basic for Windows DLL_COMPILER_VB_5 The user programs in Visual Basic 5 for Windows NT or Windows 95 98 DLL_COMPILER_PASCAL The user programs in Pascal or Delphi DLL_LABVIEW The user programs in Labview Output No output signal has occurred Task If you w...

Страница 48: ...r 9 APCI CPCI 1500 39 Input b_Compilerdefine Function diagram i_APCI1500_InitCompiler Begin b_CompilerDefine correct i_APCI1500_InitCompiler end Ok i_APCI1500_InitCompiler end Error Yes No Save b_CompilerDefine Output Return value ...

Страница 49: ...d 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 Calling convention ANSI C int i_ReturnValue unsigned char b_SlotNumberArray 10 i_ReturnValue i_APCI1500_CheckAndGetPCISlotNumber b_SlotNumberArray Return value Returns the number of xPCI 1500 boards which are inserted in your PC If the return value equals 0 th...

Страница 50: ...ram i_APCI1500_CheckAndGetPCISlotNumber Begin APCI 1500 Board Yes i_APCI1500_CheckAndGetPCISlotNumber Returns the number of APCI 1500 Search next PCI board PCI board found Yes No No Save slot number Save base address Save interrupt Output pb_SlotNumberArray Return value ...

Страница 51: ...le1 of board xPCI 1500 for using the functions Task Checks if the board xPCI 1500 is present and stores the slot number A handle is returned to the user which allows to use the following functions Handles allow to operate several boards Return value 0 No error 1 Slot number is not available 2 Board not present 3 No handle is available for the board up to 10 handles can be used 4 Error by opening t...

Страница 52: ...I1500_SetBoardInformation Begin All APCI 1500 boards checked APCI 1500 board found Yes Input parameter OK Yes Board present Yes Yes i_APCI1500_SetBoardInformation End OK i_APCI1500_SetBoardInformation End Error No No No i_APCI1500_CheckAndgetPCISlotNumber No Output pb_BoardHandle Return value ...

Страница 53: ...1500 base address PBYTE pb_InterruptNbr xPCI 1500 interrupt channel PBYTE pb_SlotNumber xPCI 1500 slot number Task Returns the base address the interrupt and the slot number of the xPCI 1500 Calling convention ANSI C int i_ReturnValue unsigned int ui_BaseAddress unsigned char b_InterruptNbr unsigned char b_SlotNumber unsigned char b_BoardHandle i_ReturnValue i_APCI1500_GetHardwareInformation b_Boa...

Страница 54: ...on diagram b_BoardHandle OK Yes i_APCI1500_GetHardwareInformation End OK i_APCI1500_GetHardwareInformation End Error No Returns Base address interrupt number Slot number i_APCI1500_GetHardwareInformation Begin Output pui_BaseAddress pb_InterruptNumber pb_SlotNumber Return value ...

Страница 55: ...oseBoardHandle BYTE b_BoardHandle Parameters Input BYTE b_BoardHandle Handle of board xPCI 1500 Output No output signal has occurred Task Releases the board handle Blocks the access to the board Calling convention ANSI C int i_ReturnValue unsigned char b_BoardHandle i_ReturnValue i_APCI1500_CloseBoardHandle b_BoardHandle Return value 0 No error 1 The handle parameter of the board is wrong ...

Страница 56: ...BoardHandle Function diagram i_APCI1500_CloseBoardHandle Begin b_BoardHandle OK Interrupt routine installed Yes i_APCI1500_ResetBoardIntRoutine Yes Release b_BoardHandle No i_APCI1500_CloseBoardHandle OK i_APCI1500_CloseBoardHandle Error No Output Return value ...

Страница 57: ...hich an interrupt action is to be enabled It installs an user interrupt function in all boards on which an interrupt is to be enabled First calling first board the user interrupt routine is installed interrupts are enabled If you operate several boards xPCI 1500 which have to react to interrupts call up the function as often as you operate boards xPCI 1500 The variable v_FunctionName is only relev...

Страница 58: ... b_BoardHandle Handle of the xPCI 1500 which has generated the interrupt b_InterruptMask Mask of the events which have generated the interrupt b_InputChannelNbr If an interrupt is generated with a Mask 0000 0001 and if you use the OR PRIORITY logic this variable gives the input number which have generated the interrupt Table 9 3 Interrupt mask Mask Meaning 0000 0001 Event 1 has occurred 0000 0010 ...

Страница 59: ...d char b_BoardHandle unsigned char b_InterruptMask unsigned int b_InputChannelNumber int 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 ...

Страница 60: ...m i_APCI1500_SetBoardIntRoutineDos Begin b_BoardHandle OK Board interrupt installed Yes First interrupt installation Set API interrupt routine i_APCI1500_SetBoardIntRoutineDos End Yes No i_APCI1500_SetBoardIntRoutineDos Error No Yes No Save old interrupt routine Save v_FunktionName Output Return value ...

Страница 61: ...d the user interrupt routine is installed interrupts are enabled If you operate several boards xPCI 1500 which have to react to interrupts call up the function as often as you operate boards xPCI 1500 The variable v_FunctionName is only relevant for the first calling Interrupt The user interrupt routine is called up by the system when an interrupt is generated The following errors are possible ove...

Страница 62: ...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 Return value 0 No error 1 The handle parameter of the board is wrong 2 Interrupt already installed ...

Страница 63: ...0_SetBoardIntRoutineVBDos Begin b_BoardHandle OK Board interrupt installed Yes First interrupt installation Set API interrupt routine i_APCI1500_SetBoardIntRoutineVBDos End Yes No i_APCI1500_SetBoardIntRoutineVBDos Error No Yes No Save old interrupt routine Save v_FunktionName Output Return value ...

Страница 64: ... xPCI 1500 on which an interrupt action is to be enabled It installs one user interrupt function in all boards on which an interrupt is to be enabled First calling first board the user interrupt routine is installed interrupts are enabled If you operate several boards xPCI 1500 which have to react to interrupts call up the function as often as you operate boards xPCI 1500 The variable v_FunctionNa...

Страница 65: ...upt routine b_BoardHandle Handle of the xPCI 1500 which has generated the interrupt b_InterruptMask Mask of the events which have generated the interrupt b_InputChannelNbr If an interrupt is generated with a Mask 0000 0001 and if you use the OR PRIORITY logic this variable gives the input number which have generated the interrupt Mask Meaning 0000 0001 Event 1 has occurred 0000 0010 Event 2 has oc...

Страница 66: ...ardHandle 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 int i_ReturnValue unsigned char b_BoardHandle i_ReturnValue i_APCI1500_SetBoardIntRoutineWin16 b_BoardHandle v_FunctionName Return value 0 No error 1 The handle parameter of the board is wrong 2 Interrupt alrea...

Страница 67: ..._APCI1500_SetBoardIntRoutineWin16 Begin b_BoardHandle OK Board interrupt installed Yes First interrupt installation Set API interrupt routine i_APCI1500_SetBoardIntRoutineWin16 End Yes No i_APCI1500_SetBoardIntRoutineWin16 Error No Yes No Save old interrupt routine Save v_FunktionName Output Return value ...

Страница 68: ...allingMode VOID pv_UserSharedMemory Parameters Input BYTE b_BoardHandle Handle of board xPCI 1500 BYTE b_UserCallingMode APCI1500_SYNCHRONOUS_MODE The user routine is directly called by the driver interrupt routine APCI1500_ASYNCHRONOUS_MODE The user routine is called by the driver interrupt thread VOID v_FunctionName Name of the user interrupt routine ULONG ul_UserSharedMemorySize Determines the ...

Страница 69: ...alling first board the user interrupt routine is installed interrupts are enabled user shared memory is allocated if APCI1500_SYNCHROUNOUS_MODE ahs been selected If you operate several boards xPCI 1500 which have to react to interrupts call up the function as often as you operate boards xPCI 1500 The variable v_FunctionName is only relevant for the first calling From the second call of the functio...

Страница 70: ...r interrupt routine Driver interrupt routine Driver interrupt thread User interrupt routine Event Synchronous mode Asynchronous mode SYNCHRONOUS MODE ADVANTAGE The code of the user interrupt routine is directly called by driver interrupt routine ring 0 The time between interrupt and the user interrupt routine is reduced The user cannot debug the user interrupt routine The user routine cannot call ...

Страница 71: ...e ul_UserSharedMemorySize indicates the size in bytes of the selected user type A pointer of the variable ppv_UserSharedMemory is given to the user interrupt routine with the variable pv_UserSharedMemory This is not possible for Visual Basic The user interrupt routine must have the following syntax VOID v_FunctionName BYTE b_BoardHandle BYTE b_InterruptMask BYTE b_InputChannelNbr BYTE b_UserCallin...

Страница 72: ...r name for v_FunctionName b_BoardHandle b_InterruptMask b_InputChannelNbr b_UserCallingMode pv_UserSharedMemory IMPORTANT If you use Visual Basic 4 the following parameters have not signification You must used the i_APCI1500_TestInterrupt function BYTE b_UserCallingMode ULONG ul_UserSharedMemorySize VOID ppv_UserSharedMemory VOID v_FunctionName BYTE b_BoardHandle BYTE b_InterruptMask BYTE b_InputC...

Страница 73: ...of str_UserStruct void ps_UserSharedMemory v_FunctionName Visual Basic 5 Sub v_FunctionName ByVal i_BoardHandle As Integer ByVal i _InterruptMask As Integer ByVal i _InputChannelNbr As Integer ByVal b_UserCallingMode As Integer ByVal l_UserSharedMemory As Long End Sub Dim i_ReturnValue As Integer Dim i_BoardHandle As Integer i_ReturnValue i_APCI1500_SetBoardIntRoutineWin32 i_BoardHandle APCI1500_A...

Страница 74: ...32 Begin b_BoardHandle OK Board interrupt installed Yes First interrupt installation Set API interrupt routine i_APCI1500_SetBoardIntRoutineWin32 End Yes No No Yes No Save v_FunktionName Asynchronous mode Set API interrupt thread Create user shared memory User shared memory size 0 No Yes No Yes i_APCI1500_SetBoardintRoutineWin32 Error Output ppv_UserSharedMemory Return value ...

Страница 75: ...logic this variable returns the input number which has generated the event 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 Voltage error 1000 0000 Short circuit error Task Checks if a board xPCI 1500 has generated an int...

Страница 76: ...pt 0 IRQ number Input Function diagram i_APCI1500_TestInterrupt Begin Interrupt occurred i_APCI1500_TestInterrupt OK i_APCI1500_TestInterrupt Error No Yes Get pb_BoardHandle Get pb_InterruptMask Get pb_ChannelNbr Output b_BoardHandle b_InterruptMask pb_ChannelNbr Return value ...

Страница 77: ...ard 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 Calling convention ANSI C unsigned char b_BoardHandle Irq i_APCI1500_ResetBoardIntRoutine b_BoardHandle Return value 0 No error 1 Handle parameter of the board is wrong 2 Interrupt routine is not insta...

Страница 78: ...Handle Function diagram i_APCI1500_ResetBoardIntRoutine Begin b_BoardHandle OK Board interrupt installed Restore old interrupt and disable APCI 1500 interrupt i_APCI1500_ResetBoardIntRoutine OK i_APCI1500_ResetBoardIntRoutine Error No No Yes Yes Output Return value ...

Страница 79: ...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 Reads the 16 input channels at once Example pl_InputValue 5555 Hex A voltage is present on the input channels 1 3 5 7 9 11 13 15 A voltage is not present on the input channels 2 4 6 8 10 12 14 16 Return value 0 No...

Страница 80: ...Address 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 The output channels 1 3 5 7 9 11 13 15 are set The output channels 2 4 6 8 10 12 14 16 are reset Return value 0 No error ...

Страница 81: ...el passes the input channel to be read 1 to 16 A value is returned with the variable pb_ChannelValue 0 low or 1 high Return value 0 No error 1 The handle parameter of the board is wrong 2 The input number is not between 1 and 16 2 i_APCI1500_Read8DigitalInput Syntax Return value i_APCI1500_Read8DigitalInput BYTE b_BoardHandle BYTE b_Port PBYTE pb_PortValue Parameters BYTE b_BoardHandle Handle of t...

Страница 82: ...italInput Syntax Return value i_APCI1500_Read16DigitalInput BYTE b_BoardHandle PLONG pl_InputValue Parameters BYTE b_BoardHandle Handle of the xPCI 1500 PLONG pl_InputValue State of the digital input channels of both ports 0 to 65535 Task Indicates the state of both ports Reads the 16 input channels at once Example pl_InputValue 5555 Hex A voltage is present on the input channels 1 3 5 7 9 11 13 1...

Страница 83: ...hest priority Input 8 has the lowest priority One possibility for the second port APCI1500_OR This logic connects the input channels with a OR logic PCHAR pc_EventMask This 8 digit character string port 1 and 6 digit character string port 2 defines the mask of the event Each digit indicates the state of the input channel The state is identified by one of the following characters X This input chann...

Страница 84: ...e happened An event is a change of state ex LowÆ high on one or several input channels if an AND OR OR_PRIORITY logic has been defined Examples Example 1 b_PortNbr 1 b_Logik APCI1500_AND pc_EventMask 3X100101 An event is generated when the input channels 2 4 and 5 are on 0 when the input channels 1 3 and 6 are on 1 and when a rising edge has been detected at input 8 T Input 8 Input 7 Input 6 Input...

Страница 85: ... 1 on input 3 on input 5 on input 8 on input 6 on input 1 Return value 0 No error 1 The handle parameter of the board is wrong 2 The parametered port number is wrong parameter 1 or 2 3 Error with the logic parameter b_Logik has not the expected value 4 Error with the mask parameter pc_EventMask has not the expected value 5 Interrupt routine not installed 6 More than 1 edge event has been declared ...

Страница 86: ...e 0 No error 1 Handle parameter of the board is wrong 2 The parametered port number is wrong 3 Event has not been initialised with the function i_APCI1500_SetInputEvent 3 i_APCI1500_StopInputEvent Syntax Return value i_APCI1500_StopInputEvent 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 funct...

Страница 87: ...set them with the function i_APCI1500_SetXDigitalOutputOff Return value 0 No error 1 Handle parameter of the board is wrong 2 i_APCI1500_SetOutputMemoryOff Syntax Return value i_APCI1500_SetOutputMemoryOff BYTE b_BoardHandle Parameters BYTE b_BoardHandle Handle of the xPCI 1500 Task Deactivates the digital output memory Return value 0 No error 1 Handle parameter of the board is wrong 3 i_APCI1500_...

Страница 88: ... channels are set to 0 Return value 0 No error 1 Handle parameter of the board is wrong 2 Input number is not between 1 and 16 4 i_APCI1500_Set1DigitalOutputOff Syntax Return value i_APCI1500_Set1DigitalOutputOff BYTE b_BoardHandle BYTE b_Channel Parameters BYTE b_BoardHandle Handle of the xPCI 1500 BYTE b_Channel Number of the output channel you want to reset 1 to 16 Task Resets the output channe...

Страница 89: ...nnel means setting to high If you have switched off the digital output memory OFF the input channels are set to 0 Example Switching on the digital output memory ON see function i_APCI1500_SetOutputMemoryOn b_Port 1 b_Value 55 Hex The output channels 1 3 5 7 are set The other output channels hold their state Switching off the digital output memory OFF see function i_APCI1500_SetOutputMemoryOff b_Po...

Страница 90: ...ex The output channels 1 3 5 7 are reset 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 port number is not 1 or 2 3 The digital output memory is OFF Please first use the function i_APCI1500_SetOutputMemoryOn 7 v_APCI1500_Set16DigitalOutputOn Syntax Retur...

Страница 91: ...OutputMemoryOff l_Value 5555 Hex Outputs 1 3 5 7 9 11 13 15 are set Outputs 2 4 6 8 10 12 14 16 are reset Return value 0 No error 1 The handle parameter of the board is wrong 8 v_APCI1500_Set16DigitalOutputOff Syntax Return value v_APCI1500_Set16DigitalOutputOff BYTE b_BoardHandle LONG l_Value Parameters BYTE b_BoardHandle Handle of the xPCI 1500 LONG l_Value Output value 0 to 65535 Task Resets on...

Страница 92: ...PCI1500_InitTimerInputClock Syntax Return value i_APCI1500_InitTimerInputClock BYTE b_BoardHandle BYTE b_InputClockCase Parameters BYTE b_BoardHandle Handle of the xPCI 1500 BYTE b_InputClockCase Select the input clock for the 3 timers APCI1500_115_KHZ 111 5 kHz APCI1500_3_6_KHZ 3 6 kHz APCI1500_1_8_KHZ 1 8 kHz IMPORTANT The timer component internally operates with half of the input frequency Task...

Страница 93: ...alue is loaded APCI1500_SINGLE If the counter or timer value is set to 0 the counter or timer is stopped 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 Task Selects the operating mo...

Страница 94: ...unter it loads the start value of the counter If the counter timer is used as a timer it loads the divider factor for the output BYTE b_ContinuousOrSingleCycleSelect APCI1500_CONTINUOUS Each time the counter value or timer value is set to 0 l_ReloadValue is loaded APCI1500_SINGLE If the counter or timer value is set to 0 the counter or timer is stopped BYTE b_HardwareOrSoftwareTriggerSelect APCI15...

Страница 95: ... or several times if the counter timer is used as a counter or a timer if an interrupt must be generated when the counter timer has run down if the external trigger is used and if the external gate is used Return value 0 No error 1 The handle parameter of the board is wrong 2 Wrong selection for counter timer APCI1500_COUNTER or APCI1500_TIMER 3 Error with the interrupt selection APCI1500_ENABLE o...

Страница 96: ... parameter has 2 meanings If the counter watchdog is used as a counter it loads the limit value of the counter If the counter watchdog is used as a watchdog it loads the watchdog time BYTE b_ContinuousOrSingleCycleSelect APCI1500_CONTINUOUS Each time the counting or timer value is set to 0 l_ReloadValue is loaded APCI1500_SINGLE If the counter or timer value is set to 0 the counter or timer is sto...

Страница 97: ...CHDOG 3 Interrupt selection error APCI1500_ENABLE or APCI1500_DISABLE 4 User interrupt routine is not installed 5 Cycle parameter is wrong APCI1500_CONTINUOUS or APCI1500_SINGLE 6 Gate parameter is wrong APCI1500_SOFTWARE_GATE or APCI1500_HARDWARE_GATE 5 i_APCI1500_StartTimerCounter1 Syntax Return value i_APCI1500_StartTimerCounter1 BYTE b_BoardHandle Parameters BYTE b_BoardHandle Handle of the xP...

Страница 98: ...eturn value 0 No error 1 The handle parameter of the board is wrong 2 The counter or timer has not been initialised Please use function i_APCI1500_InitTimerCounter2 7 i_APCI1500_StartCounter3 Syntax Return value i_APCI1500_StartCounter3 BYTE b_BoardHandle Parameters BYTE b_BoardHandle Handle of the xPCI 1500 Task Starts the third counter Please initialise it previously with the function i_APCI1500...

Страница 99: ...TimerCounter1 i_APCI1500_StopTimerCounter1 Return value 0 No error 1 The handle parameter of the board is wrong 2 The counter or timer has not been initialised Please use function i_APCI1500_InitTimerCounter1 9 i_APCI1500_StopTimerCounter2 Syntax Return value i_APCI1500_StopTimerCounter2 BYTE b_BoardHandle Parameters BYTE b_BoardHandle Handle of the xPCI 1500 Task Stops the second counter timer Th...

Страница 100: ...merCounter1 BYTE b_BoardHandle Parameters BYTE b_BoardHandle Handle of the xPCI 1500 Task Triggers the first counter timer The start value is loaded in the counter timer Return value 0 No error 1 The handle parameter of the board is wrong 2 The counter or timer has not been initialised Please use function i_APCI1500_InitTimerCounter1 12 i_APCI1500_TriggerTimerCounter2 Syntax Return value i_APCI150...

Страница 101: ...e xPCI 1500 Task Triggers the watchdog The start value is loaded in the watchdog Return value 0 No error 1 The handle parameter of the board is wrong 2 The watchdog has not been initialised 3 The counter watchdog has been initialised as a counter Please use function i_APCI1500_InitWatchdogCounter3 15 i_APCI1500_ReadTimerCounter1 Syntax Return value i_APCI1500_ReadTimerCounter1 BYTE b_BoardHandle P...

Страница 102: ... Parameters BYTE b_BoardHandle Handle of the xPCI 1500 PLONG pl_ReadValue This parameter has two meanings When the counter timer is used as a counter it returns the current value of the counter When the counter timer is used as a timer it returns the current value of the timer Task Reads the current value of the second counter timer if used as a counter or reads the timer content if used as a time...

Страница 103: ...r it returns the current value of the counter Task Reads the current value of the third counter watchdog if used as a counter Counter the counter value is decremented each time the input changes from low to high This counter value can be read with this function 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 bee...

Страница 104: ...ation of one xPCI 1500 board a Flow chart 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 Begin Initialisation Ok Yes Yes Initialisation Error No No ...

Страница 105: ...le 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 0 pb_BoardHandle 0 return 0 OK else return 1 ERROR else return 1 ERROR ...

Страница 106: ...PCI 1500 boards a Flow chart 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 Begin Initialisation Ok Yes Yes Initialisation Error No No ...

Страница 107: ...ndows defined _WINDOWS defined _WIN32 i_APCI1500_InitCompiler DLL_COMPILER_C endif i_NbrOfBoard i_PCI1710_CheckAndGetPCISlotNumber b_SlotNumberArray if i_NbrOfBoard 0 for i_Cpt 0 i_Cpt i_NbrOfBoard i_Cpt if i_APCI1500_SetBoardInformation b_SlotNumberArray i_Cpt pb_BoardHandleArray i_Cpt 0 break if i_Cpt i_NbrOfBoard return i_Cpt Return number of board found else return 1 ERROR else return 1 ERROR ...

Страница 108: ...t counter of port 1 Increment the event counter of port 2 Mask interrupt 0x1 Mask interrupt 0x2 Increment the counter of timer counter 1 Mask interrupt 0x4 Increment the counter of timer counter 2 Mask interrupt 0x8 Increment the counter of counter 3 Increment the counter of Watchdog Increment the counter for voltage error Mask interrupt 0xC0 Mask interrupt 0x10 Mask interrupt 0x20 ...

Страница 109: ...b_EventCpt 0 1 Event port 1 interrupt if b_InterruptMask 0x1 b_EventCpt 1 b_EventCpt 1 1 Event port 2 interrupt if b_InterruptMask 0x4 b_TimerCounterCpt 0 b_TimerCounterCpt 0 1 Timer Counter 1 interrupt if b_InterruptMask 0x8 b_TimerCounterCpt 1 b_TimerCounterCpt 1 1 Timer Counter 2 interrupt if b_InterruptMask 0x10 b_TimerCounterCpt 2 b_TimerCounterCpt 2 1 Counter 3 interrupt if b_InterruptMask 0...

Страница 110: ...ry if b_InterruptMask 0x1 b_EventCpt 0 b_EventCpt 0 1 Event port 1 interrupt if b_InterruptMask 0x1 b_EventCpt 1 b_EventCpt 1 1 Event port 2 interrupt if b_InterruptMask 0x4 b_TimerCounterCpt 0 b_TimerCounterCpt 0 1 Timer Counter 1 interrupt if b_InterruptMask 0x8 b_TimerCounterCpt 1 b_TimerCounterCpt 1 1 Timer Counter 2 interrupt if b_InterruptMask 0x10 b_TimerCounterCpt 2 b_TimerCounterCpt 2 1 C...

Страница 111: ...t b_EventCpt 0 ps_UserStruct b_EventCpt 0 1 if b_InterruptMask 0x1 Event port 2 interrupt ps_UserStruct b_EventCpt 1 ps_UserStruct b_EventCpt 1 1 if b_InterruptMask 0x4 Timer Counter 1 interrupt ps_UserStruct b_TimerCounterCpt 0 ps_UserStruct b_TimerCounterCpt 0 1 if b_InterruptMask 0x8 Timer Counter 2 interrupt ps_UserStruct b_TimerCounterCpt 1 ps_UserStruct b_TimerCounterCpt 1 1 if b_InterruptMa...

Страница 112: ... i_APCI1500_CloseBoardHandle Timer 1 interrupt test Begin Timer 1 interrupt test End i_APCI1500_SetBoardIntRoutine Yes Return value 0 Yes i_APCI1500_InitTimerCounter1 Loop Write number of interrupt Until a key is pressed i_APCI1500_StopTimerCounter1 i_APCI1500_ResetBoardIntRoutine 2 2 i_APCI1500_StartTimerCounter1 1 1 ...

Страница 113: ... value d i_ReturnValue i_ReturnValue i_APCI1500_StartTimerCounter1 b_BoardHandle printf nTimer start return value d i_ReturnValue do printf nTimer interrupt counter d b_TimerCounterCpt 0 while kbhit getch i_ReturnValue i_APCI1500_StopTimerCounter1 b_BoardHandle printf nTimer stop return value d i_ReturnValue i_ReturnValue i_APCI1500_ResetBoardIntRoutine b_BoardHandle printf nReset board interrupt ...

Страница 114: ...eturn value d i_ReturnValue i_ReturnValue i_APCI1500_StartTimerCounter1 b_BoardHandle printf nTimer start return value d i_ReturnValue do printf nTimer interrupt counter d b_TimerCounterCpt 0 while kbhit getch i_ReturnValue i_APCI1500_StopTimerCounter1 b_BoardHandle printf nTimer stop return value d i_ReturnValue i_ReturnValue i_APCI1500_ResetBoardIntRoutine b_BoardHandle printf nReset board inter...

Страница 115: ...lisation return value d i_ReturnValue i_ReturnValue i_APCI1500_StartTimerCounter1 b_BoardHandle printf nTimer start return value d i_ReturnValue do printf nTimer interrupt counter d b_TimerCounterCpt 0 while kbhit getch i_ReturnValue i_APCI1500_StopTimerCounter1 b_BoardHandle printf nTimer stop return value d i_ReturnValue i_ReturnValue i_APCI1500_ResetBoardIntRoutine b_BoardHandle printf nReset b...

Страница 116: ...ONTINUOUS APCI1500_ENABLE printf nTimer initialisation return value d i_ReturnValue i_ReturnValue i_APCI1500_StartTimerCounter1 b_BoardHandle printf nTimer start return value d i_ReturnValue do printf nTimer interrupt counter d ps_GlobalUserStruct b_TimerCounterCpt 0 while kbhit getch i_ReturnValue i_APCI1500_StopTimerCounter1 b_BoardHandle printf nTimer stop return value d i_ReturnValue i_ReturnV...

Страница 117: ...e 1 counter 31 33 35 diagnostic outputs 32 digital inputs 5 30 31 circuitry 31 counter 31 interrupt 31 digital outputs 6 32 33 diagnostic 32 EMC 4 event 33 functions of the board 29 35 gate 34 installation 10 14 intended purpose of the board 1 Internet error analysis 25 interrupt 31 33 interrupt sources 33 limit values 5 7 energy requirements 5 overflow 33 PC selecting a slot 11 pin connector 26 s...

Отзывы: