background image

InitCOSDriver

 

This function performs the initialization required to respond to change-of-state IRQs. It must be called 
before GetCOSData can be called, although calling GetCOSData first will only cause it to return a value of 
FALSE. The function's parameters are the card's Base Address, the IRQ level to monitor, the card's bus 
type, and the card's bus number. The last two parameters, BusType and BusNumber, are only used in 
Windows NT. The header files Win32COS.PAS (for Pascal) and Win32COS.H (for C) contain the 
enumerated constants that can be passed in the BusType parameter. The two possible values are PCIBus 
and Isa. For Windows 95/98, the IRQCOS Driver ignores these parameters and their values can be set to 
zero. The return result is TRUE if initialization was completed successfully, FALSE if not. 

  

GetCOSData

 

This function suspends the thread that it was called from and waits for an IRQ to occur on the IRQ level 
that was passed to InitCOSDriver. GetCOSData will return immediately, however, if an IRQ occurred 
anytime before the GetCOSData call, as long as InitCOSDriver was previously called. Otherwise, 
GetCOSData will not return until an IRQ occurs. If the program needs to continue running while waiting for 
GetCOSData, a separate thread should be created from which to call GetCOSData. Immediately upon 
detecting an IRQ, GetCOSData reads 48 bits of data off the card and returns the data in a pointer supplied 
by the calling application. This pointer must be at least six bytes and must be allocated by the calling 
application. For cards that contain less than 48 bits of data, the lowest bits are valid and the extraneous 
data should be discarded. For example, a card that contains 24 bits of data will return the valid data in the 
lowest 3 bytes of the memory block pointed to by the supplied pointer, while the upper 3 bytes will be 
invalid. If multiple interrupts occur before any GetCOSData call, the data read after the most recent IRQ will 
be returned. The return result is TRUE if an IRQ was detected on the given IRQ level and data was 
successfully read, FALSE if InitCOSDriver was not called before calling GetCOSData. 

 

SETUP.EXE

  
This program is supplied in the root or base directory as a tool for you to use in configuring jumpers on the 
card. It is menu-driven and provides pictures of the card on the computer monitor. You make simple 
keystrokes to select functions. The picture on the monitor then changes to show how the jumper should be 
placed to effect your choices. 
  
The setup program is a stand-alone program that can be run at any time. It does not require that the card 
be plugged into the computer for any part of the setup. The program is self-explanatory with operation 
instructions and on-line help. 
  

To run this program, at the DOS prompt, enter SETUP.EXE followed by 

-

 

VisualBASIC Utility Driver

  
Extensions to the VisualBASIC 3.0 language are also included on the diskette provided with your card. (For 
later versions of VisualBASIC, use the ACCES32 driver and samples.) The extensions are in a directory 
named VBACCES. These extensions are in the form of a .DLL, a .GBL, and a VisualBASIC sample. 
Together these files allow you to access the port and main memory space in a fashion similar to BASIC, 
QuickBASIC, Pascal, C/C++, Assembly, and most other standard languages. 
  
To use these files in a VisualBASIC program, you must create a .MAK file (File l New Project) similar to the 
sample provided (or else, modify your existing project file) and include the .GBL file (File | Add File). Once 
this has been done, VisualBASIC will be enhanced with the addition of the following functions. 

  

InPortb

 

 

Function: 

Reads a byte from a hardware port. Due to limitations of VisualBASIC, the number is 
returned in an integer. 

 Declaration: 

function InPortb(byval address as integer) as integer

 

Manual PCI-DIO-48(S) 

15

Summary of Contents for PCI-DIO-48

Page 1: ...MODEL PCI DIO 48 S USER MANUAL FILE MPCI DIO 48S D3c...

Page 2: ...nor the rights of others IBM PC PC XT and PC AT are registered trademarks of the International Business Machines Corporation Printed in USA Copyright 1995 2005 by Portwell I O Products Inc All rights...

Page 3: ...nty Warranty commences with equipment shipment Following Years Throughout your equipment s lifetime Portwell stands ready to provide on site or in plant service at reasonable rates similar to those of...

