234
DIO-BM(PCI-CPCI) www.interface.co.jp GPF-2X72C Windows Driver Software for Bus Master Digital Input/Output Product Help for Windows

GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

DIO-BM(PCI-CPCI)

www.interface.co.jp

GPF-2X72C W indows Driver Software for Bus Master Digital Input/Output Product

Help for Windows

Page 2: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

2

Chapter 1 Introduction ....................................................................................................4 1.1 Overview .......................................................................................................................................................... 4 1.2 Features ........................................................................................................................................................... 4

Chapter 2 Product Specifications....................................................................................5 2.1 Functional Specifications.................................................................................................................................. 5 2.2 Product Composition ........................................................................................................................................ 6 2.3 x64 Environment............................................................................................................................................... 8

2.3.1 Main Memory ..................................................................................................................................... 8 2.3.1 Confirming the Result of Physical Memory Allocation ........................................................................ 9 2.3.2 Changing Allocated Physical Memory Size ........................................................................................ 9

Chapter 3 Programming Guide .....................................................................................10 3.1 Installation ...................................................................................................................................................... 10 3.2 Programming Guide ....................................................................................................................................... 10

3.2.1 Initializing a Device .......................................................................................................................... 11 3.2.2 Configuring Operation Parameters................................................................................................... 12 3.2.3 Start, Suspension, and Termination Conditions ............................................................................... 12 3.2.4 Bus Master Transfer Buffer (32-bit Environment)............................................................................. 13 3.2.5 Bus Master Transfer Buffer (64-bit Environment)............................................................................. 14 3.2.6 Configuring Interrupt Handling ......................................................................................................... 14 3.2.7 Starting the Transfer ........................................................................................................................ 14 3.2.8 Closing the Device ........................................................................................................................... 14

3.3 Preparing the Transfer Buffer ......................................................................................................................... 15 Chapter 4 Reference ....................................................................................................17

4.1 List of DLL Function........................................................................................................................................ 17 4.1.1 DioBmOpen ..................................................................................................................................... 19 4.1.2 DioBmClose ..................................................................................................................................... 22 4.1.3 DioBmSetDeviceConfig.................................................................................................................... 24 4.1.4 DioBmGetDeviceConfig ................................................................................................................... 27 4.1.5 DioBmSetBufferConfig ..................................................................................................................... 29 4.1.6 DioBmGetBufferConfig..................................................................................................................... 33 4.1.7 DioBmSetTriggerConfig ................................................................................................................... 36 4.1.8 DioBmGetTriggerConfig................................................................................................................... 39 4.1.9 DioBmStart....................................................................................................................................... 41 4.1.10 DioBmStop..................................................................................................................................... 43 4.1.11 DioBmEnd...................................................................................................................................... 45 4.1.12 DioBmSoftTrigger........................................................................................................................... 47 4.1.13 DioBmSetEventConfig ................................................................................................................... 49 4.1.14 DioBmGetEventConfig ................................................................................................................... 52 4.1.15 DioBmSetCounterEventConfig....................................................................................................... 54 4.1.16 DioBmGetCounterEventConfig ...................................................................................................... 57 4.1.17 DioBmSetEvent.............................................................................................................................. 59 4.1.18 DioBmKillEvent .............................................................................................................................. 65 4.1.19 DioBmGetCounter.......................................................................................................................... 67 4.1.20 DioBmGetStatus ............................................................................................................................ 69 4.1.21 DioBmInputDword .......................................................................................................................... 72 4.1.22 DioBmOutputDword ....................................................................................................................... 74 4.1.23 DioBmGetLine................................................................................................................................ 76 4.1.24 DioBmSetLine ................................................................................................................................ 79 4.1.25 DioBmGetDeviceInfo...................................................................................................................... 83 4.1.26 DioBmAllocateBuffer ...................................................................................................................... 85 4.1.27 DioBmFreeBuffer ........................................................................................................................... 87 4.1.28 DioBmGetData ............................................................................................................................... 89 4.1.29 DioBmReadData ............................................................................................................................ 91 4.1.30 DioBmSetData ............................................................................................................................... 93 4.1.31 DioBmWriteData ............................................................................................................................ 96 4.1.32 DioBmClearData ............................................................................................................................ 99 4.1.33 DioBmSetDeviceConfigEx.............................................................................................................101 4.1.34 DioBmGetDeviceConfigEx ............................................................................................................105 4.1.35 DioBmStopEx................................................................................................................................107 4.1.36 DioBmSoftTriggerEx .....................................................................................................................109 4.1.37 DioBmSetEdgeEventConfig ..........................................................................................................111 4.1.38 DioBmGetEdgeEventConfig..........................................................................................................114 4.1.39 DioBmSetEventEx.........................................................................................................................117 4.1.40 DioBmSetFilter ..............................................................................................................................126 4.1.41 DioBmGetFilter .............................................................................................................................129 4.1.42 DioBmClearSamplingOutput .........................................................................................................132 4.1.43 DioBmSetClearMode ....................................................................................................................134 4.1.44 DioBmGetClearMode ....................................................................................................................136 4.1.45 DioBmCommonGetPciDeviceInfo .................................................................................................138 4.1.46 DioBmGetDriverInfo ......................................................................................................................148

Page 3: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

3

4.1.47 DioBmSetPhysicalMemorySize.....................................................................................................151 4.2 Callback Routine ...........................................................................................................................................153

4.2.1 Callback Routine Set by DioBmSetEvent........................................................................................153 4.2.1 Callback Routine Set by DioBmSetEventEx....................................................................................156 4.2.2 Programming Constraints in Visual Basic .......................................................................................160

4.3 Structure........................................................................................................................................................161 4.3.1 DIOBMCONF ..................................................................................................................................161 4.3.2 DIOBMTRIGCONF..........................................................................................................................171 4.3.3 DIOBMINFO....................................................................................................................................175 4.3.4 DIOBMCONFEX .............................................................................................................................177

4.4 Return Values................................................................................................................................................200 Chapter 5 Sample Programs ...................................................................................... 202

5.1 Execution Procedure .....................................................................................................................................202 5.2 List of Sample Programs ...............................................................................................................................203

5.2.1 DiBm ...............................................................................................................................................203 5.2.2 DoBm..............................................................................................................................................203 5.2.3 ExBm ..............................................................................................................................................203 5.2.4 sampling .........................................................................................................................................204 5.2.5 patternout........................................................................................................................................204

5.3 Programming Examples ................................................................................................................................205 5.3.1 C (32-bit Environment) ....................................................................................................................205 5.3.2 C (64-bit Environment) ....................................................................................................................207 5.3.3 Visual Basic (32 bit) ........................................................................................................................211 5.3.4 Visual Basic (64-bit) ........................................................................................................................213 5.3.5 Delphi (32-bit) .................................................................................................................................216 5.3.6 Delphi (64-bit) .................................................................................................................................219

Chapter 6 Data Format.................................................................................................. 222 6.1 Data Size.......................................................................................................................................................222 6.2 Data Packing .................................................................................................................................................223

Chapter 7 Utility Programs.......................................................................................... 225 7.1 Bus Master Digital Input Utility Program ........................................................................................................225 7.2 Bus Master Digital Output Utility Program .....................................................................................................225 7.3 CardBus ID Configuration Utility Program .....................................................................................................226

7.3.1 Configuring the ID Number .............................................................................................................226 7.4 Memory Size Configuration Utility..................................................................................................................227

Chapter 8 How to Use .NET ....................................................................................... 228 8.1 Overview .......................................................................................................................................................228 8.2 Class Library .................................................................................................................................................228

8.2.1 Creating the Class Library...............................................................................................................228 8.2.2 Adding Class Library Reference .....................................................................................................229

Chapter 9 Sample Programs for .NET ........................................................................ 230 9.1 Execution Procedure .....................................................................................................................................230 9.2 List of Sample Programs ...............................................................................................................................232

Chapter 10 Terms of Use............................................................................................ 233 10.1 Limited Warranty .........................................................................................................................................233 10.2 Copyrights and Intellectual Property Rights.................................................................................................233 10.3 Warning Regarding Medical and Clinical Use of Our Products ...............................................................................233 10.4 Prohibition of Reproduction .........................................................................................................................233 10.5 Limitation of Liability ....................................................................................................................................234 10.6 Trademark ...................................................................................................................................................234

Page 4: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-4851 Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

4

Chapter 1 Introduction 1.1 Overview

The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided dynamic link library (DLL) and control the bus master digital input/output boards or cards through the application programming interface (API). This document includes the information for using the GPF-2X72C on Windows.

1.2 Features - The GPF-2X72C is a hierarchy architecture driver and standardized for our bus master digital input/output

products. Therefore, you do not have to consider the board type. (except board specific features) - The GPF-2X72C can call back the user-defined function when the bus master transfer starts or stops. - The GPF-2X72C supports the message posting and event notification functions. - Unused control signals can be used as digital input/output pins. Available pins depend on the operation modes and settings.

- The Help system explains how to use the supported functions. Refer to it as you develop your programs. - The GPF-2X72C includes diagnostic program to confirm input/output operations.

Page 5: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

5

Chapter 2 Product Specifications 2.1 Functional Specifications

Function Description/Specification

Number of Devices - Up to 16 boards of the PCI-2172C and PCI-2472C can be used in the same system.

- Up to 16 boards of the PCI-2772C, CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, and CBI/CSI-292144 can be used in the same system.

Transfer modes Transfer modes are selectable as needed. <Input mode>

- Sampling mode (with control signal/ without control signal) - Gated-sampling mode - Strobe mode - Request mode

<Output mode> - Pattern output mode (with control signal/ without control

signal) - Gated-pattern output mode - Strobe mode - Request mode

Start and Termination Condition The GPF-2X72C provides a software start command to start the data transfer and a software termination command to suspend or terminate the data transfer.

Trigger Delay When a termination condition occurs, this program starts sampling after a delay of the specified number of data

Error Signal Output The GPF-2X72C can output error signals to the external devices when an over-run or under-run error occurs.

Page 6: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

6

2.2 Product Composition Item File Name Description

Management file GPF2X72C.VER Management information file for Interface Corporation use

Latest information README.HTM Latest information Installer SETUP.EXE Installation program

DIBMUTIL.EXE Bus master digital input output utility program DOBMUTIL.EXE Bus master digital input utility program

Utilities

DIOBMMEM.EXE Main memory size configuration utility for DMA transfer * Only for 64-bit environment

Sample programs Sample programs for Visual C# .NET IFCDIOBM Class library source DIBM_CS Input sample program DOBM_CS Output sample program

Visual C# .NET

EXBM_CS Sample program to simultaneously use the bus master digital input circuit and bus master digital output circuit in a device

Sample programs for Visual C++ (MFC) DIBM_CPP Input sample program DOBM_CPP Output sample program EXBM_CPP Sample program to simultaneously use the bus master

digital input circuit and bus master digital output circuit in a device

Sample programs for C DIBM_C Input sample program DOBM_C Output sample program EXBM_C Sample program to simultaneously use the bus master

digital input circuit and bus master digital output circuit in a device

SAMPLING Basic input sample program

Visual C++

PATTERNOUT Basic output sample program Sample programs for Visual Basic .NET IFCDIOBM Class library source DIBM_C Input sample program DOBM_C Output sample program EXBM_C Sample program to simultaneously use the bus master

digital input circuit and bus master digital output circuit in a device

SAMPLING Basic input sample program

Visual Basic .NET

PATTERNOUT Basic output sample program Sample programs for Visual Basic DIBM_VB Input sample program DOBM_VB Output sample program

Visual Basic

EXBM_VB Sample program to simultaneously use the bus master digital input circuit and bus master digital output circuit in a device

Page 7: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

7

Item File Name Description

Sample programs for Delphi DIBM_D Input sample program DOBM_D Output sample program

Delphi

EXBM_D Sample program to simultaneously use the bus master digital input circuit and bus master digital output circuit in a device

Sample programs for Delphi8 .NET IFCDIOBM Class library source DIBM_D Input sample program DOBM_D Output sample program

Delphi8 .NET

EXBM_D Sample program to simultaneously use the bus master digital input circuit and bus master digital output circuit in a device

FBDIOBM.DLL Dynamic link library file FBIDIOBM.LIB Import library file

FBIDIOBM.H Header file

DLL

MSVCRT.DLL C run-time shared DLL CP2X72C.SYS Driver for Windows 7, Windows Vista, Windows Server

2008, Windows XP, Windows Embedded, Windows Server 2003, and Windows 2000

GPC2xxxx.INF CBI2xxxx.INF CPZ2xxxx.INF

Driver install file for Windows 7, Windows Vista, Windows Server 2008, Windows XP, Windows Embedded, Windows Server 2003, and Windows 2000

GPC2xxxx.SLD CBI2xxxx.SLD CPZ2xxxx.SLD

SLD file for Windows Embedded

CP2X72C.SYS Driver for Windows NT 4.0. GPC2X72C.INF Driver install file for Windows NT 4.0 CP2X72C.VXD Driver for Windows ME, Windows 98, and Windows 95

Device drivers

GPC2xxxx.INF Driver install file for Windows ME, Windows 98, and Windows 95

FBIDIOBM.H Header file for Visual C++ FBIDIOBM.BAS Header file for Visual Basic

Header files

FBIDIOBM.PAS Header file for Delphi Help HELP.PDF Help (PDF file)

Note: Sample programs for Visual C# and Visual Basic .NET are created by Visual C# .NET 2003, Visual Basic .NET 2003 respectively.

Page 8: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

2.3 x64 Environment 2.3.1 Main Memory

In x64 environment, DMA transfer is not available for the main memory region allocated in the user application. Our Windows driver retrieves the continuous physical memory in the kernel and performs DMA transfer to the allocated physical memory region. The allocated data size is 256 MB (approximately 32 MB for Windows XP/server 2003) and the location to allocate the memory is in the 32-bit space. Upon the request in user application through the DioBmSetBufferConfig function, the driver maps the specified size of physical memory to the virtual address to make the memory accessible in user application. The DioBmGetBufferConfig function retrieves the initial address of the logical memory as a pointer variable and directly accesses the data.

Copyright 2002, 2015 Interface Corporation. All rights reserved.

8

0xFFFFFFFF_FFFFFFFF

0x00000000_FFFFFFFF

0x00000000_00000000

Logical memory

Allocate 256 MB

Physical memory space

Kernel space User space

User application

Pointer variable

Mapping to the logical memory

Page 9: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

9

2.3.1 Confirming the Result of Physical Memory Allocation The program allocates physical memory when the operating system starts. The allocation result is saved as an event log. The event log is saved with source name of “FBIDIOMB” and can be confirmed at “System” in event viewer. When the physical memory is successfully allocated, the following message appears in the description field; “Driver file -- It succeeded in allocating a physical memory.” If the physical memory failed to be allocated the following message appears; “Driver file -- It failed in the allocation of a physical memory.”

2.3.2 Changing Allocated Physical Memory Size The allocated physical memory size can be changed when the operating system starts. The size can be changed depending on your computer environment. The available size is up to 4 GB. Use the memory size configuration utility (DimBmMem.exe) to change the size. Refer to “7.4 Memory Size Configuration Utility”.

Page 10: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

10

Chapter 3 Programming Guide 3.1 Installation

Refer to README for installation.

3.2 Programming Guide This section explains how to use the provided functions. Sample codes are written in C. Before installing multiple CardBus cards or PCI/Compact PCI board of the same type, configure the CardBus ID number (for CardBus cards) or RSW1 setting value (for boards) not to overlap between the same type. The CardBus ID number and RSW1 setting values are used to uniquely identify each product in case multiple Interface CardBus cards of the same type are installed in the same system. If the numbers overlap, the GPF-2X72C will not work normally. The products of the same group in the following table also require setting the board ID not to overlap.

Group Product Type Device Name Bus master digital input product PCI-2172C Bus master digital output product PCI-2472C

FBIDIOBM1 through FBIDIOBM16

PCI-2772C CPZ-291244, CPZ-292244

Bus master digital input/output product

LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144

FBIDIOBM17 through FBIDIOBM48

For example, the PCI-2172C (bus master digital input product) and the PCI-2472C (bus master digital output product) can be installed up to 16 boards in the same system. The PCI-2172C (bus master digital input product) and the PCI-2772C (bus master digital input/output product) can be installed up to 16 boards each in the same system; 32 boards in total.

Page 11: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

11

3.2.1 Initializing a Device The DioBmOpen function initializes devices. (Hereafter, all code fragments are formatted in courier new font.) DeviceHandle = DioBmOpen( "FBIDIOBM1" ); Specify a device name in (FBIDIOBM1) to initialize a board. FBIDIOBM1, FBIDIOBM2, ... , FBIDIOBM48 The number after FBIDIOBM can be selectable from 1 through 48 in decimal number. For bus master digital input and bus master digital output products, the number after FBIDIOBM corresponds to the RSW1 setting value plus 1. Specify the number (RSW1 setting value plus 1) for the number after FBIDIOBM to use a device. For bus master digital input/output products, specify the device name from FBIDIOBM17 through FBIDIOBM48. When a bus master digital input/output product is installed, the bus master digital input circuits and bus master digital output circuits are identified as individual device. Decide the device name of a bus master digital input/output product according to the following rules. Bus master digital input circuits: FBIDIOBM + {(RSW1 setting value * 2) + 17} Bus master digital output circuits: FBIDIOBM + {(RSW1 setting value * 2) + 18}

RSW1 setting value (board ID) Device name Digital Input Circuit

Device name Digital Output Circuit

0h FBIDIOBM17 FBIDIOBM18 1h FBIDIOBM19 FBIDIOBM20 2h FBIDIOBM21 FBIDIOBM22 … … … Fh FBIDIOBM47 FBIDIOBM48

A device handle is returned to DeviceHandle after the board is successfully initialized. The device handle allows you to refer the board and must be specified when a function is called. Two or more processes can share the same digital input/output board. The processes should arbitrate with each other to retain data consistency in the hardware and software configuration. The initialized board must be closed by the DioBmClose function before the application is terminated.

Page 12: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

12

3.2.2 Configuring Operation Parameters The DioBmSetDeviceConfig function configures the transfer mode, transfer data unit, sampling rate, and control signals. For bus master digital input/output products, use the DioBmSetDeviceConfigEx function to configure them.

3.2.3 Start, Suspension, and Termination Conditions The DioBmSetTriggerConfig function configures the start, suspension, and termination conditions of the data transfer through the bus master digital input/output device to the application. For bus master digital input and bus master digital output products, the trigger conditions including a start trigger and end trigger are enabled only in the first sampling start after opening the device. The conditions are not applied for the second or later start by the DioBmStart function. Or, consider the settings of external interfaces to use the gated-sampling mode and gated-pattern mode. (The gated-sampling mode and gated-pattern mode allow the device to input and output data only while the GATE signal is asserted.) For bus master digital input/output products, the trigger conditions are enabled in the second and later data transfer even if the device is not closed.

Page 13: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

13

3.2.4 Bus Master Transfer Buffer (32-bit Environment) The DioBmSetBufferConfig function specifies the initial address and size of the buffer. The specified buffer is the bus master transfer buffer. In Windows XP/XP Embedded/Server 2003/2000/NT 4.0, the bus master transfer buffer size must be specified less than 64 MB (63.97 MB) because of the operating system restriction. The system call cannot simultaneously handle the area of greater than 64 MB. If the buffer size is specified greater than or equal to 64 MB, the DioBmStart function returns DIOBM_ERROR_ANOTHER. With the buffer, a large amount of data can be sent/received. When the amount of input/output data is greater than the buffer size, a data pointer is returned to the head of the buffer after the pointer reaches the end of the buffer. For data output, you can output seamlessly large amount of data by adding data to the buffer periodically. For data input, you can input continuously large amount of data by moving the sampled data to another buffer. Example: Set the DMA counter event to notify that the transferred data fill a half of the buffer, or monitor the amount of the transferred data by the DioBmGetCounter function. Then update data or move the data to another buffer. The buffer configured by the DioBmSetBufferConfig function is used as the bus master transfer region. The buffer region is mapped to the physical address when the DMA transfer is performed. However, in Windows XP/XP Embedded/Server 2003/2000/NT 4.0, the area where the system call used for the mapping is over 64 bytes at a time cannot be used. Our bus master digital input/output products can use up to approximately 4 GB (4294967292 bytes) data in its specification under the condition that the required physical memory is allocated. In Windows XP/XP Embedded/Server 2003/2000/NT 4.0, because the maximum physical memory size allocated at a time is approximately 64 MB in the specification of the operating system, the data size is limited to the 64 MB.

Page 14: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

14

3.2.5 Bus Master Transfer Buffer (64-bit Environment) * If you use this program in the 64-bit environment (including Wow 64), refer to “2.3 x64 Environment” first. To use the physical memory allocated in the kernel as a buffer, specify -1 to the second argument of the DioBmSetBufferConfig function. The set buffer is the bus master transfer buffer. The buffer size can be specified at BufferSize, the third argument of the DioBmSetBufferConfig function. However, the maximum buffer size depends on the allocated physical memory size. When the DioBmSetBufferConfig function is successfully executed, the initial address and size of the buffer retrieved by the DioBmGetBufferConfig function can be retrieved When the amount of input/output data is greater than the buffer size, a data pointer is returned to the head of the buffer after the pointer reaches the end of the buffer. For data output, you can output seamlessly large amount of data by adding data to the buffer periodically. For data input, you can input continuous large amount of data by moving the sampled data to another region. Example: Set the DMA counter event to notify that the transferred data fill a half of the buffer, or monitor the amount of the transferred data by using the DioBmGetCounter function. Then update data or move data to another buffer.

3.2.6 Configuring Interrupt Handling The DioBmSetEvent function registers an interrupt service routine, a message, and an event object when an interrupt occurs. The GPF-2X72C supports events such as start of a transfer event, end of a transfer event, end of a DMA bus master transfer, and so on.

3.2.7 Starting the Transfer The DioBmStart function starts the transfer. Once you have set the start condition using the DioBmSetTriggerConfig function, the data transfer is delayed until the start conditions are satisfied.

3.2.8 Closing the Device The DioBmClose function closes the bus master digital input/output device and releases the resources. DioBmClose( DeviceHandle );

Page 15: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

15

3.3 Preparing the Transfer Buffer There are two ways to prepare the bus master transfer buffer as follows: 1. Using the user application buffer 2. Preparing the buffer inside of the driver When you prepare the buffer inside of the driver, use the following functions to allocate the buffer, retrieve or write the data.

Function Description DioBmAllocateBuffer Allocates an internal buffer for the bus master transfer. DioBmFreeBuffer Releases the internal buffer allocated by the DioBmAllocateBuffer function. DioBmGetData Retrieves the input data. DioBmReadData Retrieves the input data. The function can specify an offset address of data to

be read. DioBmSetData Writes the output data to the internal buffer. DioBmWriteData Writes the output data to the internal buffer. The function can specify an offset

address of data to be written. DioBmClearData Clears the internal transfer buffer.

<Data input>

Follow the following procedures to input data. 1. Initialize the bus master digital input/output device. 2. Configure the following settings:

- Operation mode - Start, suspension, and termination conditions - Interrupt event

3. Allocate the buffer by using the DioBmAllocateBuffer function. Do not use the DioBmSetBufferConfig function.

4. Start the transfer by using the DioBmStart function. 5. Retrieve the input data by using the DioBmGetData function. Data can be retrieved even during the

data transfer.

Notes: - When the DioBmClearData function is called, all of the retrieved data including the data which has not been retrieved will be cleared.

- To retrieve the data in the specific address, use the DioBmReadData function.

Page 16: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

16

<Data output>

Follow the following procedures to input data. 1. Allocate the buffer by using the DioBmAllocateBuffer function. Don't use the DioBmSetBufferConfig

function. 2. Write the output data by using the DioBmSetData function. 3. Clear the internal buffer by the DioBmClearData function to write new output data to the buffer after

completion of transfer. The output data can be written even during the data transfer. The DioBmWriteData function can overwrites data in the buffer.

4. Start the transfer by using the DioBmStart function.

Page 17: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

17

Chapter 4 Reference 4.1 List of DLL Function

No. Function Description Initialization functions

1 DioBmOpen Opens a bus master digital input/output device and enables to access to the device.

2 DioBmClose Closes the bus master digital input/output device and releases the resources.

Setting functions 3 DioBmSetDeviceConfig Configures the transfer mode, transfer data unit, sampling rate, and

control signals. 4 DioBmGetDeviceConfig Retrieves the transfer mode, transfer data unit, sampling rate, and

control signals. 5 DioBmSetBufferConfig Specifies a bus master transfer buffer. 6 DioBmGetBufferConfig Retrieves an address and a size of a bus master transfer buffer. 7 DioBmSetTriggerConfig Configures the start, suspend, and termination conditions of transfer. 8 DioBmGetTriggerConfig Retrieves the start, suspend, and termination conditions of transfer.

Control functions 9 DioBmStart Starts a bus master transfer.

10 DioBmStop Suspends a bus master transfer. 11 DioBmEnd Terminates a bus master transfer. 12 DioBmSoftTrigger Issues a software trigger command.

Event setting function 13 DioBmSetEventConfig Configures interrupt edges of signals. 14 DioBmGetEventConfig Retrieves interrupt edges of signals. 15 DioBmSetCounterEventConfig Configures a counter event cycle for the bus master transfer. 16 DioBmGetCounterEventConfig Retrieves the counter event cycle for the bus master transfer. 17 DioBmSetEvent Configures interrupt events. 18 DioBmKillEvent Deletes the registered interrupt events.

Status retrieval, one data input/output function 19 DioBmGetCounter Retrieves the counter value for the bus master transfer. 20 DioBmGetStatus Retrieves transfer status. 21 DioBmInputDword Reads 32 digital input pins and stores the data into a double-word

variable. 22 DioBmOutputDword Writes 32 digital output pins. 23 DioBmGetLine Retrieves input status of control signals. 24 DioBmSetLine Controls control signals. 25 DioBmGetDeviceInfo Retrieves the device information.

Data control function 26 DioBmAllocateBuffer Allocates the buffer for the bus master transfer. 27 DioBmFreeBuffer Releases the memory resources for the bus master transfer buffer

allocated by the DioBmAllocateBuffer function. 28 DioBmGetData Retrieves the input data. 29 DioBmReadData Retrieves the input data. It allows you to specify an offset address of

data to be read. 30 DioBmSetData Writes the output data to the bus master transfer buffer. 31 DioBmWriteData Writes the output data to the bus master transfer buffer. It allows you

to specify an offset address of data to be written. 32 DioBmClearData Clears the bus master transfer buffer.

Page 18: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

18

(Continued)

No. Function Description Expansion functions for PCI-2772C, CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, and CBI/CSI-292144 33 DioBmSetDeviceConfigEx Configures the transfer mode, transfer data unit, sampling rate, and

control signals. 34 DioBmGetDeviceConfigEx Retrieves the transfer mode, transfer data unit, sampling rate, and

control signals. 35 DioBmStopEx Suspends a bus master transfer. 36 DioBmSoftTriggerEx Issues a software trigger command.

Expansion Functions for CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, and CBI/CSI-292144 37 DioBmSetEdgeEventConfig Configures input signal interrupt event source. 38 DioBmGetEdgeEventConfig Retrieves input signal interrupt event source. 39 DioBmSetEventEx Configures interrupt events. 40 DioBmSetFilter Configures a digital filter. 41 DioBmGetFilter Retrieves the digital filter. 42 DioBmClearSamplingOutput Clears the status of DMA transfer data output.

Clear Mode setting function for PCI-2772C (revision 3 or later)> 43 DioBmSetClearMode Configures output status at the start of continuous output. 44 DioBmGetClearMode Retrieves output status at the start of continuous output.

Device information retrieval function 45 DioBmCommonGetPciDeviceInfo Retrieves the information of the board such as the device ID, vendor

ID, RSW1 value, and so on. 64-bit OS control function 46 DioBmGetDriverInfo Retrieves the OS architecture and allocated physical memory size. 47 DioBmSetPhysicalMemorySize Configures the allocated physical memory size.

Page 19: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

19

4.1.1 DioBmOpen Description

The DioBmOpen function opens a bus master digital input/output device and enables to access to the device. To open the device, specify a device name defined in the table below.

Device Name RSW1 Value (Board ID) Digital Input Circuits Digital Output Circuits

0h FBIDIOBM17 FBIDIOBM18 1h FBIDIOBM19 FBIDIOBM20 2h FBIDIOBM21 FBIDIOBM22 … … … Fh FBIDIOBM47 FBIDIOBM48

For the bus master digital input/output device, device names are all of the form FBIDIOBMx (for any value of x from 1 to 48), where the value of x minus one corresponds to the RSW1 setting of the device to be initialized. The bus master digital input circuits and bus master digital output circuits are individually initialized as follows: - Bus master digital input circuits: FBIDIOBM + {(RSW1 value*2) + 17} - Bus master digital output circuits: FBIDIOBM + {(RSW1 value*2) + 18} If you use two or more PCI boards or CardBus cards, check the device names beforehand. In Windows 7/XP/XP Embedded/Server 2003/2000/Me/98/95, bus master digital input/output device names, RSW1 values, and device names are listed under FbiPciDioBm in the Device Manager. You can also verify these items by using the bus master digital input utility program and bus master digital output utility program. The list will be displayed while you use them. In Windows NT, use the above utilities to verify these items. You cannot open the device that has already been opened. You can retrieve the RSW1 value on the device and check if the device is the target one you want to use for the application. Refer to the DioBmGetDeviceInfo function for more details. For classification of each model, refer to “3.2.1 Initializing a Device”.

Page 20: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

20

Syntax

C (for x86) HANDLE DioBmOpen( LPCTSTR Name ); C (for x64) HANDLE DioBmOpen( LPCTSTR Name ); Visual Basic Declare Function DioBmOpen Lib "FbiDioBm.DLL"( _ ByVal Name As String _ )As Long Delphi function DioBmOpen( Name: Pointer ):THandle; stdcall; external 'FbiDioBm.DLL';

Parameter Name Specifies the device name "FBIDIOBMx" to open.

Return Value

The DioBmOpen function returns a valid handle when the process is successfully completed. Otherwise, this function returns INVALID_HANDLE_VALUE (FFFFFFFFh), if the process is failed.

Comment - UUNICODE strings

Although the strings specified in the Name argument of the DioBmOpen function in C for x86 is defined as LPCTSTR type, it is not applicable to UNICODE strings. To use this function in x 86 environment, write as the following examples.

Page 21: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

21

Examples

C (for x86) HANDLE DeviceHandle; DeviceHandle = DioBmOpen((LPCTSTR)“FBIDIOBM1”); HANDLE DeviceHandle; char* lpszName = “FBIDIOBM1”; DeviceHandle = DioBmOpen((LPCTSTR)lpszName);

C (for x64) HANDLE DeviceHandle; DeviceHandle = DioBmOpen(“FBIDIOBM1”); HANDLE DeviceHandle; char* lpszName = “FBIDIOBM1”; DeviceHandle = DioBmOpen((LPCTSTR)lpszName);

Visual Basic Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) Delphi var Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); end; Open a bus master digital input/output device named FBIDIOBM1 and receive a device handle in DeviceHandle.

Page 22: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

22

4.1.2 DioBmClose Description

The DioBmClose function closes the bus master digital input/output device and releases the resources used for device access. Any subsequent accesses to the device are forbidden. When the device is closed, it is reset to “No mode” and all input/output pins are set to high impedance state.

