Sie sind auf Seite 1von 13

ANNEXURE: 1 DYNALOG PCI CARD PROGRAMMING CONCEPTS

INTRODUCTION
DYNAAPI32-LV is the LabView interface to Dynalog DYNAAPI32 programming library, which provides a collection of Virtual Instruments (VIs) and Controls for the LabView Programming Environment by National Instruments. These VIs correspond to the functions available in the DYNAAPI32 programming library. An understanding of DYNAAPI32 request structures, event handling and APIs will enhance the programmers ability to use them.

REQUIREMENTS
DYNAAPI32-LV requires DYNAAPI32 DLLs and system files be installed on the system. The DYNAAPI32 configuration utility is required to configure the hardware configuration data file after installation and before the first use by DYNAAPI32-LV. DYNAAPI32-LV (32-bit) requires LabView 5.x and will run under Windows 95/98/2000 and Windows NT 4.0.

INSTALLATION AND CONFIGURATION


The DYNAAPI32-LV installation program will copy the required files to your system. DYNAAPI32-LV VIs and controls are copied to the following location by default: [Target Drive]: Program Files\ Dynalog\ Labview Support. Complete the following steps to add the DYNAAPI32-LV VI and controls to your tools palette. 1. From Labview panel menu select Window | Show Diagram. 2. Form Labview Diagram menu select Window | Show Function Palette. 3. In Function Palette select Option button on top. 4. Form Option button select Edit Palette. 5. Form Edit Palette select form Palette set | new setup. 6. In Dialog box Enter name Dynalog and OK it.

7. In Palette Set as Dynalog Right click on an empty spot on the functions palette and select Insert-->Submenu. 8. From the option box, which appears, select the Link to Existing Menu File (.mnu) [Dynalog.mnu] option. 9. Use the browse dialog and find DYNALOG.MNU in the [Target Install Drive]:\ DYNALOG\ DYNALOG DRIVER FOR WINDOWS 2000\ LABVIEW directory 10. Include the following path in Labview environment Tools | Options | Paths | VI Search Path | Uncheck "Use Default" | Browse [Target Install Drive]:\ DYNALOG\ DYNALOG DRIVER FOR WINDOWS 2000\

LABVIEW\DRIVERVI\* directory. Click on Select Cur Dir and insert after the last path entry. 11. Copy contents of [Target Install Drive]:\ DYNALOG\ DYNALOG DRIVER FOR WINDOWS 2000\ LABVIEW\DRIVERVI\ LabView Help directory to Installed directory of LabView \ Help.

DEVICE IO FUNCTION
Getnoofdeviceinfo

This Function returns the number of device registered by Device registration utility. ErrorIn (UI32) (Input): It contains error information, which can be coming from some previous function. ErrorIn is zero (No error) then function will execute. If ErrorIn is more than zero function will pass the error without execution.

NumOfDeviceRegistered (U8 array) (Output): Number of device registered by Device registration utility. DeviceType (U16 array) (Output): Type of Device type BoardID (U8 array) (Output): For identification different devices with same DeviceType. DeviceNum (UI32 array) (Output): Number of the hardware used in the Device registration utility. ErrorOut (UI32) (Output): It contains error information. If ErrorIn indicated an error, ErrorOut contains the same error information. describes the error status of this function. Otherwise, it

DeviceOpen

DeviceOpen must be called before any other functions that use DriverHandle as a parameter. It retrieves the information related to the device required for its operation from the Windows Registry and allocates memory to store it for quick reference. For the devices with digital output channels, this function also sets all the output bits to their power-up state and remembers the state. It also configures the DIO ports either to input or output mode as set in Device Registration utility. Opens the device, Returns the Driver Handle used by other function. Device Open reads the adapter information from System Registry allocates memory to it for quick reference and initializes the hardware device. DeviceNum (UI32) (Input): Number of the hardware used in the Device registration utility. ErrorIn (UI32) (Input): It contains error information, which can be coming from some previous function. ErrorIn is zero (No error) then function will execute. If ErrorIn is more than zero function will pass the error without execution.
3

DriverHandle (UI32) (Output): This value is used to identify the hardware. This is the reference to device specific configuration information stored in the registry. This information will be used in different function.

ErrorOut (UI32) (Output): It contains error information. If ErrorIn indicated an error, ErrorOut contains the same error information. describes the error status of this function. Otherwise, it

DeviceClose

DeviceClose releases the memory allocated in the DeviceOpen function. Before terminating or exiting from an application you must always close all the devices, which were opened. Closing of device means all the resources allocated are freed. DriverHandle (UI32) (Input): This value is used to identify the hardware. This is the reference to device specific configuration information stored in the registry and to be used in this function. ErrorIn (UI32) (Input): It contains error information, which can be coming from some previous function. ErrorIn is zero (No error) then function will execute. If ErrorIn is more than zero function will pass the error without execution. ErrorOut (UI32) (Output): It contains error information. If ErrorIn indicated an error, ErrorOut contains the same error information. describes the error status of this function. Otherwise, it

DIGITAL IO FUNCTION
DioWriteBit

Writes a digital output data to the specified bit of a port. The data is either 0 or 1. DriverHandle (UI32) (Input & Output): This value is used to identify the hardware. This is the reference to device specific configuration information stored in the registry and to be used in this function. PortNum (UI8) (Input): Digital I/O port of the Device. BitNum (UI8) (Input): Bit number of particular port. WriteBitData (Input): Data to written on device. ErrorIn (UI32) (Input): It contains error information, which can be coming from some previous function. ErrorIn is zero (No error) then function will execute. If ErrorIn is more than zero function will pass the error without execution. ErrorOut (UI32) (Output): It contains error information. If ErrorIn indicated an error, ErrorOut contains the same error information. describes the error status of this function. Otherwise, it

DioWriteBitDirect

Writes a digital output data directly to the addressed bit. DriverHandle (UI32) (Input & Output): This value is used to identify the hardware. This is the reference to device specific configuration information stored in the registry and to be used in this function. BitAddress (Byte) (Input): Bit address of DIO, Maximum value of n depends on the type of card. WriteBitData (Input): Data to written on device. ErrorIn (UI32) (Input): It contains error information, which can be coming from some previous function. ErrorIn is zero (No error) then function will execute. If ErrorIn is more than zero function will pass the error without execution. ErrorOut (UI32) (Output): It contains error information. If ErrorIn indicated an error, ErrorOut contains the same error information. describes the error status of this function. Otherwise, it

DioWriteByte

Writes a byte data to the specified digital port. DriverHandle (UI32) (Input and Output): This value is used to identify the hardware. This is the reference to device specific configuration information stored in the registry and to be used in this function. ErrorIn (UI32) (Input): It contains error information, which can be coming from some previous function. ErrorIn is zero (No error) then function will execute. If ErrorIn is more than zero function will pass the error without execution. PortNum (UI8) (Input): Digital I/O port of the Device. WriteDataByte (UI8) (Input): Data to written on device. MaskData (UI8) (Input): Some of the bit can be masked. ErrorOut (UI32) (Output): It contains error information. If ErrorIn indicated an error, ErrorOut contains the same error information. describes the error status of this function. Otherwise, it

DioWriteWord

Writes a word data to the specified digital port. DriverHandle (UI32) (Input and Output): This value is used to identify the hardware. This is the reference to device specific configuration information stored in the registry and to be used in this function. PortNum (UI8) (Input): Digital I/O port of the Device. WriteDataWord (UI16) (Input): Data to written on device. MaskData (UI16) (Input): Some of the bit can be masked. ErrorIn (UI32) (Input): It contains error information, which can be coming from some previous function. ErrorIn is zero (No error) then function will execute. If ErrorIn is more than zero function will pass the error without execution. ErrorOut (UI32) (Output): It contains error information. If ErrorIn indicated an error, ErrorOut contains the same error information. describes the error status of this function. Otherwise, it

DioWriteDword

Writes a 32-bit data to the specified digital port. DriverHandle (UI32) (Input): This value is used to identify the hardware. This is the reference to device specific configuration information stored in the registry and to be used in this function. PortNum (UI8) (Input): Digital I/O port of the Device. WriteDataDWord (UI32) (Input): Data to written on device. MaskData (UI32) (Input): Some of the bit can be masked. ErrorIn (UI32) (Input): It contains error information, which can be coming from some previous function. ErrorIn is zero (No error) then function will execute. If ErrorIn is more than zero function will pass the error without execution. ErrorOut (UI32) (Output): It contains error information. If ErrorIn indicated an error, ErrorOut contains the same error information. describes the error status of this function. Otherwise, it

DioGetBitConfig

This function reads the configuration of the addressed bit. This function is supported only for a device with configurable input/output bits. E.g.PCI-1020. DriverHandle (UI32) (Input & Output): This value is used to identify the hardware. This is the reference to device specific configuration information stored in the registry and to be used in this function. BitAddress (Byte) (Input): Bit address of DIO, Maximum value of n depends on the type of card. ErrorIn (UI32) (Input): It contains error information, which can be coming from some previous function. ErrorIn is zero (No error) then function will execute. If ErrorIn is more than zero function will pass the error without execution. ConfigData (UI8) (Output): Input/Output type. ErrorOut (UI32) (Output): It contains error information. If ErrorIn indicated an error, ErrorOut contains the same error information. describes the error status of this function. Otherwise, it This gives value either BitAddress is

10

DioGetAllBitsConfig

This function reads the configuration of all bits of all the ports on that device and stores into an array. This function is supported only for a device with configurable input/output bits. E.g.PCI-1021. DriverHandle (UI32) (Input): This value is used to identify the hardware. This is the reference to device specific configuration information stored in the registry and to be used in this function. NoOfBits (UI8) (Input): This value gives Number of bit to be configured. ErrorIn (UI32) (Input): It contains error information, which can be coming from some previous function. ErrorIn is zero (No error) then function will execute. If ErrorIn is more than zero function will pass the error without execution. ConfigDataArray (UI8 array) (Output): This gives the array of configured bit data. ErrorOut (UI32) (Output): It contains error information. If ErrorIn indicated an error, ErrorOut contains the same error information. describes the error status of this function. Otherwise, it

11

DioGetPortConfig

This function reads the current input and output configuration at runtime. This function is supported only for a device with configurable input/output ports. E.g.PCL225, PCI-1021 DriverHandle (UI32) (Input & Output): This value is used to identify the hardware. This is the reference to device specific configuration information stored in the registry and to be used in this function. PortNum (UI8) (Input): Digital I/O port of the device. ErrorIn (UI32) (Input): It contains error information, which can be coming from some previous function. ErrorIn is zero (No error) then function will execute. If ErrorIn is more than zero function will pass the error without execution. ConfigDataArray (UI8 array) (Output): This gives the array of configured bit data. ErrorOut (UI32) (Output): It contains error information. If ErrorIn indicated an error, ErrorOut contains the same error information. describes the error status of this function. Otherwise, it

12

DioGetAllPortsConfig

This function reads the current input and output configuration of all the port in a Device at runtime and stores into an array. This function is supported only for a device with configurable input/output ports. E.g.PCI-1021. DriverHandle (UI32) (Input): This value is used to identify the hardware. This is the reference to device specific configuration information stored in the registry and to be used in this function. NoOfPorts (UI8) (Input): Number of Digital I/O port of the device. ErrorIn (UI32) (Input): It contains error information, which can be coming from some previous function. ErrorIn is zero (No error) then function will execute. If ErrorIn is more than zero function will pass the error without execution. ConfigDataArray (UI8 array) (Output): This gives the array of configured bit data. ErrorOut (UI32) (Output): It contains error information. If ErrorIn indicated an error, ErrorOut contains the same error information. describes the error status of this function. Otherwise, it

13

Das könnte Ihnen auch gefallen