C:\Program Files\ACCES\104-DIO-24S\Doc.html
C:\Program Files\ACCES\104-DIO-24S\DIO247.dll
C:\Program Files\ACCES\104-DIO-24S\DIO247\DIO247.inf
C:\Program Files\ACCES\104-DIO-24S\DIO247\DIO247.cat
C:\Program Files\ACCES\104-DIO-24S\DIO247\Drivers\NT32\DIO247.sys
C:\Program Files\ACCES\104-DIO-24S\DIO247\Drivers\NT64\DIO247.sys
C:\Program Files\ACCES\104-DIO-24S\Headers\DIO247.pas
C:\Program Files\ACCES\104-DIO-24S\Headers\DIO247.h
C:\Program Files\ACCES\104-DIO-24S\C Libraries\VCDIO247.lib
I/O Range | 320-33F |
---|---|
IRQ | 7 |
DIO247.dll provides this API; it can be placed in C:\Windows\System32\, or in the same dir as the executable.
Headers are provided for C/C++ and Delphi (Object Pascal). C/C++ also requires a library file; one is provided for Microsoft Visual C/C++. Because the names match, it's possible to start with an ACCES32-based sample, and just remove VCACCES.lib and add VCDIO247.lib.
function GetNumCards: LongWord; cdecl; external 'DIO247.dll';
__declspec(dllimport) unsigned long GetNumCards(void);
GetNumCards() returns the number of cards installed using DIO247. The first card always has a card number of 0, the next (if any) is 1, etc. Thus if GetNumCards() returns 3, then the cards are numbered 0, 1, and 2.
function QueryCardID(CardNum: LongWord; pID: PLongWord): LongWord; cdecl; external 'DIO247.dll';
__declspec(dllimport) unsigned long QueryCardID(unsigned long CardNum, unsigned long *pDeviceID);
QueryCardID() fetches the virtual device ID of a card. The 104-DIO-24S's virtual device ID is 0x10E50. It returns a Windows error code, which will be ERROR_SUCCESS on success.
function QueryCardBase(CardNum: LongWord; pBase: PLongWord): LongWord; cdecl; external 'DIO247.dll';
__declspec(dllimport) unsigned long QueryCardBase(unsigned long CardNum, unsigned long *pBase);
QueryCardBase() fetches the base address of a card. This can be used for non-Rel port I/O. It returns a Windows error code, which will be ERROR_SUCCESS on success.
function WaitForIRQ(CardNum: LongWord): LongWord; cdecl; external 'DIO247.dll';
__declspec(dllimport) unsigned long WaitForIRQ(unsigned long CardNum);
WaitForIRQ() performs a wait, which will return when the card generates an IRQ. In normal use, spawn a worker thread which calls this function. It returns a Windows error code, which will be ERROR_SUCCESS on success.
An IOCTL with no .DLL wrapper can be called to cancel a pending wait. Contact the factory for details.
function WaitForIRQData(CardNum: LongWord; DataBytes: LongInt; pData: Pointer): LongWord; cdecl; external 'DIO247.dll';
__declspec(dllimport) unsigned long WaitForIRQData(unsigned long CardNum, signed long DataBytes, void *pData);
WaitForIRQData() performs a wait like WaitForIRQ(); if the wait completes successfully, it fills in the data buffer with bytes read from the card. For the 104-DIO-24S, this is normally 3 bytes, for ports A, B, and C.
InPortB, InPort, InPortL, OutPortB, OutPort, and OutPortL function like their ACCES32 counterparts.
RelInPortB, RelInPort, RelInPortL, RelOutPortB, RelOutPort, and RelOutPortL, are similar, but use a relative offset instead of an absolute address.
For example, if card number 0 has a base address of 0x320, RelOutPortB(0, 1, 0xF0) is equivalent to OutPortB(0x321, 0xF0).
Function | Use |
---|---|
RelInPortB | Read a byte from a relative offset |
RelInPort | Read a word (2 bytes) from a relative offset |
RelInPortL | Read a double-word (4 bytes) from a relative offset |
RelOutPortB | Write a byte to a relative offset |
RelOutPort | Write a word (2 bytes) to a relative offset |
RelOutPortL | Write a double-word (4 bytes) to a relative offset |
InPortB | Read a byte from an absolute address |
InPort | Read a word (2 bytes) from an absolute address |
InPortL | Read a double-word (4 bytes) from an absolute address |
OutPortB | Write a byte to an absolute address |
OutPort | Write a word (2 bytes) to an absolute address |
OutPortL | Write a double-word (4 bytes) to an absolute address
|