Syntax C INT DioBmClose( HANDLE DeviceHandle ); Visual Basic Declare Function DioBmClose Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long _ )As Long Delphi function DioBmClose( DeviceHandle: THandle ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function.

Return Value The DioBmClose function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Comment If you access to the device again, call the DioBmOpenfunction.

Page 23: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

23

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmClose( DeviceHandle );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmClose( DeviceHandle )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmClose( DeviceHandle ); end;

Close the bus master digital input/output device specified by DeviceHandle.

Page 24: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

24

4.1.3 DioBmSetDeviceConfig Description

The DioBmSetDeviceConfig function configures the transfer mode, transfer data unit, sampling rate, and control signals.

Syntax C INT DioBmSetDeviceConfig ( HANDLE DeviceHandle, PDIOBMCONF Conf ); Visual Basic Declare Function DioBmSetDeviceConfig Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef Conf As DIOBMCONF _ )As Long Delphi function DioBmSetDeviceConfig ( DeviceHandle: THandle; var Conf: DIOBMCONF ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Conf Points to the DIOBMCONF structure containing operation parameters.

Return Value The DioBmSetDeviceConfig function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 25: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

25

Examples

C INT Ret; HANDLE DeviceHandle; DIOBMCONF Conf; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Conf.dwMode = DIOBM_MODE_SAMPLING; Conf.dwRedirectWidth = DIOBM_WIDTH_DWORD; Conf.dwEQConf = 0; Conf.dwClock = DIOBM_CLK_100K; Conf.dwSmplNum = 1024; Conf.dwTimingOption = 0; Conf.dwSTBConf = 0; Conf.dwACKConf = 0; Conf.dwREQConf = 0; Conf.dwOREConf = 0; Conf.dwUREConf = 0; Ret = DioBmSetDeviceConfig( DeviceHandle, &Conf ); Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Conf As DIOBMCONF Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Conf.dwMode = DIOBM_MODE_SAMPLING Conf.dwRedirectWidth = DIOBM_WIDTH_DWORD Conf.dwEQConf = 0 Conf.dwClock = DIOBM_CLK_100K Conf.dwSmplNum = 1024 Conf.dwTimingOption = 0 Conf.dwSTBConf = 0 Conf.dwACKConf = 0 Conf.dwREQConf = 0 Conf.dwOREConf = 0 Conf.dwUREConf = 0 Ret = DioBmSetDeviceConfig( DeviceHandle, Conf )

Page 26: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

26

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; Conf: DIOBMCONF; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Conf.dwMode := DIOBM_MODE_SAMPLING; Conf.dwRedirectWidth := DIOBM_WIDTH_DWORD; Conf.dwEQConf := 0; Conf.dwClock := DIOBM_CLK_100K; Conf.dwSmplNum := 1024; Conf.dwTimingOption := 0; Conf.dwSTBConf := 0; Conf.dwACKConf := 0; Conf.dwREQConf := 0; Conf.dwOREConf := 0; Conf.dwUREConf := 0; Ret := DioBmSetDeviceConfig( DeviceHandle, Conf ); end;

Configure functions of the bus master digital input/output device specified by DeviceHandle as follows.

Member Parameter Mode dwMode Transfer mode Sampling mode dwRedirectWidth Bus master transfer width Double word size dwEQConf EQx signal Disabled dwClock Base clock 100 kHz dwSmplNum Number of samples 1024 dwTimingOption FIFO operation mode Not specified dwSTBConf STBx signal Disabled dwACKConf ACKx signal Disabled dwREQConf REQx signal Disabled dwOREConf ORE signal Disabled dwUREConf URE signal Disabled

Page 27: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

27

4.1.4 DioBmGetDeviceConfig Description

The DioBmGetDeviceConfig function retrieves the transfer mode, transfer data unit, sampling rate, and control signals.

Syntax C INT DioBmGetDeviceConfig ( HANDLE DeviceHandle, PDIOBMCONF Conf ); Visual Basic Declare Function DioBmGetDeviceConfig Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef Conf As DIOBMCONF _ )As Long Delphi function DioBmGetDeviceConfig ( DeviceHandle: THandle; var Conf: DIOBMCONF ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Conf Points to the DIOBMCONF structure to receive the operation parameters. With

Visual Basic or Delphi, the variable is passed by reference.

Return Value The DioBmGetDeviceConfig function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 28: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

28

Examples

C INT Ret; HANDLE DeviceHandle; DIOBMCONF Conf; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmGetDeviceConfig( DeviceHandle, &Conf );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Conf As DIOBMCONF Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmGetDeviceConfig( DeviceHandle, Conf )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; Conf: DIOBMCONF; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmGetDeviceConfig( DeviceHandle, Conf ); end;

Receive the operation parameters of the device specified by DeviceHandle into the Conf structure.

Page 29: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

29

4.1.5 DioBmSetBufferConfig Description

The DioBmSetBufferConfig function specifies the bus master transfer buffer.

Syntax C INT DioBmSetBufferConfig ( HANDLE DeviceHandle, PVOID Buffer, DWORD BufferSize ); Visual Basic Declare Function DioBmSetBufferConfig Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef Buffer As Any, _ ByVal BufferSize As Long _ )As Long Delphi function DioBmSetBufferConfig ( DeviceHandle: THandle; Buffer: Pointer; BufferSize: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Buffer Specifies the base address of bus master transfer buffer.

■ x86 environment Points to the buffer on user application. ■ x64 environment Specify -1 to use physical memory allocated in the kernel.

BufferSize Specifies the size of the bus master transfer buffer in bytes.

Return Value

The DioBmSetBufferConfig function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 30: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

30

Comments

(For 32-bit environment) - In Windows XP/EP Embedded/Server 2003/2000/NT 4.0, the bus master transfer buffer size must be specified less than 64 MB. The system call cannot handle the area of greater than 64 MB at a time. If the buffer size is specified greater than or equal to 64 MB, the DioBmStart function returns DIOBM_ERROR_ANOTHER. - With the buffer, a large amount of data can be transmitted/received. When the amount of input/output data is greater than the buffer size, a data pointer is returned to the head of the buffer after the pointer reaches the end of the buffer. You can output seamlessly large amount of data by adding data to the buffer periodically, and input continuously large amount of data by moving the sampled data to another buffer. Example: Set the DMA counter event to notify that the transferred data fill a half of the buffer, or monitor the amount of the transferred data by using the DioBmGetCounter function. Then update or move the data to another buffer. A buffer configured by the DioBmSetBufferConfig function acts as the source or destination area for the bus master transfer and is mapped into a physical address. For Windows XP/XP Embedded/ Server 2003/2000/NT 4.0, a system call used for the mapping cannot handle area over 64 Mbytes at a time. The Interface bus master digital input/output products supports data processing up to 4 GB. (4294967292 byte) when the necessary physical memory is allocated. However the operating systems above can allocate physical memory up to 64 MB at a time, the size of buffer is limited to 64 MB.

Page 31: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

31

Examples

C (32-bit environment) INT Ret; HANDLE DeviceHandle; DWORD Buffer[128]; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmSetBufferConfig( DeviceHandle, Buffer, 128 * sizeof(DWORD) );

C (64-bit environment)

INT Ret;

HANDLE DeviceHandle;

DeviceHandle = DioBmOpen( "FBIDIOBM1" );

Ret = DioBmSetBufferConfig( DeviceHandle, (PVOID)-1, 128 * sizeof(DWORD) );

Visual Basic (32-bit environment) Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Buffer(0 To 127) As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmSetBufferConfig( DeviceHandle, Buffer(0), 128 * 4 ) Visual Basic (64-bit environment)

Dim Ret As Long

Dim Name As String

Dim DeviceHandle As Long

Name = "FBIDIOBM1" & Chr( 0 )

DeviceHandle = DioBmOpen( Name )

Ret = DioBmSetBufferConfig( DeviceHandle, ByVal -1, 128 * 4 )

Delphi (32-bit environment)

var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; Buffer: Array[0..127] of DWORD;

Page 32: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

32

begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmSetBufferConfig( DeviceHandle, @Buffer[0], 128 * SizeOf(DWORD) ); end;

Delphi (64-bit environment)

var

Ret: Integer;

Name: Array[0..15] of Char;

DeviceHandle: THandle;

begin

StrCopy( Name, 'FBIDIOBM1' );

DeviceHandle := DioBmOpen( @Name[0] );

Ret := DioBmSetBufferConfig( DeviceHandle, Pointer(-1), 128 *

SizeOf(DWORD) );

end;

Specify the bus master transfer buffer of the bus master digital input/output device specified by DeviceHandle.

Page 33: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

33

4.1.6 DioBmGetBufferConfig Description

The DioBmGetBufferConfig function retrieves the address and the size of the bus master transfer buffer.

Syntax C INT DioBmGetBufferConfig ( HANDLE DeviceHandle, PVOID * Buffer, PDWORD BufferSize ); Visual Basic Declare Function DioBmGetBufferConfig Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef Buffer As Any, _ ByRef BufferSize As Long _ )As Long Delphi function DioBmGetBufferConfig ( DeviceHandle: THandle; var Buffer: Pointer; var BufferSize: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by theDioBmOpen function. Buffer Points to a variable to store the base address of the bus master transfer buffer.

In 64-bit environment, the initial address can be retrieved. BufferSize Points to a variable to receive the size of the bus master transfer buffer in bytes.

With Visual Basic or Delphi, the variable is passed by reference.

Return Value

The DioBmGetBufferConfig function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 34: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

34

Examples

C (32-bit environment) INT Ret; HANDLE DeviceHandle; PVOID Buffer; DWORD BufferSize; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmGetBufferConfig( DeviceHandle, &Buffer, &BufferSize );

C (64-bit environment)

INT Ret;

HANDLE DeviceHandle;

PVOID Buffer;

DWORD BufferSize;

DeviceHandle = DioBmOpen( "FBIDIOBM1" );

Ret = DioBmSetBufferConfig( DeviceHandle, (PVOID)-1, 128 * sizeof(DWORD) );

Ret = DioBmGetBufferConfig( DeviceHandle, &Buffer, &BufferSize );

Visual Basic (32-bit environment) Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Buffer As Long Dim BufferSize As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmGetBufferConfig( DeviceHandle, Buffer, BufferSize )

Visual Basic (64-bit environment) Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Buffer As Long Dim BufferSize As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmSetBufferConfig( DeviceHandle, ByVal -1, 128 * 4 ) : Ret = DioBmGetBufferConfig( DeviceHandle, Buffer, BufferSize )

Page 35: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

35

Delphi (32-bit environment) var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; Buffer: Pointer; BufferSize: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmGetBufferConfig( DeviceHandle, Buffer, BufferSize ); end;

Delphi (64-bit environment) var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; Buffer: Pointer; BufferSize: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmSetBufferConfig( DeviceHandle, Pointer(-1), 128 * SizeOf(DWORD) ); : Ret := DioBmGetBufferConfig( DeviceHandle, Buffer, BufferSize ); end;

Retrieve the address and size of the bus master transfer buffer of a device specified by DeviceHandle into Buffer and BufferSize, respectively.

Page 36: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

36

4.1.7 DioBmSetTriggerConfig Description

The DioBmSetTriggerConfig function configures the start, suspension, and termination conditions of transfer.

Syntax C INT DioBmSetTriggerConfig ( HANDLE DeviceHandle, PDIOBMTRIGCONF TrigConf ); Visual Basic Declare Function DioBmSetTriggerConfig Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef TrigConf As DIOBMTRIGCONF _ )As Long Delphi function DioBmSetTriggerConfig ( DeviceHandle: THandle; var TrigConf: DIOBMTRIGCONF ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. TrigConf Points to the DIOBMTRIGCONF structure containing trigger conditions.

Return Value

The DioBmSetTriggerConfig function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Comments The DioBmSetTriggerConfig function configures the start, suspension, and termination conditions of the data transfer. For bus master digital input and bus master digital output products, the trigger conditions including a start trigger and end trigger are enabled only in the first sampling after opening the device. The conditions are not applied for the second or later sampling by the DioBmStart function. Or, consider the settings of external interfaces to use the gated-sampling mode and gated-pattern mode. (The gated-sampling mode and gated-pattern mode allow the device to input and output data only while the GATE signal is asserted.) For bus master digital input/output products, the trigger conditions are enabled in the second and later data transfer even if the device is not closed. For classification of each model, refer to “3.2.1 Initializing a Device”.

Page 37: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

37

Examples

C INT Ret; HANDLE DeviceHandle; DIOBMTRIGCONF TrigConf; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : TrigConf.dwSoftTrigger = DIOBM_SOFT_TRIGGER_START; TrigConf.dwStartLine = 0; TrigConf.dwEndLine = DIOBM_LINE_FUNC_ENABLE; TrigConf.dwStopLine = 0; TrigConf.dwTriggerDelayNum = 0; TrigConf.dwPatternEq = 0; TrigConf.dwPatternMask = 0; TrigConf.dwPatternData = 0; Ret = DioBmSetTriggerConfig( DeviceHandle, &TrigConf );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim TrigConf As DIOBMTRIGCONF Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : TrigConf.dwSoftTrigger = DIOBM_SOFT_TRIGGER_START TrigConf.dwStartLine = 0 TrigConf.dwEndLine = DIOBM_LINE_FUNC_ENABLE TrigConf.dwStopLine = 0 TrigConf.dwTriggerDelayNum = 0 TrigConf.dwPatternEq = 0 TrigConf.dwPatternMask = 0 TrigConf.dwPatternData = 0 Ret = DioBmSetTriggerConfig( DeviceHandle, TrigConf )

Page 38: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

38

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; TrigConf: DIOBMTRIGCONF; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : TrigConf.dwSoftTrigger := DIOBM_SOFT_TRIGGER_START; TrigConf.dwStartLine := 0; TrigConf.dwEndLine := DIOBM_LINE_FUNC_ENABLE; TrigConf.dwStopLine := 0; TrigConf.dwTriggerDelayNum := 0; TrigConf.dwPatternEq := 0; TrigConf.dwPatternMask := 0; TrigConf.dwPatternData := 0; Ret := DioBmSetTriggerConfig( DeviceHandle, TrigConf ); end;

Configure the start, suspension, and termination conditions of transfer of the bus master digital input/output device specified by DeviceHandle as follows.

Condition Description

Software trigger Enables software start command. STARTx signal trigger Disabled ENDx signal trigger Enabled

(Terminates the transfer at assertion of the END signal.) STOPx signal trigger Disabled Number of trigger delay 0 (disabled) Pattern matching trigger Disabled Pattern matching valid bit No meanings Pattern matching data No meanings (Because the pattern matching trigger is disabled.)

Page 39: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

39

4.1.8 DioBmGetTriggerConfig Description

The DioBmGetTriggerConfig function retrieves the start, suspension, and termination conditions of transfer.

Syntax C INT DioBmGetTriggerConfig ( HANDLE DeviceHandle, PDIOBMTRIGCONF TrigConf ); Visual Basic Declare Function DioBmGetTriggerConfig Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef TrigConf As DIOBMTRIGCONF _ )As Long Delphi function DioBmGetTriggerConfig ( DeviceHandle: THandle; var TrigConf: DIOBMTRIGCONF ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function.

TrigConf Points to the DIOBMTRIGCONF structure to receive trigger conditions. With Visual Basic or Delphi, the variable is passed by reference.

Return Value

The DioBmGetTriggerConfig function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 40: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

40

Examples

C INT Ret; HANDLE DeviceHandle; DIOBMTRIGCONF TrigConf; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmGetTriggerConfig( DeviceHandle, &TrigConf );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim TrigConf As DIOBMTRIGCONF Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmGetTriggerConfig( DeviceHandle, TrigConf )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; TrigConf: DIOBMTRIGCONF; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmGetTriggerConfig( DeviceHandle, TrigConf ); end;

Retrieve the start, suspension, and termination conditions of transfer of the bus master digital input/output device specified by DeviceHandle into the TrigConf structure.

Page 41: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

41

4.1.9 DioBmStart Description

The DioBmStart function starts the bus master transfer. When the bus master transfer is suspended, this function resumes the bus master transfer.

Syntax C INT DioBmStart ( HANDLE DeviceHandle ); Visual Basic Declare Function DioBmStart Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long _ )As Long Delphi function DioBmStart ( DeviceHandle: THandle ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function.

Return Value

The DioBmStart function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Comments (For 32-bit environment) - In Windows 7/XP/EP Embedded/Server 2003/2000/NT 4.0, the bus master transfer buffer size must be

specified less than 64 MB. The system call cannot handle the area of greater than 64 MB at a time. If the buffer size is specified greater than or equal to 64 MB, the DioBmStart function returns DIOBM_ERROR_ANOTHER.

- With the buffer, a large amount of data can be transmitted/received. When the amount of input/output data

is greater than the buffer size, a data pointer is returned to the head of the buffer after the pointer reaches the end of the buffer. You can output seamlessly large amount of data by adding data to the buffer periodically, and input continuously large amount of data by moving the sampled data to another buffer.

Page 42: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

42

Example: Set the DMA counter event to notify that the transferred data fill a half of the buffer, or monitor the amount of the transferred data by using the DioBmGetCounter function. Then update or move the data to another buffer. A buffer configured by the DioBmSetBufferConfig function acts as a source or destination area for the bus master transfer and is mapped into a physical address. For Windows XP/XP Embedded/Server 2003/2000/NT 4.0, a system call used for the mapping cannot handle area over 64 MB at a time. The Interface bus master digital input/output products support data processing up to 4 GB (4294967292 bytes) when ensuring the physical memory to be allocated. However the operating systems above can allocate physical memory up to 64 Mbytes at a time, the size of buffer is limited to 64 MB.

Examples C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmStart( DeviceHandle );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmStart( DeviceHandle )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmStart( DeviceHandle ); end;

Start the bus master transfer of the bus master digital input/output device specified by DeviceHandle.

Page 43: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

43

4.1.10 DioBmStop Description

The DioBmStop function suspends the bus master transfer.

Syntax C INT DioBmStop ( HANDLE DeviceHandle ); Visual Basic Declare Function DioBmStop Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long _ )As Long Delphi function DioBmStop ( DeviceHandle: THandle ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function.

Return Value

The DioBmStop function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 44: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

44

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmStop( DeviceHandle );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmStop( DeviceHandle )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmStop( DeviceHandle ); end;

Suspend the bus master transfer of the bus master digital input/output device specified by DeviceHandle.

Page 45: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

45

4.1.11 DioBmEnd Description

The DioBmEnd function terminates the bus master transfer forcibly. This function is only applicable to the bus master digital output circuit.

Syntax C INT DioBmEnd ( HANDLE DeviceHandle ); Visual Basic Declare Function DioBmEnd Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long _ )As Long Delphi function DioBmEnd ( DeviceHandle: THandle ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function.

Return Value

The DioBmEnd function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 46: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

46

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmEnd( DeviceHandle );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmEnd( DeviceHandle )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmEnd( DeviceHandle ); end;

Terminate the bus master transfer of the bus master digital input/output device specified by DeviceHandle.

Page 47: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

47

4.1.12 DioBmSoftTrigger Description

The DioBmSoftTrigger function issues a software trigger command. If you use the software trigger, you must enable it by the DioBmSetTriggerConfig function beforehand.

Syntax C INT DioBmSoftTrigger ( HANDLE DeviceHandle ); Visual Basic Declare Function DioBmSoftTrigger Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long _ )As Long Delphi function DioBmSoftTrigger ( DeviceHandle: THandle ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function.

Return Value The DioBmSoftTrigger function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 48: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

48

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmSoftTrigger( DeviceHandle );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmSoftTrigger( DeviceHandle )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmSoftTrigger( DeviceHandle ); end;

Issue the software trigger command on the bus master digital input/output device specified by DeviceHandle.

Page 49: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

49

4.1.13 DioBmSetEventConfig Description

The DioBmSetEventConfig function configures interrupt edges of signals.

Syntax C INT DioBmSetEventConfig ( HANDLE DeviceHandle, DWORD EventConfig ); Visual Basic Declare Function DioBmSetEventConfig Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal EventConfig As Long _ )As Long Delphi function DioBmSetEventConfig ( DeviceHandle: THandle; EventConfig: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function.

EventConfig Specifies the data to configure interrupt edges of signals. Refer to the following tables.

Code Description 0 Detects an interrupt event at the falling edge. (high to low) 1 Detects an interrupt event at the rising edge. (low to high)

<PCI-2172C, PCI-2472C>

bit31 … bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0

Reserved Reserved END signal

STARTsignal Reserved Reserved Reserved Reserved Reserved Reserved

Page 50: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

50

<PCI-2772C, CPZ-291244, CPZ-292244>

bit31 … bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 Reserved Reserved Reserved Reserved STOP2

signal STOP1signal

EXT22signal

EXT21 signal

EXT12 signal

EXT11signal

Notes: - All setting values are 0 under the following conditions: ● When the computer is turned on. ● When the PCI bus is reset. ● When the external reset signal is input.

- When you use the START or END signal event, use the DioBmSetDeviceConfigEx function to assign the START or END signal to the EXT11, EXT12, EXT21, or EXT22 signal.

<PCI-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144> Not supported

Return Value The DioBmSetEventConfig function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 51: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

51

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmSetEventConfig( DeviceHandle, 0x00 );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmSetEventConfig( DeviceHandle, &H0 )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmSetEventConfig( DeviceHandle, $00 ); end;

Configure the interrupt edge of the signal of the bus master digital input/output device specified by DeviceHandle as follows: - START signal: An interrupt occurs at each falling edge of the signal. - END signal: An interrupt occurs at each falling edge of the signal.

Page 52: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

52

4.1.14 DioBmGetEventConfig Description

The DioBmGetEventConfig function retrieves interrupt edges of signals.

Syntax C INT DioBmGetEventConfig ( HANDLE DeviceHandle, PDWORD EventConfig );

Visual Basic Declare Function DioBmGetEventConfig Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef EventConfig As Long _ )As Long

Delphi function DioBmGetEventConfig ( DeviceHandle: THandle; var EventConfig: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. EventConfig Points to a variable to receive the interrupt edges of signal configurations. With

Visual Basic or Delphi, the variable is passed by reference. Refer to the following tables.

<PCI-2172C, PCI-2472C>

bit31 … bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0

Reserved Reserved END signal

STARTsignal Reserved Reserved Reserved Reserved Reserved Reserved

<PCI-2772C, CPZ-291244, CPZ-292244>

bit31 … bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 Reserved Reserved Reserved Reserved STOP2

signal STOP1signal

EXT22signal

EXT21 signal

EXT12 signal

EXT11signal

<PCI-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144> Not supported

Page 53: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

53

Return Value

The DioBmGetEventConfig function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Examples C INT Ret; HANDLE DeviceHandle; DWORD EventConfig; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmGetEventConfig( DeviceHandle, &EventConfig );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim EventConfig As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmGetEventConfig( DeviceHandle, EventConfig )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; EventConfig: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmGetEventConfig( DeviceHandle, EventConfig ); end;

Retrieve the interrupt edge of the signal of the bus master digital input/output device specified by DeviceHandle.

Page 54: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

54

4.1.15 DioBmSetCounterEventConfig Description

The DioBmSetCounterEventConfig function configures a counter event cycle for the bus master transfer.

Syntax C INT DioBmSetCounterEventConfig ( HANDLE DeviceHandle, DWORD Counter );

Visual Basic Declare Function DioBmSetCounterEventConfig Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal Counter As Long _ )As Long

Delphi function DioBmSetCounterEventConfig ( DeviceHandle: THandle; Counter: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Counter Specifies the counter setting value to generate the counter match

events. <PCI-2172C, PCI-2472C>

Specifies a counter event cycle based on the transfer count. The input/output counter event (DIOBM_EV_EXEQ) and DMA counter event (DIOBM_EV_INEQ) occur at the specified cycle. You can set the value to 0 or power of 2. The default setting is 0. The following table shows the minimum setting value of the counter.

Transfer Width Minimum Configurable Counter ValueDWORD 1 WORD 2 BYTE 4

If you specify 0, each operation is different depending on the transfer width.

Transfer Width Description DWORD No event available WORD No event available BYTE An input/output counter event occurs at every 4294967295 counts.

Page 55: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

55

Specifies a counter event cycle based on the transfer count. The input/output counter event (DIOBM_EV_EXEQ) or DMA counter event (DIOBM_EV_INEQ) occurs at the specified cycle. You can set the value in the range of 1 through 4294967295, by step 1. Specify the DIOBM_EV_EXEQ and DIOBM_EV_INEQ by the DioBmSetEvent function to set event masks. <PCI-2772C, CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144> The configurable range is from 0 through 4294967295 (0h through FFFFFFFFh) The value is configured by count in input/output counter event. The value is configured by byte in DMA counter event. Either input/output counter event (DIOBM_EV_EXEQ) or DMA counter event (DIOBM_EV_INEQ) occurs at the specified cycle. DIOBM_EV_EXEQ and DIOBM_EV_INEQ cannot be unmasked simultaneously by the DioBmSetEvent in the PCI-2772C, CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, and CBI/CSI-292144. When input/output counter matches, the EQ1 or EQ2 signal can be asserted to low. To use counter match detection output function, enable the EQ1 or EQ2 signal by the DioBmSetDeviceConfigEx. When the DMA counter match is detected, the EQ signals are not asserted. Only an interrupt event occurs.

Return Value The DioBmSetCounterEventConfig function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 56: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

56

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmSetCounterEventConfig( DeviceHandle, 1024 );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmSetCounterEventConfig( DeviceHandle, 1024 )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmSetCounterEventConfig( DeviceHandle, 1024 ); end;

Configure the counter event cycle to 1024 on the bus master digital input/output device specified by DeviceHandle.

Page 57: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

57

4.1.16 DioBmGetCounterEventConfig Description

The DioBmGetCounterEventConfig function retrieves the counter event cycle for the bus master transfer.

Syntax C INT DioBmGetCounterEventConfig ( HANDLE DeviceHandle, PDWORD Counter ); Visual Basic Declare Function DioBmGetCounterEventConfig Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef Counter As Long _ )As Long Delphi function DioBmGetCounterEventConfig ( DeviceHandle: THandle; var Counter: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Counter Points to a variable to receive a counter event cycle.

Return Value

The DioBmGetCounterEventConfig function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 58: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

58

Examples

C INT Ret; HANDLE DeviceHandle; DWORD Counter; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmGetCounterEventConfig( DeviceHandle, &Counter );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Counter As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmGetCounterEventConfig( DeviceHandle, Counter )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; Counter: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmGetCounterEventConfig( DeviceHandle, Counter ); end;

Retrieve the counter event cycle to Counter of the bus master digital input/output device or card specified by DeviceHandle.

Page 59: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

59

4.1.17 DioBmSetEvent Description

The DioBmSetEvent function configures interrupt events.

Syntax C (for x86) INT DioBmSetEvent ( HANDLE DeviceHandle, DWORD EventMask, HANDLE Wnd, UINT Msg, LPDIOBMCALLBACK EventProc, DWORD User, HANDLE Event, PDWORD EventData ); C (for x64) INT DioBmSetEvent ( HANDLE DeviceHandle, DWORD EventMask, HANDLE Wnd, UINT Msg,

LPDIOBMCALLBACK

EventProc,

PVOID User, HANDLE Event, PDWORD EventData );

Visual Basic Declare Function DioBmSetEvent Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal EventMask As Long, _ ByVal Wnd As Long, _ ByVal Msg As Long, _ ByVal EventProc As Long, _ ByVal User As Long, _ ByVal Event As Long, _ ByRef EventData As Long _ )As Long Delphi function DioBmSetEvent ( DeviceHandle: THandle; EventMask: DWORD; Wnd: THandle; Msg: DWORD; EventProc: FARPROC; User: DWORD; Event: THandle; var EventData: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Page 60: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

60

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function.

EventMask Specifies event sources to use.

When you specify two or more event sources, use the following codes by using OR operators or plus (+) operators.

<PCI-2172C, PCI-2472C>

Code Description DIOBM_EV_ENDTRG End of transfer event DIOBM_EV_DTRG Trigger delay event DIOBM_EV_START_TRG Start of transfer event DIOBM_EV_START_LINE START1 or START2 signal event DIOBM_EV_END_LINE END1 or END2 signal event DIOBM_EV_DMAEND End of DMA event

DIOBM_EV_STOP STOP1 or STOP2 signal event The code is available only when the STOP1 or STOP2 signal is enabled.

DIOBM_EV_FIFO_EFFF FIFO full/empty event DIOBM_EV_OREURE Over-run/under-run error event DIOBM_EV_EXEQ Input/output counter event DIOBM_EV_INEQ DMA counter event

<PCI-2772C, CPZ-291244, CPZ-292244>

Code Description DIOBM_EV_ENDTRG End of transfer event DIOBM_EV_DTRG Trigger delay event DIOBM_EV_START_TRG Start of transfer event DIOBM_EV_DMAEND End of DMA event DIOBM_EV_STOP1 STOP1 signal event DIOBM_EV_STOP2 STOP2 signal event DIOBM_EV_FIFO_EFFF FIFO full/empty event DIOBM_EV_OREURE Over-run/under-run error event DIOBM_EV_EXEQ Input/output counter event DIOBM_EV_INEQ DMA counter event DIOBM_EV_EXT11 EXT11 signal event DIOBM_EV_EXT12 EXT12 signal event DIOBM_EV_EXT21 EXT21 signal event DIOBM_EV_EXT22 EXT22 signal event DIOBM_EV_EDGE Input signal interrupt*

Notes:

- When you use the START or END signal event, use the DioBmSetDeviceConfigEx function to assign the START or END signal to the EXT11, EXT12, EXT21, or EXT22 signal.

- To use the counter interrupt, set the counter event by using the DioBmSetCounterEventConfig function.

- * Input signal interrupt (DIOBM_EV_EDGE) is applicable only to the CPZ-291244 and CPZ-292244.

Page 61: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

61

<PCI-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144,

CBI/CSI-292144> Code Description

DIOBM_EV_ENDTRG End of transfer event DIOBM_EV_DTRG Trigger delay event DIOBM_EV_START_TRG Start of transfer event DIOBM_EV_DMAEND End of DMA event DIOBM_EV_FIFO_EFFF FIFO full/empty event DIOBM_EV_OREURE Over-run/under-run error event DIOBM_EV_EXEQ Input/output counter event DIOBM_EV_INEQ DMA counter event DIOBM_EV_EDGE Input signal interrupt

Notes:

- When using the START or END signal event, enable the edge event of input signals assigned to the START or END signal by the DioBmSetEdgeEventConfig function.

- When using the counter interrupt, set the counter event by using the DioBmSetCounterEventConfig function.

- All interrupt factors are configured to be disabled at the default setting. Therefore, the factors (rising or falling edge, input signal) are needed to be properly configured by using the DioBmSetEdgeEventConfig function.

Wnd Specifies a handle of the window to which a message is sent when an event

occurs. If you do not use event notification, specify it as follows: - NULL (C) - 0 (Visual Basic) - nil (Delphi)

Msg Specifies a message identifier to send to Wnd when an event occurs. EventProc Points to the callback routine to call when an event occurs. If you do not use

event notification, specify it as follows: - NULL (C) - 0 (Visual Basic) - nil (Delphi)

User Specifies the user-supplied 32-bit data passed to the callback routine when the

events occur. ■ x86 environment Passes DWORD type data ■ x64 environment Passes the buffer address where user data is stored because the data is PVOID

type. The buffer should be allocated in the global area.

Page 62: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

62

Event Specifies the handle of the event object to be signaled. If you do not use event

notification, specify it as follows: - NULL (C) - 0 (Visual Basic) - nil (Delphi)

EventData Points to a variable to receive event sources occurred.

When an event occurs, the following code is set to the corresponding bit. With Visual Basic or Delphi, the variable is passed by reference.

<PCI-2172C, PCI-2472C>

Code Description DIOBM_EV_ENDTRG End of transfer event DIOBM_EV_DTRG Trigger delay event DIOBM_EV_START_TRG Start of transfer event DIOBM_EV_START_LINE START1 or START2 signal event DIOBM_EV_END_LINE END1 or END2 signal event DIOBM_EV_DMAEND End of DMA event DIOBM_EV_STOP STOP1 or STOP2 signal event

(only with the STOP1 and STOP2 signals enabled)

DIOBM_EV_FIFO_EFFF FIFO full/empty event DIOBM_EV_OREURE Over-run/under-run error event DIOBM_EV_EXEQ Input/output counter event DIOBM_EV_INEQ DMA counter event

<PCI-2772C, CPZ-291244, CPZ-292244>

Code Description DIOBM_EV_ENDTRG End of transfer event DIOBM_EV_DTRG Trigger delay event DIOBM_EV_START_TRG Start of transfer event DIOBM_EV_DMAEND End of DMA event DIOBM_EV_STOP1 STOP1 signal event DIOBM_EV_STOP2 STOP2 signal event DIOBM_EV_FIFO_EFFF FIFO full/empty event DIOBM_EV_OREURE Over-run/under-run error event DIOBM_EV_EXEQ Input/output counter event DIOBM_EV_INEQ DMA counter event DIOBM_EV_EXT11 EXT11 signal event DIOBM_EV_EXT12 EXT12 signal event DIOBM_EV_EXT21 EXT21 signal event DIOBM_EV_EXT22 EXT22 signal event DIOBM_EV_EDGE Input signal interrupt*

Note: * Input interrupt (DIOBM_EV_EDGE) is applicable only to the

CPZ-291244 and CPZ-292244.

Page 63: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

63

<PCI-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144>

Code Description DIOBM_EV_ENDTRG End of transfer event DIOBM_EV_DTRG Trigger delay event DIOBM_EV_START_TRG Start of transfer event DIOBM_EV_DMAEND End of DMA event DIOBM_EV_FIFO_EFFF FIFO full/empty event DIOBM_EV_OREURE Over-run/under-run error event DIOBM_EV_EXEQ Input/output counter event DIOBM_EV_INEQ DMA counter event DIOBM_EV_EDGE Input signal interrupt

Note:

When using the START or END signal event, enable the edge event of input signals assigned to the START or END signal by the DioBmSetEdgeEventConfig function.

Return Value

The DioBmSetEvent function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Examples

C (for x86) INT Ret; HANDLE DeviceHandle; HANDLE Event; DWORD EventData; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Event = CreateEvent( NULL, TRUE, FALSE, NULL); Ret = DioBmSetEvent( DeviceHandle, DIOBM_EV_ENDTRG, NULL, WM_NULL, NULL, 0, Event, &EventData );

C (for x64) INT Ret; HANDLE DeviceHandle; HANDLE Event; DWORD EventData; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Event = CreateEvent( NULL, TRUE, FALSE, NULL); Ret = DioBmSetEvent( DeviceHandle, DIOBM_EV_ENDTRG, NULL, WM_NULL, NULL, NULL, Event, &EventData );

Page 64: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

64

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Event As Long Dim EventData As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Event = CreateEvent( 0, true, false, 0) Ret = DioBmSetEvent( DeviceHandle, DIOBM_EV_ENDTRG, 0, 0, 0, 0, Event, EventData )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; Event: THandle; EventData: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Event := CreateEvent(nil, True, False, nil); Ret := DioBmSetEvent( DeviceHandle, DIOBM_EV_ENDTRG, nil, WM_NULL, nil, 0, Event, EventData ); end;

Configure the interrupt events of the bus master digital input/output device specified by DeviceHandle as follows.

Event mask: Input or end of transfer Window handle: Not specified Message identifier: Disabled (because of no window handle) Callback routine: Not specified User data: Disabled (because of no callback routine) Event handle: Event (created by Win32 API CreateEvent function) Event buffer: EventData

Page 65: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

65

4.1.18 DioBmKillEvent Description

The DioBmKillEvent function deletes the registered interrupt events.

Syntax C INT DioBmKillEvent ( HANDLE DeviceHandle ); Visual Basic Declare Function DioBmKillEvent Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long _ )As Long