Page 4: ...tion Selection Map 12 Chapter 4 Address Selection 13 Chapter 5 Software 14 Chapter 6 Programming 17 Table 6 1 Address Assignment Table 17 Table 6 2 Control Register Bit Assignment 18 Table 6 3 Change...

Page 5: ...red and if any one or more bits change state a latched interrupt request can be generated Thus it is not necessary to use software to continuously poll the inputs to detect a change of state The chang...

Page 6: ...O 22 Gordos Potter Brumfield et al module mounting racks Every second conductor of the flat cables is grounded to minimize crosstalk between signals in the cables If needed for external circuits 5 VDC...

Page 7: ...l Outputs Logic High 2 0 VDC min source 32 mA Logic Low 0 55 VDC max sink 64 mA Power Output 5 VDC from computer bus ext 1A fast blow fuse recommended Power Required 5 VDC at 250 mA typical Size 6 9 L...

Page 8: ...STATE DETECT CHANGE OF STATE INTERRUPT APPLIES TO S CARDS ONLY CHANGE OF STATE INTERRUPT EXTERNAL INTERRUPT COMPUTER PCI BUS I O B U F F E R S C O N N E C T O R C O N N E C T O R PORT A PORT B PORT C...

Page 9: ...ous card options CD Software Installation The following instructions assume the CD ROM drive is drive D Please substitute the appropriate drive letter for your system as necessary DOS 1 Place the CD i...

Page 10: ...of the provided sample programs that was copied to the newly created card directory from the CD to test and validate your installation The base address assigned by BIOS or the operating system can cha...

Page 11: ...position the I O buffers are always enabled When the jumper is in the TST Tristate position enabled disabled state is controlled by a control register See the programming section of this manual for a...

Page 12: ...Figure 3 1 Option Selection Map Manual PCI DIO 48 S 12...

Page 13: ...s and the respective IRQs allotted Alternatively some operating systems Windows95 98 2000 can be queried to determine which resources were assigned In these operating systems you can use either PCIFin...

Page 14: ...ter It is not necessary to reboot your system prior to using IRQCOS SYS Win32COS DLL Description Win32COS DLL is a Dynamic Link Library or DLL for Windows 95 98 and NT It provides a simple interface t...

Page 15: ...d pointer while the upper 3 bytes will be invalid If multiple interrupts occur before any GetCOSData call the data read after the most recent IRQ will be returned The return result is TRUE if an IRQ w...

Page 16: ...s integer byval offset as integer byval value as integer as integer Note that in all of the above functions an inherent limitation of BASIC in general and VisualBASIC in particular makes the values se...

Page 17: ...ts A3 through A0 as follows Address Port Assignment Operation Base Address PA Group 0 Read Write Base Address 1 PB Group 0 Read Write Base Address 2 PC Group 0 Read Write Base Address 3 Control Group...

Page 18: ...eans to enable disable the tristate I O buffers under program control If the TST BEN jumper on the card is installed in the BEN position the I O buffers are permanently enabled However if that jumper...

Page 19: ...E_ADDRESS 3 0x09 Enable the tristate output buffers by using the same control byte used to configure the PPI but now set bit D7 low See item d above Programming Example BASIC The following example in...

Page 20: ...nd the output buffers will be disabled This problem can be resolved as follows Two computer I O bus addresses are available that permit you to enable or disable the I O buffers at will without program...

Page 21: ...through D5 control ports A B and C of the 8255 PPIs as shown in Table 4 Any access of Base B will enable the non COS IRQ associated with port C bit 3 Bit Port Controlled D0 Group 0 Port A D1 Group 0 P...

Page 22: ...ort C Hi PC6 3 4 Port C Hi PC5 5 6 Port C Hi PC4 7 8 Port C Lo PC3 9 Ground 10 Port C Lo PC2 11 12 Port C Lo PC1 13 14 Port C Lo PC0 15 16 Port B PB7 17 Ground 18 Port B PB6 19 20 Port B PB5 21 22 Por...

Page 23: ...ny problems with this manual or just want to give us some feedback please email us at tech portwell com Please detail any errors you find and include your mailing address so that we can send you any m...

Reviews: