Home
ActiveX Control (OCX) for PCI-Bus Series boards User`s Manual
Contents
1. These methods are only for PISO813X OCX Date Aug 14 2003 Ver 1 1 Page 27 ActiveX Control for PCI series boards User s Manual 3 7 1 SetChannelGain This method provides a function to setup AD channel gain code This subroutine can be used to setup the AD channel of the active PISO 813 board In order to enable this function users need to call the ActiveBoard method to activate the selected PISO 813 board Prototype void SetChannelGain short nChannel short nGainCode Parameters nChannel Channel number of PISO 813 card nGainCode Gain code the value is 0 to 4 JP2 a JP1 20V Input GA GAIN2 GAIN1 GAINO Gain Code out ie Range ESV O A0 1 25V 2 5V eee ee led 16 0 1 0 10V Notuse use Not use Tepe ees oe Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first board to active Control SetChannelGain 0 0 Channel 0 10V range V0 Control Analogin 1 1 VO Channel 0 analog input value by float format Comment This function is only for PISO813X OCX Date Aug 14 2003 Ver 1 1 Page 28 ActiveX Control for PCI series boards User s Manual 3 7 2 Analoglin This method performs the AD conversion by polling method Function Control SetChannelGain can be used to set up or change analog input channel and gain code And then Control Analogin bases on this configuration to obtain analog input value
2. Date Aug 14 2003 Ver 1 1 Page 38 ActiveX Control for PCI series boards User s Manual 3 8 4 GetIrqCount This method is used to get the interrupt counter value in the device driver Prototype long GetlrqCount Return counter value of interrupt Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Control ResetlrqCount Reset interrupt count hEvent CreateEvent 0 False False 0 Control Installlrq hEvent 0 1 Install interrupt handle CloseHandle hEvent dwintCount Control GetlrqCount Get interrupt count Comment This function is for PIODAX PIOSODIOX PIODIOX OCX Date Aug 14 2003 Ver 1 1 Page 39 ActiveX Control for PCI series boards User s Manual 3 9 Specific Interrupt Methods Data type of Wi Method Name Descriptions returned value D48installirq void Install interrupt handle for a specific IRQ D48Removelrq void Remove the IRQ service routine D48GetirqCount long Get the counter value on the device driver for the interrupt D48Freq long Obtain the number of times which interrupt have happened These methods are only for PIO D48 board Data type of BE Method Name Descriptions returned value SavelrqActiveFlag void Save active low and active high flag from the device s queue GetIrqActiveFlag short Get active low and active high flag from the device
3. Prototype float GetHextoFloat short nHex short nGainCode short nJUMP short nBipolar Parameters nHex Hex value 0 OxOFFF nGainCode Gain code the value is 0 to 4 refer to 3 7 1 nJUMP 1 gt 20V HW default O a 10V nBipolar 1 Bipolar HW default O Unipolar Return float value converted from Hex value Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first board to active Control SetChannelGain 0 0 Channel 0 10V range V0 Control AnaloglnHex VO Channel 0 analog value by Hex format V1 Control GetHextoFloat V0 0 0 0 V1 float value converted from VO Comment This function is only for PISO813X OCX Date Aug 14 2003 Ver 1 1 Page 33 ActiveX Control for PCI series boards User s Manual 3 8 Interrupt Methods Method Name Data type of returned value Descriptions Installlrq void Install interrupt handler for a specific IRQ Removelrq void Remove the IRQ service routine ResetirqCount void Clear the counter value on the device driver for the interrupt GetIrqCount long Get interrupt counter value in the device driver These methods are for PIODAX PIOSODIOX PISO725X PIODIOX OCX ResetirqCount and GetirqCount are not for PISO725X OCX Date Aug 14 2003 Ver 1 1 Page 34 ActiveX Control for PCI series boards User s Manual 3 8 1 Installlrq This
4. method long D48GetIrqCount method void SavelrqActiveFlag method short GetlrqActiveFlag short FlagNum method void DriverClose Date Aug 14 2003 Ver 1 1 Page ActiveX Control for PCI series boards User s Manual PISO725X property short ErrorCode property BSTR ErrorString property short ActiveBoard method short DriverInit method long GetConfigAddressSpace short nAddrNum method short GetDriverVersion method short Gett Version method void OutputByte long IBaseAddr short nOutputData method short InputByte long IBaseAddr method void OutputWord long IBaseAddr long OutputData method long InputWord long IBaseAddr method void DigitalOut short nOutputValue method short Digitalln short nPort method void Installlrq long hEvent method void Removelrq method short GetlrqActiveFlag short FlagNum method void SavelrgActiveFlag method void DriverClose TMC12X property short ErrorCode property BSTR ErrorString property short ActiveBoard method short Driverlnit method long GetConfigAddressSpace short nAddrNum method short GetDriverVersion method short Gett Version method void OutputWord short nPortAddress short nOutData m
5. from the defined channel by the float format according to active PISO 813 board In first users need to call Control ActiveBoard method to activate the selected PISO 813 board Prototype float Analogin short nJump short nBipolar Parameters nJump 1 20V HW default 0 gt 10V nBipolar 1 Bipolar HW default 0 gt Unipolar Return Analog input value in float format Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first board to active Control SetChannelGain 0 0 Channel 0 10V range V0 Control Analogin 1 1 VO Channel 0 analog input value by float format Comment This function is only for PISO813X OCX Date Aug 14 2003 Ver 1 1 Page 29 ActiveX Control for PCI series boards User s Manual 3 7 3 AnaloginHex This method performs the AD conversion by polling method Function Control SetChannelGain can be used to set up or change analog input channel and gain code And then Control AanloginHex bases on this configuration to obtain analog input value from defined channel by the hex format according to active PISO 813 board Firstly users need to call Control ActiveBoard method to activate selected PISO 813 board Prototype short AnaloglnHex Return Analog input value in hex format Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first board to act
6. long ErrorCode property BSTR ErrorString property short ActiveBoard method short DriverInit method long GetConfigAddressSpace method short Gett Version method short GetDriverVersion method void OutputByte long IBaseAddr short nOutputData method void OutputWord long IBaseAddr long lOutputData method short InputByte long IBaseAddr method long InputWord long IBaseAddr method void SetChannelGain short nChannel short nGainCode method short AnalogInHex method float GetHextoFloat short nHex short nGainCode short nJUMP short nBipolar method float AnalogIn short nJump short nBipolar method void AnalogInMultiHex short wAdsBuf long ICount method void AnalogInMulti short nJump20V short nBipolar float fAdsBuf long Count method void DriverClose Date Aug 14 2003 Ver 1 1 Page ActiveX Control for PCI series boards User s Manual The following figure gives the programming system architecture for the ActiveX Control ActiveX Control Get or set properties Call methods OLE Control PIODIOX Container Fire Events VB Delphi BCB etc PIODIO_X DLL JC Vxd Sys j PCI BUS m 2 Data Type ActiveX Control Data Size BCB Delphi VB Data Type short 2 Bytes Short Smalllnt Integer long 4 Bytes Lon
7. long nCounterVal method void ResetlrqCount method void Installlrq long hEvent short nlrqSource short nActiveMode method void Removelrq method long GetlrqCount method void DriverClose Date Aug 14 2003 Ver 1 1 Page ActiveX Control for PCI series boards User s Manual PIODIOX property BSTR ErrorString property short ErrorCode property short ActiveBoard method short DriverInit method long GetConfigAddressSpace short nAddrNum method short Gett Version method short GetDriverVersion method short InoutByte long IBaseAddr method long InputWord long IBaseAddr method void OutputByte long IBaseAddr short nOutputData method void OutputWord long IBaseAddr long l OutputData method short Digitalln short nPort method void DigitalOut short nPort short nOutputValue method void SetCounter short nCounterNo short nCounterMode long nCounterVal method long ReadCounter short nCounterNo short nCounterMode method long ResetlrqCount method void Installlrq long hEvent short nlrqSource short nActiveMode method void Removelrq method void GetlrqCount method long D48Freq method void D48Installlrq long IHandle short nlrqMask short nActiveMode method void D48Removelra
8. 14 2003 Ver 1 1 Page ActiveX Control for PCI series boards User s Manual 3 4 1 Digitalin This method is used to obtain the digital input value from the active PCI series board Prototype1 short Digitalln Return 16 bits data from Digital input port Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board to 0 Print Control Digitalln Print the digital input value Comment This function is only for PCIPRX PISO725X TMC12X PIODAX OCX Prototype2 short Digitalln short nPort Parameters nPort digital input port number of PCI card Return 8 bits data from specified Digital input port Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board to 0 Print Control Digitalln 0 Print the Port 0 digital input value Comment This function is only for PISODIOX PIODIOX OCX Date Aug 14 2003 Ver 1 1 Page 19 ActiveX Control for PCI series boards User s Manual 3 4 2 DigitalOut This method is used to output the digital value through the active PCI series board Prototype void DigitalOut long wDo Parameters wDo Digital output value Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board to 0 Control DigitalOut 5 Digital output 5 Comment This function is
9. Control ResetirqCount Reset interrupt count hEvent CreateEvent 0 False False 0 Control D48lnstalllrq hEvent 1 1 Install interrupt handle CloseHandle hEvent Control SavelrgqActiveFlag Save interrupt active high and low flags ActiveFlag_High Control GetlrqActiveFlag 1 Get interrupt active high flags ActiveFlag_Low Control GetlrqActiveFlag 0 Get interrupt active low flags Comment This function is only for PlO D48 PISO 725 boards Date Aug 14 2003 Ver 1 1 Page 45 ActiveX Control for PCI series boards User s Manual 3 9 6 GetlrqActiveFlag This method is used to get the active low or active high flags from the device s queue First in First out Buffer Size 2000 flags for High Low Prototype short GetlrqActiveFlag short FlagNum Parameters FlagNum 0 gt Active Low 1 gt Active Hihg Return active low or active high flags Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Control ResetlrqCount Reset interrupt count hEvent CreateEvent 0 False False 0 Control D48lnstalllrq hEvent 1 1 Install interrupt handle CloseHandle hEvent Control SavelrqActiveFlag Save interrupt active high and low flags ActiveFlag_High Control GetlrqActiveFlag 1 Get interrupt active high flags ActiveFlag_Low Control GetlrqActiveFlag 0 Get interrupt active low flags Comment This function is only for
10. EEE AA EA E E E E A erences 51 Date Aug 14 2003 Ver 1 1 Page 3 ActiveX Control for PCI series boards User s Manual 1 Introduction The PCIPRX PIODAX PIODIOX PISO725X PISODIOX TMC12X PISO813X is an ActiveX Control component OCX for PCl Bus series boards It enables you to develop programs in a quick and easy way Before using this driver users need to install the PCIPRX PIODAX PIODIOX PISO725X PISODIOX TMC12X PISO813X OCX drivers into the system firstly and then insert the OCX component into the selected software development tools Finally you can make use of this OCX just like the general ActiveX Control components OCX included in your development tools Please also refer to ActiveX Control OCX Installation Manual It contains the following topics 1 Installing the software into your system 2 Installing Uninstalling the ActiveX Control into from Visual Basic 5 0 3 Installing Uninstalling the ActiveX Control into from Delphi 5 0 4 Installing Uninstalling the ActiveX Control into from Borland C Builder 3 0 Following table shows the current supported products of PCI DAQ card for OCX OCX Card model TMC12X PCI TMC12A PIODIOX PIO D168 PIO D144 PIO D96 PIO D64 PIO D56 PIO D48 PIO D24 PISO725X PISO 725 PISO813X PISO 813 PIODAX PIO DA16 PIO DA8 PIO DA4 PCIPRX PCI P8R8 PCI P16R16 PCI P16C16 PCI P16OR16 PISO P8R8 PISO P8SSR8AC PISO P8SSR8DC PIS
11. of PCI series board s driver Prototype short GetDllVersion Return DLL version of PCI series board Example For example If it returns 0x250 then the version is 2 50 wer Control GetDllVersion 3 2 3 GetDriverVersion This method is used to obtain the driver version information of PCI series board from Vxd driver of window 9X or Sys driver of windows NT 2000 Prototype short GetDriverVersion Return Driver version from operation system Example For example If it returns 0x200 then the version is 2 00 wVer Control GetDriverVersion Date Aug 14 2003 Ver 1 1 Page 15 ActiveX Control for PCI series boards User s Manual 3 2 4 DriverClose Stop and close the OCX Driver of PCI series board and release the device resource from computer device resource This method must be called once before exiting the user s application program Prototype void DriverClose Example TotalBoards Control DriverInit initial driver Control ActiveBoard 0 select action board 0 Control DriverClose release the device resource Date Aug 14 2003 Ver 1 1 Page 16 ActiveX Control for PCI series boards User s Manual 3 3 General Properties Data type of ee Properties Name Descriptions returned value Get or select active PCI series boards installed in ActiveBoard short the system 3 3 1 ActiveBoard This property is used to activate one of the PCI series boards installed in the sys
12. 1 ActiveX Control for PCI series boards User s Manual 3 7 5 AnaloglnMultiHex This method performs multiple AD conversions by software polling trigger during one batch time Function SetChannelGain can be used to change channel or configuration code And the AnaloginMultiHex function bases on the setting of SetChannelGain to get AD data in hex format This function also refers to the current active PISO813 board by using the function Control ActiveBoard Prototype void AnaloginMultiHex short FAR wAdsBuf long Count Parameters wAdsBuf Starting address of AD data buffer 16 bits these data will be automatically computed based on the setting of the SetChannelGain function ICount Number of AD conversions will be performed Return Analog input value which is automatically computed based on the setting of SetChannelGain Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first board to active Control SetChannelGain 0 0 Channel 0 10V range Control AnaloginMultiHex fAdBuf 0 100 Start the AnalogInMultiHex function and save data into fAdBuf Comment This function is only for PISO813X OCX Date Aug 14 2003 Ver 1 1 Page 32 ActiveX Control for PCI series boards User s Manual 3 7 6 GetHextoFloat This method is used to convert the analog input value from Hex to floating format depending on GainCode Bipolar Unipolar and 10V 20V settings
13. 3 Ver 1 1 Page 50 ActiveX Control for PCI series boards User s Manual 3 11 General Events The PCIPRX PIODIOX PISODIOX PISO725X PISO813X PIODAX and TMC12X have only one Event as shown in the following 3 11 1 OnError This event is used for default procedure and it is called when an error occurs You could code an error massage when necessary Prototype void OnError long IErrorCode Parameters ErrorCode Error code in long data type The OCX passes this argument into the procedure Please Refer to it for further using Example MsgBox Error Code Str IErrorCode Chr 13 Error Message Control ErrorString Date Aug 14 2003 Ver 1 1 Page 51
14. ActiveX Control for PCI series boards User s Manual ActiveX Control OCX for PCl Bus Series boards User s Manual Version 1 1 PIODAX OCX is for PIO DA PIODIOX OCX is for PIO DIO PISODIOX OCX is for PISO DIO PISO725X OCX is for PISO 725 TMC12X OCX is for PCI TMC12A PISO813X OCX is for PISO 813 PCIPRX OCX is for PCI R16 P8R8 P16C16 P16OR16 Date Aug 14 2003 Ver 1 1 Page ActiveX Control for PCI series boards User s Manual Table of Contents n ee Ee e BEE 4 2 Data Type crassa ccc epee ses cece EE 10 Oe nt rface oft PCOS DOA BEE 11 3 1 General PMO TEE 11 3 1 1 ENON GODS teins ba decree ctinee Sa thi cete cide c tat tineasdn a tictird nd eeastacehinccdmeustaseiiteudacleemamemeend 12 E ed E 12 3 1 3 Table of ErrorCode and Errorstring c ccc 2cscgecnecencennessncecneceneetnedeneencdendenneenne 13 RR En e e Sissis nsanra eesin neiaie i seva Wayi e KUS SENA KANNE Naia 14 Cea E DI YAS I nI S E E A eegeedegene 14 3 2 2 TRUE e EE 15 3 2 3 GetDriverVersion wsscsasicecetessencctscceacededencsseedigeuadadeercepebienssdudeacoedeSiveusgadiencebeSiseoutes 15 E SE E EN 16 3 3 General Properties tege eg 17 3 3 1 ActiveBoard a ccacures tcc scssnetcactiten mtetaicinaie dee Oita areata eatin ieeemneeo 17 3 4 Digital Input Output Methods 2 000 222 eee ee eee eeeeeee cece eee eeeeeeeeaeeeeeeeeeeeeeeeeaaaeeeeeeeeeeeeeeeenaaees 18 3 41 Digitall eessen e a O 19 34 2 Digtal TE 20 3 5 Input Output Get Address Mee egeer
15. Event dwintCount Control GetlrqCount Get interrupt count Comment This function is for PPODAX PIOSODIOX PISO725X PIODIOX OCX Date Aug 14 2003 Ver 1 1 Page 36 ActiveX Control for PCI series boards User s Manual 3 8 2 Removelrq This method is used to remove the IRQ service routine Prototype void Removelrq Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Control ResetirqCount Reset interrupt count hEvent CreateEvent 0 False False 0 Control Installlrq hEvent 0 1 Install interrupt handle CloseHandle hEvent dwintCount Control GetlrqCount Get interrupt count Comment This function is for PPODAX PIOSODIOX PISO725X PIODIOX OCX Date Aug 14 2003 Ver 1 1 Page 37 ActiveX Control for PCI series boards User s Manual 3 8 3 ResetirqCount This method is used to clear the counter value on the device driver for the interrupt Prototype void ResetlrqCount Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Control Resetlrqcount Reset interrupt count hEvent CreateEvent 0 False False 0 Control Installlrq hEvent 0 1 Install interrupt handle CloseHandle hEvent dwintCount Control GetlrqCount Get interrupt count Comment This function is for PIODAX PIOSODIOX PIODIOX OCX
16. ODIOX PISO P32A32 PISO P32C32 PISO A64 PISO P64 PISO C64 PISO 730 PISO 730A Date Aug 14 2003 Ver 1 1 Page ActiveX Control for PCI series boards User s Manual The following tables are the function lists for the specific OCX PCIPRX property short ErrorCode property BSTR ErrorString property short ActiveBoard method short DriverInit method long GetConfigAddressSpace short nAddrNum method short Gett Version method short GetDriverVersion method void DigitalOut short nOutputValue method short Digitalln method void DriverClose PIODAX property long ErrorCode property BSTR ErrorString property short ActiveBoard method short Driverlnit method long GetConfigAddressSpace short nAddrNum method short GetDriverVersion method short Gett Version method long Digitalln method void DigitalOut long Output aluei method void OutVoltage short nChannel float OutputValue method void OutCurrent short nChannel float fOutputValue method short InputByte long BaseAddr method void OutputByte long IBaseAddr short nOutputData method void OutputWord long IBaseAdar long lOutputData method long InputWord long IBaseAdadr method void SetCounter short nCounterNo short nCounterMode
17. PlO D48 PISO 725 boards Date Aug 14 2003 Ver 1 1 Page 46 ActiveX Control for PCI series boards User s Manual 3 10 Counter Methods Data type of ae Method Name Descriptions returned value Select8254 void Select 8254 chip which you want to programming SetCounter void Set the counter s mode and value ReadCounter long 4 bytes Read the counter value These methods are only for PIO D48 PIO D64 PIO DA and TMC 12 boards Select8254 function is only for PCI TMC12A ReadCounter function is not for PIO DA board Date Aug 14 2003 Ver 1 1 Page 47 ActiveX Control for PCI series boards User s Manual 3 10 1 Select8254 This method is used to select the 8254 chip which you want to programming The valid value is between 0 and 3 This function is only for TMC12X OCX Prototype void Select8254 short nWhich8254 Parameters nWhich8254 8254 chip you select value 0 3 Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Control Select8254 0 Select first 8254 chip Control SetCounter 0 0 40000 counter 0 mode 0 counter value 40000 Sleep 1 wRetVal Control ReadCounter read the counter value Comment This function is only for TMC12X OCX Date Aug 14 2003 Ver 1 1 Page 48 ActiveX Control for PCI series boards User s Manual 3 10 2 SetCounter This method is used to set the mod
18. ctive Mode is 1 2 or 1 to3 zech CH GetActiveFlagError Can t get interrupt active flag 15 ActiveFlagEndOfQueue The flag queue is empty Oxffff TimeOutError Time Out 100 AdError2 AD value Error Date Aug 14 2003 Ver 1 1 Page 13 ActiveX Control for PCI series boards User s Manual 3 2 General Methods Data type of i Se Method Name Data size Descriptions returned value Driverlnit short 2 bytes Open the driver and allocate the resource fo the device and get the total boards GetDLLVersion short 2 bytes Get the DLL file version GetDriverVersion short 2 bytes Get the driver version in the system DriverClose void Close the Driver and release the resource from the device 3 2 1 Driverlnit This method is used to start the PCI series board s driver and allocate the computer resource for the device This method must be called once before calling or using control methods or other properties Prototype short DriverInit Return Total boards of defined PCI series boards Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board to 0 Print Control GetDllVersion Print the DLL version Date Aug 14 2003 Ver 1 1 Page 14 ActiveX Control for PCI series boards User s Manual 3 2 2 GetDIilVersion This method is used to get the DLL version information
19. dle hEvent Comment This function is only for PlO D48 board Date Aug 14 2003 Ver 1 1 Page 41 ActiveX Control for PCI series boards User s Manual 3 9 2 D48Removelrq This method is used to remove the IRQ service routine This function is only for PIO D48 board Prototype void D48Removelrq Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Control ResetirqCount Reset interrupt count hEvent CreateEvent 0 False False 0 Control D48lnstalllrq hEvent 1 1 Install interrupt handle CloseHandle hEvent Comment This function is only for PIO D48 board Date Aug 14 2003 Ver 1 1 Page 42 ActiveX Control for PCI series boards User s Manual 3 9 3 D48GetirqCount This method is used to obtain the Interrupt Counter value in the device driver The Interrupt Counter will be increased in the ISR when the interrupt is triggered When the interrupt setting to Active High only or Active Low only some of the interrupt signal will be ignored and the Interrupt Counter will not be increased This function is only for PIO D48 board Prototype long D48GetIrqCount Retuen counter value Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Control Resetlrqcount Reset interrupt count hEvent CreateEvent 0 False False 0 Co
20. e and value of the specified counter Prototype void SetCounter short nCounterNo sort nCounterMode long nCounterVal Parameters nCounterNo The Counter Number 0 2 PIO D48 PIO DA PCI TMC12A 0 5 PIO D64 0 to 2 Chip 0 3 to 5 Chip 1 nCounterMode The Counter Mode 0 to 5 nCounterVal The 16 bits value for the counter to counting only the lower WORD is valid Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Control SetCounter 0 0 40000 counter 0 mode 0 counter value 40000 Sleep 1 wRetVal Control ReadCounter read the counter value Comment This function is only for PlO D48 PIO D64 PIO DA and PCI TMC12A boards Note Before use SetCounter function in PCI TMC12A please use Select8254 function firstly Date Aug 14 2003 Ver 1 1 Page 49 ActiveX Control for PCI series boards User s Manual 3 10 3 ReadCounter This method is used to read the value of the specified counter Prototype long ReadCounter Return counter value Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Control SetCounter 0 0 40000 counter 0 mode 0 counter value 40000 Sleep 1 wRetVal Control ReadCounter read the counter value Comment This function is only for PlO D48 PIO D64 and PCI TMC12A boards Date Aug 14 200
21. ethod void InputWord short nPortAddress method short Digitalln method void DigitalOut short nOutputValue method void Select8254 short nWhich8254 method void SetCounter short nCounterNo short nCounterMode long CounterVal method long ReadCounter short nCounterNo short nCounterMode method short GetlrqNo method void DriverClose Date Aug 14 2003 Ver 1 1 Page ActiveX Control for PCI series boards User s Manual PISODIOX property short ErrorCode property BSTR ErrorString property short ActiveBoard method short Driverlnit method Jong GetConfigAddressSpace short nAddrNum method short GetDllVersion method short GetDriverVersion method void OutputByte long IBaseAddr short nOutputData method void OutputWord long IBaseAddr long l OutputData method short InputByte long IBaseAdadr method long InputWord long IBaseAddr method void DigitalOut short nPort short nOutputValue method short Digitalln short nPort method void ResetlrqCount method void Installlrq long hEvent short nlrqSource short nActiveMode method void Removelra method Jong GetlrqCount method void DriverClose Date Aug 14 2003 Ver 1 1 Page ActiveX Control for PCI series boards User s Manual PISO813X property
22. g LongInt Long float 4 Bytes Float Single Single LPCTSTR Wchar_t String String BSTR AnsiString String String Date Aug 14 2003 Ver 1 1 Page 10 ActiveX Control for PCI series boards User s Manual 3 Interface of PCl bus board The interface of PCI series boards is for PCIPRX PIODAX PIODIOX PISO725xX PISODIOX TMC12X and PISO813X 3 1 General Properties Property Name Data Type Data Size Access mode Run time Only Description ErrorCode long short 4 2 Bytes Read Write No Get select the Error Code ErrorString BSTR Read only No Get the Error Message Note In the following examples please replace the Control word by your Control Object name For example 1 PCIPRX1 or PCIPRX2 is for PCIPRX OCX 2 PIODAX tor PIODAX2 is for PIODAX OCX 3 PIODIOX1 or PIODIOX2 is for PIODIOX OCX 5 PISODIOX1 or PISODIOX2 is for PISODIOX OCX 6 PISO813X1 or PISO813X2 is for PISO813X OCX 2 3 4 PISO725X1 or PISO725X2 is for PISO725X OCX 5 6 7 7 TMC12X1 or TMC12X2 is for TMC12X OCX Date Aug 14 2003 Ver 1 1 Page 11 ActiveX Control for PCI series boards User s Manual 3 1 1 ErrorCode This property records any error code includes 0 no error produced by software function driver after you use any method or other properties Users should check on this property to make sure no error occurred af
23. he desired digital input port Prototype short InputByte long AddrBase Parameters AddrBase I O port addresses Return 16 bits data with the leading 8 bits are all 0 Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board to 0 wBaseAdadr Control GetConfigAddressSpace 0 get the AddrBase Control OutputByte wBaseAddr 1 enable all DI DO InVal2 Control InputByte wBaseAddr amp HC4 input value from Port 1 Comment This function is not for PCIPRX TMC12X OCX 3 5 3 InputWord This method is used to input the 16 bit data from the desired digital input port Prototype long InputWord long AddrBase Parameters AddrBase I O port addresses Return 32 bit data Only the low WORD is valid Comment This function is not for PCIPRX OCX Date Aug 14 2003 Ver 1 1 Page 23 ActiveX Control for PCI series boards User s Manual 3 5 4 OutputByte This method is used to send the 8 bits data to the desired digital output port Prototype void OutputByte long AddrBase short nOutputVal Parameters AddrBase I O port addresses nOutputVal 8 bit data send to I O port Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board to 0 wBaseAdadr Control GetConfigAddressSpace 0 get the AddrBase Control OutputByte wBaseAdar 1 enable all DI DO InVal2 Contro
24. is function is only for PPODAX OCX Date Aug 14 2003 Ver 1 1 Page 25 ActiveX Control for PCI series boards User s Manual 3 6 2 OutCurrent This method is used to output the analog current data to the analog output port through the active PIO DA board Firstly users need to call Control ActiveBoard method to activate the selected board and then use this function to output analog current value The analog output value is in float format Prototype void OutCurrent short nChannel float fOutputValue Parameters nChannel The channel number of PIO DA card fOutputValue Analog output current value by float format Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board to 0 Control OutCurrent 0 15 Channel Number 0 Analog output value 15 mA Comment This function is only for PIODAX OCX Date Aug 14 2003 Ver 1 1 Page 26 ActiveX Control for PCI series boards User s Manual 3 7 Analog input methods Data type of Method Name returned value SetChannelGain void Select the AD channel s gain code Analogin float Get Analog input value by float format Descriptions AnaloginHex short Get Analog input value by hex format Analog nMulti void Get Analog input values by float format AnalogInMultiHex void Get Analog inputs value by hex format GetHextoFloat float Get float value converted from Hex value
25. ive Control SetChannelGain 0 0 Channel 0 10V range V0 Control AnaloglnHex VO Channel 0 analog value by Hex format Comment This function is only for PISO813X OCX Date Aug 14 2003 Ver 1 1 Page 30 ActiveX Control for PCI series boards User s Manual 3 7 4 AnaloginMulti This method performs multiple AD conversions by software polling trigger during one batch time Function SetChannelGain can be used to change channel or gain code and the AnaloglinMulti function bases on the setting of SetChannelGain to get AD data in float format This function also refers to the current active PISO 813 board by using the function Control ActiveBoard Prototype void AnalogInMulti short nJump20V short nBipolar float FAR fAdsBuf long Count Parameters nJump 1 gt 20V HW default O gt 10V nBipolar 1 Bipolar HW default 0 gt Unipolar fAdsBuf Starting address of AD data buffer 16 bits these data will be automatically computed based on the setting of the SetChannelGain function ICount Number of AD conversions will be performed Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first board to active Control SetChannelGain 0 0 Channel 0 10V range Control AnaloginMulti 1 1 fAdBuf 0 100 Start the AnalogInMulti function and save data into fAdBuf Comment This function is only for PISO813X OCX Date Aug 14 2003 Ver 1 1 Page 3
26. l InputByte wBaseAddr amp HC4 input value to Port 1 Comment This function is not for PCIPRX TMC12X OCX 3 5 5 OutputWord This method is used to send the 16 bits data to the desired digital output port Prototype void OutoputWord long nAddrBase long nOutData Parameters nAddrBase UO port addresses nOutputVal 32 bit data send to I O port Only the low WORD is valid Comment This function is not for PCIPRX OCX Date Aug 14 2003 Ver 1 1 Page 24 ActiveX Control for PCI series boards User s Manual 3 6 Analog Output Methods Data type of 1 Sc Method Name Data size Descriptions returned value OutVoltage void Output analog voltage value OutCurrent void Output analog current value These methods are only for PIODAX OCX 3 6 1 OutVoltage This method is used to output the analog voltage data to the analog output port through the active PIO DA board Firstly users need to call Control ActiveBoard method to activate the selected PIO DA board and then use this function to output analog voltage value Prototype void OutVoltage short nChannel float fOutputValue Parameters nChannel The channel number of PIO DA card fOutputValue Analog output value by float format Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board to 0 Control OutVoltage 0 5 5 Channel Number 0 Analog output value 5 5v Comment Th
27. method is used to install interrupt handler for a specific IRQ level n Prototype 1 void Installlrq long hEvent short nlrqSource short nActiveMode Prototype 2 void Installlrq long hEvent for PISO725X only Parameters hEvent The user must use the CreateEvent function to create the event object and obtain its handle and pass the handle into this function nlrqSource What the Interrupt Source to be used Please refer to hardware s manual for the detail information Card No InterruptSource Description 0 PC3 PC7 from Port 2 PIO D48 1 PC3 PC7 from Port 5 2 CoutO 3 Cout2 0 PCO PIO D56 D24 1 DCH 2 PC2 3 PC3 0 EXTIRQ PIO D64 J EE 2 TMRIRQ 0 P2Co PIO D96 1 P5C0 2 P8Co 3 P11C0 0 P2Co PIO D144 1 P2C1 2 P2C2 3 P2C3 PISO 730 A 0 DIO 1 Di PIO DA16 DA8 DA4 0 INTO 1 INT ActiveMode How to trigger the interrupt This can be ActiveHigh or ActiveLow nActiveMode Description 0 ActiveLow 1 ActiveHigh Date Aug 14 2003 Ver 1 1 Page 35 ActiveX Control for PCI series boards User s Manual Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Control ResetlrqCount Reset interrupt count hEvent CreateEvent 0 False False 0 Control Installlrq hEvent 0 1 Install interrupt handle CloseHandle h
28. ntrol D48lnstalllrq hEvent 1 1 Install interrupt handle CloseHandle hEvent dwintCount Control D48GetIrqcount Get interrupt count value Comment This function is only for PlO D48 board Date Aug 14 2003 Ver 1 1 Page 43 ActiveX Control for PCI series boards User s Manual 3 9 4 D48Freq This method is used to measure the signal frequency Users have to connect the signal with CN1 Pin29 and connect the signal with CN1 Pin19 The Counter 0 and Counter 1 will be used to measure the frequency Therefore users shouldn t use Counter 0 and Counter 1 for other purposes This function is only for PIO D48 board Prototype long D48Freq Return Signal frequency value Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Control Resetlrqcount Reset interrupt count IFrequency Control D48Freq Get frequency value Comment This function is only for PlO D48 board Date Aug 14 2003 Ver 1 1 Page 44 ActiveX Control for PCI series boards User s Manual 3 9 5 SavelrqActiveFlag This method is used to save the active low and active high flags from the device s queue First in First out Buffer Size 2000 flags for High Low Prototype void SavelrgActiveFlag Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active
29. only for PCIPRX PISO725X TMC12X PIODAX OCX Prototype2 void DigitalOut short nPort short nOutputValue Parameters nPort digital output port number of PCI card nOutputValue 8 bit Digital output value Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board to 0 Control DigitalOut 1 5 Digital output port 1 output value 5 Comment This function is only for PISODIOX PIODIOX OCX Date Aug 14 2003 Ver 1 1 Page 20 ActiveX Control for PCI series boards User s Manual 3 5 Input Output Get Address Methods Method Name Data type of returned value Descriptions GetConfigAddressSpace long Get the card information InputByte short Input the 8 bit data from the desired I O port InputWord long Input the 16 bit data from the desired I O port OutputByte void Send the 8 bits data to the desired I O port OutputWord void Send the 16 bits data to the desired I O port InputByte and OutputByte methods are not for TMC12X PCIPRX OCX InputWord and OutputWord methods are not for PCIPRX OCX Date Aug 14 2003 Ver 1 1 Page 21 ActiveX Control for PCI series boards User s Manual 3 5 1 GetConfigAddressSpace This method is used to get the base address IO address or specified information of PCI serial boards Please refer to the following table Prototype long Ge
30. regtegeeegeedeuedeECHNNEdEE degedEEHENEECdeee geheegt 21 3 5 1 ek ENEE DEENEN ence etcetera 22 3 52 Mp tBytE ssiri etninei aai ea a eani iaaa 23 E Mmmm g e e E E E R 23 3 94 QUU EE 24 35 5 OQutputWord essesi ee eee me ee eee ee EE eee eee 24 3 6 Analog CAE genee EE 25 SEH O tVoltage sireeni a aaant aa Eaa aara Eanna aa ni aaa 25 2 E CATE A EEE E A E E E E ebgte 26 3 7 Analog input methbode ee 27 3 7 1 SetChannelGain E 28 Date Aug 14 2003 Ver 1 1 Page ActiveX Control for PCI series boards User s Manual 3 7 2 en ae eee oe een te oe eet once ear Ee Enee E AE E aaa cee eae 29 e a elle ele 30 3 7 4 e ell EE EN 3 7 5 AnaloglnMultiHex eegtegesegegugesagegegesegetrgeseggtreregegegesegetugegeget egegetrgesegeE Eege goge 32 Sech GetH xtoFloat ee EE eel ee teases 33 38 Oe Methods sisira ee 34 3 8 EE e EE 35 38 2 JMOMOVCIO ee 37 3 8 3 ResetlrqCount ce eeeececceee eee eeeeeeeeeeeeeeeeeeeeeaaaaeeeeeeeeeeseeeeeaaaeeeeeeeeeeeeeseeeeteeeeeeeees 38 38 4 CTO UN ea aa a I ee he eee 39 3 9 Specific Interrupt MethodS 2 40 Asn SvanAxal Asa NAwalA va ANa Nasa Anas ay 40 3 9 1 D48lnstalllrq WEE 41 E DAGREMOVGIG WEE 42 3 9 3 D48GeEtlrAC ee EE 43 E Ne EE 44 3 9 5 SavelrqActiveFlag WEE 45 E Ee Dee DEE 46 3 10 Counter Methods AAA 47 3 10 1 SE 48 3 10 2 SUC OURS ie cites pee ea a a eee ae E 49 3 10 3 Se ee in 50 Selle Ee VES scence cit se soso oat ou ees la hata ad aha So De eho oa koa 51 3 11 1 RIE
31. s queue These methods are only for PIO D48 and PISO 725 boards Date Aug 14 2003 Ver 1 1 Page 40 ActiveX Control for PCI series boards User s Manual 3 9 1 D48installlirq This method is used to install the IRQ service routine This function supports multiple interrupt source and the Active Mode can be set as Active Low only Active High only and Active Low or Active High This function is only for PIO D48 board Prototype void D48iInstalllrq long Handle short nlrqMask short nActiveMode Parameters IHandle address of a event handle The user must use the CreateEvent function to create the event object nirqMask what the interrupt source to be use nirqMask Description INT_CHAN_0 PC3 PC7 from Port 2 INT_CHAN_0 PC3 PC7 from Port 5 INT_CHAN_0 Couto INT_CHAN_0 Cout2 This function supports 4 interrupt source at a time thus users can co A N use multi interrupt source like 1 2 8 nActiveMode How to trigger the interrupt This can be ActiveHigh or ActiveLow nActiveMode Description 1 PIOD48_ActiveLow 2 PIOD48_ActiveHigh Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Control ResetlrqCount Reset interrupt count hEvent CreateEvent 0 False False 0 Control D48Installlrq hEvent 1 1 Install interrupt handle CloseHan
32. tConfigAddressSpace short nAddrNum Parameters nAddrNum specified parameter as following table Return Card information refer to the following table nAddrNum GE 0 1 2 3 4 5 6 PIODIOX AddrBase SubVendor SubDevice SubAux SlotBus SlotDevice PISODIOX AddrBase SubVendor SubDevice SubAux SlotBus SlotDevice PIODAX __ AddrBase IrqNo SubVendor SubDevice SubAux SlotBus SlotDevice PIOS725X AddrBase IrqNo SubVendor SubDevice SubAux SlotBus SlotDevice PISO813X IrqNo SubVendor SubDevice SubAux SlotBus SlotDevice PCIPRX TypelD Address2 TMC12X AddrBase IrqNo AddrBase base address of the board control word SubVendor subVendor ID of this board SubDevice subDevice ID of this board subAux ID of this board SubAux SlotBus hardware slot ID1 of this board SlotDevice hardware slot ID2 of this board IrqNo TypelD Address I O port address Example allocated IRQ channel number of this board 0 gt this board is PCI P16R16 1 gt this board is PCI P8R8 wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board to 0 Print Control GetConfigAddressSpace 0 print the base address Date Aug 14 2003 Ver 1 1 Page 22 ActiveX Control for PCI series boards User s Manual 3 5 2 InputByte This method is used to obtain the 8 bit data from t
33. tem This function must be called once before the Digitalln DigitalOut and etc functions are used It also allows users to get or select the ActiveBoard Return short Active board number Default 0 ActiveBoard 0 Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board to 0 Board Control ActiveBoard Get the active board value Date Aug 14 2003 Ver 1 1 Page 17 ActiveX Control for PCI series boards User s Manual 3 4 Digital Input Output Methods Data type of ae Method Name Data size Descriptions returned value Digitalln short 2 bytes Get digital input value DigitalOut void Output digital value These methods are for PCIPRX PIODAX PIODIOX PISO725X PISODIOX and TMC12X OCX In these cards listed in followings table you can switch the ports of eight digital channels in group to be output and or input And every digital component has 8 digital channels Port Number Port Number Card Model OCX Card Model OCX DI DO DI DO PIO D24 3 3 PIODIOX PIO D168 21 21 PIODIOX PIO D48 6 6 PIODIOX PISO P8R8 1 1 PISODIOX PISO PIO D56 5 5 PIODIOX 4 4 PISODIOX P32A32 P32C32 PIO D64 4 4 PIODIOX PISO A64 C64 0 8 PISODIOX PIO D96 12 12 PIODIOX PISO P64 8 0 PISODIOX PIO D144 18 18 PIODIOX PISO 730 730A 4 4 PISODIOX Date Aug
34. ter using any function Return long short Example If Control ErrorCode lt gt 0 then Error occurs Do something Exit sub End if Comment Please refer to the ErrorString property to understand the meaning of error message 3 1 2 ErrorString This property provides message information according to error code when an error has been occurred That is users can get the meaning of error message from the ErrorString property Return BSTR Example strError Control ErrorString Ger the error message Date Aug 14 2003 Ver 1 1 Page 12 ActiveX Control for PCI series boards User s Manual 3 1 3 Table of ErrorCode and ErrorString Error ID Error String Comment NoError OK No Error DrivrOpenError Device driver can t be opened DriverNoOpen Users have to call the Driverlnit function firstly GetDriverVersionError Get driver version error InsralllrqError Can t install interrupt service ClearIntCountError Can t clear interrupt count GetIntCountError Can t get interrupt count RegisterApcError Register Apc Error RemovelrqError Can t remove interrupt resource O ON FD oF A Gi Mi FindBoardError Check your card zech CH ExceedBoardNumber The Max boards is 8 wh wech ResetError Can t reset interrupt count N IrqMaskError Irq Mask is 1 2 4 8 or 1 to OxF Wi ActiveModeError A
Download Pdf Manuals
Related Search
Related Contents
LG WM3470HWA washing machine Arrow SBMAMW Instructions / Assembly RACLETTE + GRILL IEG-120 Manuel d`utilisation Notification de sécurité produit Manual de usuario Emerson EZL Series Pressure Reducing Regulator for Low Pressure Applications Drawings & Schematics COBY electronic CT-P8800 User's Manual Copyright © All rights reserved.
Failed to retrieve file