Delphi function DioBmKillEvent ( DeviceHandle: THandle ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function.

Return Value The DioBmKillEvent function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 66: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

66

Examples

C INT Ret; HANDLE DeviceHandle; HANDLE Event; DWORD EventData; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Event = CreateEvent( NULL, TRUE, FALSE, NULL); Ret = DioBmSetEvent( DeviceHandle, DIOBM_EV_ENDTRG, NULL, WM_NULL, NULL, 0, Event, &EventData ); : Ret = DioBmKillEvent( DeviceHandle );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Event As Long Dim EventData As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Event = CreateEvent( 0, true, false, 0) Ret = DioBmSetEvent( DeviceHandle, DIOBM_EV_ENDTRG, 0, 0, 0, 0, Event, EventData ) : Ret = DioBmKillEvent( DeviceHandle )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; Event: THandle; EventData: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Event := CreateEvent(nil, True, False, nil); Ret := DioBmSetEvent( DeviceHandle, DIOBM_EV_ENDTRG, nil, WM_NULL, nil, 0, Event, EventData ); : Ret := DioBmKillEvent( DeviceHandle ); end; Delete the registered interrupt events of the bus master digital input/output device specified by DeviceHandle.

Page 67: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

4.1.19 DioBmGetCounter Description

The DioBmGetCounter function retrieves the counter value for the bus master transfer.

Syntax C INT DioBmGetCounter ( HANDLE DeviceHandle, PDWORD InOutCounter, PDWORD DmaCounter ); Visual Basic Declare Function DioBmGetCounter Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef InOutCounter As Long, _ ByRef DmaCounter As Long _ )As Long Delphi function DioBmGetCounter ( DeviceHandle: THandle; var InOutCounter: DWORD; var DmaCounter: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. InOutCounter Points to a variable to receive the input/output counter value. With Visual

Basic or Delphi, the variable is passed by reference. When you use the PCI-2172C or PCI-2472C, if the specified clock is 20 MHz or the external clock, you cannot retrieve the input/output counter value. In that case, -1 (FFFFFFFF h) is returned.

<PCI-27172C, CPZ-291244,CPZ-292244, LPC-291144, LPC-292144,

PEX-291144, PEX-292144, CBI/CSI-291144, CBI-CSI-292144> The counter range is from 0 to 4,294,967,295 (FFFFFFFF h). If the number of input/output data exceeds the maximum value, the counter will wrap around.

<PCI-27172C, PCI-2472C>

Transfer Data Size Counter Unit 8 bits 0 to 4,294,967,295 (FFFFFFFF h) Each

16 bits 0 to 2,147,483,647 (7FFFFFFF h) Each 32 bits 0 to 1,073,741,823 (3FFFFFFF h) Each

Copyright 2002, 2015 Interface Corporation. All rights reserved.

67

Page 68: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

DmaCounter Points to a variable to receive the DMA counter. With Visual Basic or Delphi, the variable is passed by reference.

<PCI-27172C, PCI-2472C, PCI-2772C, CPZ-291244,CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI-CSI-292144>

Transfer Data Size Counter Unit 4 bits 0 to 4,294,967,288 (FFFFFFF8 h) Every 88 bits 0 to 4,294,967,292 (FFFFFFFC h) Every 4

12 bits/16 bits 0 to 2,147,483,646 (7FFFFFFE h) Every 220 bits/24 bits/28 bits/32 bit 0 to 1,073,741,823 (3FFFFFFF h) Each

Return Value The DioBmGetCounter function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Examples C INT Ret; HANDLE DeviceHandle; DWORD InOutCounter, DmaCounter; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmGetCounter( DeviceHandle, &InOutCounter, &DmaCounter ); Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim InOutCounter As Long Dim DmaCounter As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmGetCounter( DeviceHandle, InOutCounter, DmaCounter ) Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; InOutCounter, DmaCounter: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmGetCounter( DeviceHandle, InOutCounter, DmaCounter ); end;

Retrieve the input/output counter value to InOutCounter of the bus master digital input/output device specified by DeviceHandle and the counter value for the bus master transfer to DmaCounter.

Copyright 2002, 2015 Interface Corporation. All rights reserved.

68

Page 69: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

69

4.1.20 DioBmGetStatus Description

The DioBmGetStatus function retrieves the transfer status.

Syntax C INT DioBmGetStatus ( HANDLE DeviceHandle, PDWORD Status ); Visual Basic Declare Function DioBmGetStatus Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef Status As Long _ )As Long Delphi function DioBmGetStatus ( DeviceHandle: THandle; var Status: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Status Points to a variable to receive transfer status. With Visual Basic or Delphi, the

variable is passed by reference. The following code will be set in the variable according to the transfer status. <PCI-2172C, PCI-2472C>

Code Description DIOBM_STATUS_ACTIVE_DMA The bus master transfer is in progress.DIOBM_STATUS_FIFO_EMPTY The FIFO buffer is empty. DIOBM_STATUS_FIFO_FULL The FIFO buffer is full of data. DIOBM_STATUS_GATE The Input/output gate is open, so the

signals are enabled.

Page 70: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

70

<PCI-2772C, CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144>

Code Description DIOBM_STATUS_ACTIVE_DMA The bus master transfer is in progress.DIOBM_STATUS_FIFO_EMPTY The FIFO buffer is empty. DIOBM_STATUS_FIFO_FULL The FIFO buffer is full of data. DIOBM_STATUS_CARRY_ INOUT_COUNTER

The input/output counter is over 4294967295.

DIOBM_STATUS_CARRY_DMA_COUNTER

The DMA counter is over 4294967295.

DIOBM_STATUS_INOUT_ ACTIVE

The input/output operation is in progress.

DIOBM_STATUS_SOFTT_STOP The bus master transfer is terminated by software.

DIOBM_STATUS_DELAY Samples after a trigger are being retrieved.

DIOBM_STATUS_ORE_URE An over-run error or under-run error has been occurred.

Return Value

The DioBmGetStatus function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Examples C INT Ret; HANDLE DeviceHandle; DWORD Status; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmGetStatus( DeviceHandle, &Status );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Status As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmGetStatus( DeviceHandle, Status )

Page 71: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

71

Delphi var Ret: Integer; Name: Array[0..15] of Char; Status: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmGetStatus( DeviceHandle, Status ); end;

Retrieve the status to Status from the bus master digital input/output device specified by DeviceHandle.

Page 72: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

72

4.1.21 DioBmInputDword Description

The DioBmInputDword function reads 32 digital input pins and stores the data into a double-word variable.

Syntax C INT DioBmInputDword ( HANDLE DeviceHandle, PDWORD InputData );

Visual Basic Declare Function DioBmInputDword Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef InputData As Long _ )As Long

Delphi function DioBmInputDword ( DeviceHandle: THandle; var InputData: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. InputData Points to a variable to receive the digital input status. With Visual Basic or

Delphi, the variable is passed by reference. Data Format The data format in the variable receiving data is as follows.

bit31 bit30 bit29 … bit2 bit1 bit0 IN32 IN31 IN30 … IN3 IN2 IN1

Positive Logic 0: The input level is low. 1: The input level is high.

Return Value

The DioBmInputDword function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 73: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

73

Comments

To retrieve digital input status by using the DioBmInputDword function, use the DioBmSetDeviceConfig/ DioBmSetDeviceConfigEx function to set any mode from the following modes. DIOBM_MODE_NON Set INOUT1 to INOUT32 as digital inputs. DIOBM_MODE_SAMPLING DIOBM_MODE_SAMPLING_GATE DIOBM_MODE_STROBE DIOBM_MODE_REQUEST DIOBM_MODE_SAMPLING_NOCTL

Set the pins that are not enabled for DMA transfer output by dwRedirectWidth or dwSignalEnable as general purpose inputs.

Make sure of the mode configuration to input data after executing the DioBmOutputDword function.

Examples C INT Ret; HANDLE DeviceHandle; DWORD InputData; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmInputDword( DeviceHandle, &InputData );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim InputData As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmInputDword( DeviceHandle, InputData )

Delphi var Ret: Integer; Name: Array[0..15] of Char; InputData: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmInputDword( DeviceHandle, InputData ); end;

Read the digital input pins to InputData of the bus master digital input/output device specified by DeviceHandle.

Page 74: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

74

4.1.22 DioBmOutputDword Description

The DioBmOutputDword function writes 32 digital output pins.

Syntax C INT DioBmOutputDword ( HANDLE DeviceHandle, DWORD OutputData ); Visual Basic Declare Function DioBmOutputDword Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal OutputData As Long _ )As Long Delphi function DioBmOutputDword ( DeviceHandle: THandle; OutputData: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. OutputData Specifies output data.

Data Format Each data bit is output to the corresponding output pin.

bit31 bit30 bit29 … bit2 bit1 bit0 OUT32 OUT31 OUT30 … OUT3 OUT2 OUT1

Positive Logic 0: The output level is low. 1: The output level is high.

Return Value

The DioBmOutputDword function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 75: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

75

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmOutputDword( DeviceHandle, 0x00000001 );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmOutputDword( DeviceHandle, &H1 )

Delphi var Ret: Integer; Name: Array[0..15] of Char; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmOutputDword( DeviceHandle, $00000001 ); end;

Turn on OUT1 on the bus master digital input/output device specified by DeviceHandle.

Page 76: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

76

4.1.23 DioBmGetLine Description The DioBmGetLine function retrieves the input status of control signals Syntax

C INT DioBmGetLine ( HANDLE DeviceHandle, PDWORD Line );

Visual Basic Declare Function DioBmGetLine Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef Line As Long _ )As Long

Delphi function DioBmGetLine ( DeviceHandle: THandle; var Line: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Page 77: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

77

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Line Points to a variable to receive input status of control signals. It is specified by bit patterns.

Refer to the following tables. <PCI-2172C, PCI-2472C>

bit31 to bit 8

bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0

END1 START1 EQ1 ORE1 ACK1STOP1/

FF1

STB1/

REQ1/

GATE1/

STAT1 Reserved

EQ2 URE2 END2 START2 ACK2EF2/

STOP2

STB2/

REQ2/

GATE2/

STAT2

Reserved

<PCI-2772C, CPZ-291244, CPZ-292244>

bit31 to bit 8

bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0

Reserved

STAT2 /GATE2 /ACK2 /REQ2

STAT1/GATE1/ACK1/REQ1

STOP2/EF2

STOP1/FF1

EXT22 EXT21 EXT12 EXT11

Each of the EXT11, EXT12, EXT21, EXT22 signal returns the status of the START, END, EQ, ORE1, or URE2 signal depending on the assignment by the DioBmSetDeviceConfigEx function. Negative Logic 0: The input level is high. (off) 1: The input level is low. (on) <PCI-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144> Not supported

Return Value

The DioBmGetLine function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 78: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

78

Examples

C INT Ret; HANDLE DeviceHandle; DWORD Line; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmGetLine( DeviceHandle, &Line );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Line As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmGetLine( DeviceHandle, Line )

Delphi var Ret: Integer; Name: Array[0..15] of Char; Line: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmGetLine( DeviceHandle, Line ); end;

Retrieve the input status of control signals of the bus master transfer buffer.

Page 79: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

79

4.1.24 DioBmSetLine Description

The DioBmSetLine function controls the control signals.

Syntax C INT DioBmSetLine ( HANDLE DeviceHandle, DWORD Line ); Visual Basic Declare Function DioBmSetLine Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal Line As Long _ )As Long Delphi function DioBmSetLine ( DeviceHandle: THandle; Line: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Line Specifies the setting data of the control signals.

<PCI-2172C, PCI-2472C> ORE1/URE22 as digital output Specifies the following code to control ORE1 or URE2 if the signal is programmed as a digital output signal.

Code Description

DIOBM_OREURE_OUT_HIGH High latch outputs DIOBM_OREURE_OUT_LOW Low latch outputs

EQ1/EQ2 as digital output Specifies the following code to control EQ1 or EQ2 if the signal is programmed as a digital output signal.

Code Description DIOBM_EQ_OUT_HIGH High latch outputs DIOBM_EQ_OUT_LOW Low latch outputs

Page 80: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

80

ORE1/URE2 as error signal Specifies the following code to clear error output if the ORE1 or URE2 signal is programmed as an error signal.

Code Description DIOBM_OREURE_CLEAR Deasserts ORE1 or URE2

<PCI-2772C, CPZ-291244, CPZ-292244> EXT11 signal Specifies the following code to control the line of the EXT11 signal. These codes cannot be specified together. To control another EXT signal simultaneously, specify a code combined with OR.

Code Description DIOBM_EXT11_OUT_HIGH High latch outputs DIOBM_EXT11_OUT_LOW Low latch outputs

EXT12 signal Specifies the following code to control the line of the EXT12 signal. These codes cannot be specified together. To control another EXT signal simultaneously, specify a code combined with OR.

Code Description DIOBM_EXT12_OUT_HIGH High latch outputs DIOBM_EXT12_OUT_LOW Low latch outputs

EXT21 signal Specifies the following code to control the line of the EXT21 signal. These codes cannot be specified together. To control another EXT signal simultaneously, specify a code combined with OR.

Code Description DIOBM_EXT21_OUT_HIGH High latch outputs DIOBM_EXT21_OUT_LOW Low latch outputs

EXT22 signal Specifies the following code to control the line of the EXT22 signal. These codes cannot be specified together. To control another EXT signal simultaneously, specify an identifier combined with OR.

Code Description DIOBM_EXT22_OUT_HIGH High latch outputs DIOBM_EXT22_OUT_LOW Low latch outputs

ORE1/URE2 as error signal Specifies the following code to clear error output if the ORE1 or URE2 signal is programmed as an error signal. To control an EXT signal simultaneously, specify a code combined with OR.

Code Description DIOBM_OREURE_CLEAR Deasserts ORE1 or URE2

Page 81: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

81

<LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144,

CBI/CSI-292144> ORE1/URE2 as error signal Specifies the following code to clear error output if the ORE1 or URE2 signal is programmed as an error signal.

Code Description DIOBM_OREURE_CLEAR Deasserts ORE1 or URE2

Return Value

The DioBmSetLine function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 82: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

82

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmSetLine( DeviceHandle, DIOBM_OREURE_OUT_HIGH + DIOBM_EQ_OUT_LOW ); Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmSetLine( DeviceHandle, DIOBM_OREURE_OUT_HIGH + DIOBM_EQ_OUT_LOW )

Delphi var Ret: Integer; Name: Array[0..15] of Char; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmSetLine( DeviceHandle, DIOBM_OREURE_OUT_HIGH + DIOBM_EQ_OUT_LOW ); end;

Control the control signal of the bus master digital input/output device specified by DeviceHandle. (In the case of the ORE1 or URE2 signal is disabled or the EQ1 or EQ2 signal is disabled.) - The ORE1 or URE2 signal: high latch output - The EQ1 or EQ2 signal: low latch output

Page 83: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

83

4.1.25 DioBmGetDeviceInfo Description

The DioBmGetDeviceInfo function retrieves the device information.

Syntax C INT DioBmGetDeviceInfo ( HANDLE DeviceHandle, PDIOBMINFO Info ); Visual Basic Declare Function DioBmGetDeviceInfo Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef Info As DIOBMINFO _ )As Long Delphi function DioBmGetDeviceInfo ( DeviceHandle: THandle; var Info: DIOBMINFO ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Info Points to the DIOBMINFO structure to receive the device information.

With Visual Basic or Delphi, the variable is passed by reference.

Return Value The DioBmGetDeviceInfo function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 84: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

84

Examples

C INT Ret; HANDLE DeviceHandle; DIOBMINFO Info; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmGetDeviceInfo( DeviceHandle, &Info );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Info As DIOBMINFO Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmGetDeviceInfo( DeviceHandle, Info )

Delphi var Ret: Integer; Name: Array[0..15] of Char; Info: DIOBMINFO; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmGetDeviceInfo( DeviceHandle, Info ); end;

Retrieve the device information to the DIOBMINFO structure of the bus master digital input/output device specified by DeviceHandle.

Page 85: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

85

4.1.26 DioBmAllocateBuffer Description

The DioBmAllocateBuffer function allocates the buffer in the device driver for the bus master transfer.

Syntax C INT DioBmAllocateBuffer ( HANDLE DeviceHandle, DWORD BufferSize );

Visual Basic Declare Function DioBmAllocateBuffer Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal BufferSize As Long _ )As Long

Delphi function DioBmAllocateBuffer ( DeviceHandle: THandle; BufferSize: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. BufferSize Specifies the size of the bus master transfer buffer in bytes.

Return Value The DioBmAllocateBuffer function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Comment Use DioBmAllocateBuffer function to read input data when the buffer is allocated by the device driver.

Page 86: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

86

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * sizeof(DWORD) );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * 4 )

Delphi var Ret: Integer; Name: Array[0..15] of Char; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmAllocateBuffer( DeviceHandle, 128 * SizeOf(DWORD) ); end;

Allocate the bus master transfer buffer for the device specified by DeviceHandle.

Page 87: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

87

4.1.27 DioBmFreeBuffer Description

The DioBmFreeBuffer function releases the internal buffer allocated by the DioBmAllocateBuffer function.

Syntax C INT DioBmFreeBuffer ( HANDLE DeviceHandle ); Visual Basic Declare Function DioBmFreeBuffer Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long _ )As Long Delphi function DioBmFreeBuffer ( DeviceHandle: THandle ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function.

Return Value The DioBmFreeBuffer function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Comment Use DioBmFreeBuffer function to read input data when the buffer is allocated by the device driver.

Page 88: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

88

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * 4 ) : Ret = DioBmFreeBuffer( DeviceHandle );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * 4 ) : Ret = DioBmFreeBuffer( DeviceHandle )

Delphi var Ret: Integer; Name: Array[0..15] of Char; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmAllocateBuffer( DeviceHandle, 128 * SizeOf(DWORD) ); : Ret := DioBmFreeBuffer( DeviceHandle ); end;

Releases the internal buffer allocated by bus master digital input/output device specified by DeviceHandle.

Page 89: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

4.1.28 DioBmGetData Description

The DioBmGetData function retrieves input data.

Syntax C INT DioBmGetData ( HANDLE DeviceHandle, PVOID Data, PDWORD DataNum );

Visual Basic Declare Function DioBmGetData Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef Data As Any, _ ByRef DataNum As Long _ )As Long

Delphi function DioBmGetData ( DeviceHandle: THandle; Data: Pointer; var DataNum: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Data Points to the buffer to receive the input data. With Visual Basic, the variable is

passed by reference. DataNum Points to a variable containing the number of data to be read. The variable

pointed by DataNum will receive the number of data actually read when this function is completed.

Return Value

The DioBmGetData function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Comment Use DioBmGetData function to read input data when the buffer is allocated by the device driver.

Copyright 2002, 2015 Interface Corporation. All rights reserved.

89

Page 90: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

90

Examples

C INT Ret; HANDLE DeviceHandle; DWORD Data[128]; DWORD DataNum; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * 4 ) : DataNum = 128; Ret = DioBmGetData( DeviceHandle, wData, &DataNum );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Data(128) As Long Dim DataNum As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * 4 ) : DataNum = 128 Ret = DioBmGetData( DeviceHandle, Data(0), Counter )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; Data[128]: DWORD; DataNum: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmAllocateBuffer( DeviceHandle, 128 * SizeOf(DWORD) ); : DataNum = 128; Ret := DioBmGetData( DeviceHandle, @Data[0], DataNum ); end;

Retrieve 128 double-words of data from the bus master digital input/output device specified by DeviceHandle and store them into the bus master buffer (Data). The number of data actually read is stored into DataNum.

Page 91: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

91

4.1.29 DioBmReadData Description

The DioBmReadData function receives input data. It allows you to specify an offset address.

Syntax C INT DioBmReadData ( HANDLE DeviceHandle, DWORD Offset, PVOID Data, PDWORD DataNum ); Visual Basic Declare Function DioBmReadData Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal Offset As Long, _ ByRef Data As Any, _ ByRef DataNum As Long _ )As Long Delphi function DioBmReadData ( DeviceHandle: THandle; Offset: DWORD; Data: Pointer; var DataNum: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Offset Specifies an offset address within the buffer from which to read the data, where 0h

is the top of the buffer. Data Points to the buffer to receive input data. With Visual Basic, the variable is passed

by reference. DataNum Points to a variable containing the number of data to be read.

The variable pointed by DataNum will receive the number of data actually read when this function is completed.

Return Value

The DioBmReadData function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 92: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

92

Comment

Use the DioBmReadData function to read input data when the buffer is allocated by the device driver.

Examples C INT Ret; HANDLE DeviceHandle; DWORD Data[128]; DWORD DataNum; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * 4 ) : DataNum = 128; Ret = DioBmReadData( DeviceHandle, 64, Data, &DataNum );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Data(128) As Long Dim DataNum As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * 4 ) : DataNum = 128 Ret = DioBmReadData( DeviceHandle, 64, Data(0), Counter )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; Data[128]: DWORD; DataNum: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmAllocateBuffer( DeviceHandle, 128 * SizeOf(DWORD) ); : DataNum := 128; Ret := DioBmReadData( DeviceHandle, 64, @Data[0], DataNum ); end;

Retrieve 128 double-words of data from the offset address of 64 of in the bus master transfer buffer.

Page 93: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

93

4.1.30 DioBmSetData Description

The DioBmSetData function writes the output data to the bus master transfer buffer.

Syntax C INT DioBmSetData ( HANDLE DeviceHandle, PVOID Data, PDWORD DataNum );

Visual Basic Declare Function DioBmSetData Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef Data As Any, _ ByRef DataNum As Long _ )As Long

Delphi function DioBmSetData ( DeviceHandle: THandle; Data: Pointer; var DataNum: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Data Points to the buffer containing the output data. With Visual Basic, the variable is

passed by reference. DataNum Points to a variable containing the number of data to be written. With Visual

Basic or Delphi, the variable is passed by reference. The variable pointed by DataNum will receive the number of data actually written when this function is completed.

Return Value

The DioBmSetData function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 94: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

94

Examples

C INT Ret; HANDLE DeviceHandle; DWORD Data[128]; DWORD DataNum; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * 4 ) : Data[0] = 0x1; Data[1] = 0x3; : Data[127] = 0x8000; DataNum = 128; Ret = DioBmSetData( DeviceHandle, Data, &DataNum );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Data(128) As Long Dim DataNum As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * 4 ) : Data(0) = &h1; Data(1) = &h3; : Data(127) = &h8000; DataNum = 128 Ret = DioBmSetData( DeviceHandle, Data(0), Counter )

Page 95: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

95

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; Data[128]: DWORD; DataNum: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmAllocateBuffer( DeviceHandle, 128 * SizeOf(DWORD) ); : Data[0] := $1; Data[1] := $3; : Data[127] := $8000; DataNum := 128; Ret := DioBmSetData( DeviceHandle, @Data[0], DataNum ); end;

Write 128 double-words of data to in the bus master transfer buffer for the device specified by DeviceHandle.

Page 96: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

96

4.1.31 DioBmWriteData Description

The DioBmWriteData function is similar to the DioBmSetData function except that it allows specifying an offset address within the buffer from which to begin the write.

Syntax C INT DioBmWriteData ( HANDLE DeviceHandle, DWORD Offset, PVOID Data, PDWORD DataNum );

Visual Basic Declare Function DioBmWriteData Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal Offset As Long, _ ByRef Data As Any, _ ByRef DataNum As Long _ )As Long

Delphi function DioBmWriteData ( DeviceHandle: THandle; Offset: DWORD; Data: Pointer; var DataNum: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Offset Specifies an offset address within the buffer from which to write the data, where

0h is the top of the buffer. Data Points to the buffer containing the output data. With Visual Basic, the variable is

passed by reference. DataNum Points to a variable containing the number of output data to be written. With

Visual Basic or Delphi, the variable is passed by reference. The variable pointed by DataNum will receive the number of data actually written when this function is completed.

Page 97: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

97

Return Value

The DioBmWriteData function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Comment

The variable pointed by DataNum will receive the number of data actually written when this function is completed.

Examples C INT Ret; HANDLE DeviceHandle; DWORD Data[128]; DWORD DataNum; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * 4 ) : Data[0] = 0x1; Data[1] = 0x3; : Data[127] = 0x8000; DataNum = 128; Ret = DioBmWriteData( DeviceHandle, 64, Data, &DataNum );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Data(128) As Long Dim DataNum As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * 4 ) : Data(0) = &h1; Data(1) = &h3; : Data(127) = &h8000; DataNum = 128 Ret = DioBmWriteData( DeviceHandle, 64, Data(0), Counter )

Page 98: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

98

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; Data[128]: DWORD; DataNum: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmAllocateBuffer( DeviceHandle, 128 * SizeOf(DWORD) ); : Data[0] := $1; Data[1] := $3; : Data[127] := $8000; DataNum := 128; Ret := DioBmWriteData( DeviceHandle, 64, @Data[0], DataNum ); end;

Write 128 double-words of data at an offset address of 64 of the bus master transfer buffer at an offset address of 64 for the device specified by DeviceHandle. The number of data actually written is stored into DataNum.

Page 99: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

99

4.1.32 DioBmClearData Description

The DioBmClearData function clears the bus master transfer buffer.

Syntax C INT DioBmClearData ( HANDLE DeviceHandle );

Visual Basic Declare Function DioBmClearData Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long _ )As Long

Delphi function DioBmClearData ( DeviceHandle: THandle ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by theDioBmOpen function.

Return Value The DioBmClearData function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values”.

Page 100: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

100

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * 4 ) : Ret = DioBmClearData( DeviceHandle );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmAllocateBuffer( DeviceHandle, 128 * 4 ) : Ret = DioBmClearData( DeviceHandle )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmAllocateBuffer( DeviceHandle, 128 * SizeOf(DWORD) ); : Ret := DioBmClearData( DeviceHandle ); end;

Clear the bus master transfer buffer for the device specified by DeviceHandle.

Page 101: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

101

4.1.33 DioBmSetDeviceConfigEx Description

The DioBmSetDeviceConfigEx function configures the transfer mode, transfer data unit, sampling rate, and control signals only for the PCI-2772C, CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, or CBI/CSI-292144.

Syntax C INT DioBmSetDeviceConfigEx ( HANDLE DeviceHandle, PDIOBMCONFEX ConfEx );

Visual Basic Declare Function DioBmSetDeviceConfigEx Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef ConfEx As DIOBMCONFEX _ )As Long

Delphi function DioBmSetDeviceConfigEx ( DeviceHandle: THandle; var ConfEx: DIOBMCONFEX ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. ConfEx Points to the DIOBMCONFEX structure containing operation parameters.

Return Value The DioBmSetDeviceConfigEx function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 102: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

102

Examples

C INT Ret; HANDLE DeviceHandle; DIOBMCONFEX ConfEx; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : ConfEx.dwMode = DIOBM_MODE_SAMPLING; ConfEx.dwRedirectWidth = DIOBM_EX_SETTING; ConfEx.dwEQConf = 0; ConfEx.dwClock = DIOBM_EX_SETTING; ConfEx.dwSmplNum = 1024; ConfEx.dwTimingOption = 0; ConfEx.dwSTBConf = 0; ConfEx.dwACKConf = 0; ConfEx.dwREQConf = 0; ConfEx.dwOREConf = 0; ConfEx.dwUREConf = 0; ConfEx.dwAssignExt[0] = 0; ConfEx.dwAssignExt[1] = 0; ConfEx.dwAssignExt[2] = 0; ConfEx.dwAssignExt[3] = 0; ConfEx.dwSignalEnable = 0x15; ConfEx.dwSCLKConf = DIOBM_INTERNAL; ConfEx.dwClockMulti = 4; ConfEx.dwSTBSuMulti = 0; ConfEx.dwSTBPuMulti = 0; ConfEx.dwAckMulti = 0; ConfEx.dwREQMulti = 0; ConfEx.dwGATEConf = 0; ConfEx.dwSTOPConf = DIOBM_LINE_STOP1; ConfEx.dwStopBehav = DIOBM_BH_NORMAL; Ret = DioBmSetDeviceConfigEx( DeviceHandle, &ConfEx );

Page 103: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

103

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim ConfEx As DIOBMCONFEX Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : BmConfEx.dwMode = DIOBM_MODE_SAMPLING ConfEx.dwRedirectWidth = DIOBM_EX_SETTING ConfEx.dwEQConf = 0 ConfEx.dwClock = DIOBM_EX_SETTING ConfEx.dwSmplNum = 1024 ConfEx.dwTimingOption = 0 ConfEx.dwSTBConf = 0 ConfEx.dwACKConf = 0 ConfEx.dwREQConf = 0 ConfEx.dwOREConf = 0 ConfEx.dwUREConf = 0 ConfEx.dwAssignExt(0) = 0 ConfEx.dwAssignExt(1) = 0 ConfEx.dwAssignExt(2) = 0 ConfEx.dwAssignExt(3) = 0 ConfEx.dwSignalEnable = &H15 ConfEx.dwSCLKConf = DIOBM_INTERNAL ConfEx.dwClockMulti = 4 ConfEx.dwSTBSuMulti = 0 ConfEx.dwSTBPuMulti = 0 ConfEx.dwAckMulti = 0 ConfEx.dwREQMulti = 0 ConfEx.dwGATEConf = 0 ConfEx.dwSTOPConf = DIOBM_LINE_STOP1 ConfEx.dwStopBehav = DIOBM_BH_NORMAL Ret = DioBmSetDeviceConfigEx( DeviceHandle, ConfEx )

Page 104: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

104

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; ConfEx: DIOBMCONFEX; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : ConfEx.dwMode := DIOBM_MODE_SAMPLING; ConfEx.dwRedirectWidth := DIOBM_EX_SETTING; ConfEx.dwEQConf := 0; ConfEx.dwClock := DIOBM_EX_SETTING; ConfEx.dwSmplNum := 1024; ConfEx.dwTimingOption := 0; ConfEx.dwSTBConf := 0; ConfEx.dwACKConf := 0; ConfEx.dwREQConf := 0; ConfEx.dwOREConf := 0; ConfEx.dwUREConf := 0; ConfEx.dwAssignExt[0] := 0; ConfEx.dwAssignExt[1] := 0; ConfEx.dwAssignExt[2] := 0; ConfEx.dwAssignExt[3] := 0; ConfEx.dwSignalEnable := $15; ConfEx.dwSCLKConf := DIOBM_INTERNAL; ConfEx.dwClockMultiplier := 4; ConfEx.dwSTBSuMulti := 0; ConfEx.dwSTBPuMulti := 0; ConfEx.dwAckPuMulti := 0; ConfEx.dwREQMulti := 0; ConfEx.dwGATEConf := 0; ConfEx.dwSTOPConf := DIOBM_LINE_STOP1; ConfEx.dwStopBehav := DIOBM_BH_NORMAL; Ret := DioBmSetDeviceConfigEx( DeviceHandle, ConfEx ); end;

Configure functions of the bus master digital input/output device specified by DeviceHandle as follows.

Transfer mode Sampling mode Bus master transfer width 12 bit (INOUT1 through INOUT4, INOUT9 through INOUT12,

INOUT17 through INOUT20) EQx signal output Disabled Base clock Internal clock: 5 MHz (200 ns) Number of samples 1024 FIFO operation mode Not specified STB signal Disabled ACK signal Disabled REQ signal Disabled ORE signal Disabled URE signal Disabled

Page 105: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

105

4.1.34 DioBmGetDeviceConfigEx Description

The DioBmGetDeviceConfigEx function retrieves the transfer mode, transfer data unit, sampling rate, and control signals only for the PCI-2772C, CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-291144, or CBI/CSI-291144, CBI/CSI-292144.

Syntax C INT DioBmGetDeviceConfigEx ( HANDLE DeviceHandle, PDIOBMCONFEX ConfEx ); Visual Basic Declare Function DioBmGetDeviceConfigEx Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef ConfEx As DIOBMCONFEX _ )As Long Delphi function DioBmGetDeviceConfigEx ( DeviceHandle: THandle; var ConfEx: DIOBMCONFEX ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. ConfEx Points to the DIOBMCONFEX structure to receive the operation parameters.

With Visual Basic or Delphi, the variable is passed by reference.

Return Value The DioBmGetDeviceConfigEx function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 106: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

106

Examples

C INT Ret; HANDLE DeviceHandle; DIOBMCONFEX ConfEx; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmGetDeviceConfigEx( DeviceHandle, &ConfEx );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim ConfEx As DIOBMCONFEX Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmGetDeviceConfigEx( DeviceHandle, ConfEx )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; ConfEx: DIOBMCONFEX; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmGetDeviceConfigEx( DeviceHandle, ConfEx ); end;

Receive the operation parameters of the bus master transfer digital input/output device specified by DeviceHandle into the ConfEx structure.

Page 107: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

107

4.1.35 DioBmStopEx Description

The DioBmStopEx function suspends the bus master transfer for the PCI-2772C, CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, or CBI/CSI-292144. This function can suspend the bus master transfer of both the input circuits and output circuits at the same time.

Syntax C INT DioBmStopEx ( HANDLE DeviceHandle, DWORD Option );

Visual Basic Declare Function DioBmStopEx Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal Option As Long _ )As Long

Delphi function DioBmStopEx ( DeviceHandle: THandle; Option: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Option Specifies the bus master transfer operation.

Code Description DIOBM_OWN Suspends the bus master transfer of the device

specified by DeviceHandle. DIOBM_SYNC_DI_DO Suspends the bus master transfer of both the input

circuits and output circuits at the same time. This code is applicable only to the devices that have both bus master digital input and bus master digital output.

Return Value

The DioBmStopEx function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 108: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

108

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmStopEx( DeviceHandle, DIOBM_SYNC_DI_DO );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmStopEx( DeviceHandle, DIOBM_SYNC_DI_DO )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmStopEx( DeviceHandle, DIOBM_SYNC_DI_DO ); end;

Suspend the bus master transfer of the input circuits and output circuits of the bus master digital input/output device specified by DeviceHandle by specifying the DIOBM_SYNC_DI_DO identifier.

Page 109: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

109

4.1.36 DioBmSoftTriggerEx Description

The DioBmSoftTriggerEx function issues a software trigger command. If you use the software trigger, you must enable it by the DioBmSetTriggerConfig function beforehand. For the PCI-2772C, CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-291144, or CBI/CSI-291144, CBI/CSI-292144, this function can issue a software trigger command on both the input circuits and output circuits at the same time.

Syntax C INT DioBmSoftTriggerEx ( HANDLE DeviceHandle, DWORD Option ); Visual Basic Declare Function DioBmSoftTriggerEx Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal Option As Long _ )As Long Delphi function DioBmSoftTriggerEx ( DeviceHandle: THandle; Option: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Option Specifies the bus master transfer operation.

Code Description DIOBM_OWN Issues a software trigger command on the device

specified by DeviceHandle. DIOBM_SYNC_DI_DO Issues a software trigger command on both the input

circuits and output circuits at the same time. This code is applicable only to the devices that have both bus master digital input and bus master digital output.

Return Value

The DioBmSoftTriggerEx function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 110: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

110

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmSoftTriggerEx( DeviceHandle, DIOBM_SYNC_DI_DO );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmSoftTriggerEx( DeviceHandle, DIOBM_SYNC_DI_DO )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmSoftTriggerEx( DeviceHandle, DIOBM_SYNC_DI_DO ); end;

Issue the software trigger command on both the input circuits and output circuits of the bus master digital input/output device specified by DeviceHandle at the same time.

Page 111: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

111

4.1.37 DioBmSetEdgeEventConfig Description

The DioBmSetEdgeEventConfig function configures input signal interrupt event source for the CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144

Syntax

C INT DioBmSetEdgeEventConfig ( HANDLE DeviceHandle, DWORD RiseConfig, DWORD FallConfig );

Visual Basic Declare Function DioBmSetEdgeEventConfig Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal RiseConfig As Long, _ ByVal FallConfig As Long _ )As Long

Delphi function DioBmSetEdgeEventConfig ( DeviceHandle: THandle; RiseConfig: DWORD; FallConfig: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Page 112: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

112

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. RiseConfig Specifies the input signal that detects the rising edge (low to high) when input

signal interrupts are enabled. Also it is specified by bit patterns. Code Description

0 Not detects the rising edge 1 Detects the rising edge (An interrupt event is occurred.)

The corresponding bits are as follows. <CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144,

PEX-292144, CBI/CSI-291144, CBI/CSI-292144>

bit31 … bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0

IN32 … IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1

All setting values are 0 under the following conditions: - When the computer is turned on. - When the PCI bus is reset. - When the external reset signal is input. To generate interrupts specified by each bit of IN1 through IN32, configure DIOBM_EV_EDGE by using DioBmSetEventEx function.

FallConfig Specifies the input signal that detects the falling edge (high to low) when input

signal interrupts are enabled. Also it is specified by bit patterns. Code Description

0 Not detects the falling edge. 1 Detects the falling edge. (An interrupt event is occurred.)

The corresponding bits are as follows. <CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144,

PEX-292144, CBI/CSI-291144, CBI/CSI-292144>

bit31 … bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0

IN32 … IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1

All setting values are 0 under the following conditions: - When the computer is turned on. - When the PCI bus is reset. - When the external reset signal is input. To generate interrupts specified by each bit of IN1 through IN32, configure DIOBM_EV_EDGE by using DioBmSetEventEx function.

Page 113: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

113

Return Value

The DioBmSetEdgeEventConfig function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Examples C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmSetEdgeEventConfig( DeviceHandle, 0x0000FFFF, 0xFFFF0000 );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmSetEdgeEventConfig( DeviceHandle, &HFFFF, &HFFFF0000 )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmSetEdgeEventConfig( DeviceHandle, $0000FFFF, $FFFF0000 ); end;

Configure the input signal interrupt event factors of bus master transfer digital input/output device specified by DeviceHandle as follows: IN1 through IN16: An interrupt occurs at each rising edge. IN17 through IN32: An interrupt occurs at each falling edge.

Page 114: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

114

4.1.38 DioBmGetEdgeEventConfig Description

The DioBmGetEdgeEventConfig function configures input signal interrupt event source for the CPZ-291244, CPZ-292244, LPC-291144, LPC-292144 PEX-291144, PEX-292144, CBI/CSI-291144, and CBI/CSI-292144.

Syntax

C INT DioBmGetEdgeEventConfig ( HANDLE DeviceHandle, PDWORD RiseConfig, PDWORD FallConfig ); Visual Basic Declare Function DioBmGetEdgeEventConfig Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef RiseConfig As Long, _ ByRef FallConfig As Long _ )As Long Delphi function DioBmGetEdgeEventConfig ( DeviceHandle: THandle; var RiseConfig: DWORD; var FallConfig: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. RiseConfig Points to a variable to retrieve the information which input pin detects the rising

edge (low to high) when input signal interrupts are enabled. With Visual Basic or Delphi, the variable is passed by reference. The setting is specified by bit patterns.

Code Description 0 Not detects the rising edge. 1 Detects the rising edge. (An interrupt event is occurred.)

The corresponding bits are as follows. <CPZ-29124, CPZ-292244, LPC-291144, LPC-292144, PEX-291144,

PEX-292144, CBI/CSI-291144, CBI/CSI-292144> bit31 … bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0

IN32 … IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1

Page 115: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

115

FallConfig Points to a variable to retrieve the information which input pin detects the rising

edge (low to high) when input signal interrupts are enabled. With Visual Basic or Delphi, the variable is passed by reference. The setting is specified by bit patterns.

Bit Pattern Description 0 Not detects the rising edge. 1 Detects the rising edge. (An interrupt event is occurred.)

The corresponding bits are as follows.

<CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144> bit31 … bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0

IN32 … IN8 IN7 IN6 IN5 IN4 IN3 IN2 IN1

Return Value The DioBmGetEdgeEventConfig function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Examples

C INT Ret; HANDLE DeviceHandle; DWORD RiseConfig; DWORD FallConfig; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmGetEdgeEventConfig( DeviceHandle, &RiseConfig, &FallConfig );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim RiseConfig As Long Dim FallConfig As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmGetEdgeEventConfig( DeviceHandle, RiseConfig, FallConfig )

Page 116: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

116

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; RiseConfig: DWORD; FallConfig: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmGetEdgeEventConfig( DeviceHandle, RiseConfig, FallConfig ); end;

Store input signal interrupt event factors setting data into the variable, dwRiseConfig and dwFallConfig, from bus master transfer digital input/output cards specified by DeviceHandle.

Page 117: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

117

4.1.39 DioBmSetEventEx Description

The DioBmSetEventEx function configures interrupt events for the CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, and CBI/CSI-292144.

Syntax C (for x86) INT DioBmSetEventEx ( HANDLE DeviceHandle, DWORD EventMask, HANDLE Wnd, UINT Msg,

LPDIOBMCALLBACKEX

EventProcEx,

DWORD User, HANDLE Event, PDWORD EventData ); C (for x64) INT DioBmSetEventEx ( HANDLE DeviceHandle, DWORD EventMask, HANDLE Wnd, UINT Msg,

LPDIOBMCALLBACKEX

EventProcEx,

PVOID User, HANDLE Event, PDWORD EventData ); Visual Basic Declare Function DioBmSetEventEx Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal EventMask As Long, _ ByVal Wnd As Long, _ ByVal Msg As Long, _ ByVal EventProcEx As Long, _ ByVal User As Long, _ ByVal Event As Long, _ ByRef EventData As Long _ )As Long Delphi function DioBmSetEventEx ( DeviceHandle: THandle; EventMask: DWORD; Wnd: THandle; Msg: DWORD; EventProcEx: FARPROC; User: DWORD; Event: THandle; var EventData: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Page 118: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

118

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. EventMask Specifies setting data of event masks.

Configures an event to be enabled or disabled. Two or more sources can be enabled simultaneously. To enable multiple sources, specifies the code with an OR operator or plus operator. <PCI-2172C, PCI-2472C>

Code Description DIOBM_EV_ENDTRG Terminates input or output. DIOBM_EV_DTRG Trigger delay occurs. DIOBM_EV_START_TRG Starts input or output. DIOBM_EV_START_LINE START1 or START2 external interrupt occurs. DIOBM_EV_END_LINE END1 or END2 external interrupt occurs. DIOBM_EV_DMAEND Completes DMA transfer. DIOBM_EV_STOP STOP1 or STOP2 interrupt occurs. (only when

STOP1 and SROP2 are enabled.) DIOBM_EV_FIFO_EFFF Makes FIFO empty or full. DIOBM_EV_OREURE Overrun error or underrun error occurs. DIOBM_EV_EXEQ Matches data input/output count and

comparator counter. DIOBM_EV_INEQ Matches DMA transfer counter and comparator

counter. <PCI-2772C, CPZ-291244, CPZ-292244>

Code Description DIOBM_EV_ENDTRG Terminates input or output. DIOBM_EV_DTRG Trigger delay occurs. DIOBM_EV_START_TRG Starts input or output. DIOBM_EV_DMAEND Completes DMA transfer. DIOBM_EV_STOP1 STOP1 interrupt occurs. DIOBM_EV_STOP2 STOP2 interrupt occurs. DIOBM_EV_FIFO_EFFF Makes FIFO empty or full. DIOBM_EV_OREURE Overrun error or underrun error occurs. DIOBM_EV_EXEQ Matches data input/output count and

comparator counter. DIOBM_EV_INEQ Matches DMA transfer counter and

comparator counter. DIOBM_EV_EXT11 EXT11 interrupt occurs. DIOBM_EV_EXT12 EXT12 interrupt occurs. DIOBM_EV_EXT21 Interrupts EXT21. DIOBM_EV_EXT22 EXT22 interrupt occurs. DIOBM_EV_EDGE Input signal interrupt occurs *

Page 119: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

119

When using a START or END signal interrupt, assign the signal to any of the EXT11,

EXT12, EXT21, or EXT22 signal by the DioBmSetDeviceConfigEx function. And then, enable the event of the EXT signal to which the START or END signal is assigned by the event mask setting. When using the counter matching interrupt, configure a comparator counter by using the DioBmSetCounterEventConfig function. The input signal interrupt (DIOBM_EV_EDGE) is supported only by the CPZ-291144 and CPZ-292244. <LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144,

CBI/CSI-292144> Code Description

DIOBM_EV_ENDTRG Terminates input or output. DIOBM_EV_DTRG Trigger delay occurs. DIOBM_EV_START_TRG Starts input or output. DIOBM_EV_DMAEND Completes DMA transfer. DIOBM_EV_FIFO_EFFF Makes FIFO empty or full.. DIOBM_EV_OREURE Overrun error or under-run error occurs. DIOBM_EV_EXEQ Matches data input counter and comparator

counter. DIOBM_EV_INEQ Matches DMA transfer counter and comparator

counter. DIOBM_EV_EDGE Input signal interrupt*

The DioBmSetEdgeEventConfig function enables the edge event of input signal which has the START or END signal when using the START or END signal interrupt. The DioBmSetCounterEventConfig function configures a comparator counter when using counter matching interrupt. All input signal interrupt factors are configured to be disabled at the default setting. Therefore, the factors (rising or falling edge, input signal) are needed to be properly configured by using the DioBmSetEdgeEventConfig function.

Wnd Specifies a handle of the window to which a message is sent when an event occurs. If

you do not use event notification, specify it as follows: NULL (C) 0 (Visual Basic) nil (Delphi)

Msg Specifies message codes to send to Wnd when an event occurs.

Page 120: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

120

EventProcEx Specifies the expansion callback function called when an event occurs. If you do not use

event notification, specify it as follows: NULL (C) 0 (Visual Basic) nil (Delphi)

User

Specifies the user data passed to the callback routine when the events occur. ■ x86 environment Passes DWORD type data. ■ x64 environment Passes the buffer address where the user data is stored because the data is PVOID type. The buffer should be allocated in the global area.

Event Specifies event object handle that becomes signal status when an event occurs. If you do

not use event notification, specify it as follows: NULL (C) 0 (Visual Basic) nil (Delphi)

Page 121: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

121

EventData Points to a buffer to receive occurred events. When specifying NULL, this parameter is ignored. After an event occurs, corresponding bit to the occurred event is 1 in the specified buffer. Multiple sources may be simultaneously enabled. <PCI-2172C, PCI-2472C> - The first element of the array (EventDataEx[0])

Code Description DIOBM_EV_ENDTRG Terminates input or output. DIOBM_EV_DTRG Trigger delay occurs. DIOBM_EV_START_TRG Starts input or output. DIOBM_EV_START_LINE START1 or START2 external interrupt occurs.DIOBM_EV_END_LINE END1 or END2 external interrupt occurs. DIOBM_EV_DMAEND Completes DMA transfer. DIOBM_EV_STOP STOP1 or STOP2 interrupt occurs. (only

when STOP1 and SROP2 are enabled.) DIOBM_EV_FIFO_EFFF Makes FIFO empty or full. DIOBM_EV_OREURE Overrun error or underrun error occurs. DIOBM_EV_EXEQ Matches data input/output count and

comparator counter. DIOBM_EV_INEQ Matches DMA transfer counter and

comparator counter. - The second element of the array (EventDataEx[1]) 0 is always stored. - The third element of the array (EventDataEx[2]) 0 is always stored.

Page 122: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

122

<PCI-2772C, CPZ-291244, CPZ-292244> - The first element of the array (EventDataEx[0])

Code Description DIOBM_EV_ENDTRG Terminates input or output. DIOBM_EV_DTRG Occurs trigger delay. DIOBM_EV_START_TRG Starts input or output. DIOBM_EV_DMAEND Completes DMA transfer. DIOBM_EV_STOP1 STOP1 interrupt occurs. DIOBM_EV_STOP2 STOP2 interrupt occurs. DIOBM_EV_FIFO_EFFF Makes FIFO empty or full. DIOBM_EV_OREURE Makes FIFO empty or full.. DIOBM_EV_EXEQ Matches data input/output count and

comparator counter. DIOBM_EV_INEQ Matches DMA transfer counter and comparator

counter. DIOBM_EV_EXT11 Interrupts EXT11. DIOBM_EV_EXT12 Interrupts EXT12. DIOBM_EV_EXT21 Interrupts EXT21. DIOBM_EV_EXT22 Interrupts EXT22. DIOBM_EV_EDGE Interrupts EXT22.*

When using interrupt of the START and END signals, assign the signals to any of the EXT11, EXT12, EXT21, or EXT22 signal by the DioBmSetDeviceConfigEx function. When the interrupt event of the EXT signal to which the START or END signal is assigned is enabled, an interrupt handling is performed. The input signal interrupt (DIOBM_EV_EDGE) is supported only by the CPZ-291144 and CPZ-292244. - The second element of the array (Event[1])

bit31 to bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 SR_IN32 to

SR_IN8 SR_IN7 SR_IN6 SR_IN5 SR_IN4 SR_IN3 SR_IN2 SR_IN1

SR_IN1 through SR_IN32: The corresponding bit is 1 when interrupt event is generated by rising edge input. To use interrupt event by rising edge input to IN1 through IN32, enable the edge event of the corresponding input pin by the DioBmGetEdgeEventConfig.

- The third element of the array (Event[2]) * Only for CPZ-291244 and CPZ-292244.

bit31 to bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 SF_IN32 to

SF_IN8 SR_IN7 SR_IN6 SR_IN5 SR_IN4 SR_IN3 SR_IN2 SR_IN1

SF_IN1 through SF_IN32: The corresponding bit is 1 when interrupt event is generated by rising edge input. To use interrupt event by rising edge input to IN1 through IN32, enable the edge event of the corresponding input pin by the DioBmGetEdgeEventConfig.

Page 123: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

123

<LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144,

CBI/CSI-292144> - The first element of the array (EventDataEx[0])

Code Description DIOBM_EV_ENDTRG End of transfer event DIOBM_EV_DTRG Trigger delay event DIOBM_EV_START_TRG Start of transfer event DIOBM_EV_DMAEND End of DMA event DIOBM_EV_STOP1 STOP1 signal event DIOBM_EV_STOP2 STOP2 signal event DIOBM_EV_FIFO_EFFF FIFO full/empty event DIOBM_EV_OREURE Over-run/under-run error event DIOBM_EV_EXEQ Matches data input/output count and

comparator counter. DIOBM_EV_INEQ Matches data input/output count and

comparator counter. DIOBM_EV_EDGE Input signal interrupt event*

To use the START or END signal events, enable the edge event of the input pin that contains START or END signal by the DioBmSetDeviceConfig function. When an input signal event is generated, these callback routines do not retrieve the detailed edge sources. To retrieve the detailed edge sources, register expansion event callback routine by the DioBmSetEventEx function. <<The second element of the array (Event[1])>>

bit31 to bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 SR_IN32 to

SR_IN8 SR_IN7 SR_IN6 SR_IN5 SR_IN4 SR_IN3 SR_IN2 SR_IN1

SR_IN1 through SR_IN32: The corresponding bit is 1 when interrupt event is generated by rising edge input. To use ineterrupt event by rising edge input to IN1 through IN32, enable the edge event of the corresponding input pin by the DioBmGetEdgeEventConfig. <<The third element of the array (Event[2])>>

bit31 to bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 SF_IN32 to

SF_IN8 SR_IN7 SR_IN6 SR_IN5 SR_IN4 SR_IN3 SR_IN2 SR_IN1

SF_IN1 through SF_IN32: The corresponding bit is 1 when interrupt event is generated by rising edge input.

To use ineterrupt event by rising edge input to IN1 through IN32, enable the edge event of the corresponding input pin by the DioBmGetEdgeEventConfig.

Page 124: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

124

Return Value

The DioBmSetEventEx function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Examples

C INT Ret; HANDLE DeviceHandle; HANDLE Event; DWORD EventDataEx[3]; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Event = CreateEvent( NULL, TRUE, FALSE, NULL); Ret = DioBmSetEvent( DeviceHandle, DIOBM_EV_ENDTRG, NULL, WM_NULL, NULL, 0, Event, &EventDataEx[0] );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Event As Long Dim EventDataEx(0 To 2) As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Event = CreateEvent( 0, true, false, 0) Ret = DioBmSetEvent( DeviceHandle, DIOBM_EV_ENDTRG, 0, 0, 0, 0, Event, EventDataEx(0) )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; Event: THandle; EventDataEx: Array[0..2] of DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Event := CreateEvent(nil, True, False, nil); Ret := DioBmSetEvent( DeviceHandle, DIOBM_EV_ENDTRG, nil, WM_NULL, nil, 0, Event, EventDataEx[0] ); end;

Configure the interrupt event of bus master transfer digital input/output boards or cards specified by hDeviceHandle as follows:

Page 125: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

125

Event: End of transfer End of transfer: Not specified Message identifier: Disabled (because of no window handle) Callback routine: Not specified User data: Disabled (because of no callback routine) Event object: hEvent Event buffer: dwEventData

Page 126: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

126

4.1.40 DioBmSetFilter Description

The DioBmSetFilter function configures a digital filter for the CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144 and CBI/CSI-291144.

Syntax

C INT DioBmSetFilter ( HANDLE DeviceHandle, DWORD Number, DWORD Config ); Visual Basic Declare Function DioBmSetFilter Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal Number As Long, _ ByVal Config As Long _ )As Long

Delphi function DioBmSetFilter ( DeviceHandle: THandle; Number: DWORD; Config: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Number Specifies an input signal number to configure a digital filter. The number is specified

every four points. The codes below are used. By specifying combining two or more codes by logical sum, the same filter can be set for the specified whole terminals. When a different filter setting is needed for each input signal, change the input signal number and filter setting, and then perform this function two or more times. <CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144,PEX-292144,

CBI/CSI-291144, CBI/CSI-292144> Code Description

DIOBM_FILTER_IN1_4 Configures a digital filter to IN1 through IN4. DIOBM_FILTER_IN5_8 Configures a digital filter to IN5 through IN8. DIOBM_FILTER_IN9_12 Configures a digital filter to IN9 through IN12. DIOBM_FILTER_IN13_16 Configures a digital filter to IN13 through IN16.DIOBM_FILTER_IN17_20 Configures a digital filter to IN17 through IN20.DIOBM_FILTER_IN21_24 Configures a digital filter to IN21 through IN24.DIOBM_FILTER_IN25_28 Configures a digital filter to IN25 through IN28.DIOBM_FILTER_IN29_32 Configures a digital filter to IN29 through IN32.

Page 127: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

127

Config Specifies the setting value of a digital filter.

Specifies the digital setting by combining a filter base clock (FCLK) and count number (FCNT*) <CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144>

bit31 … bit15 bit14 … bit4 bit3 bit2 bit1 bit0

Reserved … FCLK FCNT14 … FCNT4 FCNT

3 FCNT

2 FCNT

1 FCNT

0

Filter Base Clock (FCLK)

0 1 Count Number (FCNT) 100 ns 10 us

0 No filter No filter 1 100 ns 10 us 2 200 ns 20 us

JC : : 32,767 3.2767 ms 327.67 ms

The filter time is given by the following equation: T = FCNT* × FCLK T: Filter timer FCNT*: Count number (FCNT14 through FCNT0): 1 through 32767 FCLK: Filter based clock: 100 ns, 10 microsecond When an input signal is changed in the shorter time than the specified filter time, the input signal is removed as noise.

Return Value

The DioSetFilter function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 128: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

128

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmSetFilter( DeviceHandle, DIOBM_FILTER_IN1_4 + DIOBM_FILTER_IN5_8, 0x8A );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmSetFilter( DeviceHandle, DIOBM_FILTER_IN1_4 + DIOBM_FILTER_IN5_8, &H8A )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmSetFilter( DeviceHandle, DIOBM_FILTER_IN1_IN4 + DIOBM_FILTER_IN5_8, $8A ); end;

Configure a digital filter (filter: 100 microsecond) to IN1 through IN8 of bus master transfer digital input/output cards specified by hDeviceHandle.

Page 129: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

129

4.1.41 DioBmGetFilter Description

The DioBmGetFilter function retrieves the digital filter for CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144.

Syntax C INT DioBmGetFilter ( HANDLE DeviceHandle, DWORD Number, PDWORD Config

); Visual Basic Declare Function DioBmGetFilter Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal Number As Long, _ ByRef Config As Long _ )As Long Delphi function DioBmGetFilter ( DeviceHandle: THandle;

Number: DWORD;

var Config: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. Number Specifies input signal number to retrieve the digital filter. The codes below are

used. <CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144,

PEX-292144, CBI/CSI-291144, CBI/CSI-292144> Code Description

DIOBM_FILTER_IN1_4 Configures a digital filter to IN1 through IN4. DIOBM_FILTER_IN5_8 Configures a digital filter to IN5 through IN8. DIOBM_FILTER_IN9_12 Configures a digital filter to IN9 through IN12. DIOBM_FILTER_IN13_16 Configures a digital filter to IN13 through IN16.DIOBM_FILTER_IN17_20 Configures a digital filter to IN17 through IN20.DIOBM_FILTER_IN21_24 Configures a digital filter to IN21 through IN24.DIOBM_FILTER_IN25_28 Configures a digital filter to IN25 through IN28.DIOBM_FILTER_IN29_32 Configures a digital filter to IN29 through IN32.

Page 130: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

130

Config Points to a variable to receive setting values of the digital filter. The setting is

specified by combining a base clock (FCLK) of the filter and the count number (FCNT). <CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144,

PEX-292144, CBI/CSI-291144, CBI/CSI-292144> bit31 … bit15 bit14 … bit4 bit3 bit2 bit1 bit0

Reserved … FCLK FCNT14 … FCN

T4 FCNT3

FCNT2

FCNT1

FCNT0

Filter Base Clock (FCLK) 0 1 Count Number

(FCNT) 100 ns 10 us 0 No filter No filter 1 100ns 10 us 2 200ns 20 us : : :

32,767 3.2767 ms 327.67 ms

The filter time is given by the following equation: T = FCNT* × FCLK

T: Filter timer FCNT*: Count number (FCNT14 through FCNT0): 1 through 32767 FCLK: Filter based clock: 100 ns, 10 microsecond

Return Value

The DioGetFilter function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Page 131: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

131

Examples

C INT Ret; HANDLE DeviceHandle; DWORD Config DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmGetFilter( DeviceHandle, DIOBM_FILTER_IN1_4, &Config );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim Config As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmGetFilter( DeviceHandle, DIOBM_FILTER_IN1_4, Config )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; RiseConfig: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmGetFilter( DeviceHandle, DIOBM_FILTER_IN1_IN4, Config ); end;

Retrieve the digital filter (filter: 100 microsecond) of IN1 through IN4 of bus master transfer digital input/output card specified by DeviceHandle to Config.

Page 132: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

132

4.1.42 DioBmClearSamplingOutput Description

The DioBmClearSamplingOutput function clears the status of DMA transfer data output for the PCI-2772C (RevsionID: 3 or later), CPZ-291244, CPZ-292244, LPC-291144, PC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, and CBI/CSI-292144.

Syntax

C INT DioBmClearSamplingOutput ( HANDLE DeviceHandle, DWORD ClearConfig );

Visual Basic Declare Function DioBmClearSamplingOutput Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal ClearConfig As Long _ )As Long

Delphi function DioBmClearSamplingOutput ( DeviceHandle: THandle; ClearConfig: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. ClearConfig Specifies a clear setting value.

<CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144,

PEX-292144, CBI/CSI-291144, CBI/CSI-292144, PCI-2772C (RevsionID: 3 or later)> Setting Value Description

0 Clears the output status of OUT1 through OUT32* to low. 1 Clears the output status of OUT1 through OUT32* to high

Note:

* These output signals clear the status of output signals that perform bus master transfer output by dwRedirectWidth of DIOBMCONFEX structure. When specifying DIOBM_EX_SETTING to dwRedirectWidth, clear the status of output signals specified by dwSignalEnable.

Page 133: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

133

Return Value

The DioBmClearSamplingOutput function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Examples C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmClearSamplingOutput( DeviceHandle, 1 );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmClearSamplingOutput( DeviceHandle, 1 )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmClearSamplingOutput( DeviceHandle, 1 ); end;

Clear DMA transfer data output of OUT1 through OUT32 of bus master transfer digital input/output device specified by DeviceHandle to the status of high.

Page 134: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

134

4.1.43 DioBmSetClearMode Description The DioBmSetClearMode function configures output status at the start of continuous output for the PCI-2772C (RevisionID: 3 or later).

Syntax

C INT DioBmSetClearMode ( HANDLE DeviceHandle, DWORD ClearMode ); Visual Basic Declare Function DioBmSetClearMode Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByVal ClearMode As Long _ )As Long Delphi function DioBmSetClearMode ( DeviceHandle: THandle; ClearMode: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. ClearMode Specifies the setting value of the clear mode.

<PCI-2772C (RevsionID: 3 or later)>

Code Description

DIOBM_CLEAR_OUTPUT Clears the output status to high at the start of continuous output.

DIOBM_KEEP_OUTPUT Saves the output status of the previous setting at the start of continuous output.

Return Value

The DioBmClearSamplingOutput function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Comments This function is applicable to setting for the PCI-2772C (RevisionID: 3 or later). If using the model with the revision ID of 2 or earlier, use the DIOBM_CLEAR_OUTPUT only.

Model RevisionID ClearMode PCI-2772C 2 or earlier DIOBM_CLEAR_OUTPUT PCI-2772C 3 or later DIOBM_CLEAR_OUTPUT

or DIOBM_KEEP_OUTPUT

Refer to the DioBmCommonGetPciDeviceInfo function for the RevisionID of the PCI-2772C.

Page 135: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

135

Examples

C INT Ret; HANDLE DeviceHandle; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmSetClearMode( DeviceHandle, DIOBM_KEEP_OUTPUT );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmSetClearMode( DeviceHandle, DIOBM_KEEP_OUTPUT )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmSetClearMode( DeviceHandle, DIOBM_KEEP_OUTPUT ); end;

Configure output status of the bus master transfer digital input/output device specified by DeviceHandle to save the previous setting at the start of continuous output.

Page 136: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

136

4.1.44 DioBmGetClearMode

Description The DioBmGetClearMode function retrieves output status at the start of continuous output for the PCI-2772C (RevisionID: 3 or later).

Syntax

C INT DioBmGetClearMode ( HANDLE DeviceHandle, PDWORD ClearMode ); Visual Basic Declare Function DioBmGetClearMode Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef ClearMode As Long _ )As Long Delphi function DioBmGetClearMode ( DeviceHandle: THandle; var ClearMode: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter DeviceHandle Specifies the device handle obtained by the DioBmOpen function. ClearMode Points to a variable to receive the setting values of the clear mode. With Visual

Basic or Delphi, the variable is passed by reference. <PCI-2772C (RevisionID: 3 or later)>

Code Description

DIOBM_CLEAR_OUTPUT Clears the output status to high at the start of continuous output.

DIOBM_KEEP_OUTPUT Saves the output status of the previous setting at the start of continuous output.

Return Value

The DioBmGetClearMode function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Comments

This function is applicable to setting for the PCI-2772C (RevisionID: 3 or later). If using the model with the revision ID of 2 or earlier, use the DIOBM_CLEAR_OUTPUT only.

Model RevisionID ClearMode 2 or earlier DIOBM_CLEAR_OUTPUT PCI-2772C 3 or later DIOBM_CLEAR_OUTPUT

Or DIOBM_KEEP_OUTPUT

Refer to the DioBmCommonGetPciDeviceInfo function for the RevisionID of the PCI-2772C.

Page 137: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

137

Examples

C INT Ret; HANDLE DeviceHandle; DWORD ClearMode; DeviceHandle = DioBmOpen( "FBIDIOBM1" ); : Ret = DioBmGetClearMode( DeviceHandle, &ClearMode );

Visual Basic Dim Ret As Long Dim Name As String Dim DeviceHandle As Long Dim ClearMode As Long Name = "FBIDIOBM1" & Chr( 0 ) DeviceHandle = DioBmOpen( Name ) : Ret = DioBmGetClearMode( DeviceHandle, ClearMode )

Delphi var Ret: Integer; Name: Array[0..15] of Char; DeviceHandle: THandle; ClearMode: DWORD; begin StrCopy( Name, 'FBIDIOBM1' ); DeviceHandle := DioBmOpen( @Name[0] ); : Ret := DioBmGetClearMode( DeviceHandle, ClearMode ); end;

Retrieve output status information at the start of continuous output for the bus master transfer digital input/output device specified by DeviceHandle.

Page 138: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

138

4.1.45 DioBmCommonGetPciDeviceInfo Description

The DioBmCommonGetPciDeviceInfo function retrieves the information of the device such as the device ID, resource information, and RSW1 value.

Syntax C INT DioBmCommonGetPciDeviceInfo ( HANDLE DeviceHandle, PDWORD DeviceID, PDWORD VendorID, PDWORD ClassCode, PDWORD RevisionID, PDWORD BaseAddress0, PDWORD BaseAddress1, PDWORD BaseAddress2, PDWORD BaseAddress3, PDWORD BaseAddress4, PDWORD BaseAddress5, PDWORD SubsystemID, PDWORD SubsystemVendorID, PDWORD InterruptLine, PDWORD BoardID ); Visual Basic Declare Function DioBmCommonGetPciDeviceInfo Lib "FbiDioBm.DLL"( _ ByVal DeviceHandle As Long, _ ByRef DeviceID As Long, _ ByRef VendorID As Long, _ ByRef ClassCode As Long, _ ByRef RevisionID As Long, _ ByRef BaseAddress0 As Long, _ ByRef BaseAddress1 As Long, _ ByRef BaseAddress2 As Long, _ ByRef BaseAddress3 As Long, _ ByRef BaseAddress4 As Long, _ ByRef BaseAddress5 As Long, _ ByRef SubsystemID As Long, _ ByRef SubsystemVendorID As Long, _ ByRef InterruptLine As Long, _ ByRef BoardID As Long _ )As Long

Page 139: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Delphi function DioBmCommonGetPciDeviceInfo ( DeviceHandle THandle; var DeviceID: DWORD; var VendorID: DWORD; var ClassCode: DWORD; var RevisionID: DWORD; var BaseAddress0: DWORD; var BaseAddress1: DWORD; var BaseAddress2: DWORD; var BaseAddress3: DWORD; var BaseAddress4: DWORD; var BaseAddress5: DWORD; var SubsystemID: DWORD;

var SubsystemVendorID:

DWORD;

var InterruptLine: DWORD; var BoardID: DWORD ):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. DeviceID Points to a variable to receive the device ID. With Visual Basic or Delphi,

the variable is passed by reference.

Example: 2172 (87Ch in hexadecimal) is for the PCI-2172C. 2472 (9A8h in hexadecimal) is for the PCI-2472C.

All the data below except for BoardID are the data of PCI bus devices specified by the PCI Rev2.1. The value of BoadID is a value for the RSW1 included in our device.

VendorID Points to a variable to receive the vendor ID. With Visual Basic or Delphi,

the variable is passed by reference. The vendor ID of Interface Corporation is 1147h.

ClassCode Points to a variable to receive the class code of the device. With Visual

Basic or Delphi, the variable is passed by reference. A value specified by the PCI Rev2.1 is received.

RevisionID Points to a variable to receive the revision ID of the device. With Visual

Basic or Delphi, the variable is passed by reference.

Copyright 2002, 2015 Interface Corporation. All rights reserved.

139

Page 140: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

BaseAddress0 Points to a variable to receive the base address 0 of the board. With Visual

Basic or Delphi, the variable is passed by reference. <PCI-2172C, PCI-2472C> The I/O ports address of the board will be retrieved. Mask the value with FFFCh to retrieve the actual I/O port address. <PCI-2772C> The I/O ports address for the bus master digital input circuit and output circuit will be retrieved. Mask the value with FFFCh to retrieve the actual I/O port address. <CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144> The I/O ports address for the bus master digital input circuit and output circuit will be retrieved. Mask the value with FFFFFFFCh to retrieve the actual I/O port address.

BaseAddress1 Points to a variable to receive the base address 1 of the board. With Visual

Basic or Delphi, the variable is passed by reference. <PCI-2172C, PCI-2472C> Not used. <PCI-2772C> The I/O ports address for the bus master digital input circuit will be retrieved. <CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144> The memory mapped I/O port address of the bus master digital input circuits will be retrieved.

BaseAddress2 Points to a variable to receive the base address 2 of the board. With Visual

Basic or Delphi, the variable is passed by reference.

<PCI-2172C, PCI-2472C> Not used. <PCI-2772C> The I/O ports address for the bus master digital output circuit will be retrieved. <CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144> The memory mapped I/O ports address for the bus master digital output circuit will be retrieved.

Copyright 2002, 2015 Interface Corporation. All rights reserved.

140

Page 141: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

BaseAddress3 Points to a variable to receive the base address 3 of the board. With Visual

Basic or Delphi, the variable is passed by reference. Not used for Interface PCI bus master digital input/output devices.

BaseAddress4 Points to a variable to receive the base address 4 of the board. With Visual

Basic or Delphi, the variable is passed by reference. Not used for Interface PCI bus master input/output devices.

BaseAddress5 Points to a variable to receive the base address 5 of the board. With Visual

Basic or Delphi, the variable is passed by reference. Not used for Interface bus master digital input/output devices .

SubsystemID Points to a variable to receive the subsystem ID of the board. With Visual

Basic or Delphi, the variable is passed by reference. SubsystemVendorID Points to a variable to receive the subsystem vendor ID of the board. With

Visual Basic or Delphi, the variable is passed by reference. InterruptLine Points to a variable to receive the interrupt line of the board. With Visual

Basic or Delphi, the variable is passed by reference. BoardID Points to a variable to receive the board ID of the board. With Visual Basic

or Delphi, the variable is passed by reference. The board ID means RSW1 value of the board.

Return Value

The CanOpenPort function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Copyright 2002, 2015 Interface Corporation. All rights reserved.

141

Page 142: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

142

Examples

C #include <windows.h> #include <stdio.h> #include <string.h> #include "FBIDIOBM.h" #define BOARD_NUM 4 typedef struct { ULONG BoardModel; ULONG RswNumber; char DeviceName[16]; } BOARDINFO, *PBOARDINFO; void main(void) { BOARDINFO Info[BOARD_NUM]; char Name[64]; INT i, j, Count, Ret; HANDLE DeviceHandle; DWORD DeviceID, VendorID, ClassCode, RevisionID; DWORD BaseAddress0, BaseAddress1, BaseAddress2, BaseAddress3; DWORD BaseAddress4, BaseAddress5, SubsystemID, SubsystemVendorID; DWORD InterruptLine, BoardID; Info[0].BoardModel = 2172; Info[0].RswNumber = 0; Info[0].DeviceName[0] = '\0'; Info[1].BoardModel = 2172; Info[1].RswNumber = 1; Info[1].DeviceName[0] = '\0'; Info[2].BoardModel = 2172; Info[2].RswNumber = 2; Info[2].DeviceName[0] = '\0'; Info[3].BoardModel = 2172; Info[3].RswNumber = 3; Info[3].DeviceName[0] = '\0'; for(i = 1, Count = 0; i < 256; i++){ wsprintf(Name, "FBIDIOBM%d", i); DeviceHandle = DioBmOpen(Name); if(DeviceHandle == INVALID_HANDLE_VALUE) continue; Ret = DioBmCommonGetPciDeviceInfo( DeviceHandle, &DeviceID, &VendorID, &ClassCode, &RevisionID, &BaseAddress0, &BaseAddress1, &BaseAddress2,

Page 143: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

143

&BaseAddress3, &BaseAddress4, &BaseAddress5, &SubsystemID, &SubsystemVendorID, &InterruptLine, &BoardID ); if(Ret != FBIDIOBM_ERROR_SUCCESS){ printf("Error : DioBmCommonGetPciDeviceInfo\n"); }else{ for(j = 0; j < BOARD_NUM; j++){ if( DeviceID == Info[j].BoardModel){ if(BoardID == Info[j].RswNumber){ strcpy(Info[j].DeviceName, Name); Count++; break; } } } } Ret = DioBmClose(DeviceHandle); if(Ret != FBIDIOBM_ERROR_SUCCESS){ printf("Error : DioBmClose\n"); } if(Count == BOARD_NUM) break; } for(i = 0; i < BOARD_NUM; i++){ printf("PCI-%dC : RSW-%x : %s\n", Info[i].BoardModel, Info[i].RswNumber, Info[i].DeviceName); } }

Page 144: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

144

Visual Basic Public Const BOARD_NUM = 4 Type BOARDINFO BoardModel As Long RswNumber As Long DeviceName As String End Type Private Sub Command1_Click() Dim Info(BOARD_NUM - 1) As BOARDINFO Dim Name As String Dim i, j, Count, Ret As Integer Dim DeviceHandle As Long Dim DeviceID As Long Dim VendorID As Long Dim ClassCode As Long Dim RevisionID As Long Dim BaseAddress0 As Long Dim BaseAddress1 As Long Dim BaseAddress2 As Long Dim BaseAddress3 As Long Dim BaseAddress4 As Long Dim BaseAddress5 As Long Dim SubsystemID As Long Dim InterruptLine As Long Dim BoardID As Long Info(0).BoardModel = 2172 Info(0).RswNumber = 0 Info(0).DeviceName = Chr(0) Info(1).BoardModel = 2172 Info(1).RswNumber = 1 Info(1).DeviceName = Chr(0) Info(2).BoardModel = 2172 Info(2).RswNumber = 2 Info(2).DeviceName = Chr(0) Info(3).BoardModel = 2172 Info(3).RswNumber = 3 Info(3).DeviceName = Chr(0) Count = 0 For i = 1 To 255 Name = "FBIDIOBM" & i & Chr(0) DeviceHandle = DioBmOpen(Name) If DeviceHandle = &HFFFFFFFF Then GoTo Continue

Page 145: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

145

Ret = DioBmCommonGetPciDeviceInfo(DeviceHandle, DeviceID, VendorID, _ ClassCode, RevisionID, BaseAddress0, _ BaseAddress1, BaseAddress2, BaseAddress3, _ BaseAddress4, BaseAddress5, SubsystemID, _ SubsystemVendorID, InterruptLine, BoardID) End If End If Next j End If Ret = DioBmClose(DeviceHandle) If Ret <> FBIDIOBM_ERROR_SUCCESS Then Ret = MsgBox("Error : DioClose", vbOKOnly + vbCritical, "FBIDIO") End If If Count = BOARD_NUM Then Exit For Continue: Next i Label1.Caption = "PCI-" & Info(0).BoardModel & "C" _ & " : RSW-" & Info(0).RswNumber _ & " : " & Info(0).DeviceName Label2.Caption = "PCI-" & Info(1).BoardModel & "C" _ & " : RSW-" & Info(1).RswNumber _ & " : " & Info(1).DeviceName Label3.Caption = "PCI-" & Info(2).BoardModel & "C" _ & " : RSW-" & Info(2).RswNumber _ & " : " & Info(2).DeviceName Label4.Caption = "PCI-" & Info(3).BoardModel & "C" _ & " : RSW-" & Info(3).RswNumber _ & " : " & Info(3).DeviceName End Sub

Page 146: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

146

Delphi type BOARDINFO = record BoardModel : Cardinal; RswNumber : Cardinal; DeviceName : array[0..15] of Char; end; procedure TForm1.Button1Click(Sender: TObject); var Info : array[0..4] of BOARDINFO; Name : array[0..15] of Char; i, j, Count, Ret : Integer; DeviceID, VendorID, ClassCode, RevisionID: DWORD; BaseAddress0, BaseAddress1, BaseAddress2, BaseAddress3: DWORD; BaseAddress4, BaseAddress5, SubsystemID, SubsystemVendorID: DWORD; InterruptLine, BoardID:DWORD; begin Info[0].BoardModel := 2172; Info[0].RswNumber := 0; Info[0].DeviceName[0] := #0; Info[1].BoardModel := 2172; Info[1].RswNumber := 1; Info[1].DeviceName[0] := #0; Info[2].BoardModel := 2172; Info[2].RswNumber := 2; Info[2].DeviceName[0] := #0; Info[3].BoardModel := 2172; Info[3].RswNumber := 3; Info[3].DeviceName[0] := #0; Count := 0; for i := 1 to 255 do begin StrPCopy(Name ,'FBIDIOBM'+ IntToStr(i)); DeviceHandle := DioBmOpen(@Name[0]); if DeviceHandle = INVALID_HANDLE_VALUE then Continue; Ret := DioBmCommonGetPciDeviceInfo( DeviceHandle, DeviceID, VendorID, ClassCode, RevisionID, BaseAddress0, BaseAddress1, BaseAddress2, BaseAddress3, BaseAddress4, BaseAddress5, SubsystemID, SubsystemVendorID, InterruptLine, BoardID );

Page 147: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

147

if Ret <> FBIDIOBM_ERROR_SUCCESS then MessageDlg('Error : DioBmCommonGetPciDeviceInfo', mtError, [mbOk], 0) else begin for j := 0 to 4 do begin if DeviceID = Info[j].BoardModel then begin if BoardID = Info[j].RswNumber then begin StrCopy(Info[j].DeviceName, Name); Count := Count + 1; Break; end; end; end; end; Ret := DioBmClose(DeviceHandle); if Ret <> FBIDIOBM_ERROR_SUCCESS then MessageDlg('Error : DioBmClose', mtError, [mbOk], 0); if Count = 4 then Break; end; Label1.Caption := 'PCI-' + IntToStr(Info[0].BoardModel) + 'C' + ' : RSW-' + IntToStr(Info[0].RswNumber) + ' : ' + Info[0].DeviceName; Label2.Caption := 'PCI-' + IntToStr(Info[1].BoardModel) + 'C' + ' : RSW-' + IntToStr(Info[1].RswNumber) + ' : ' + Info[1].DeviceName; Label3.Caption := 'PCI-' + IntToStr(Info[2].BoardModel) + 'C' + ' : RSW-' + IntToStr(Info[2].RswNumber) + ' : ' + Info[2].DeviceName; Label4.Caption := 'PCI-' + IntToStr(Info[3].BoardModel) + 'C' + ' : RSW-' + IntToStr(Info[3].RswNumber) + ' : ' + Info[3].DeviceName; end; end; Check each device name of four PCI-2172C boards identified by the board IDs. Write the board model actually you use into the program.

Page 148: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

4.1.46 DioBmGetDriverInfo Description

The DioBmGetDriverInfo function retrieves the information of the OS architecture and the allocated physical memory size. The function to retrieve the allocated physical memory size is only for 64-bit OS. When an application is used in 64-bit and 32-bit environments, use this function to branch for the bus master transfer processing by architecture.

Syntax C INT DioBmGetDriverInfo (

HANDLE DeviceHandle, PDWORD OsArchitecture, PDWORD PhysicalMemorysSize ); Visual Basic Declare Function DioBmGetStatus Lib "FbiDioBm.DLL"( _

ByVal DeviceHandle As Long, _

ByRef OsArchitecture As Long _

ByRef PhysicalMemorysSize As Long

)As Long Delphi function DioBmGetStatus (

DeviceHandle: THandle;

var OsArchitecture: DWORD;

var PhysicalMemorysSize: DWORD

):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. OsArchitecture Point to the variable to store the OS information.

Code Description

DIOBM_OS_ARCHITECTURE_x64 64-bit environment

DIOBM_OS_ARCHITECTURE_x86 32-bit environment

Note: In Wow64 environment, the same information as 64-bit environment is retrieved.

PhysicalMemorysSize Points to a variable to store the allocated physical memory size.

For 32-bit environment, the size is 0.

Return Value The DioBmGetDriverInfo function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Copyright 2002, 2015 Interface Corporation. All rights reserved.

148

Page 149: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

149

Examples

C

INT Ret;

HANDLE DeviceHandle;

DWORD Buffer[128];

DWORD OsArchitecture;

DWORD MemoerySize;

DeviceHandle = DioBmOpen( "FBIDIOBM1" );

Ret = DioBmGetDriverInfo(DeviceHandle, &OsArchitecture, &MemoerySize);

if(OsArchitecture == DIOBM_OS_ARCHITECTURE_x64){

Ret = DioBmSetBufferConfig( DeviceHandle, (PVOID)-1, 128 * sizeof(DWORD) );

}else{

Ret = DioBmSetBufferConfig( DeviceHandle, Buffer, 128 * sizeof(DWORD) );

}

Visual Basic

Dim Ret As Long

Dim Name As String

Dim DeviceHandle As Long

Dim Buffer(0 To 127) As Long

Dim OsArchitecture As Long

Dim MemoerySize As Long

Name = "FBIDIOBM1" & Chr( 0 )

DeviceHandle = DioBmOpen( Name )

Ret = DioBmGetDriverInfo(DeviceHandle, OsArchitecture, MemoerySize)

If OsArchitecture = DIOBM_OS_ARCHITECTURE_x64 Then

Ret = DioBmSetBufferConfig( DeviceHandle, ByVal -1, 128 * 4 )

Else

Ret = DioBmSetBufferConfig( DeviceHandle, Buffer(0), 128 * 4 )

End If

Page 150: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

150

Delphi

var

Ret: Integer;

Name: Array[0..15] of Char;

DeviceHandle: THandle;

Buffer: Array[0..127] of DWORD;

Architecture: DWORD;

MemorySize: DWORD;

begin

StrCopy( Name, 'FBIDIOBM1' );

DeviceHandle := DioBmOpen( @Name[0] );

Ret := DioBmGetDriverInfo(DeviceHandle,Architecture, MemorySize);

if Architecture = DIOBM_OS_ARCHITECTURE_x64 then

begin

nRet := DioBmSetBufferConfig(DeviceHandle, Pointer(-1), 128 * 4);

end

else

begin

nRet := DioBmSetBufferConfig(DeviceHandle, @Buffer[0], 128 * 4);

end;

end;

Retrieve the OS information, and branch the processing method of the DioBmBufferConfig function for each OS environment.

Page 151: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

4.1.47 DioBmSetPhysicalMemorySize Description

The DioBmSetPhysicalMemorySize function is an API function for 64-bit environment. It configures the allocated physical memory size. The size can be configured either the DioBmMem.exe or this function. After this function is successfully executed, restart the operating system to reflect the configured size.

Syntax C INT DioBmSetPhysicalMemorySize (

HANDLE DeviceHandle,

DWORD PhysicalMemorysSize

);

Visual Basic Declare Function DioBmSetPhysicalMemorySize Lib "FbiDioBm.DLL"( _

ByVal DeviceHandle As Long, _

ByVal PhysicalMemorysSize As Long _

)As Long

Delphi function DioBmSetPhysicalMemorySize (

DeviceHandle: THandle;

PhysicalMemorysSize: DWORD

):Integer; stdcall; external 'FbiDioBm.DLL';

Parameter

DeviceHandle Specifies the device handle obtained by the DioBmOpen function. PhysicalMemorySize Specifies the allocated physical memory size (up to 4 GB).

Return Value

The DioBmSetPhysicalMemorySize function returns 0 if the process is successfully completed. Otherwise, this function returns a non-zero value. Refer to the “4.4 Return Values.”

Comment Although this function is successfully executed, the configured size of physical memory is necessarily allocated. Confirm the allocated size by the DioBmMem.exe or the DioBmGetDriverInfo function.

Copyright 2002, 2015 Interface Corporation. All rights reserved.

151

Page 152: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

152

Examples C

INT Ret;

HANDLE DeviceHandle;

DeviceHandle = DioBmOpen( "FBIDIOBM1" );

:

Ret = DioBmSetPhysicalMemorysSize ( DeviceHandle, 0x1000000);

Visual Basic

Dim Ret As Long

Dim Name As String

Dim DeviceHandle As Long

Name = "FBIDIOBM1" & Chr( 0 )

DeviceHandle = DioBmOpen( Name )

:

Ret = DioBmSetPhysicalMemorysSize ( DeviceHandle, &H1000000)

Delphi

var

Ret: Integer;

Name: Array[0..15] of Char;

DeviceHandle: THandle;

begin

StrCopy( Name, 'FBIDIOBM1' );

DeviceHandle := DioBmOpen( @Name[0] );

:

Ret := DioBmSetPhysicalMemorysSize ( DeviceHandle, $1000000);

end;

Allocate the 16 MB of physical memory.

Page 153: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

153

4.2 Callback Routine Visual Basic has some programming constraints to use a callback routine. Refer to “Programming Constrains in Visual Basic.” To generate asynchronous events in Visual Basic, use the BPA-0507, ActiveX control for digital input/output. The program is downloaded from our website free of charge.

4.2.1 Callback Routine Set by DioBmSetEvent The callback routine is registered by the DioBmSetEvent function and called when an interrupt event is generated. The name of callback routine need not be EventProc, but the callback routine need to be written with a function that includes two DWORD (32 bit) parameters with no return value in x86 environment or that includes a DWORD parameter and PVOID parameter with no return value in x64 environment. The event function is not available in Visual Basic 4.0 because the program does not support AddressOf operator and cannot register any callback routine. The function is available in Visual Basic 5.0.

Syntax In the following example, the callback routine is EventProc. C (for x86) void CALLBACK EventProc(DWORD Event, DWORD User) { // Write a corresponding process for an interrupt event. } LPDIOBMCALLBACK is defined as follows.

typedef void (CALLBACK DIOBMCALLBACK)(DWORD Event, DWORD User); typedef DIOBMCALLBACK FAR *LPDIOBMCALLBACK;

C (for x64) void CALLBACK EventProc(DWORD Event, PVOID User) { // Write a corresponding process for an interrupt event. } LPDIOBMCALLBACK is defined as follows.

typedef void (CALLBACK DIOBMCALLBACK)(DWORD Event, PVOID User);

typedef DIOBMCALLBACK FAR *LPDIOBMCALLBACK; Visual Basic Function EventProc(Event As Long, User As Long) ‘Write a corresponding process for an interrupt event. End Function Write the callback routine in a standard module of a project that calls the DioBmSetEvent. Use the AddressOf operator to pass the procedure address by the DioBmSetEvent function. Refer to “Examples” in “DioBmSetEvent”. When the AddressOf operator is used, the procedure address is passed to the DioBmSetEvent function in the dynamic library (DLL).

Page 154: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

154

Delphi procedure EventProc(Event:DWORD; User:DWORD); stdcall; begin // Write a corresponding process for an interrupt event. end;

Parameters

Event

Event sources are stored in this parameter. The event sources are described as follows. Multiple sources can be enabled at the same time.

<PCI-2172C, PCI-2472C> Code Description

DIOBM_EV_ENDTRG End of transfer event DIOBM_EV_DTRG Trigger delay event DIOBM_EV_START_TRG Start of transfer event DIOBM_EV_START_LINE START1 or START2 signal event DIOBM_EV_END_LINE END1 or END2 signal event DIOBM_EV_DMAEND End of DMA event DIOBM_EV_STOP STOP1 or STOP2 signal event DIOBM_EV_FIFO_EFFF FIFO full/empty event DIOBM_EV_OREURE Over-run/under-run error event DIOBM_EV_EXEQ I/O counter and reference counter match DIOBM_EV_INEQ DMA counter and reference counter match

<PCI-2772C, CPZ-291244, CPZ-292244>

Code Description DIOBM_EV_ENDTRG End of transfer event DIOBM_EV_DTRG Trigger delay event DIOBM_EV_START_TRG Start of transfer event DIOBM_EV_DMAEND Completion of DMA transfer DIOBM_EV_STOP1 STOP1 signal event DIOBM_EV_STOP2 STOP2 signal event DIOBM_EV_FIFO_EFFF FIFO full/empty event DIOBM_EV_OREURE Over-run/under-run error event DIOBM_EV_EXEQ I/O counter event DIOBM_EV_INEQ DMA counter event DIOBM_EV_EXT11 EXT11 signal event DIOBM_EV_EXT12 EXT12 signal event DIOBM_EV_EXT21 EXT21 signal event DIOBM_EV_EXT22 EXT22 signal event DIOBM_EV_EDGE Input signal interrupt event

To use the START or END signal events, assign the START or END signal to the EXT11, EXT12, EXT21, or EXT22 signal by the DioBmSetDeviceConfigEx function. An interrupt event is generated when the EXT signal that the START or END signal is assigned is enabled. The input signal interrupt event (DIOBM_EV_EDGE) is available only for CPZ-291244, CPZ-292244.

Page 155: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

155

<LPC-291144,LPC-292144,PEX-291144,PEX-292144,CBI/CSI-291144,

CBI/CSI-292144> Code Description

DIOBM_EV_ENDTRG End of transfer event DIOBM_EV_DTRG Trigger delay event DIOBM_EV_START_TRG Start of transfer event DIOBM_EV_DMAEND Emd of DMA event DIOBM_EV_STOP1 STOP1 signal event DIOBM_EV_STOP2 STOP2 signal event DIOBM_EV_FIFO_EFFF FIFO full/empty event DIOBM_EV_OREURE Over-run/under-run error event DIOBM_EV_EXEQ I/O counter and reference counter match DIOBM_EV_INEQ DMA counter and reference counter match DIOBM_EV_EDGE Input signal interrupt event

To use the START or END signal events, enable the edge event of the input pin that contains START or END signal by the DioBmSetDeviceConfig function. When the input signal interrupt event is generated, these callback routines do not retrieve the detailed edge sources. To retrieve the detailed edge sources, register an expansion event callback routine by the DioBmSetEventEx function

User User data specified by the DioBmSetEvent.

■ x86 DWORD type data is passed. ■ x64 PVOID type pointer variable is passed. It is the address of user buffer specified

by the DimBmSetEvent function.

Return Value

This function does not have return values.

Page 156: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

156

4.2.1 Callback Routine Set by DioBmSetEventEx The callback routine is registered by the DioBmSetEventEx function and called when an interrupt event is generated. The name of callback routine need not be EventProcEx, but the callback routine need to be written with a function that includes two DWORD (32 bit) parameters with no return value in x86 environment or that includes a DWORD parameter and PVOID parameter with no return value in x64 environment. The event function is not available in Visual Basic 4.0 because the program does not support AddressOf operator and cannot register any callback routine. The function is available in Visual Basic 5.0.

Syntax C (for x86) void CALLBACK EventProcEx(PWORD Event, DWORD User) { // Write a corresponding process for an interrupt event. } LPDIOBMCALLBACKEX is defined as follows.

typedef void (CALLBACK DIOBMCALLBACKEX)(PDWORD Event, DWORD User); typedef DIOBMCALLBACKEX FAR *LPDIOBMCALLBACKEX;

C (for x64) void CALLBACK EventProcEx(PDWORD Event, PVOID User) { // Write a corresponding process for an interrupt event. } LPDIOBMCALLBACKEX is defined as follows.

typedef void (CALLBACK DIOBMCALLBACKEX)(PDWORD Event, PVOID User);

typedef DIOBMCALLBACKEX FAR *LPDIOBMCALLBACKEX; Visual Basic Function EventProcEx(Event(0 To 2) As Long, User As Long) ‘Write a corresponding process for an interrupt event. End Function Write the callback routine in a standard module of a project that calls the DioBmSetEventEx. Use the AddressOf operator to pass the procedure address by the DioBmSetEventEx function. Refer to “Examples” in “4.1.39 DioBmSetEventEx”. When the AddressOf operator is used, the procedure address is passed to the DioBmSetEventEx function in the dynamic library (DLL). Delphi procedure EventProcEx(Event: Array(0..2) of DWORD; User:DWORD); stdcall;begin // Write a corresponding process for an interrupt event. end;

Page 157: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

157

Parameters

Event

Event sources are stored in this parameter. The event sources are described as follows. Multiple sources can be enabled at the same time.

<PCI-2172C, PCI-2472C> <<The first element of the array (Event[0])>>

Code Description DIOBM_EV_ENDTRG End of transfer event DIOBM_EV_DTRG Trigger delay event DIOBM_EV_START_TRG Start of transfer event DIOBM_EV_START_LINE START1 or START2 signal event DIOBM_EV_END_LINE END1 or END2 signal event DIOBM_EV_DMAEND End of DMA event DIOBM_EV_STOP STOP1 or STOP2 signal event DIOBM_EV_FIFO_EFFF FIFO full/empty event DIOBM_EV_OREURE Over-run/under-run error event DIOBM_EV_EXEQ I/O counter and reference counter match DIOBM_EV_INEQ DMA counter and reference counter match

<<The second element of the array (Event[1])>> 0 is always stored. << The third element of the array (Event[2])>> 0 is always stored. <PCI-2772C, CPZ-291244, CPZ-292244> << The first element of the array (Event[0])>>

Code Description DIOBM_EV_ENDTRG End of transfer event DIOBM_EV_DTRG Trigger delay event DIOBM_EV_START_TRG Start of transfer event DIOBM_EV_DMAEND Completion of DMA transfer DIOBM_EV_STOP1 STOP1 signal event DIOBM_EV_STOP2 STOP2 signal event DIOBM_EV_FIFO_EFFF FIFO full/empty event DIOBM_EV_OREURE Over-run/under-run error event DIOBM_EV_EXEQ I/O counter event DIOBM_EV_INEQ DMA counter event DIOBM_EV_EXT11 EXT11 signal event DIOBM_EV_EXT12 EXT12 signal event DIOBM_EV_EXT21 EXT21 signal event DIOBM_EV_EXT22 EXT22 signal event DIOBM_EV_EDGE All input signal event

To use the START or END signal events, assign the START or END signal to the EXT11, EXT12, EXT21, or EXT22 signal by the DioBmSetDeviceConfigEx function. An interrupt event is generated when the EXT signal that the START or END signal is assigned is enabled. Input signal event (DIOBM_EV_EDGE) is available only for CPZ-291244, CPZ-292244.

Page 158: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

158

<<The second element of the array (Event[1])>>

* Only for CPZ-291244 and CPZ-292244.

bit31 to bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 SR_IN32 to SR_IN8 SR_IN7 SR_IN6 SR_IN5 SR_IN4 SR_IN3 SR_IN2 SR_IN1

SR_IN1 through SR_IN32: The corresponding bit is 1 when interrupt event is generated by rising edge input. To use ineterrupt event by rising edge input to IN1 through IN32, enable the edge event of the corresponding input pin by the DioBmGetEdgeEventConfig. <<The third element of the array (Event[2])>> * Only for CPZ-291244 and CPZ-292244.

bit31 to bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 SF_IN32 to SF_IN8 SF_IN7 SF_IN6 SF_IN5 SF_IN4 SF_IN3 SF_IN2 SF_IN1

SF_IN1~SF_IN32: The corresponding bit is 1 when interrupt event is generated by falling edge input. To use ineterrupt event by falling edge input to IN1 through IN32, enable the edge event of the corresponding input pin by the DioBmGetEdgeEventConfig. <LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144> <<The first element of the array (Event[0])>>

Code Description DIOBM_EV_ENDTRG End of transfer event DIOBM_EV_DTRG Trigger delay event DIOBM_EV_START_TRG Start of transfer event DIOBM_EV_DMAEND Emd of DMA event DIOBM_EV_STOP1 STOP1 signal event DIOBM_EV_STOP2 STOP2 signal event DIOBM_EV_FIFO_EFFF FIFO full/empty event DIOBM_EV_OREURE Over-run/under-run error event DIOBM_EV_EXEQ I/O counter and reference counter match DIOBM_EV_INEQ DMA counter and reference counter match DIOBM_EV_EDGE Input signal interrupt event

To use the START or END signal events, enable the edge event of the input pin that contains START or END signal by the DioBmSetDeviceConfig function. When an input signal interrupt event is generated, these callback routines do not retrieve the detailed edge sources. To retrieve the detailed edge sources, register expansion event callback routine by the DioBmSetEventEx function.

Page 159: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

159

<<The second element of the array (Event[1])>>

bit31 to bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 SR_IN32 to SR_IN8 SR_IN7 SR_IN6 SR_IN5 SR_IN4 SR_IN3 SR_IN2 SR_IN1

SR_IN1 through SR_IN32: The corresponding bit is 1 when interrupt event is generated by rising edge input. To use ineterrupt event by rising edge input to IN1 through IN32, enable the edge event of the corresponding input pin by the DioBmGetEdgeEventConfig. <<The third element of the array (Event[2])>>

bit31 to bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0

SF_IN32 to SF_IN8 SF_IN

7 SF_IN

6 SF_IN

5 SF_IN

4 SF_IN

3 SF_IN

2 SF_IN

1

SF_IN1 through SF_IN32: The corresponding bit is 1 when interrupt event is generated by falling edge input.

To use ineterrupt event by falling edge input to IN1 through IN32, enable the edge event of the corresponding input pin by the DioBmGetEdgeEventConfig.

User User data specified by the DioBmSetEventEx are stored in this parameter.

■ x86 DWORD type data is passed. ■ x64 PVOID type pointer variable is passed. It is the address of user buffer specified

by the DimBmSetEvent function.

Return Value This function does not have return values.

Page 160: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

160

4.2.2 Programming Constraints in Visual Basic - The event function is not available in Visual Basic 4.0 because the program does not support AddressOf

operator and cannot register any callback routine. The function is available in Visual Basic 5.0.

- When you use the callback function provided by our software library, the following application error may

occur. "The instruction at '0x660d64d0' referenced memory at '0x0000009c'. The memory could not be 'written'." '0x660d64d0' may be different value. An application error occurs in the following conditions; - Calling functions, including the functions offered by our software library. - Calling Statements of Visual Basic such as Str(). - Assigning strings to a static text In Visual Basic 6.0, use appropriate notification methods, such as the event signaling, message passing, and/or polling, instead of the callback routine. The Apartment model is adopted as the threading model in Microsoft Visual Basic 6.0. An application error may occur when a callback function is performed by a thread other than that is generated and started with Microsoft Visual Basic 6.0. Such error occurs because our software library performs a callback function registered at another thread that is started in the library.

- To generate asynchronous events in Visual Basic, use the BPA-0507, ActiveX control for digital

input/output. The program is downloaded from our website free of charge.

Page 161: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

161

4.3 Structure 4.3.1 DIOBMCONF

The DIOBMCONF structure contains operation parameters. C typedef struct { DWORD dwMode; DWORD dwRedirectWidth; DWORD dwEQConf; DWORD dwClock; DWORD dwSmplNum; DWORD dwTimingOption; DWORD dwSTBConf; DWORD dwACKConf; DWORD dwREQConf; DWORD dwOREConf; DWORD dwUREConf; } DIOBMCONF, *PDIOBMCONF;

Visual Basic Type DIOBMCONF dwMode As Long dwRedirectWidth As Long dwEQConf As Long dwClock As Long dwSmplNum As Long dwTimingOption As Long dwSTBConf As Long dwACKConf As Long dwREQConf As Long dwOREConf As Long dwUREConf As Long End Type

Delphi DIOBMCONF = record dwMode: DWORD; dwRedirectWidth: DWORD; dwEQConf: DWORD; dwClock: DWORD; dwSmplNum: DWORD; dwTimingOption: DWORD; dwSTBConf: DWORD; dwACKConf: DWORD; dwREQConf: DWORD; dwOREConf: DWORD; dwUREConf: DWORD; end;

Page 162: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

162

Member Description dwMode Specifies the transfer mode by using one of the following codes. Code Description

DIOBM_MODE_NON Stand-by mode (default setting) Each pin is set to high-impedance state.

DIOBM_MODE_SAMPLING Sampling mode (with control signals) DIOBM_MODE_SAMPLING_GATE

Gated-sampling mode

DIOBM_MODE_PATTERN_ OUT

Pattern output mode (with control signals)

DIOBM_MODE_PATTERN_ OUT_GATE

Gated-pattern output mode

DIOBM_MODE_STROBE Strobe mode DIOBM_MODE_REQUEST Request mode

The table below shows the settable values.

- Bus mater digital input product - Digital input circuit of bus

master digital input products

DIOBM_MODE_NON DIOBM_MODE_SAMPLING DIOBM_MODE_SAMPLING_GATE DIOBM_MODE_STROBE DIOBM_MODE_REQUEST

- Bus mater digital output product- Digital output circuit of bus

master digital input products

DIOBM_MODE_NON DIOBM_MODE_PATTERN_OUT DIOBM_MODE_PATTERN_OUT_GATEDIOBM_MODE_STROBE DIOBM_MODE_REQUEST

dwRedirectWidth Specifies the bus master transfer width by using one of the following codes. Refer

to "5.8 Data Format" as the bus master transfer width for details. Code/Value Description

0 Specified 0 with the no mode selected. DIOBM_WIDTH_DWORD Double word (4 bytes) DIOBM_WIDTH_WORD Word (2 bytes) DIOBM_WIDTH_BYTE Byte (1 b pattern matching byte )

Use the DIOBM_WIDTH_BYTE or DIOBM_WIDTH_WORD structure for the bus master digital output circuit of the CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI-CSI-291144, and CBI/CSI-292144.

dwEQConf Specifies the function of the EQ1 or EQ2 signal according to the board by using the following code or 0.

When you use the PCI-2772C, CBI-291144, and CBI-292144, specify 0. To use the EQ1 or EQ2 signal on the PCI-2772C, CBI-291144, and CBI-292144, use the DIOBMCONFEX structure instead of the DIOBMCONF structure.

Code/Value Description 0 Disables counter match event detection output.

EQ1 or EQ2 signal is available as a digital output signal.

DIOBM_LINE_FUNC_ENABLE

Enables counter match event detection output.

Page 163: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

163

dwClock Specifies the pacer rate by using one of the following codes or 0.

Code/Value Description 0 Disables the base clock. (suspended)

Specify 0 in the mode that the base clock/frequency is not required. - strobe mode of the bus master

digital input product - request mode of the bus master

digital input product DIOBM_CLK_EXT External clock

Available external clock signal pins of bus master digital input/output products are as follows. - Bus master digital input circuit:

CLKIN1 signal - Bus master digital output circuit:

CLKIN2 signal DIOBM_CLK_1 1 Hz DIOBM_CLK_2 2 Hz DIOBM_CLK_4 4 Hz DIOBM_CLK_10 10 Hz DIOBM_CLK_20 20 Hz DIOBM_CLK_40 40 Hz DIOBM_CLK_100 100 Hz DIOBM_CLK_200 200 Hz DIOBM_CLK_400 400 Hz DIOBM_CLK_1K 1 kHz DIOBM_CLK_2K 2 kHz DIOBM_CLK_4K 4 kHz DIOBM_CLK_10K 10 kHz DIOBM_CLK_20K 20 kHz DIOBM_CLK_40K 40 kHz DIOBM_CLK_100K 100 kHz DIOBM_CLK_200K 200 kHz DIOBM_CLK_400K 400 kHz DIOBM_CLK_1M 1 MHz DIOBM_CLK_2M 2 MHz DIOBM_CLK_4M 4 MHz DIOBM_CLK_10M 10 MHz DIOBM_CLK_20M 20 MHz

Page 164: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

164

dwSmplNum Specifies the number of samples.

The setting range you can specify depends on the transfer modes and bus muster transfer width. Refer to the followings.

<Bus master Digital input products> <Digital input circuit of bus master Digital input/output products>

Double Word DIOBM_WIDTH_DWORD

Word DIOBM_WIDTH_WORD

Byte DIOBM_WIDTH_BYTE

Sampling mode (with control signals)

2 to 1073741823 (2h to FFFFFFFh) Configurable every sampling 0: infinite repeat

2 to 2147483646 (2h to 7FFFFFFEh)

Configurable every two samplings 0: infinite repeat

4 to 4294967292 (4h to FFFFFFFCh)

Configurable every four samplings 0: infinite repeat

Gated sampling mode 0 0 0 Strobe mode 0 0 0 Request mode 1 to 1073741823

(1h to 3FFFFFFFh) Configurable every sampling 0: infinite repeat

2 to 2147483646 (2h to 7FFFFFFEh)

Configurable every two samplings 0: infinite repeat

4 to 4294967292 (4h to FFFFFFFEh)

Configurable every four samplings 0: infinite repeat

<Bus master Digital output products> <Digital output circuit of bus master Digital input/output products>

Double Word DIOBM_WIDTH_DWORD

Word DIOBM_WIDTH_WORD

Byte DIOBM_WIDTH_BYTE

Pattern output ( with control signals)

2 to 1073741823 (2h to FFFFFFFh) Configurable every sampling 0: infinite repeat

2 to 2147483646 (2h to 7FFFFFFEh)

Configurable every two samplings 0: infinite repeat

4 to 4294967292 (4h to FFFFFFFCh)

Configurable every four samplings 0: infinite repeat

Gated pattern output mode 0 0 0

Strobe mode 1 to 1073741823 (1h to 3FFFFFFFh)

Configurable every sampling 0: infinite repeat

2 to 2147483646 (2h to 7FFFFFFEh)

Configurable every two samplings 0: infinite repeat

4 to 4294967292 (4h to FFFFFFFEh)

Configurable every four samplings 0: infinite repeat

Request mode 0 0 0

Page 165: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

dwTimingOption Specifies the timing option by using one of the following codes or 0.

Code/Value Description 0 No option DIOBM_TIMING_FIFO FIFO timing DIOBM_TIMING_FIFO_ SHOW_AHEAD

FIFO show ahead timing

DIOBM_TIMING_FIFO_ LEGACY

FIFO legacy timing

<Bus master digital output product>

Pattern output mode (with control signals)

0 DIOBM_TIMING_FIFO

Gated-pattern output mode0 DIOBM_TIMING_FIFO_SHOW_AHEAD DIOBM_TIMING_FIFO_LEGACY

Strobe mode 0 Request mode 0

<Digital input circuit of bus master digital input/output product>

Sampling mode (with control signals)

0 DIOBM_TIMING_FIFO_LEGACY

Gated sampling mode 0 DIOBM_TIMING_FIFO

Strobe mode 0 Request mode 0

<Digital output circuit of bus master digital input/output products>

Pattern output mode (with control signals)

0 DIOBM_TIMING_FIFO

Gated-pattern output mode 0 DIOBM_TIMING_FIFO_LEGACY

Strobe mode 0 Request mode 0

Copyright 2002, 2015 Interface Corporation. All rights reserved.

165

Page 166: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

dwSTBConf Specifies the function of the STB1 or STB2 signal by using one of the following

codes or 0. Code Description

0 Disables the STB signals. DIOBM_STB1_FALL_EDGE Enable STB1 falling edge. DIOBM_STB1_RISE_EDGE Enables STB1 rising edge. DIOBM_SU_25N Setup time: 25 ns* DIOBM_SU_100N Setup time: 100 ns* DIOBM_SU_500N Setup time: 500 ns* DIOBM_SU_1MICRO Setup time: 1 µs* DIOBM_SU_5MICRO Setup time: 5 µs* DIOBM_SU_10MICRO Setup time: 10 µs* DIOBM_SU_50MICRO Setup time: 50 µs* DIOBM_SU_100MICRO Setup time: 100 µs* DIOBM_PU_100N Low-pulse output width: 100 ns DIOBM_PU_500N Low-pulse output width: 500 ns DIOBM_PU_1MICRO Low-pulse output width: 1 µs DIOBM_PU_5MICRO Low-pulse output width: 5 µs DIOBM_PU_10MICRO Low-pulse output width: 10 µs DIOBM_PU_50MICRO Low-pulse output width: 50 µs DIOBM_PU_100MICRO Low-pulse output width: 100 µs

Specify a setup time code in combination with a pulse output width code in the strobe mode of a bus master digital output product.

Example: DIOBM_SU_1MICRO | DIOBM_PU_500N) If the setup time is not specified, the setup time is 25 ns (50 ns for bus master digital input/output product).

The code or value you can specify depends on the transfer modes.

The table below shows the settable values. When you use the transfer mode which does not use the STB signals, specify 0. <Bus master digital input product> <Digital input circuit of bus master digital input/output product>

Sampling mode (with control signals)

0

Gated sampling mode 0 Strobe mode DIOBM_STB1_FALL_EDGE

DIOBM_STB1_RISE_EDGE Request mode 0

Copyright 2002, 2015 Interface Corporation. All rights reserved.

166

Page 167: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

<Bus master digital output product>

<Digital output circuit of bus master digital input/output product> Pattern output mode (with control signals)

0

Gated-pattern output mode 0 Strobe mode - Setup time:

DIOBM_SU_25N DIOBM_SU_100N DIOBM_SU_500N DIOBM_SU_1MICRO DIOBM_SU_5MICRO DIOBM_SU_10MICRO DIOBM_SU_50MICRO DIOBM_SU_100MICRO

- Low-pulse output width DIOBM_PU_100N DIOBM_PU_500N DIOBM_PU_1MICRO DIOBM_PU_5MICRO DIOBM_PU_10MICRO DIOBM_PU_50MICRO DIOBM_PU_100MICRO

Example: DIOBM_SU_1MICRO | DIOBM_PU_500N)

Request mode 0 If the setup time is not specified, the setup time is 25 ns (50 ns for bus master

digital input/output products). dwACKConf Specifies the function of the ACK1 or ACK2 signal by using one of the following

codes or 0. The code or value you can specify is different depending on the transfer modes. Refer to the followings. When you use the transfer mode which does not use the ACK signals, specify 0.

Code/Value Description 0 Disables ACK signals.

To use the ACK1 or ACK2 signal as a input signal, specify 0 when setting the strobe mode of a bus master digital input product or output product.

DIOBM_LINE_FUNC_ENABLE Enables ACK signals. The code can be specified in the strobe mode of a bus master digital output product.

DIOBM_LOW Low-level pulse output DIOBM_PU_100N Low pulse output width: 100 ns DIOBM_PU_500N Low pulse output width: 500 ns DIOBM_PU_1MICRO Low pulse output width: 1 µs DIOBM_PU_5MICRO Low pulse output width: 5 µs DIOBM_PU_10MICRO Low pulse output width: 10 µs DIOBM_PU_50MICRO Low pulse output width: 50 µs DIOBM_PU_100MICRO Low pulse output width: 100 µs

Copyright 2002, 2015 Interface Corporation. All rights reserved.

167

Page 168: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

The code or value you can specify depends on the transfer modes.

The table below shows the settable values. <Bus master digital input product> <Digital input circuit of bus master digital input/output product>

Sampling mode (with control signals)

0

Gated sampling mode 0 DIOBM_LOW DIOBM_PU_100N DIOBM_PU_500N DIOBM_PU_1MICRO DIOBM_PU_5MICRO DIOBM_PU_10MICRO DIOBM_PU_50MICRO DIOBM_PU_100MICRO

Strobe mode 0 Request mode 0

<Bus master digital output product>

<Digital output circuit of bus master digital input/output product> Pattern output mode (with control signals)

0

Gated-pattern output mode 0 DIOBM_LOW DIOBM_PU_100N DIOBM_PU_500N DIOBM_PU_1MICRO DIOBM_PU_5MICRO DIOBM_PU_10MICRO DIOBM_PU_50MICRO DIOBM_PU_100MICRO

Strobe mode 0 DIOBM_LINE_FUNC_ENABLE

Request mode 0

Copyright 2002, 2015 Interface Corporation. All rights reserved.

168

Page 169: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

dwREQConf Specifies the function of the REQ1 or REQ2 signal by using one of the following

codes or 0. The code or value you can specify is different depending on the transfer modes. Refer to the followings. When you use the transfer mode which does not use the REQ signals, specify 0.

Code Description 0 Disables REQ signals

DIOBM_LOW Enables REQ signals at low level. Specify the code in the request mode of a bus master digital output product.

DIOBM_PU_100N Low pulse output width: 100 ns DIOBM_PU_500N Low pulse output width: 500 ns DIOBM_PU_1MICRO Low pulse output width: 1 µs DIOBM_PU_5MICRO Low pulse output width: 5 µs DIOBM_PU_10MICRO Low pulse output width: 10 µs DIOBM_PU_50MICRO Low pulse output width: 50 µs DIOBM_PU_100MICRO Low pulse output width: 100 µs

The code or value you can specify depends on the transfer modes. The table below shows the settable values. <Bus master digital input product> <Digital input circuit of bus master digital input/output product>

Sampling mode (with control signals)

0

Gated sampling mode 0 Strobe mode 0

Request mode

0 DIOBM_LOW DIOBM_PU_100N DIOBM_PU_500N DIOBM_PU_1MICRO DIOBM_PU_5MICRO DIOBM_PU_10MICRO DIOBM_PU_50MICRO DIOBM_PU_100MICRO

<Bus master digital output product>

<Digital output circuit of bus master digital input/output product> Pattern output mode (with control signals)

0

Gated-pattern output mode

0

Strobe mode 0 Request mode DIOBM_LOW

Do not specify 0.

Copyright 2002, 2015 Interface Corporation. All rights reserved.

169

Page 170: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

dwOREConf Specifies the function of the ORE1 signal according to the board by using the

following code or 0. When you use the PCI-2772C, CBI-291144, and CBI-292144, specify 0. To use the function of the ORE1 signal, use the DioBmGetDeviceConfigEx function.

Code/Value Description 0 Disables ORE output.

To use the ORE1 signal for output, specify 0.

DIOBM_LINE_FUNC_ENABLE Enables ORE output. dwUREConf Specifies the function of the ORE2 signal according to the board by using the

following code or 0. When you use the PCI-2772C, CBI-291144, and CBI-292144, specify 0. To use the function of the ORE2 signal, use the DioBmSetDeviceConfigEX function.

Code/Value Description 0 Disables URE output.

To use the URE2 signal for output, specify 0.

DIOBM_LINE_FUNC_ENABLE Enables URE output.

Copyright 2002, 2015 Interface Corporation. All rights reserved.

170

Page 171: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

171

4.3.2 DIOBMTRIGCONF The DIOBMTRIGCONF structure contains trigger parameters. C typedef struct { DWORD dwDeviceID; DWORD dwBaseAddress; DWORD dwAddressSize; DWORD dwInterruptLevel; DWORD dwBoardID; DWORD dwSupportFunction; } DIOBMINFO, *PDIOBMINFO;

Visual Basic Type DIOBMINFO dwDeviceID As Long dwBaseAddress As Long dwAddressSize As Long dwInterruptLevel As Long dwBoardID As Long dwSupportFunction As Long End Type

Delphi DIOBMINFO = record dwDeviceID: DWORD; dwBaseAddress: DWORD; dwAddressSize: DWORD; dwInterruptLevel: DWORD; dwBoardID: DWORD;

dwSupportFunction:

DWORD;

end;

Member Description dwSoftTrigger Specifies the software trigger operation of the DioBmSoftTrigger function by

using one of the following codes or 0.

Code/Value Description 0 Disables the software trigger operation.DIOBM_SOFT_TRIGGER_START Enables the software trigger start. DIOBM_SOFT_TRIGGER_END Enables the software trigger end.

Page 172: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

172

dwStartLine Specifies the transfer operation according to the START1 and START2 signals

by using one of the following codes or 0. <Bus master digital input product> <Bus master digital output product >

Code Description 0 Disables START signals. DIOBM_START_ASSERT Starts data transfer when the START signal is

asserted. DIOBM_START_END_PULSE Starts/ends data transfer at the first/second

pulse of the START signal. DIOBM_START_END_LEVEL Starts/ends data transfer at a falling/rising edge

of the START signal. <Digital input circuit of bus master digital input/output product> <Digital output circuit of bus master digital input/output product>

Code/Value Description 0 Disables the transfer operation. DIOBM_START_ASSERT Starts data transfer when the START signal is

asserted. - Digital input circuit: START1 signal - Digital output circuit: START2 signal

DIOBM_START_END_PULSE Starts and ends data transfer at a first pulse and the second pulse of the START signal respectively. - Digital input circuit: START1 signal - Digital output circuit: START2 signal

DIOBM_START_END_LEVEL Starts and ends data transfer at a falling edge and a rising edge of the START signal respectively. - Digital input circuit: START1 signal - Digital output circuit: START2 signal

DIOBM_START_ASSERT_ START1

Starts data transfer when the START1 signal is asserted.

DIOBM_START_END_ PULSE_START1

Starts and ends data transfer at a first pulse and the second pulse of the START1 signal respectively.

DIOBM_START_END_ LEVEL_START1

Starts and ends data transfer at a falling edge and a rising edge of the START1 signal respectively.

DIOBM_START1_END_ FALL_EDGE

Ends data transfer at a falling edge of the START1 signal.

DIOBM_START1_END_RISE_EDGE

Ends data transfer at a rising edge of the START1 signal.

DIOBM_START_ASSERT_ START2

Starts data transfer when the START2 signal is asserted.

DIOBM_START_END_ PULSE_START2

Starts and ends data transfer at a first pulse and the second pulse of the START2 signal respectively.

DIOBM_START_END_ LEVEL_START2

Starts and ends data transfer at a falling edge and a rising edge of the START2 signal respectively.

DIOBM_START2_END_ FALL_EDGE

Ends data transfer at a falling edge of the START2 signal.

DIOBM_START2_END_RISE_EDGE

Ends data transfer at a rising edge of the START2 signal.

Page 173: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

173

dwEndLine Specifies the transfer operation according to the END1 and END2 signals by

using one of the following code or 0. <Bus master digital input product> <Bus master digital output product >

Code/Value Description 0 Disables END signals. DIOBM_LINE_FUNC_ ENABLE

Ends data transfer when the END signal is asserted.

<Digital input circuit of bus master digital input/output product> <Digital output circuit of bus master digital input/output product>

Code/Value Description 0 Disables the transfer operation.

DIOBM_LINE_FUNC_ ENABLE

Ends data transfer when the END signal is asserted. - Digital input circuit: END1 signal - Digital output circuit: END2 signal

DIOBM_END1_END_FALL_ EDGE_ENABLE

Ends data transfer when the END1 signal is asserted.

DIOBM_END2_END_FALL_ EDGE_ENABLE

Ends data transfer when the END2 signal is asserted.

Page 174: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

174

dwStopLine Specifies the transfer operation according to the STOP1 and STOP2 signals by

using one of the following code or 0. Code/Value Description

0 Disables STOP signals. DIOBM_LINE_FUNC_ENABLE Suspends data transfer when the

STOP1 or STOP2 signal is asserted. Restarts data transfer when the signal is deasserted.

You can use the STOP signal in the sampling mode and request mode of bus master digital input products and in the pattern output mode and strobe mode of bus master digital output products. Specify 0 in the other modes.

dwTriggerDelay

Num

Specifies the number of trigger delay samples in the range of 1 through 16777215 (1 through 00FFFFFFh). After the stop condition is satisfied, the transfer will stop when the delay samples are transferred. You can use this member in the all transfer modes.

dwPatternEq Specifies the pattern matching trigger by using one of the following codes or 0.

Code/Value Description 0 Disables the pattern matching

operation.

DIOBM_PATTERN_EQ_START Starts the pattern matching operation.

DIOBM_PATTERN_EQ_END Ends the pattern matching operation. dwPatternMask Specifies valid bits to compare input data with the pattern matching data. Refer

to the following tables. bit31 … bit15 bit14 … bit0 IN32 … IN16 IN15 … IN1

- Bit pattern 0: Input signal status is not compared with bit pattern of pattern matching data.1: Input signal status matches the bit pattern of pattern matching data.

dwPatternData Specifies a pattern matching data. Refer to the following tables.

bit31 … bit15 bit14 … bit0 IN32 … IN16 IN15 … IN1

- Bit pattern 0: Input signal status is 0 (low level). 1: Input signal status is 1 (high level).

Page 175: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

175

4.3.3 DIOBMINFO The DIOBMINFO structure contains the device information.

C typedef struct { DWORD dwDeviceID; DWORD dwBaseAddress; DWORD dwAddressSize; DWORD dwInterruptLevel; DWORD dwBoardID; DWORD dwSupportFunction; } DIOBMINFO, *PDIOBMINFO;

Visual Basic Type DIOBMINFO dwDeviceID As Long dwBaseAddress As Long dwAddressSize As Long dwInterruptLevel As Long dwBoardID As Long dwSupportFunction As Long End Type

Delphi DIOBMINFO = record dwDeviceID: DWORD; dwBaseAddress: DWORD; dwAddressSize: DWORD; dwInterruptLevel: DWORD; dwBoardID: DWORD; dwSupportFunction: DWORD; end;

Member Description dwDeviceID Receives the device ID. dwBaseAddress Receives the I/O port base addresses. This member receives the base address

of I/O control registers. dwAddressSize Receives the I/O port area size. dwInterruptLevel Receives the interrupt level. dwBoardID Receives the board ID (RSW1 value of the board). dwSupportFunction Receives information of the functions that the device supports. Refer to the

following tables.

Page 176: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

176

Bit Description

Bit0 IN1 through IN8 Bit1 IN9 through IN16 Bit2 IN17 through IN24 Bit3 IN25 through IN32 Bit4 Reserved Bit5 Reserved Bit6 Reserved Bit7 Reserved Bit8 OUT1 through OUT8 Bit9 OUT9 through OUT16 Bit10 OUT17 through OUT24 Bit11 OUT25 through OUT32 Bit12 Reserved Bit13 Reserved Bit14 Reserved Bit15 Reserved Bit16 SCLK signal Bit17 STB/REQ/STAT/GATE signal Bit18 FF/EF signal Bit19 ACK signal Bit20 EQ signal Bit21 START signal Bit22 END signal Bit23 ORE/URE signal Bit24 Interval timer Bit25 Bus master digital input, busmaster digital output,

multi-function devices Bit26 Input/output, control signal switching device

(LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, and CBI/CSI-292144)

Bit27 Stop at a specified number of data Bit28 Digital filter Bit29 All input interrupts Bit30 Digital output reset output Bit31 Reserved

Page 177: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

177

4.3.4 DIOBMCONFEX The DIOBMCONFEX structure stores the mode, transfer unit, sampling frequency, and function setting information of control signal.

C typedef struct { DWORD dwMode; DWORD dwRedirectWidth; DWORD dwEQConf; DWORD dwClock; DWORD dwSmplNum; DWORD dwTimingOption; DWORD dwSTBConf; DWORD dwACKConf; DWORD dwREQConf; DWORD dwOREConf; DWORD dwUREConf; DWORD dwAssignExt[4]; DWORD dwSignalEnable; DWORD dwSCLKConf; DWORD dwClockMulti; DWORD dwSTBSuMulti; DWORD dwSTBPuMulti; DWORD dwACKMulti; DWORD dwREQMulti; DWORD dwGATEConf; DWORD dwSTOPConf; DWORD dwStopBehav; } DIOBMCONFEX, *PDIOBMCONFEX;

Visual Basic Type DIOBMCONFEX dwMode As Long dwRedirectWidth As Long dwEQConf As Long dwClock As Long dwSmplNum As Long dwTimingOption As Long dwSTBConf As Long dwACKConf As Long dwREQConf As Long dwOREConf As Long dwUREConf As Long dwAssignExt(3) As Long dwSignalEnable As Long dwSCLKConf As Long dwClockMulti As Long dwSTBSuMulti As Long dwSTBPuMulti As Long dwACKMulti As Long dwREQMulti As Long dwGATEConf As Long dwSTOPConf As Long dwStopBehav As Long End Type

Page 178: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

178

Delphi DIOBMCONFEX = record dwMode: DWORD; dwRedirectWidth: DWORD; dwEQConf: DWORD; dwClock: DWORD; dwSmplNum: DWORD; dwTimingOption: DWORD; dwSTBConf: DWORD; dwACKConf: DWORD; dwREQConf: DWORD; dwOREConf: DWORD; dwUREConf: DWORD; dwAssignExt: Array[0..3] of DWORD; dwSignalEnable: DWORD; dwSCLKConf: DWORD; dwClockMulti: DWORD; dwSTBSuMulti: DWORD; dwSTBPuMulti: DWORD; dwACKMulti: DWORD; dwREQMulti: DWORD; dwGATEConf: DWORD; dwSTOPConf: DWORD; dwStopBehav: DWORD; end;

Page 179: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

179

Member Description dwMode Specifies the transfer mode by using one of the following codes. Code Description

DIOBM_MODE_NON Stand-by mode (default setting) Each pin is open.

DIOBM_MODE_SAMPLING Sampling mode (with control signal)

DIOBM_MODE_SAMPLING_GATE Gated-sampling mode DIOBM_MODE_PATTERN_OUT Pattern output mode DIOBM_MODE_PATTERN_OUT_GATE Gated-pattern output mode DIOBM_MODE_STROBE Strobe mode DIOBM_MODE_REQUEST Request mode DIOBM_MODE_SAMPLING_NOCTL Sampling mode

(without control signal) DIOBM_MODE_PATTERN_OUT_NOCTL Pattern output mode

(without control signal)

The table below shows the settable values.

Bus master digital input products Digital input of PCI-2772C, CPZ-291244, CPZ-292244

DIOBM_MODE_NON DIOBM_MODE_SAMPLING DIOBM_MODE_SAMPLING_GATE DIOBM_MODE_STROBE DIOBM_MODE_REQUEST

Bus master digital output products Digital output of PCI-2772C, CPZ-291244, CPZ-292244

DIOBM_MODE_NON DIOBM_MODE_PATTERN_OUT DIOBM_MODE_PATTERN_OUT_GATE DIOBM_MODE_STROBE DIOBM_MODE_REQUEST

Digital input of LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144

DIOBM_MODE_NON DIOBM_MODE_SAMPLING DIOBM_MODE_SAMPLING_GATE DIOBM_MODE_STROBE DIOBM_MODE_REQUEST DIOBM_MODE_SAMPLING_NOCTL

LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144

DIOBM_MODE_NON DIOBM_MODE_PATTERN_OUT DIOBM_MODE_PATTERN_OUT_GATE DIOBM_MODE_STROBE DIOBM_MODE_REQUEST DIOBM_MODE_PATTERN_OUT_NOCTL

When specifying the DIOBM_MODE_NON code, specify 0 to all the other members.

Page 180: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

180

dwRedirectWidth Specifies the bus master transfer width by using one of the following codes. Refer

to "Data Format" as the bus master transfer width for details. Code/Value Description

0 Sets no mode. DIOBM_WIDTH_DWORD Double word size (4 byte) DIOBM_WIDTH_WORD Word size (2 byte) DIOBM_WIDTH_BYTE Byte size (1 byte) DIOBM_EX_SETTING Selects input/output channels every

4 bits. Only applicable to the bus master digital input/output products

In bus master output circuit of the LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144 the configurable bus master transfer width depends on the mode.

<Digital output of LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144>

Digital Output Mode Settings Configurable Code Pattern output mode (with control signal) Gated-pattern output mode Strobe output mode Request output mode

DIOBM_WIDTH_WORD DIOBM_WIDTH_BYTE DIOBM_EX_SETTING

Pattern output mode (without control signal)

DIOBM_WIDTH_DWORD DIOBM_WIDTH_WORD DIOBM_WIDTH_BYTE DIOBM_EX_SETTING

Digital Input Mode Settings Control Signals Output Pin Sampling mode (with control signal) Gated-sampling mode Strobe output mode Request output mode

INOUT21 through INOUT24

No mode Sampling mode (without control signal)

None

Digital Output Mode Settings Control Signals Output Pin Pattern output mode (with control signal) Gated-pattern output mode Strobe output mode Request output mode

INOUT29 through INOUT32

No mode Pattern output mode (without control signal)

None

Example

- Bus master digital input: Sampling mode (with control signal) - Bus master digital output: Pattern output mode (with control signal) When mode settings as above are performed, only INOUT1 through INOUT20 and INOUT25 through INOUT28 can be used as data output.

Page 181: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

181

dwEQConf Specifies the function of the EQ1 or EQ2 signal according to the board by using the following code or 0.

Code/Value Description 0 Disables the comparator output. EQ1 or

EQ2 is used as a digital output signal (not available for the bus master digital input/output products).

DIOBM_LINE_FUNC_ENABLE Enables the comparator output. DIOBM_ONCE Outputs the comparator output only

once (except for the comparator output interrupt). This code is applicable only for bus master digital input/output products. Use the code in combination with the DIOBM_LINE_FUNC_ENABLE. The comparator output interrupt is repeatedly generated.

DIOBM_LOOP Outputs the comparator output whenever counter event occurs. Use the code in combination with the DIOBM_LINE_FUNC_ENABLE. The operation with the DIOBM_LOOP specified is executed if the DIOBM_ONCE or DIOBM_LOOP is not specified.

Page 182: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

182

dwClock Specifies the pacer rate by using one of the following codes or 0.

Code/Value Description 0 Disables the internal pacer.

Specify 0 when you use the following transfer modes. These modes do not need the internal pacer.

Transfer Type Mode Bus master input Strobe mode Bus master output Request mode

DIOBM_CLK_EXT External clock When you use a bus master digital input/output product, the CLKIN1 signal is used for the bus master digital input circuits and the CLKIN2 signal for the bus master digital output circuits. To specify the CLKIN signals you use, specify DIOBM_EX_SETTING and configure the setting of dwSCLKConf.

DIOBM_CLK_1 1 Hz DIOBM_CLK_2 2 Hz DIOBM_CLK_4 4 Hz DIOBM_CLK_10 10 Hz DIOBM_CLK_20 20 Hz DIOBM_CLK_40 40 Hz DIOBM_CLK_100 100 Hz DIOBM_CLK_200 200 Hz DIOBM_CLK_400 400 Hz DIOBM_CLK_1K 1 kHz DIOBM_CLK_2K 2 kHz DIOBM_CLK_4K 4 kHz DIOBM_CLK_10K 10 kHz DIOBM_CLK_20K 20 kHz DIOBM_CLK_40K 40 kHz DIOBM_CLK_100K 100 kHz DIOBM_CLK_200K 200 kHz DIOBM_CLK_400K 400 kHz DIOBM_CLK_1M 1 MHz DIOBM_CLK_2M 2 MHz DIOBM_CLK_4M 4 MHz DIOBM_CLK_10M 10 MHz DIOBM_CLK_20M 20 MHz

DIOBM_EX_SETTING

Selects the signal line to input the clock or configures the setting of the internal clock by 50 ns step. This code is only applicable to the bus master digital input/output products.

Page 183: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

183

dwSmplNum Specifies the number of samples to be read for input or to be written for output. The range you can specify depends on the transfer modes and bus master transfer width. Refer to the followings.

<Bus master digital input products>

Mode Double Word DIOBM_WIDTH_

DWORD

Word DIOBM_WIDTH

_WORD

Byte DIOBM_WIDTH

_BYTE Sampling Mode (with Control Signal)

2 through 1073741823 (2h through 3FFFFFFFh) You can specify the value every double-word-sample.When you specify 0, the operation is infinitely repeated.

2 through 2147483646 (2h through 7FFFFFFEh) You can specify the value every two word-samples. When you specify 0, the operation is infinitely repeated.

4 through 4294967292 (4h through FFFFFFFCh) You can specify the value every four byte-samples.When you specify 0, the operation is infinitely repeated.

Gated-Sampling Mode 0 0 0

Strobe Mode 0 0 0 Request Mode 1 through

1073741823 (2h through 3FFFFFFFh) You can specify the value every double-word-sample.When you specify 0, the operation is infinitely repeated.

2 through 2147483646 (2h through 7FFFFFFEh) You can specify the value every two word-samples. When you specify 0, the operation is infinitely repeated.

4 through 4294967292 (4h through FFFFFFFCh) You can specify the value every four byte-samples.When you specify 0, the operation is infinitely repeated.

Page 184: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

184

<Bus master digital output products>

Mode Double Word DIOBM_WIDTH

_DWORD

Word DIOBM_WIDTH

_WORD

Byte DIOBM_WIDTH

_BYTE Pattern Output mode (With Control Signal)

2 through 1073741823 (2h through 3FFFFFFFh) You can specify the value every double-word sample. When you specify 0, the operation is infinitely repeated.

2 through 2147483646 (2h through 7FFFFFFEh) You can specify the value every two word samples. When you specify 0, the operation is infinitely repeated.

4 through 4294967292 (4h through FFFFFFFCh) You can specify the value every four byte samples.When you specify 0, the operation is infinitely repeated.

Gated-Pattern Output Mode 0 0 0

Strobe Mode 1 through 1073741823 (1h through 3FFFFFFFh) You can specify the value every double-word sample. When you specify 0, the operation is infinitely repeated.

2 through 2147483646 (2h through 7FFFFFFEh) You can specify the value every two word samples. When you specify 0, the operation is infinitely repeated.

4 through 4294967292 (4h through FFFFFFFCh) You can specify the value every four byte samples.When you specify 0, the operation is infinitely repeated.

Request Mode 0 0 0

<Digital Input circuit of bus master digital input/output product>

Mode Double Word DIOBM_WIDTH

_DWORD

Word DIOBM_WIDTH

_WORD

Byte DIOBM_WIDTH

_BYTE Sampling Mode (with Control Signal)

Request Mode

Gated-Sampling Mode Strobe Mode

1 through 1073741823 (1h through 3FFFFFFFh) You can specify the value every double-word sample. When you specify 0, the operation is infinitely repeated.

2 through 2147483646 (2h through 7FFFFFFEh) You can specify the value at every two word-samples. When you specify 0, the operation is infinitely repeated.

4 through 4294967292 (4h through FFFFFFFCh) You can specify the value at every four byte-samples.When you specify 0, the operation is infinitely repeated.

Page 185: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

185

When you specify the number of samples by 4 bits by using dwRedirectWidth and dwSignalEnable members, the range you can specify is dependent on the channels. Refer to the followings.

Mode 4 Channels 8 Channels 12 Channels Sampling Mode (with Control Signal) (without Control Signal) Gated-Sampling Mode

Strobe Mode

Request Mode

8 through 4294967280 (8h through FFFFFFF0h) You can specify the value at every eight-sample. When you specify 0, the operation is infinitely repeated.

Same operation as when DIOBM_WIDTH_BYTE is specified to dwRedirectWidth

Same operation as when DIOBM_WIDTH_WORD is specified to dwRedirectWidth

Mode 16 Channels 20 Channels 24 Channels Sampling Mode (with Control Signal) (without Control Signal) Gated-Sampling Mode Strobe Mode Request Mode

Same operation as when DIOBM_WIDTH_WORD is specified to dwRedirectWidth

Same operation as when DIOBM_WIDTH_DWORD is specified to dwRedirectWidth

Same operation as when DIOBM_WIDTH_DWORD is specified to dwRedirectWidth

Mode 28 Channels 32 Channels Sampling Mode (with Control Signal) (without Control Signal) Gated-Sampling Mode Strobe Mode Request Mode

Same operation as when DIOBM_WIDTH_DWORD is specified to dwRedirectWidth

Same operation as when DIOBM_WIDTH_DWORD is specified to dwRedirectWidth

Page 186: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

186

<Digital output circuit of bus master digital input/output products>

Double Word DIOBM_WIDTH

_DWORD

Word DIOBM_WIDTH

_WORD

Byte DIOBM_WIDTH

_BYTE Pattern Output Mode (with Control Signal) Gated-Pattern Output Mode Strobe Mode Request Mode

1 through 4294967295 (1h through FFFFFFFFh) You can specify the value every double-word sample. When you specify 0, the operation is infinitely repeated.

2 through 4294967294 (2h through FFFFFFFEh) You can specify the value every two word samples. When you specify 0, the operation is infinitely

4 through 4294967292 (4h through FFFFFFFCh) You can specify the value every four byte samples. When you specify 0, the operation is infinitely

4 Channels 8 Channels 12 Channels Pattern Output Mode (with Control Signal) Gated-Pattern Output Mode

Strobe Mode

Request Mode

8 through 4294967280 (8h through FFFFFFF0h) You can specify the value at every eight sample. When you specify 0, the operation is infinitely repeated.

Same operation as when DIOBM_WIDTH_BYTE is specified to dwRedirectWidth

Same operation as when DIOBM_WIDTH_WORD is specified to dwRedirectWidth

16 Channels 20 Channels 24 Channels Pattern Output Mode (with Control Signal) Gated-Pattern Output Mode Strobe Mode Request Mode

Same operation as when DIOBM_WIDTH_WORD is specified to dwRedirectWidth

Same operation as when DIOBM_WIDTH_DWORD is specified to dwRedirectWidth

Same operation as when DIOBM_WIDTH_DWORD is specified to dwRedirectWidth

28 Channels 32 Channels Pattern Output Mode (with Control Signal) Gated-Pattern Output Mode Strobe Mode Request Mode

Same operation as when DIOBM_WIDTH_DWORD is specified to dwRedirectWidth

Same operation as when DIOBM_WIDTH_DWORD is specified to dwRedirectWidth

Page 187: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

187

dwTimingOption Specifies the FIFO timing option by using one of the following codes or 0. This

parameter can be used with an external device like an FIFO memory chip. Digital Input Mode Settings Control Signals Output Pin

0 Not specified DIOBM_TIMING_FIFO FIFO normal timing DIOBM_TIMING_FIFO_SHOW_AHEAD FIFO show-ahead timing DIOBM_TIMING_FIFO_LEGACY FIFO legacy timing

The configurable values depend on the mode.

<Bus master digital input products>

Mode Code /Value Sampling mode (with control signal)

0 DIOBM_TIMING_FIFO_SHOW_AHEAD DIOBM_TIMING_FIFO_LEGACY

Gated-sampling mode 0 DIOBM_TIMING_FIFO

Strobe mode 0

Request mode 0

<Bus master digital output products>

Mode Code /Value Pattern output mode (with control signal)

0 DIOBM_TIMING_FIFO

Gated-pattern output mode 0 DIOBM_TIMING_FIFO_SHOW_AHEAD DIOBM_TIMING_FIFO_LEGACY

Strobe mode 0 Request mode 0

<Digital input circuit of bus master digital input/output products>

Mode Code /Value Sampling mode (with control signal)

0 DIOBM_TIMING_FIFO_LEGACY

Gated-sampling mode 0 DIOBM_TIMING_FIFO

Strobe mode 0 Request mode 0

<Digital output circuit of bus master digital input/output products>

Mode Code /Value Pattern output mode (with control signal)

0 DIOBM_TIMING_FIFO

Gated-pattern output mode 0 DIOBM_TIMING_FIFO_SHOW_AHEAD DIOBM_TIMING_FIFO_LEGACY

Strobe mode 0 Request mode 0

Page 188: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

188

dwSTBConf Specifies the function of the STB1 or STB2 signal by using one of the following codes or 0.

Code/Value Description 0 Disables the STB1 signal. DIOBM_STB1_FALL_EDGE Enables STB1 falling edge. DIOBM_STB1_RISE_EDGE Enables STB1 rising edge. DIOBM_SU_25N The setup time is 25 ns.

The code is not available for bus master digital input/output products.

DIOBM_SU_50N The setup time is 50 ns. The code is available only for busmaster digital input output products.

DIOBM_SU_100N The setup time is 100 ns DIOBM_SU_500N The setup time is 500 ns DIOBM_SU_1MICRO The setup time is 1 us DIOBM_SU_5MICRO The setup time is 5 us DIOBM_SU_10MICRO The setup time is 10 us DIOBM_SU_50MICRO The setup time is 50 us DIOBM_SU_100MICRO The setup time is 100 us DIOBM_PU_50N The negative pulse width is 50 ns.

This code is not applicable only for bus master digital input/output products.

DIOBM_PU_100N The negative pulse width is 100 ns. DIOBM_PU_500N The negative pulse width is 500 ns. DIOBM_PU_1MICRO The negative pulse width is 1 us DIOBM_PU_5MICRO The negative pulse width is 5 us DIOBM_PU_10MICRO The negative pulse width is 10 us DIOBM_PU_50MICRO The negative pulse width is 50 us DIOBM_PU_100MICRO The negative pulse width is 100 us DIOBM_EX_SETTING Configures setup time by 50 ns step with

dwSTBSuMulti and output pulse width by 50 ns step with the dwSTBPuMulti. This code is applicable only for bus master digital input/output products. A code with the DIOBM_EX_SETTING combined with the DIOBM_SU_ or DIOBM_PU_ is preceded. Specifies the setup time by using the DIOBM_SU_ and the pulse width by the dwSTBPuMulti. <Example> dwSTBConf member = (DIOBM_EX_SETTING | DIOBM_SU_1MICRO) dwSTBPuMulti member = 4 In this case, the setup time is 1 µs and the pilse output width is 200 ns (50 n x 4).

Page 189: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

189

The code or value you can specify is different depending on the transfer modes.

Refer to the followings. When you use the transfer mode which does not use the REQ signals, specify 0.

<Bus master digital input products>

Mode Code /Value Sampling mode (with control signal) 0

Gated-sampling mode 0 Strobe mode DIOBM_STB1_FALL_EDGE

DIOBM_STB1_RISE_EDGE Request mode 0

<Bus master digital output products>

Mode Code /Value Pattern output mode (with control signal) 0

Gated-pattern output mode 0 Strobe mode - Setup time

DIOBM_SU_25N DIOBM_SU_100N DIOBM_SU_500N DIOBM_SU_1MICRO DIOBM_SU_5MICRO DIOBM_SU_10MICRO DIOBM_SU_50MICRO DIOBM_SU_100MICRO

- Low pulse output width DIOBM_PU_100N DIOBM_PU_500N DIOBM_PU_1MICRO DIOBM_PU_5MICRO DIOBM_PU_10MICRO DIOBM_PU_50MICRO DIOBM_PU_100MICRO

Specify an identifier with logical add (or addition operator +). Example:

DIOBM_SU_1MICRO | DIOBM_PU_500N) If the setup time is not specified, the setup time is 25 ns (50 ns for bus master digital input/output product). The DIOBM_SU_50N is not available.

Request mode 0

Page 190: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

190

<Digital input circuit of bus master digital input/output products>

Mode Code /Value Sampling mode (with control signal) (without control signal)

0

Gated-sampling mode 0 Strobe mode DIOBM_STB1_FALL_EDGE

DIOBM_STB1_RISE_EDGE Request mode 0

<Digital output circuit of bus master digital input/output products>

Mode Code /Value Pattern output mode (with control signal) (without control signal)

0

Gated-pattern output mode 0 Strobe mode - Low level output

DIOBM_LOW The DIOBM_LOW is applicable when the ACK2 signal is asserted.

The code cannot be specified with a code of low pulse output width together. -Setup time

DIOBM_SU_50N DIOBM_SU_100N DIOBM_SU_500N DIOBM_SU_1MICRO DIOBM_SU_5MICRO DIOBM_SU_10MICRO DIOBM_SU_50MICRO DIOBM_SU_100MICRO

-Low pulse output width

DIOBM_PU_50N DIOBM_PU_100N DIOBM_PU_500N DIOBM_PU_1MICRO DIOBM_PU_5MICRO DIOBM_PU_10MICRO DIOBM_PU_50MICRO DIOBM_PU_100MICRO

Specify an identifier with logical add (or addition operator +). Example:

DIOBM_SU_1MICRO | DIOBM_PU_500N If the setup time is not specified, the setup time is 50 ns. Specify DIOBM_EX_SETTING in the dwSTBSuMulti member to configure pulse output width settings and setup time by 50 ns. The DIOBM_SU_25N is not available.

Request mode 0

Page 191: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

191

dwACKConf Specifies the function of the ACK1 or ACK2 signal by using one of the following

codes or 0. Code /Value Description

0 Disables the ACK1 signal. DIOBM_LINE_FUNC_ENABLE Enables the ACK signal. The code is

selectable with the strobe mode of busmaster digital output products.

DIOBM_LOW Low level output DIOBM_PU_100N The low pulse output width is 100 ns DIOBM_PU_500N The low pulse output width is 500 ns DIOBM_PU_1MICRO The low pulse output width is 1 us DIOBM_PU_5MICRO The low pulse output width is 5 us DIOBM_PU_10MICRO The low pulse output width is 10 us DIOBM_PU_50MICRO The low pulse output width is 50μs DIOBM_PU_100MICRO The low pulse output width is 100 us DIOBM_EX_SETTING Configures the pulse output width by 50 ns

step with dwACKMulti. This code is only applicable to the bus master digital input/output products.

The selectable values differ depending on the mode settings. The tables below show the configurable values. Specify 0 (disabled) for a mode that does not use ACK signal.

<Bus master digital input products>

Mode Code /Value Sampling mode (with control signal) 0

Gated-sampling mode 0 Strobe mode 0

DIOBM_LOW DIOBM_PU_100N DIOBM_PU_500N DIOBM_PU_1MICRO DIOBM_PU_5MICRO DIOBM_PU_10MICRO DIOBM_PU_50MICRO DIOBM_PU_100MICRO

Request mode 0

<Bus master digital output products>

Mode Code /Value Pattern output mode (with control signal) 0

Gated-pattern output mode 0 Strobe mode 0

DIOBM_LINE_FUNC_ENABLE Request mode 0

Page 192: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

192

<Digital input circuit of bus master digital input/output products>

Mode Code /Value Sampling mode (with control signal) (without control signal)

0

Gated-sampling mode 0 Strobe mode 0

DIOBM_LOW DIOBM_PU_50N DIOBM_PU_100N DIOBM_PU_500N DIOBM_PU_1MICRO DIOBM_PU_5MICRO DIOBM_PU_10MICRO DIOBM_PU_50MICRO DIOBM_PU_100MICRO Specify DIOBM_EX_SETTING in the dwACKMulti member to configure pulse output width settings and setup time by 50 ns.

Request mode 0

<Digital output circuit of bus master digital input/output products>

Mode Code /Value Pattern output mode (with control signal) (without control signal)

0

Gated-pattern output mode 0 Strobe mode 0

DIOBM_LINE_FUNC_ENABLE Request mode 0

dwREQConf

Code/Value Description 0 Disables the REQ signals. DIOBM_LOW Enables REQ signals at falling edge.

The code is used in the request mode of bus master digital output products.

DIOBM_PU_100N The low pulse width is 100 ns DIOBM_PU_500N The low pulse width is 500 ns DIOBM_PU_1MICRO The low pulse width is 1 µs DIOBM_PU_5MICRO The low pulse width is 5 µs DIOBM_PU_10MICRO The low pulse width is 10 µs DIOBM_PU_50MICRO The low pulse width is 50 µs DIOBM_PU_100MICRO The low pulse width is 100 µs DIOBM_EX_SETTING Configures pulse output width by 50 ns step

with dwREQMulti. The code is applicable for busmaster digital input/output products.

The selectable values differ depending on the mode settings. The tables below show the configurable values. Specify 0 (disabled) for a mode that does not use REQ signal.

Page 193: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

193

<Bus master digital input products>

Mode Code /Value Sampling mode (with control signal)

0

Gated-sampling mode 0 Strobe mode 0

DIOBM_LOW DIOBM_PU_100N DIOBM_PU_500N DIOBM_PU_1MICRO DIOBM_PU_5MICRO DIOBM_PU_10MICRO DIOBM_PU_50MICRO DIOBM_PU_100MICRO

Request mode 0 <Bus master digital output products>

Mode Code /Value Pattern output mode (with control signal)

0

Gated-pattern output mode 0 Strobe mode 0 Request mode DIOBM_LOW

Do not specify 0 (disabled). <Digital input circuit of bus master digital input/output products>

Mode Code /Value Sampling mode (with control signal) (without control signal)

0

Gated-sampling mode 0 Strobe mode 0 Request mode DIOBM_PU_50N

DIOBM_PU_100N DIOBM_PU_500N DIOBM_PU_1MICRO DIOBM_PU_5MICRO DIOBM_PU_10MICRO DIOBM_PU_50MICRO DIOBM_PU_100MICRO By specifying the DIOBM_EX_SETTING identifier, the dwREQMulti configures pulse output width.

<Digital output circuit of bus master digital input/output products>

Mode Code /Value Pattern output mode (with control signal) (without control signal)

0

Gated-pattern output mode 0 Strobe mode 0 Request mode DIOBM_LOW

Do not specify 0 (disabled).

Page 194: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

194

dwOREConf Specifies the function of the ORE1 signal according to the board by using the

following code or 0. For the PCI-2772C, CPZ-291244, and CPZ-292244, assign ORE1 signal to the

EXT signal in the dwAssignExt member settings.

Code/Value Description 0 Disables the ORE signals.

ORE1 signal can be used as output. The value is ignored in PCI-2772C, CPZ-291244, CPZ-292244.

DIOBM_LINE_FUNC_ENABLE Enables ORE output function. .

dwUREConf Specifies the function of the URE2 signal according to the board by using the following code or 0.

For the PCI-2772C, CPZ-291244, and CPZ-292244, assign ORE1 signal to the EXT signal in the dwAssignExt member settings.

Code/Value Description 0 Disables the URE signals.

URE2 signal can be used as output. The value is ignored in PCI-2772C, CPZ-291244, and CPZ-292244.

DIOBM_LINE_FUNC_ENABLE Enables URE output signal. .

dwAssignExt The dwAssignExt member is for PCI-2772C, CPZ-291244, and CPZ-292244. Specify 0 for the following models;

PCI-2172C, PCI-2472C, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, and CBI/CSI-292144

Specifies the signal to assign to the EXT11, EXT12, EXT21, and EXT22 signals. The array of dwAssignExt is 4 double word values. The following table shows the indexes and the EXT signals.

dwAssignExt (Index) EXT Signal dwAssignExt[0] EXT11 dwAssignExt[1] EXT12 dwAssignExt[2] EXT21 dwAssignExt[3] EXT22

Code/Value Description 0 Not used.

EXTxx is used as a digital input/output signal.

DIOBM_LINE_START1 Assigns the START1 signal. DIOBM_LINE_START2 Assigns the START2 signal. DIOBM_LINE_END1 Assigns the END1 signal. DIOBM_LINE_END2 Assigns the END2 signal. DIOBM_LINE_EQ1 Assigns the EQ1 signal. DIOBM_LINE_EQ2 Assigns the EQ2 signal. DIOBM_LINE_ORE1 Assigns the ORE1 signal. DIOBM_LINE_URE2 Assigns the URE2 signal.

Page 195: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

195

dwSignalEnable The SignalEnable member is for bus master digital input/output products.

Specify 0 for PCI-2172C and PCI-2472C. The member enables or disables the input or output signal. The setting can be configurable by 4 pins. The bits in a data correspond to signals as follows.

bit31 to bit8 bit7 bit6

Reserved INOUT29

to INOUT32

INOUT25to

INOUT28

bit5 bit4 bit3 bit2 bit1 bit0 INOUT21

to INOUT24

INOUT17to

INOUT20

INOUT13to

INOUT16

INOUT9 to

INOUT12

INOUT5 to

INOUT8

INOUT1 to

INOUT4 0: Disabled 1: Enabled

dwSCLKConf The dwSCLKConf member is for bus master digital input/output products. Specify 0 for PCI-2172C and PCI-2472C. The member configures clock input. DIOBM_EX_SETTING is specified to the dwClock member, use the following codes.

Code/Value Description 0 Specify 0 when DIOBM_EX_SETTING

is not specified to dwClock. DIOBM_INTERNAL Uses the internal clock according to the

settings specified by dwClockMulti. DIOBM_INTERNAL_SYNC_DI_DO

Uses the internal clock for the bus master input and bus master output synchronously.

DIOBM_LINE_CLKIN1 Inputs the external clock from the CLKIN1 pin.

DIOBM_LINE_CLKIN2 Inputs the external clock from the CLKIN2 pin.

dwClockMulti The dwClockMulti member is for digital input/output products. Specify 0 for PCI-2172C and PCI-2472C. The member configures internal clock cycle. Specify 0 to use an external clock. The setting by the dwClockMulti member is applicable only when DIOBM_EX_SETTING is specified in the dwClock member, and DIOBM_INTERNAL and DIOBM_INTERNAL_SYNC_DI_DO is specified in the dwSCLKConf member. A value specified in dwClockMulti x 50 ns = clock cycle The configurable range differs depending on the modes.

Page 196: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

196

dwSTBSuMulti The dwSTBSuMulti member is for digital input/output products.

Specify 0 for PCI-2172C and PCI-2472C. The member configures setup time The setting by the dwSTBSuMulti member is applicable only when DIOBM_EX_SETTING is specified in dwSTBConf. Specify 0 if the digital output circuit of digital input/output product is other than strobe mode. The table blow shows the configurable range.

Code/Value Description 1 to 2048 (1h to 800h) 50 ns to 102400 ns

dwSTBPuMulti The dwSTBPuMulti member is for digital input/output products. Specify 0 for PCI-2172C and PCI-2472C. The member configures pulse output width of STB2. The setting by the dwSTBPuMulti member is applicable only when DIOBM_EX_SETTING is specified in dwSTBConf. Specify 0 if the digital output circuit of digital input/output product is other than strobe mode. A value specified in dwSTBPuMulti x 50 ns = pulse output width The table blow shows the configurable range.

Code/Value Description 1 to 2048 (1h to 800h) 50 ns to 102400 ns

dwACKMulti The d dwACKMulti member is for digital input/output products.

Specify 0 for PCI-2172C and PCI-2472C. The member configures pulse output width of ACK1. The setting by the dwACKMulti member is applicable only when DIOBM_EX_SETTING is specified in dwACKConf. A value specified in dwACKMulti x 50 ns = pulse output width Specify 0 if the digital output circuit of digital input/output product is other than strobe mode. The table blow shows the configurable range.

Code/Value Description 1 to 2048 (1h to 800h) 50 ns to 102400 ns

Page 197: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

197

dwREQMulti The d dwREQMulti member is for digital input/output products.

Specify 0 for PCI-2172C and PCI-2472C. The member configures pulse output width of REQ1. The setting by the dwREQMulti member is applicable only when DIOBM_EX_SETTING is specified in dwREQConf. A value specified in dwREQConf x 50 ns = pulse output width Specify 0 if the digital output circuit of digital input/output product is other than strobe mode. The table blow shows the configurable range.

Code/Value Description 1 to 2048 (1h to 800h) 50 ns to 102400 ns

dwGATEConf The dwGATEConf member is for digital input/output products.

Specify 0 for PCI-2172C and PCI-2472C. The member configures GATE signal. Specify 0 if the mode is other than gated-sampling mode or gated-pattern output mode. <Digital input circuit of bus master digital input/output products> (Gated-sampling mode)

Code/Value Description 0 Uses the GATE1 signal. DIOBM_LINE_GATE1 Uses the GATE1 signal.

DIOBM_LINE_GATE2 Uses the GATE2 signal. This code is available only when the bus master output mode is the gated-pattern output mode.

<Digital output circuit of bus master digital input/output products> (Gated-pattern mode)

Code/Value Description 0 Uses the GATE2 signal.

DIOBM_LINE_GATE1 Uses the GATE1 signal. This code is available only when the bus master input mode is the gated-sampling mode.

DIOBM_LINE_GATE2 Uses the GATE2 signal.

Page 198: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

198

dwSTOPConf The dwSTOPConf member is for digital input/output products.

Specify 0 for PCI-2172C and PCI-2472C. The member configures STOP signal. Specify 0 if the mode is other than gated-sampling mode or gated-pattern output mode. <Digital input circuit of bus master digital input/output products> (Gated-sampling mode)

Code/Value Description

0 Uses the STOP1 signal.

DIOBM_LINE_STOP1 Uses the STOP1 signal.

DIOBM_LINE_STOP2 Uses the STOP2 signal. This code is available only for the pattern output mode.

DIOBM_STOP_NUMBER

The code stops at the specific number of data. After the number of data specified in dwSmplNum is input, the system becomes STOP status and restart to input by the software or external triggers. * For CBI/CSI-291144, CBI/CSI-292144, the code is available devices whose Revision ID is 2 and later.

<Digital output circuit of bus master digital input/output products> (Gated-pattern mode)

Code/Value Description 0 Uses the GATE2 signal.

DIOBM_LINE_GATE1 Uses the GATE1 signal. This code is available only when the bus master input mode is the gated-sampling mode.

DIOBM_LINE_GATE2 Uses the GATE2 signal.

Page 199: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

199

dwStopBehav The dwStopBehav member is for digital input/output products.

Specify 0 for PCI-2172C and PCI-2472C. The member configures the operation when the data transfer is terminated. The configuration is not applied when the data transfer is terminated by the software trigger or forced stop function. <Digital input circuit of bus master digital input/output products>

Code/Value Description

0 Terminates the operation normally after the retrieved data are transferred to the application.

DIOBM_BH_NORMAL Terminates the operation normally after the retrieved data are transferred to the application.

DIOBM_BH_COMPLUSION

Terminates the operation forcibly. Terminates the data input immediately. The data in the FIFO cannot be transferred to the application.

<Digital output circuit of bus master digital input/output products>

Code/Value Description

0

Terminates the operation normally. If FIFO has data that have not been output, the code terminates the operation after all the data in FIFO are output.

DIOBM_BH_NORMAL

Terminates the operation normally. If FIFO has data that have not been output, the code terminates the operation after all the data in FIFO are output.

DIOBM_BH_COMPLUSION

Terminates the operation forcibly. Immediately terminates data input. If input data is left in FIFO, the data is not sent to the application.

Page 200: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

200

4.4 Return Values Error Code Value Description Comments/Solutions

DIOBM_ERROR_SUCCESS 00000000h (0) The operation was successfully completed.

-

DIOBM_ERROR_INVALID_ HANDLE

C0000003h (-1073741821)

The device handle is invalid.

Use the device handle returned by the DioBmOpen function.

DIOBM_ERROR_ INSUFFICIENT_BUFFER

C0000007h (-1073741817)

The data area passed to system call is too small.

An internal error occurred in the driver. Inform us of the condition the error occurred.

OBM_ERROR_IO_PENDING C0000008h (-1073741816)

Overlapped I/O operations are in progress.

Wait until the event is completed by the WaitForSingleObject function of Win32API.

DIOBM_ERROR_NOT_ SUPPORTED

C0000009h (-1073741815)

The function is not supported.

The error occurs, for example, if the DioBmOutputDword function is called by specifying a device handle of digital input device.

DIOBM_ERROR_MEMORY_ NOTALLOCATED

C0001000h (-1073737728)

Not enough memory Close application you do not use to increase available memory space.

DIOBM_ERROR_PARAMETER C0001001h (-1073737727)

The specified parameter is invalid.

The value specified for API function is invalid or out of possible range.

DIOBM_ERROR_INVALID_ CALL

C0001002h (-1073737726)

Invalid function is called.

The called function isn't available now.

DIOBM_ERROR_DRVCAL C0001003h (-1073737725)

Failed to call the driver.

Install the driver software.

DIOBM_ERROR_NULL_POINTER C0001004h (-1073737724)

A NULL pointer is passed between DLL and driver.

The system may have an error. Tell us erroneous situation and environment.

DIOBM_ERROR_IO_ INCOMPLETE

C0001005h (-1073737723)

Asynchronous I/O event is not in the signal status.

Wait until the asynchronous I/O event is completed.

DIOBM_ERROR_NOW_SAMPLING C0001006h (-1073737722)

The sampling is running now.

The specified function is not available while the sampling is running.

DIOBM_ERROR_STOP_ SAMPLING

C0001007h (-1073737721)

The sampling is stopped.

The specified sampling is not available while the sampling has been stopped.

DIOBM_ERROR_CREATE_ THREAD

C0001008h (-1073737720)

Failed to create the thread.

-

DIOBM_ERROR_ALREADY_SET_EVENT

C0001009h (-1073737719)

The function has already been registered.

Release the event settings by the DioBmKillEvent function and reconfigure the settings.

DIOBM_ERROR_DONT_SET_ EVENT

C000100Ah (-1073737718)

No available functions are registered.

Register events by the DioBmSetEvent or DioBmSetEventEx function.

Page 201: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

201

(Continued)

Error Code Value Description Comments/Solutions DIOBM_ERROR_DONT_SET_ BUFFER

C000100Bh (-1073737717)

No destination buffer is specified.

Specify a destination buffer address by the DioBmSetBufferConfig function.

DIOBM_ERROR_ANOTHER C000100Ch (-1073737716)

An unexpected error occurred.

-

Page 202: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

202

Chapter 5 Sample Programs 5.1 Execution Procedure

This product provides sample program files for C++, Visual Basic, and Delphi. Executable files of the sample programs are not included with this product. Compile the source code and create executable file to start. Visual C++ 1. Start Visual C++ (Visual Studio). 2. Select File > Open Workspace. 3. Open the makefile, *.mak. 4. Build the project file. 5. Run the executable file, *.exe. Visual Basic 1. Start Visual Basic. 2. Open the project file, *.vbp. 3. Build the project file. 4. Run the executable file, *exe. Delphi 1. Start Delphi. 2. Open the project file, *.dpr. 3. Build the project file. 4. Run the executable file, *.exe.

Page 203: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

203

5.2 List of Sample Programs Sample Program Description

DiBm This sample program inputs data in the sampling mode. DoBm This sample program outputs data in the pattern output mode. ExBm This sample program inputs and outputs data simultaneously in both the sampling

mode and pattern output mode. The sample program can be used in bi-directional digital input and output devices.

sampling This sample program is a simple program that inputs data in the sampling mode. patternout This sample program is a simple program that continuously outputs data in the

pattern output mode.

5.2.1 DiBm The DiBm sample program performs sampling input in the device opened by specifying the device name ("FBIDIOBMx"). The sample program is executed under the following conditions; - The number of samples is 1024;

- The data width is DWORD (32 bits), and - The sampling clock is 100 kHz.

The retrieved data is displayed after completion of DMA transfer of sampling data.

5.2.2 DoBm The DoBm sample program performs pattern output in the device opened by specifying the device name ("FBIDIOBMx"). The sample program is executed under the following conditions; - The number of samples is 1024;

- The data width is DWORD (32 bits), and - The sampling clock is 100 kHz.

The sample program waits until pattern data output is completed using interrupt events, then terminates the processing.

5.2.3 ExBm The ExBm sample program performs sampling input and pattern output in the input device and output device opened by specifying the device name ("FBIDIOBMx"). The sample program is executed under the following conditions; - The number of samples is 1024;

- The data width is DWORD (32 bits), and - The sampling clock is 100 kHz.

Specify a digital input circuit and digital output circuit of the same board because the input and output operations are started simultaneously at the software trigger. The sample program waits until the completion of DMA transfer of sampling data, then displays the retrieved data on the screen.

Page 204: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

204

5.2.4 sampling The sampling sample program performs pattern output in the device opened by specifying the device name ("FBIDIOBMx"). The sample program is executed under the following conditions; - The number of samples is 1024;

- The data width is DWORD (32 bits), and - The sampling clock is 100 kHz.

The sample program waits until the completion of DMA transfer of sampling data, then displays the retrieved data on the screen.

5.2.5 patternout The patternout sample program performs pattern output in the device opened by specifying the device name ("FBIDIOBMx"). The sample program is executed under the following conditions; - The number of samples is 1024;

- The data width is DWORD (32 bits), and - The sampling clock is 100 kHz.

The sample program waits until continuous data output is completed using interrupt events, then closes the device and terminates the processing.

Page 205: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

205

5.3 Programming Examples 5.3.1 C (32-bit Environment)

//==================================================================== // PCI bus master digital input/output device software for // Windows 7/Vista/XP/XP Embedded/Server 2003/2000/NT/Me/98/95 // Console application for C // // Copyright 2001,2006 Interface Corporation. All rights reserved. // // Description // The sample program is used for data sampling. //==================================================================== #include <windows.h>; #include <stdio.h>; #include "FbiDioBm.h"; void main(void) { HANDLE DeviceHandle; //Device handle DIOBMCONF DevConf; // Function setting structure DIOBMTRIGCONF TrigConf; // Trigger condition setting structure DWORD Buffer[1024]; // Bus master transfer buffer DWORD Status; // A variable to retrieve the status INT Ret; // Return value // Initialize FBIDIOBM1 of the bus maser digital input output products DeviceHandle = DioBmOpen("FBIDIOBM1"); if (DeviceHandle == INVALID_HANDLE_VALUE) { printf("FBIDIOBM1 is not available\n"); exit(0); // Exit program } DevConf.dwMode = DIOBM_MODE_SAMPLING; // Sampling mode DevConf.dwRedirectWidth = DIOBM_WIDTH_DWORD;

// Bus master transfer width: double word size DevConf.dwEQConf = 0; // Counter matching detection

//output signal: disabled DevConf.dwClock = DIOBM_CLK_100K; // Base clock:100kHz DevConf.dwSmplNum = 1024; // Number of samples:1024

Page 206: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

206

DevConf.dwTimingOption = 0; // Timing option: not specified DevConf.dwSTBConf = 0; // STB signal: disabled DevConf.dwACKConf = 0; // ACK signal: disabled DevConf.dwREQConf = 0; // REQ signal: disabled DevConf.dwOREConf = 0; // ORE signal: disabled DevConf.dwUREConf = 0; // URE signal: disabled // Configures the transfer mode, transfer data unit, sampling rate,

// and control signals Ret = DioBmSetDeviceConfig(DeviceHandle, &DevConf); if (Ret != DIOBM_ERROR_SUCCESS) { printf("Failed to configure the operation mode \n"); DioBmClose(DeviceHandle); // Close the device exit(0); // Exit program } TrigConf.dwSoftTrigger = 0; // Software trigger: disabled TrigConf.dwStartLine = 0; // START signal trigger: disabled TrigConf.dwEndLine = 0; // END signal trigger: disabled TrigConf.dwStopLine = 0; // STOP signal input: disabled TrigConf.dwTriggerDelayNum = 0; // Number of trigger delay:0

//(disabled) TrigConf.dwPatternEq = 0; // Pattern matching input: disabled TrigConf.dwPatternMask = 0; // Pattern matching valid bid: disabled TrigConf.dwPatternData = 0; // Pattern matching data: disabled // Configures the start, suspension, and termination conditions Ret = DioBmSetTriggerConfig(DeviceHandle, &TrigConf); if (Ret != DIOBM_ERROR_SUCCESS) { printf("Failed to configure the conditions \n"); DioBmClose(DeviceHandle); // Close the device exit(0); // Exit program } // Configures the bus master transfer buffer Ret = DioBmSetBufferConfig(DeviceHandle, Buffer, 1024 * sizeof(DWORD)); if (Ret != DIOBM_ERROR_SUCCESS) { printf("Failed to configure the buffer\n"); DioBmClose(DeviceHandle); // Close the device exit(0); // Exit program } // Starts the bus master transfer Ret = DioBmStart(DeviceHandle);

Page 207: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

207

if (Ret != DIOBM_ERROR_SUCCESS) { printf("Failed to specify the buffer \n"); DioBmClose(DeviceHandle); // Close the device exit(0); // Exit program } // Wait until the bus master transfer is completed do { // Retrieve the status DioBmGetStatus(DeviceHandle, &Status); } while (Status & DIOBM_STATUS_ACTIVE_DMA); // // After completion of bus master transfer, sampling data is stored // in Buffer // // Clean up and exit DioBmClose(DeviceHandle); }

5.3.2 C (64-bit Environment)

//==================================================================== // 64-bit PCI bus master digital input/output device software for // Windows 7/Vista/XP/XP Embedded/Server 2003/2000/NT/Me/98/95 // Console application for C // // Copyright 2011 Interface Corporation. All rights reserved. // // Description // The sample program is used for data sampling. //==================================================================== #include <windows.h>; #include <stdio.h>; #include "FbiDioBm.h"; void main(void) { HANDLE DeviceHandle; //Device handle DIOBMCONF DevConf; // Function setting structure

Page 208: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

208

DIOBMTRIGCONF TrigConf; // Trigger condition setting structure PVOID BufferPtr; // Pointer for bus master transfer buffer

DWORD Status; // A variable to retrieve the status INT Ret; // Return value PDWORD Buffer[1024]; // Pointer for bus master transfer // buffer (DWORD type)

DWORD BufferSize; // Busmaster transfer buffer size

// Initialize FBIDIOBM1 of the bus maser digital input output products DeviceHandle = DioBmOpen("FBIDIOBM1"); if (DeviceHandle == INVALID_HANDLE_VALUE) { printf("FBIDIOBM1 is not available\n"); exit(0); // Exit program } DevConf.dwMode = DIOBM_MODE_SAMPLING; // Sampling mode DevConf.dwRedirectWidth = DIOBM_WIDTH_DWORD;

// Bus master transfer width: double word size DevConf.dwEQConf = 0; // Counter matching detection

//output signal: disabled DevConf.dwClock = DIOBM_CLK_100K; // Base clock:100kHz DevConf.dwSmplNum = 1024; // Number of samples:1024 DevConf.dwTimingOption = 0; // Timing option: not specified DevConf.dwSTBConf = 0; // STB signal: disabled DevConf.dwACKConf = 0; // ACK signal: disabled DevConf.dwREQConf = 0; // REQ signal: disabled DevConf.dwOREConf = 0; // ORE signal: disabled DevConf.dwUREConf = 0; // URE signal: disabled // Configures the transfer mode, transfer data unit, sampling rate,

// and control signals Ret = DioBmSetDeviceConfig(DeviceHandle, &DevConf); if (Ret != DIOBM_ERROR_SUCCESS) { printf("Failed to configure the operation mode \n"); DioBmClose(DeviceHandle); // Close the device exit(0); // Exit program } TrigConf.dwSoftTrigger = 0; // Software trigger: disabled TrigConf.dwStartLine = 0; // START signal trigger: disabled TrigConf.dwEndLine = 0; // END signal trigger: disabled TrigConf.dwStopLine = 0; // STOP signal input: disabled TrigConf.dwTriggerDelayNum = 0; // Number of trigger delay:0

//(disabled)

Page 209: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

209

TrigConf.dwPatternEq = 0; // Pattern matching input: disabled TrigConf.dwPatternMask = 0; // Pattern matching valid bid: disabled TrigConf.dwPatternData = 0; // Pattern matching data: disabled // Configures the start, suspension, and termination conditions Ret = DioBmSetTriggerConfig(DeviceHandle, &TrigConf); if (Ret != DIOBM_ERROR_SUCCESS) { printf("Failed to configure the conditions \n"); DioBmClose(DeviceHandle); // Close the device exit(0); // Exit program } // Configures the bus master transfer buffer Ret = DioBmSetBufferConfig(DeviceHandle, (PVOID)-1, 1024 *

sizeof(DWORD));

if (Ret != DIOBM_ERROR_SUCCESS) { printf("Failed to configure the buffer\n"); DioBmClose(DeviceHandle); // Close the device exit(0); // Exit program } // Retrieves the pointer of bus master transfer buffer

Ret = DioBmGetBufferConfig(DeviceHandle, &BufferPtr, &BufferSize);

if (Ret != DIOBM_ERROR_SUCCESS) {

printf("Failed to retrieve the buffer pointer \n");

DioBmClose(DeviceHandle); // Close the device

exit(0); // Exit program

}

Buffer = (PDWORD)BufferPtr;

// Starts the bus master transfer Ret = DioBmStart(DeviceHandle); if (Ret != DIOBM_ERROR_SUCCESS) { printf("Failed to start the buffer \n"); DioBmClose(DeviceHandle); // Close the device exit(0); // Exit program } // Wait until the bus master transfer is completed do { // Retrieve the status DioBmGetStatus(DeviceHandle, &Status); } while (Status & DIOBM_STATUS_ACTIVE_DMA);

Page 210: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

210

// // After completion of bus master transfer, sampling data is stored // in Buffer // // Clean up and exit DioBmClose(DeviceHandle); }

Page 211: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

211

5.3.3 Visual Basic (32 bit)

'===================================================================== ' PCI bus master digital input/output device software for ' Windows 7/Vista/XP/XP Embedded/Server 2003/2000/NT/Me/98/95 ' Visual Basic ' ' Copyright 2001,2011 Interface Corporation. All rights reserved. ' ' Description ' The sample program is used for data sampling. '===================================================================== Dim DeviceHandle As Long ' Device handle Dim WorkDeviceName As String * 16 ' Storage area for device name Dim DevConf As DIOBMCONF ' Function setting structure Dim TrigConf As DIOBMTRIGCONF ' Trigger condition setting structure Dim Buffer(0 To 1023) As Long ' Bus master transfer buffer Dim Status As Long ' A variable to retrieve the status Dim Ret As Long ' Return value WorkDeviceName = "FBIDIOBM1" & Chr(0) DeviceHandle = DioBmOpen(WorkDeviceName) If DeviceHandle = -1 Then Ret = MsgBox("FBIDIOBM1 is not available", _ (vbOKOnly + vbCritical), "FBIDIOBM1") Unload Me End If DevConf.dwMode = DIOBM_MODE_SAMPLING DevConf.dwRedirectWidth = DIOBM_WIDTH_DWORD DevConf.dwEQConf = 0 DevConf.dwClock = DIOBM_CLK_100K DevConf.dwSmplNum = 1024 DevConf.dwTimingOption = 0 DevConf.dwSTBConf = 0 DevConf.dwACKConf = 0 DevConf.dwREQConf = 0 DevConf.dwOREConf = 0 DevConf.dwUREConf = 0 Ret = DioBmSetDeviceConfig(DeviceHandle, DevConf) If Ret <> DIOBM_ERROR_SUCCESS Then Ret = MsgBox("Failed to configure the operation mode", vbOKOnly + vbCritical) Ret = DioBmClose(DeviceHandle)

Page 212: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

212

Unload Me End If TrigConf.dwSoftTrigger = 0 TrigConf.dwStartLine = 0 TrigConf.dwEndLine = 0 TrigConf.dwStopLine = 0 TrigConf.dwTriggerDelayNum = 0 TrigConf.dwPatternEq = 0 TrigConf.dwPatternMask = 0 TrigConf.dwPatternData = 0

Ret = DioBmSetTriggerConfig(DeviceHandle, TrigConf) If Ret <> DIOBM_ERROR_SUCCESS Then Ret = MsgBox("Failed to configure the conditions", vbOKOnly + vbCritical) Ret = DioBmClose(DeviceHandle) Unload Me End If Ret = DioBmSetBufferConfig(DeviceHandle, Buffer(0), 1024 * 4) If Ret <> DIOBM_ERROR_SUCCESS Then Ret = MsgBox("Failed to configure the buffer setting", vbOKOnly + vbCritical) Ret = DioBmClose(DeviceHandle) Unload Me End If Ret = DioBmStart(DeviceHandle) If Ret <> DIOBM_ERROR_SUCCESS Then Ret = MsgBox("Failed to specify the buffer", vbOKOnly + vbCritical) Ret = DioBmClose(DeviceHandle) Unload Me End If Do Ret = DioBmGetStatus(DeviceHandle, Status) Loop While Status And DIOBM_STATUS_ACTIVE_DMA Ret = DioBmClose(DeviceHandle)

Page 213: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

213

5.3.4 Visual Basic (64-bit)

'===================================================================== ' 64-bit PCI bus master digital input/output device software for ' Windows 7/Vista/XP/XP Embedded/Server 2003/2000/NT/Me/98/95 ' Visual Basic ' ' Copyright 2011 Interface Corporation. All rights reserved. ' ' Description ' The sample program is used for data sampling. '===================================================================== ' Declare RtlMoveMemory of WinAPI function as an external procedure

Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" (Destination

As Any, Source As Any, ByVal Length As Long)

Dim DeviceHandle As Long ' Device handle Dim WorkDeviceName As String * 16 ' Storage area for device name Dim DevConf As DIOBMCONF ' Function setting structure Dim TrigConf As DIOBMTRIGCONF ' Trigger condition setting structure Dim Buffer(0 To 1023) As Long ' Bus master transfer buffer Dim Status As Long ' A variable to retrieve the status Dim Ret As Long ' Return value

Dim BufferPtr As Long ' Bus master transfer buffer pointer

Dim BufferSize As Long ' Bus master transfer buffer size

WorkDeviceName = "FBIDIOBM1" & Chr(0) DeviceHandle = DioBmOpen(WorkDeviceName) If DeviceHandle = -1 Then Ret = MsgBox("FBIDIOBM1 is not available", _ (vbOKOnly + vbCritical), "FBIDIOBM1") Unload Me End If DevConf.dwMode = DIOBM_MODE_SAMPLING DevConf.dwRedirectWidth = DIOBM_WIDTH_DWORD DevConf.dwEQConf = 0 DevConf.dwClock = DIOBM_CLK_100K DevConf.dwSmplNum = 1024 DevConf.dwTimingOption = 0 DevConf.dwSTBConf = 0 DevConf.dwACKConf = 0 DevConf.dwREQConf = 0 DevConf.dwOREConf = 0 DevConf.dwUREConf = 0

Page 214: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

214

Ret = DioBmSetDeviceConfig(DeviceHandle, DevConf) If Ret <> DIOBM_ERROR_SUCCESS Then Ret = MsgBox("Failed to configure the operation mode", vbOKOnly + vbCritical) Ret = DioBmClose(DeviceHandle) Unload Me End If TrigConf.dwSoftTrigger = 0 TrigConf.dwStartLine = 0 TrigConf.dwEndLine = 0 TrigConf.dwStopLine = 0 TrigConf.dwTriggerDelayNum = 0 TrigConf.dwPatternEq = 0 TrigConf.dwPatternMask = 0 TrigConf.dwPatternData = 0 Ret = DioBmSetTriggerConfig(DeviceHandle, TrigConf) If Ret <> DIOBM_ERROR_SUCCESS Then Ret = MsgBox("Failed to configure the conditions", vbOKOnly + vbCritical) Ret = DioBmClose(DeviceHandle) Unload Me End If Ret = DioBmSetBufferConfig(DeviceHandle, Buffer(0), 1024 * 4) If Ret <> DIOBM_ERROR_SUCCESS Then Ret = MsgBox("Failed to configure the buffer setting", vbOKOnly + vbCritical) Ret = DioBmClose(DeviceHandle) Unload Me End If ' Retrieves the bus master transfer buffer pointer Ret = DioBmGetBufferConfig(DeviceHandle, BufferPtr , BufferSize) If Ret <> DIOBM_ERROR_SUCCESS Then Ret = MsgBox("Failed to retrieve the buffer pointer", vbOKOnly + vbCritical) Ret = DioBmClose(DeviceHandle) ' Close device Unload Me ' Close the form End If

Ret = DioBmStart(DeviceHandle) If Ret <> DIOBM_ERROR_SUCCESS Then Ret = MsgBox("Failed to specify the buffer", vbOKOnly + vbCritical) Ret = DioBmClose(DeviceHandle)

Page 215: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

215

Unload Me End If Do Ret = DioBmGetStatus(DeviceHandle, Status) Loop While Status And DIOBM_STATUS_ACTIVE_DMA CopyMemory Buffer(0), ByVal BufferPtr, 1024 * 4

Ret = DioBmClose(DeviceHandle)

Page 216: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

216

5.3.5 Delphi (32-bit)

//

======================================================================

// PCI bus master digital input/output device software for

// Windows 7/Vista/XP/XP Embedded/Server 2003/2000/NT/Me/98/95

// Programming example for Delphi

//

// Copyright 2001,2011 Interface Corporation. All rights reserved.

//

// Description

// The sample program inputs/outputs data.

//

======================================================================

var

DeviceHandle: THandle; // Device handle

DeviceName: array[0..15] of Char; //Device name storing region

DevConf: DIOBMCONF; // Function setting structure

TrigConf: DIOBMTRIGCONF; // Trigger condition setting

Buffer; array[0..1023] of DWORD; // Bus master transfer buffer

Status: DWORD; // Variable to retrieve status

Ret: Integer; // Return value

begin

// Initialize FBIDIOBM1 of the bus maser digital input output products

StrCopy(DeviceName,'FBIDIOBM1');

DeviceHandle := DioBmOpen(@DeviceName[0]);

if DeviceHandle = $ffffffff then begin

MessageDlg('FBIDIOBM1 is not available', mtInformation, [mbOK], 0);

Close; // Close the form

end;

DevConf.dwMode := DIOBM_MODE_SAMPLING; // Sampling mode

DevConf.dwRedirectWidth := DIOBM_WIDTH_DWORD; // Transfer width:

// double word

DevConf.dwEQConf := 0;// Counter matching detection output signal:

disabled

DevConf.dwClock := DIOBM_CLK_100K; // Base clock:100kHz

DevConf.dwSmplNum := 1024; // Number of samples:1024

DevConf.dwTimingOption := 0; // Timing option: not specified

DevConf.dwSTBConf := 0; // STB signal: disabled

DevConf.dwACKConf := 0; // ACK signal: disabled

Page 217: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

217

DevConf.dwREQConf := 0; // REQ signal: disabled

DevConf.dwOREConf := 0; // ORE signal: disabled

DevConf.dwUREConf := 0; // URE signal: disabled

// Configures the transfer mode, transfer data unit, sampling rate, and

// control signals

Ret := DioBmSetDeviceConfig(DeviceHandle, DevConf);

if Ret <> DIOBM_ERROR_SUCCESS then begin

MessageDlg('Failed to configure the operation mode', mtInformation,

[mbOK], 0);

DioBmClose(DeviceHandle); // Close the device

Close; // Close the form

end;

TrigConf.dwSoftTrigger := 0; // Software trigger: disabled

TrigConf.dwStartLine := 0; // START signal input: disabled

TrigConf.dwEndLine := 0; // END signal input: disabled

TrigConf.dwStopLine := 0; // STOP signal input: disabled

TrigConf.dwTriggerDelayNum := 0; // Number of trigger delay:0(disabled)

TrigConf.dwPatternEq := 0; // Pattern matching input: disabled

TrigConf.dwPatternMask := 0; // Pattern matching valid bid: disabled

TrigConf.dwPatternData := 0; // Pattern matching data: disabled

// Configures the start, suspension, and termination conditions

Ret := DioBmSetTriggerConfig(DeviceHandle, TrigConf);

if Ret <> DIOBM_ERROR_SUCCESS then begin

MessageDlg('Failed to configure the conditions', mtInformation, [mbOK],

0);

DioBmClose(DeviceHandle); // Close the device

Close; // Close the form

end;

// Configures the bus master transfer buffer Ret := DioBmSetBufferConfig(DeviceHandle, @Buffer[0], 1024 *

SizeOf(DWORD));

if Ret <> DIOBM_ERROR_SUCCESS then begin

MessageDlg('Failed to configure buffer', mtInformation, [mbOK], 0);

DioBmClose(DeviceHandle); // Close the device

Close; // Close the form

end;

// Starts the bus master transfer

Ret := DioBmStart(DeviceHandle);

if Ret <> DIOBM_ERROR_SUCCESS then begin

MessageDlg('Cannot start busmaster transfer', mtInformation, [mbOK],

0);

Page 218: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

218

DioBmClose(DeviceHandle); // Close the device

Close; // Close the form

end;

// Wait until the bus master transfer is completed

repeat

// Retrieve the status

DioBmGetStatus(DeviceHandle, Status);

until not(Status and DIOBM_STATUS_ACTIVE_DMA);

//

// After completion of bus master transfer, sampling data is stored in

// Buffer

//

// Close the busmaster digital input/output device

DioBmClose(DeviceHandle);

end;

Page 219: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

219

5.3.6 Delphi (64-bit)

//

======================================================================

// PCI bus master digital input/output device software for // Windows 7/Vista/XP/XP Embedded/Server 2003/2000/NT/Me/98/95 // Programming example for Delphi

//

// Copyright 2011 Interface Corporation. All rights reserved.

//

// Description // The sample program inputs/outputs data.

//

======================================================================

var

DeviceHandle: THandle; // Device handle

DeviceName: array[0..15] of Char; // device name storing region

DevConf: DIOBMCONF; // Function setting structure

TrigConf: DIOBMTRIGCONF; // Trigger condition setting structure

Buffer; Pointer; // Bus master transfer buffer

Status: DWORD; // Variable to retrieve status

BufferSize: DWORD; // Bus master transfer buffer size

Ret: Integer; // Return value

begin

// Initialize FBIDIOBM1 of the bus maser digital input output products

StrCopy(DeviceName,'FBIDIOBM1');

DeviceHandle := DioBmOpen(@DeviceName[0]);

if DeviceHandle = $ffffffff then begin

MessageDlg('FBIDIOBM1 is not available', mtInformation, [mbOK], 0);

Close; // Close the form

end;

DevConf.dwMode := DIOBM_MODE_SAMPLING; // Sampling mode

DevConf.dwRedirectWidth := DIOBM_WIDTH_DWORD; // Transfer width:

// double word

DevConf.dwEQConf := 0; // Counter matching detection output signal:

// disabled DevConf.dwClock := DIOBM_CLK_100K; // Base clock:100kHz

DevConf.dwSmplNum := 1024; // Number of samples:1024

DevConf.dwTimingOption := 0; // Timing option: not specified

DevConf.dwSTBConf := 0; // STB signal: disabled

DevConf.dwACKConf := 0; // ACK signal: disabled

Page 220: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

220

DevConf.dwREQConf := 0; // REQ signal: disabled

DevConf.dwOREConf := 0; // ORE signal: disabled

DevConf.dwUREConf := 0; // URE signal: disabled

// Configures the transfer mode, transfer data unit, sampling rate, // and control signals

Ret := DioBmSetDeviceConfig(DeviceHandle, DevConf);

if Ret <> DIOBM_ERROR_SUCCESS then begin

MessageDlg(' Failed to configure the operation mode', mtInformation,

[mbOK], 0);

DioBmClose(DeviceHandle); // Close the device

Close; // Close the form

end;

TrigConf.dwSoftTrigger := 0; // Software trigger: disabled

TrigConf.dwStartLine := 0; // START signal trigger: disabled TrigConf.dwEndLine := 0; // END signal trigger: disabled

TrigConf.dwStopLine := 0; // STOP signal input: disabled

TrigConf.dwTriggerDelayNum := 0; // Number of trigger delay:0(disabled) TrigConf.dwPatternEq := 0; // Pattern matching input: disabled

TrigConf.dwPatternMask := 0; // Pattern matching valid bid: disabled TrigConf.dwPatternData := 0; // Pattern matching data: disabled

// Configures the start, suspension, and termination conditions

Ret := DioBmSetTriggerConfig(DeviceHandle, TrigConf);

if Ret <> DIOBM_ERROR_SUCCESS then begin

MessageDlg('Failed to configure the conditions ', mtInformation, [mbOK],

0);

DioBmClose(DeviceHandle); // Close the device

Close; // Close the form

end;

// Configures the bus master transfer buffer Ret := DioBmSetBufferConfig(DeviceHandle, Pointer(-1), 1024 *

SizeOf(DWORD));

if Ret <> DIOBM_ERROR_SUCCESS then begin

MessageDlg('Failed to configure buffer', mtInformation, [mbOK], 0);

DioBmClose(DeviceHandle); // Close the device

Close; // Close the form

end;

// Retrieves a pointer of bus master transfer buffer

Ret := DioBmGetBufferConfig(DeviceHandle, Buffer, BufferSize);

if Ret <> DIOBM_ERROR_SUCCESS then begin

MessageDlg('failed to retrieve buffer pointer', mtInformation, [mbOK],

Page 221: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

221

0);

DioBmClose(DeviceHandle); // Close the device

Close; // Close the form

end;

// Starts the bus master transfer

Ret := DioBmStart(DeviceHandle);

if Ret <> DIOBM_ERROR_SUCCESS then begin

MessageDlg('Cannot start busmaster transfer', mtInformation, [mbOK],

0);

DioBmClose(DeviceHandle); // Close the device

Close; // Close the form

end;

// Wait until the bus master transfer is completed

repeat

// Retrieve the status

DioBmGetStatus(DeviceHandle, Status);

until not(Status and DIOBM_STATUS_ACTIVE_DMA);

//

// After completion of bus master transfer, sampling data is stored in

// Buffer

// Close the busmaster digital input/output device

DioBmClose(DeviceHandle);

end;

Page 222: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

222

Chapter 6 Data Format 6.1 Data Size

Interface bus master digital input/output devices can change the number of input/output channels. The following table shows the correspondence of the boards or cards and input/output data width.

Models

Data Width (bit) PCI-2172C PCI-2472C

PCI-2772C LPC-291144 LPC-292144 PEX-291144 PEX-292144 CPZ-291244 CPZ-292244

CBI/CSI-291144 CBI/CSI-292144

4 Not supported Not supported Supported 8 (BYTE) Supported Supported Supported

12 Not supported Not supported Supported 16 (WORD) Supported Supported Supported

20 Not supported Not supported Supported 24 Not supported Not supported Supported 28 Not supported Not supported Supported

32 (DWORD) Supported Supported Supported

Data format stored in data area or application and output data format

One channel of data corresponds to 1 bit. When a data is less than 32 bits, the data is packed into 32 bit size. Depending on the number of the channels, unused (indefinite value) bits are included in the 32-bit data after packing.

Page 223: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

223

6.2 Data Packing The following table shows the data packing for the PCI-2172C, PCI-2472C, and PCI-2772C.

Data Width (bit) 32 bit

bit31 to bit28

bit27 to bit24

bit23 to bit20

bit19 to bit16

bit15 to bit12

bit11 to bit8

bit7 to bit4

bit3 to bit0

8 7 6 5 4 3 2 1 4

bit31 ….. bit24 bit23 ….. bit16 bit15 ….. bit8 bit7 ….. bit0

4 3 2 1 8 (BYTE)

bit31 ….. bit24 bit23 ….. bit12 bit11 ….. bit0

Not used 2 1 12 Reserved

bit31 ….. bit16 bit15 ….. bit02 1 16

(WORD)

bit31 ….. bit20 bit19 ….. bit0Not used 1 20 Reserved

bit31 ….. bit24 bit23 ….. bit0Not used 1 24 Reserved

bit31 to bit28 bit27 ….. bit0

Not used 1 28

Reserved bit31 ….. bit0

1 32 (DWORD)

Page 224: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

224

The following table shows the data packing for the CPZ-291244, CPZ-292244, LPC-291144, LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, and CBI/CSI-292144.

Data Width (bit) 32 bit

bit31 to bit28

bit27 to bit24

bit23 to bit20

bit19 to bit16

bit15 to bit12

bit11 to bit8

bit7 to bit4

bit3 to bit0

8 7 6 5 4 3 2 1 4

bit31 ….. bit24 bit23 ….. bit16 bit15 ….. bit8 bit7 ….. bit0

4 3 2 1 8 (BYTE)

bit31 ….. bit28 Bit27 ….. bit16 Bit15 …..

bit12 Bit11 ….. bit0

Not used 2 Not used 1 12

Reserved Reserved bit31 ….. bit16 bit15 ….. bit0

2 1 16 (WORD)

bit31 ….. bit20 bit19 ….. bit0

Not used 1 20 Reserved

bit31 ….. bit24 bit123 ….. bit0 Not used 1 24 Reserved

bit31 to bit28 bit27 ….. bit0

Not used 1 28

Reserved Bit31 ….. bit0

1 32 (DWORD)

Note: * In case of 12-bit data size, the data packing of the CPZ-291244, CPZ-292244, LPC-291144,

LPC-292144, PEX-291144, PEX-292144, CBI/CSI-291144, CBI/CSI-292144 differs from the data packing of the PCI-2172C, PCI-2472C, PCI-2772C.

Page 225: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

225

Chapter 7 Utility Programs 7.1 Bus Master Digital Input Utility Program

1. Click the Start button, point to Programs, point to Interface GPF-2X72C, then click DiBmUtil. 2. The Open New Board dialog box will appear. 3. Click the Find Boards button to enumerate boards or cards installed on the computer. Select the

board or card type to diagnose, and then click OK. When you use two or more boards or cards, specify an unique number of the RSW1 rotary switch to each board or card.

4. All input signals will be displayed. LEDs on the screen glow red when the status of the signals is high.

They glow black when the status of the signals is low. 5. Click Exit on the File menu to terminate the program.

7.2 Bus Master Digital Output Utility Program 1. Click the Start button, point to Programs, point to Interface GPF-2X72C, then click DoBmUtil. 2. The Open New Board dialog box will appear. 3. Click the Find Boards button to enumerate boards installed on the computer. Select the board or card

type to diagnose, and then click OK.When you use two or more boards or cards, specify a unique number of the RSW1 rotary switch to each board or card.

4. To change the status of output signal, click the corresponding button on the screen. The status of

signals is high while LEDs on the screen glow red. They are low while LEDs on the screen glow black. The commands to turn on and off all OUT pins are available from the menu.

5. Click Exit on the File menu to terminate the program.

Page 226: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

7.3 CardBus ID Configuration Utility Program This utility program can configure the CardBus ID number. The ID number on each Interface CardBus card is used to uniquely identify each card, in case multiple Interface CardBus cards of the same type are installed in the same system. This ID number for CardBus card is the same meaning as the rotary switch number for PCI/CompactPCI products. Therefore, the CardBus ID number is appeared as the rotary switch number (RSW1) on the diagnostic program or device manager.

7.3.1 Configuring the ID Number 1. After installing the driver software, click the Start button and point to Settings, and then click

Control Panel. 2. Double-click Interface CardBus ID Utility, and then the CardBus ID Utility dialog box will appear.

Item Description Bus (hex) Bus number in hexadecimal Dev (hex) Device number in hexadecimal Func (hex) Function number in hexadecimal Board type Model ID Number (hex) CardBus ID number in hexadecimal

3. Select a card that you want to set the ID number. Then, another CardBus ID Utility dialog box will

appear.

Notes: - Selectable ID number is in the range of 0h through Fh. - To recognize the card which changed the ID number, remove the card and insert it or restart the system. - To identify each card, put an attached sticker with the ID number on the card.

Copyright 2002, 2015 Interface Corporation. All rights reserved.

226

Page 227: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

227

7.4 Memory Size Configuration Utility This utility is dedicated to the 64-bit environment. 1. Starting the utility

Click Start > Programs > Interface GPF-2X72C > DioBmMem to start Memory Size Configuration Utility.

2. Selecting a board Select a device to be configured from combo box. After selecting a device, the allocated memory

size is displayed in the allocated size column. 3. Configuring the memory size Type the memory size to be allocated in the allocated size column in hexadecimal number. Then,

click OK. If the program failed to configure the memory allocation, an error message dialog box appears. To configure multiple devices, repeat the procedures 2 and 3.

4. Closing the utility program After the configuration, a dialog box will prompt you to restart Windows to reflect the settings. To reflect the change of size, you need to restart the operating system. After the operating system

restarts and DioBmMem.exe is executed, the allocated size will be displayed the allocated size column.

(Note) Depending on your computer environment, the specified physical memory may not be allocated.

Allocate the comfortable memory size by your self.

Page 228: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

228

Chapter 8 How to Use .NET 8.1 Overview

This chapter explains how to use the GPF-2X72C for .NET. The following table shows supported languages.

Microsoft Visual C++ .NET 2002, 2003, 2005, 2008, 2010, 2012, 2013 Microsoft Visual C# .NET 2002, 2003, 2005, 2008, 2010, 2012, 2013 Microsoft Visual Basic .NET 2002, 2003, 2005, 2008, 2010, 2012, 2013

Supported Languages

Borland Delphi 8 for the Microsoft .NET Framework

8.2 Class Library This product includes the source files of the class library. Creating the class library from the source files makes it easier to define DLL functions. (To customize DLL function call, refer to the class library sources.) The IFCDIOBM class is a definition for x86 and left for compatibility with the previous versions. To create a new application, use the definition of the IFCDIOBM_ANY class (x86, x64 shared).

8.2.1 Creating the Class Library To call DLL functions on .NET, you need to prepare class library first. Visual C# .NET

1. Start Visual Studio. 2. Open the following project file.

<installation destination> \interface\GPF2X72C\samples\CS_NET\IFCDIOBM\bin\release\ifcdiobm.dll

After building the project file, IFCDIOBM.DLL is created in the bin folder. Visual Basic .NET

1. Start Visual Studio. 2. Open the following project file.

<installation destination> \interface\GPF2X72C\samples\VB_NET\IFCDIOBM\bin\release\ifcdiobm.dll

After building the project file, IFCDIOBM.DLL is created in the bin folder. Borland Delphi 8 for the Microsoft .NET Framework

1. Start Visual Studio. 2. Open the following project file.

<installation destination> \interface\GPF2X72C\samples\DELPHI_NET\IFCDIOBM\IFCDIOBM.DLL

After building the project file, IFCDIOBM.DLL is created in the bin folder.

Page 229: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

229

8.2.2 Adding Class Library Reference Visual C# .NET Visual Basic .NET, and Borland Delphi 8 for the Microsoft .NET Framework 1. Start Visual Studio. 2. Select Project > Add Reference. 3. Click the Browse button. 4. Specify the class library DLL to refer.

<installation destination> \interface\GPF2X72C\samples\CS_NET\IFCDIOBM\bin\release\ifcdiobm.dll

<installation destination> \interface\GPF2X72C\samples\VB_NET\IFCDIOBM\bin\release\ifcdiobm.dll

<installation destination> \interface\GPF2X72C\samples\DELPHI_NET\IFCDIOBM\IFCDIOBM.DLL

5. The DLL file will be displayed in Selected Components. 6. Click OK. 7. Add the namespace of InterfaceCorpDllWrap as below at the header of your source file to call the DLL functions. Visual C# .NET using InterfaceCorpDllWrap; Visual Basic .NET Imports InterfaceCorpDllWrap Borland Delphi 8 for the Microsoft .NET Framework uses InterfaceCorpDllWrap,InterfaceCorpDllWrap.IFCDIOBM;

Page 230: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

230

Chapter 9 Sample Programs for .NET

This chapter describes the outline of sample programs prepared for each .NET language.

9.1 Execution Procedure The GPF-2X72C has sample programs for Visual C# .NET, Visual Basic .NET, and Borland Delphi 8 for the Microsoft .NET Framework. Sample program for Visual C# .NET and Visual Basic .NET are created with Visual Studio .NET 2003. These sample programs are created by referring to the project in the class library. Execution procedure Executable files of the sample programs are not included with this product. Compile the source code and create executable file to start. Visual C++ (Microsoft Visual C++ .NET 2003 through 2008) 1. Start Visual Studio. 2. Select File > Open > Project. 3. Open the project file, *.vcproj. 4. Build the project file. 5. Run the executable file, *.exe. Visual C++ (Microsoft Visual C++ .NET2010 and later versions ) 1. Start Visual Studio. 2. Select File > Open > Project. 3. Open the project file, *.vcxproj. 4. Build the project file. 5. Run the executable file, *.exe. Note: The *.vcxproj file is created with Visual Studio 2010. To use the file in a later version than Visual

Studio 2010, configure as follows. 1. In Visual Studio, select Project > Properties > Configuration Properties > General. 2. Select Platform Toolset and then select toolset you want from the drop-down list. For example, if you use Visual Studio 2012, select Visual Studio 2012(v110).

Visual C# .NET 1. Start Visual Studio. 2. Select File > Open > Project. 3. Open the project file, *.csproj. 4. Build the project file. 5. Run the executable file, *.exe.

Page 231: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

231

Visual Basic .NET 1. Start Visual Studio. 2. Select File > Open > Project. 3. Open the project file, *.vbproj. 4. Build the project file. 5. Run the executable file, *.exe. Borland Delphi 8 for the Microsoft .NET 1. Start Delphi. 2. Open the project file, *.dpr. 3. Build the project file. 4. Run the executable file, *.exe. Note: The class library will be automatically built at the same time as opening the project files.

Page 232: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

232

9.2 List of Sample Programs The outline of each sample program is as follows.

Sample program Description

DiBm_Cs This sample program performs pattern output with a bus master digital input device. (Visual C# .NET)

DoBm_Cs This sample program performs pattern output with a bus master digital output device. (Visual C# .NET)

ExBm_Cs This sample program performs sampling and pattern output with a bus master digital input/output device. (Visual C# .NET)

DiBm_Vb This sample program performs pattern output with a bus master digital input device. (Visual Basic .NET)

DoBm_Vb This sample program performs pattern output with a bus master digital output device. (Visual Basic .NET)

ExBm_Vb This sample program performs sampling and pattern output with a bus master digital input/output device. (Visual Basic .NET)

DiBm_D This sample program performs pattern output with a bus master digital input device. (Borland Delphi 8 for the Microsoft .NET) Framework

DoBm_D This sample program performs pattern output with a bus master digital output device. (Borland Delphi 8 for the Microsoft .NET Framework)

ExBm_D This sample program performs sampling and pattern output with a bus master digital input/output device. (Borland Delphi 8 for the Microsoft .NET Framework)

Page 233: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

233

Chapter 10 Terms of Use 10.1 Limited Warranty

Interface Corporation does not warrant uninterrupted or error-free operations of the software product. The entire risks as to the quality or arising out of use or performance of the software products, if any, remains with you. Interface believes that information contained in the document is accurate. The document is carefully reviewed for technical accuracy. Interface reserves the right to make changes to subsequent editions of this document without prior notice to holders of this edition. Interface is not liable for any damages arising out of or related to this document or the information contained in it. Charts and tables contained in this document are only for illustration purposes and may vary depending upon a user's specific application.

10.2 Copyrights and Intellectual Property Rights Interface Corporation owns all titles and intellectual property rights in and to the products. The products include the software, audio/visual content such as images, texts, or pictures.

10.3 Warning Regarding Medical and Clinical Use of Our Products Our products are not designed for components intended to ensure a level of reliability suitable for use under conditions that might cause serious injury or death. Our products are not designed with components and testing instrument intended to ensure a level of reliability suitable for use in treatment and diagnosis of human. Applications of our products involving medical or clinical treatment can create a potential for accidental injury caused by product failure, or by errors on the part of the user or application engineer.

10.4 Prohibition of Reproduction No part of this document may be reproduced or changed in any form without the prior consent of Interface Corporation.

Page 234: GPF-2X72C - Interface...The GPF-2X72C controls Interface bus master digital input/output products from your application running on Windows. Application software should link a provided

GPF-2X72C Help for Windows

Copyright 2002, 2015 Interface Corporation. All rights reserved.

234

10.5 Limitation of Liability

Interface Corporation will not be liable for any special, incidental, indirect or consequential damages whatsoever even if Interface Corporation or any reseller could foresee the possibility of damages. Users shall assume any subsequent risks whatsoever resulting from such as using and installing this product. Interface Corporation shall not be liable for any incidental or consequential damages, including damages or other costs resulting from defects which might be contained in the product, product supply delay or product failure. Customer's right to recover damages caused by fault or negligence on the part of Interface Corporation shall be limited exclusively to product replacement. This product is designed under Japanese domestic specifications. Interface Corporation is not responsible for the use of this product outside Japan. We do not offer any maintenance service or technical support abroad. Interface Corporation is not liable for any damage arising from the included document or information.

10.6 Trademark Products and company names are trademarks, registered trademarks, or servicemarks of their respective owners.