Home
ActiveX Control (OCX) for PCI-Bus multifunction boards User`s
Contents
1. 1 0 Gei the SecondCardchannel0 configuration Control SetSecondCardChannelConfig 1 1 0 Gei the SecondCardchannel1 configuration Control SetSecondCardChannelConfig 2 1 0 Gei the SecondCardchannel2 configuration Control SecondCardStartScan 80 AdNumber Set the parameter and start continuous capture of function SecondCard RetValue Control GetSecondCardChannelData Buf 0 Buf1 0 wStatus Get data and status of SecondCard IF RetValue 0 then Control SecondCardStop Stop the SecondCard End IF Comments Please refer to the demo13 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 60 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 10 6 SecondCardStartScan This method is used to start continuous data capture mechanism of Function Secondcard by the configuration of AD sampling rate and how many data can be got from the selected channel in SecondCard Prototype void SecondCardStartScan short nSampleRate short nCount Parameters nSampleRate AD sampling rate 8M nSampleRate nSampleRate 80 gt sampling rate 8M 80 100K nCount How many AD data can be got in one batch time from selected scan channel Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 1 Set the active board number is 1 Control SetSecondCardChannelConfig 0 1 0 Gei the SecondCardchannel0 configuration Control SetSecondCardChannelConfig 1 1 0 Ge
2. 1 1 0 Control SetTwoMAChannelConfig 2 1 0 2 1 0 Control SetTwoMAParameter wClockDiv wClockDiv 20000 20000 Priority Set the parameters of TwoMA function Control twoMAStart Card0Buf0 0 CardOBuf1 0 Start TwoMA and store the data into buffer RetValue Control TwoMAReadStatus Read the TwoMA status IF RetValue 128 Then Control TwoMAStop Stop TwoMA function Else iF RetValue 8 then End Exit program End IF Comments Please refer to the demo20 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 50 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 9 7 SetTwoMAParameter This method is used to set up the sampling rate how many data can be read and priority for the first and second multifunction boards of TwoMA The priority setting is described in below Prototype void SetTwoMAParameter short nCardoClockDiv short nCard1ClockDiv long dwCardoMaxCount long dwCard1MaxCount short nPriority Parameters nCard0ClockDiv Define Card0 AD sampling rate which is 8M nCard0ClockDiv nCardiClockDiv Define Cardi AD sampling rate which is 8M nCardOClockDiv dwCardoMaxCount Set how many analog input data can be read from the Card0 dwCard1MaxCount Set how many analog input data can be read from the Card1 nPriority Set the thread s priority Here the thread is used to get the AD data for these two PCI multifunction boards Priority Value Priority ID 2 THREAD PRIORITY LOWES
3. Str amp H800 Set data No and value Elself ii gt 191 And ii lt 256 Then CONTROL SetMFun2DavVal ii Str amp H800 64 8 Set data No and value Else CONTROL SetMFun2DavVal ii Str amp H800 Set data No and value End If Next ii CONTROL StartMFun2 Start MFun2 Function CONTROL GetMFun2Buf wAd 0 Get MFun2 AD Buffer data Comments Please refer to the demo7 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 38 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 8 5 StartMFun2 StartMFun2 is used to start function MFun2 to output the defined waveform to the device and obtain the defined data number of Analog input values into the buffer Refer to multifunction boards Hardware Manual chapter 5 for details Here the analog input channel 0 and analog output channel 0 are used to produce designated function Prototype void StartMFun2 Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board is 0 Control SetMFun2Parameter 320 50 80 510 0 Set Mfun2 s Parameter For ii 0 To 127 produce arbitrary waveform by user triangle waveform If ii lt 64 Then CONTROL SetMFun2DavVal ii Str amp H800 ii 16 Set data No and value Else CONTROL SetMFun2DavVal ii Str amp H800 128 ii 16 Set data No and value End If Next ii For ii 128 To 319 produce arbitrary wave
4. The methods can t be used with PCI 1002 series multifunction board because magicscan function is adapted Data type of s Method Name Data size Descriptions returned value SetFirstCardChannelContig Void Set channel configuration of first Card FirstCardStartScan Void Start data scan mechanism of first Card GetFirstCardChannelData short Get the data and status of first Card FirstCardStop Void Stop the continuous capture of first Card SetSecondCardChannelConfig Void Set channel configuration of second Card SecondCardStartScan Void Set start data scan mechanism of second Card GetSecondCardChannelData short Get data and status of second Card SecondCardStop Void Stop the continuous capture second Card The procedures for how to use FirstCard SecondCard function is shown as following 1 The operation procedure for FirstCard FirstCard SetFirstCardChannelConfig gt FirstCardStartScan gt GetFirstCardChannelData gt FirstCardStop 2 The operation procedure for SecondCard SecondCard SetSecondCardChannelConfig gt SecondCardStartScan gt GetSecondCardChannelData gt SecondCardStop Date January 24 2002 Ver 1 0 Page 55 PC11800X PC11602X PCI1202X ActiveX Control User s Manual 3 10 1 SetFirstCardChannelConfig This method is used to set up the Channel Configuration of function FirstCard for the first board Prototype void SetFirstCardChannelConfig short nChanne
5. 0 Set the active board 0 Control DigitalOut Dodata Set the digital output value Didata Control Digitalln Get the digital input value Control SetMFuniParameter 360 10 4 5 80 200 0 10 10 Set Parameters of MFunt Function Control StartMFun1 AdBuf 0 Start MFun1 and get MFun1 data Comments Please refer to the DEMO5 and it is not for PCI 1002 PC11800X PCI11602X PC11202X ActiveX Control User s Manual 3 8 2 StartMFun1 The function StartMFun1 is used to start Mfun1 to execute the default duty Refer to multifunction boards Hardware Manual chapter 5 for details Here the Analog input channel 0 and analog output channel 0 are used to produce designated function Prototype void StartMFun1 float FAR fAdBuf Parameters fAdBuf The starting address of fAdBuf which store the AD data Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control DigitalOut Dodata Set the digital output value Didata Control Digitalln Get the digital input value Control SetMFun1 Parameter DF DW DA AC 200 0 10 10 Set Parameters of MFun1 Function Control StartMFun1 AdBuf 0 Start MFun1 and get MFun1 data Comments Please refer to the demo5 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 36 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 8 3 SetMFun2Parameter This method pro
6. 1 controller timeout 0x04 MagicScan stage 2 controller timeout 0x08 MagicScan FIFO overflow 0x80 MagicScan function OK Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control ClearMagicScan Clear the scan data Control AddToMagicScan 0 0 1 0 0 0 Add CH 0 to scan in Magic Scan Control SaveMagicScan 0 wV0 0 Save data in place 0 of Magic scan buffer Control AddToMagicScan 2 0 1 0 0 O Add CH 2 to scan in Magic Scan Control SaveMagicScan 1 wV1 0 Save data in place 1 of Magic scan buffer Control StartMagicScan 24 2000 0 Set parameters of magic scan and start scan While True Do while Status Control ReadMagicScanStatus Get the Magic Scan Status If Status gt 1 Then If the status gt 1 GoTo Over call the sub Over End If End if Sleep 10 Wend Over Control StopMagicScan Stop magic scan Comments Please also refer to the demo 11 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 27 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 7 4 SaveMagicScan This method specify the scan seguence into the scan gueue and the starting address of AD data buffer of current active multifunction board for MagicScan method Prototype void SaveMagicScan short wAdChannel short FAR wAdBuf Parameters wAdChannel Scan sequence in the scan queue
7. EE 57 Dt E ET ge en VE IR Ch A DE 58 SO O MR gt e hela e sien with escape tee el e et tte ek 59 3 10 5 SetSecondCardChannel Config 1 60 510 6 SecondGardStaitScan cis eege 61 3 10 7 GetGecondCardChannelliata 62 310 8 SecondCardStop J ek Ske Sa ee 63 3 11 Interrupt Methods er 64 3 11 1 GetlrgNo EE 65 3 112 EEN 65 3 11 37 SADiraStop EE 66 ILEA ADASA EE 67 STES W e E 68 EE EE EE EE 69 3 11 7 GetFloatBuffer AAA 70 3 12 General EV CIS 6 a eee a de eee le ul ae am Eanair aiandi 71 EE E OREO A say ae ae oases ae ME 71 Date January 24 2002 Ver 1 0 Page 4 PC11800X PC11602X PC11202X ActiveX Control User s Manual 1 Introduction The PC11800X PC11602X PC11202X PC11002X is an ActiveX Control component OCX for PCl Bus multifunction Boards It enables you to develop programs in a quick and easy way Before using this driver users need to install the PCI1800X PCI1602X PC11202X PC11002X 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
8. January 24 2002 Ver 1 0 Page 67 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 11 5 Installlrq This method is used to install interrupt handler for a specific IRQ level n and set the maximum count number for interrupts Prototype void Installlrq long Event long Count Parameters Event The user must use the CreateEvent function to create the event object and obtain its handle and pass the handle into this function Count Maximum numbers of counter to interrupt transfer Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Control Installlrq hEvent 100 Install the event and counter Control ADIrqStart 0 0 c2 Set the channel configuration code and sampling rate of the Start ADIrqStart function Control GetFloatBuffer DataNo WaveData 0 Set the parameter and get Interrupt data after the ADIrqStart starts Control ADIrqStop Stop the AD Analog Digital Interrupt Comments Please refer to the Interrupt demo and it is only for PCI 1002 Date January 24 2002 Ver 1 0 Page 68 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 11 6 GetBuffer This method is used to Transfer analog input data obtained from interrupt method into user s buffer by word format Prototype void GetBuffer long dwNum short FAR wBuffer Parameters dwNum The total number to be transfered to user s bu
9. No and value Elself ii gt 191 And ii lt 256 Then CONTROL SetMFun2DavVal ii Str amp H800 64 8 Set data No and value Else CONTROL SetMFun2DavVal ii Str amp H800 Set data No and value End If Next ii CONTROL StartMFun2 Start MFun2 Function CONTROL GetMFun2Buf wAd 0 Get MFun2 AD Buffer data Comments Please refer to the demo7 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 37 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 8 4 SetMFun2DaVal This method is used to transfer the defined DA data order and its values into the Mfun2 buffer That means this function provides a way for user to generate arbitrary waveform Prototype void SetMFun2DaVal short DaNum short DaVal Parameters DaNum Set DA data s number DaVal Set Data s value Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board is 0 Control SetMFun2Parameter 320 50 80 510 0 Set Mfun2 s Parameter For ti 0 To 127 produce arbitrary waveform by user triangle waveform If ii lt 64 Then CONTROL SetMFun2DavVal ii Str amp H800 ii 16 Set data No and value Else CONTROL SetMFun2DavVal ii Str amp H800 128 ii 16 Set data No and value End If Next ii For ii 128 To 319 produce arbitrary waveform by user square waveform If ii gt 128 And ii lt 192 Then CONTROL SetMFun2DavVal ii
10. Note not the AD channel number wAdBuf Buffer to store the AD data of Magic Scan function Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control ClearMagicScan Clear the scan data Control AddToMagicScan 0 0 1 0 0 0 Add CH 0 to scan in Magic Scan Control SaveMagicScan 0 wV0 0 Save data in place 0 of Magic scan buffer Control AddToMagicScan 2 0 1 0 0 O Add CH 2 to scan in Magic Scan Control SaveMagicScan 1 wV1 0 Save data in place 1 of Magic scan buffer Control StartMagicScan 24 2000 0 Set parameters of magic scan and start scan While True Do while Status Control ReadMagicScanStatus Get the Magic Scan Status If Status gt 1 Then If the status gt 1 GoTo Over call the sub Over End If End if Sleep 10 Wend Over Control StopMagicScan Stop magic scan Comments Please also refer to the demo 11 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 28 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 7 5 StartMagicScan This method starts the MagicScan operation of current active multifunction board Users can utilize Control ReadMagicScanStatus to check the operation state of MagicScan function Prototype void StartMagicScan short nSampleRateDiv long dwNum short nPriority Parameters nSampleRateDiv AD sampling rate 8M nSampleRateDiv nSamp
11. Parameter gt StartMFun1 2 The Mfun2 working procedure MFun2 SetMFun2DaVal gt SetMFun2Parameter gt StartMFun2 gt GetMFun2Buf 3 The Mfun3 working procedure MFun3 SetMFun3ChannelConfig gt SetMFun3Parameter gt StartMFun3 Function name DA AD Mt un channel 0 sine wave channel O 10V MFun2 channel 0 arbitrary wave form channel 0 10V channel gain programmable 32 channels max MFun3 channel 0 sine wave Date January 24 2002 Ver 1 0 Page 34 3 8 1 SetMFun1 Parameter This method is used to configue the Parameters of MFun1 function to generate the waveform image automatically Prototype void SetWFun1Parameter short nDaFreguency short nDaWave float fDaAmplitude short nAdClock short nAdNumber short nAdConfig long fLowAlarm float fHighAlarm Parameters nDaFrequency DA output frequency 1 8M wDaFrequency Pentium 120 nDaWave Number of DA waveform to be generated fDaAmplitude Amplitude of DA output NOTE the hardware J1 must be selected as 10V nAdClock AD sampling clock samples sec 8M nAdClock nAdNumber Number of AD data to be read nAdConfig Configuration code of AD input range Refer to Section 3 6 5 fLowAlarm Low alarm limit if value lt fLowAlarm gt LowAlarm fHighAlarm High alarm limit if value gt fHighAlarm gt HighAlarm Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard
12. Wend Over Control StopMagicScan Stop magic scan Comments Please also refer to the demo11 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 33 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 8 M Function Methods Some real world applications have to send out the pre defined pattern signal to the external device and measure the output responses of the device for analysis purpose Maybe users need one arbitrary waveform generator and one high speed AD converter The MFunctions provided by PCI 1202 1602 1800 1802 can send out the user defined arbitrary wave form and perform the AD conversion at the same time The detail functions list are shown in the following table Note that the following methods can not be used with PCI 1002 Data type of MV Method Name Descriptions returned value SetMFun1Parameter Void Set the Parameter of MFun1 Function StartMFun1 Void Start MFun1 Function and get data SetMFun2DaVal Void Set DA value and store into DA buffer SetMFun2Parameter Void Set the Parameter of MFun2 StartMFun2 Void Start MFun2 Function GetMFun2Buf Void Get MFun2 buffer data SetMFun3Parameter Void Set Parameter of Mfun3 SetMFun3ChannelConfig Void Set channel s Parameter of Mfun3 StartMFUN3 Void Start MFun3 Function and get data The procedures for how to use these methods of M function are shown as following 1 The MFun1 working procedure MFun1 SetMFun1
13. is used by PCI 1002 This function is not necessary method for your program Prototype short GetlrgNo Return IRQ number Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Print Control GetlrqNo Print the IRQ number Comments Please refer to the Interrupt demo and it is only for PCI 1002 3 11 2 GetirqCount This method is used to get IRQ counter value of the active PCI 1002 board installed in the system which means how many times of PCI 1002 card s interrupt has been happened This function is not necessary for your program Prototype long GetlrqCount Return Counter data Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first card to active Print Control GetlrgCount Print the IRQ count number Comments Please refer to the Interrupt demo and it is only for PCI 1002 Date January 24 2002 Ver 1 0 Page 65 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 11 3 ADiIrqStop This method is used to stop the PCI 1002 card s interrupt and remove the installed interrupt handler Prototype void ADIrqStop Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control Installlrq hEvent 100 Install the event and counter Control A
14. is working 8 Data over flow 128 Data ready Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board number is 0 Control SetOneMAChannelConfig 0 1 0 Gei the OneMA channel configuration Control SetOneMAChannelConfig 1 1 0 Gei the OneMA channel configuration Control SetOneMAChannelConfig 2 1 0 Gei the OneMA channel configuration Control SetOneMAChannelConfig 7 1 0 Gei the OneMA channel7 configuration Control SetOneMAParameter 80 2000000 0 Set the parameters of function Control OneMAStart Card0Buf0 0 Start OneMA and store the data into buffer RetValue Control OneMAReadStatus Get the status of OneMA IF RetValue 128 Then Control OneMAStop Stop OneMA function End IF Comments Please refer to the demo21 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 48 PC11800X PCI11602X PC11202X ActiveX Control User s Manual 3 9 5 OneMAStop This method is used to stop the capturing data mechanism of the function OneMA Prototype void OneMAStop Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board number is 0 Control SetOneMAChannelConfig 0 1 0 Gei the OneMA channel configuration Control SetOneMAChannelConfig 1 1 0 Gei the OneMA channel configuration Control SetOneMAChannelConfig 2 1 0 Gei the OneMA channel
15. nSBuf Data buffer which store data in scan seguence order format 012 N012 N 012 N nCBuf Data buffer which store data in channel seguence order format 00000 11111 22222 NNNNN nStatus 1 thread start 2 TimeOut 8 FIFO overflow 0x80 thread finish Return 0 Data is ready 1 Data not ready Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board number is 0 Control SetFirstCardChannelConfig 0 1 0 Get the FirstCard channel configuration Control SetFirstCardChannelConfig 1 1 0 Get the FirstCard channel1 configuration Control SetFirstCardChannelConfig 2 1 0 Gei the FirstCard channel2 configuration Control FirstCardStartScan 80 AdNumber Set the parameter and start continuous capture of function FirstCard RetValue Control GetFirstCardChannelData Buf 0 Buf1 0 wStatus Get data and status of FirstCard IF the RetValue 0 then Control FirstCardStop Stop the FirstCard EndlF Comments Please refer to the demo13 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 58 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 10 4 FirstCardStop This method is used to stop FirstCard continuously capturing analog input data from the first board Prototype void FirstCardStop Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBo
16. s Manual 3 2 General Methods Method Name Data type of returned value Data size Descriptions Driverinit 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 DelayUs void Set the delay time DriverClose 3 2 1 Driverlnit void Close the Driver and release the resource from the device Start the PCI Multifunction 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 Driverlnit Return Total boards of defined PCI Multifunction board Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards boardsControl ActiveBoard 0 Set the Active Board to 0 Print Control GetDil Version Print the DLL Version Date January 24 2002 Ver 1 0 Page 10 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 2 2 GetDLLVersion Get the version information of multifunction board s drivers Prototype short GetDLLVersion Return DLL version of multifunction board Example For example If it returns 0x250 then the version is 2 50 wVer Control GetDLLVersion 3 2 3 GetDriverVersion This method is used
17. to obtain the driver version information of multifunction 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 January 24 2002 Ver 1 0 Page 11 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 2 4 DelayUs This function provides a machine independent timer It can be used to delay the setting time or used as a general purpose machine independent timer It need to work with the current active multifunction board Please use the method ActiveBoard to select the active board Prototype void DelayUs short nDelaytime Parameters nDelaytime Number of us to delay 8191 Max nDelaytime 1 gt delay 1 us nDelaytime 1000 gt delay 1000 us 1 ms nDelaytime 8191 gt delay 8191 us 8 191 ms maximum delay nDelaytime 8192 gt invalidate delay will return error Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first board to active Control SetChannelConfig 1 0 5V range Control DelayUs 23 delay 23 us settling time VO Control ADPolling VO is ADPolling value Comments This function is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 12 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 2 5 DriverClos
18. void AnalogOut short nChannel short nDaVal Parameters nChannel The Channel Number of card 0 to 1 nDaVal Analog output value by hex format Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the Active Board to 0 Control AnalogOut 0 A000 Channel Number 0 Analog output value A000 hex Comment This function is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 16 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 6 Analog input methods Data type of Data returned value size SetChannelConfig Void Set the AD channel s configuration code ADPolling Float 4 Bytes Get Analog input value by float format Method Name Descriptions ADMultiPacer Void Perform multiple AD conversions by pacer trigger ADMultiPolling Void Perform multiple AD conversions by polling ADPollingHex short Get Analog input value by Hex format 3 6 1 SetChannelConfig This method provides a function to setup AD channel configuration code This subroutine can be used to setup the active AD channel of the ADPolling ADMultiPolling and ADMultiPacer function for the active multifunction board In order to enable this function users need to call the ActiveBoard method to activate selected PCI multifunction board Prototype void SetChannelConfig short nChannel short nConfig Parameters nChannel Set channel number nConfig Configura
19. 10K s Max Switching Frequency 0x03 Configuration Code Bipolar 5V 44K s 0x10 Bipolar 0 5V 36K s 0x21 Bipolar 0 05V 7K s 0x32 Bipolar 0 005 0 8K s 0x43 Date January 24 2002 Ver 1 0 Page 23 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 7 MagicScan Methods These methods cannot be used with PCI 1002 series multifunction boards Method Name Data type of returned value Descriptions AAddToMagicScan Void Add one channel to the MagicScan circular queue ClearMagicScan Void Initialize the MagicScan controller to the Initial state ReadMagicScanStatus Short Get MagicScan Status value SaveMagicScan Void Specify the starting address of AD databuffer for MagicScan StartMagicScan Void Start the MagicScan operation StartMagicScanPostTrg Void Start the MagicScanPostTrg operation StartMagicScanPreTrg Void Start the MagicScanPretTrg operation StartMagicScanMiddleTrg Void Start the MagicScanMiddleTrg operation StopMagicScan Void Stop MagicScan Date January 24 2002 Ver 1 0 Page 24 PC11800X PCI11602X PC11202X ActiveX Control User s Manual 3 7 1 AddToMagicScan This method adds one channel to the MagicScan circular queue for current active PCI multifunction board Before enabling this fun
20. 2X PC11202X ActiveX Control User s Manual 3 9 1 SetOneMAChannelConfig This method is used to set up the AD channel to be scanned or not and configuration code of selected channel for the only one multifunction board Prototype void SetOneMAChannelConfig short nChannel short nChannelVal short nConfig Parameters nChannel Select the Card0 scan channel nChannelVal Set up scan 1 or no scan 0 for card0O selected channel nConfig Configuration code for card0 selected channel Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board number is 0 Control SetOneMAChannelConfig 0 1 0 Set the OneMA channelO configuration Control SetOneMAChannelConfig 1 1 0 Gei the OneMA channel configuration Control SetOneMAChannelConfig 2 1 0 Gei the OneMA channel configuration Control SetOneMAChannelConfig 7 1 0 Gei the OneMA channel configuration Control SetOneMAParameter 80 2000000 0 Set the parameters of function Control OneMAStart Card0Buf0 0 Start OneMA and store the data into buffer RetValue Control OneMAReadStatus Get the status of OneMA IF RetValue 128 Then Control OneMAStop Stop OneMA function End IF Comments Please refer to the demo21 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 45 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 9 2 SetOneMAParameter The method is u
21. 7 7 StartMagicScanPreTrg This method will start the pre trigger operation of MagicScan for current active multifunction board Users can use the method ReadMagicScanStatus to check the operation state of StartMagicScanPreTrg function External trigger CH Prototype void StartMagicScanPreTrigger short Start End wSampleRateDiv long dwNum short nPriority External pre trigger timing Parameters wSampleRateDiv AD sampling rate 8M wSampleRateDiv wSampleRate 24 gt sampling rate 8M 24 330K dwNum Number of MagicScan cycle performed nPriority Be used to adjust the priority of the thread For example to prevent the lock of CPU users can try to use the lower priority ID Description THREAD_PRIORITY_LOWEST THREAD_PRIORITY_BELOW_NORMAL THREAD_PRIORITY_NORMAL THREAD_PRIORITY_ABOVE_NORMAL THREAD_PRIORITY_HIGHEST 15 THREAD_PRIORITY_TIME_CRITICAL others THREAD_PRIORITY_NORMAL Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control ClearMagicScan Clear the scan data Control AddToMagicScan 0 0 1 0 0 0 Add CH 0 to scan in Magic Scan Control SaveMagicScan 0 wV0 0 Save data in place 0 of Magic scan buffer Control AddToMagicScan 2 0 1 0 0 O Add CH 2 to scan in Magic Scan Control SaveMagicScan 1 wV1 0 Save data in place 1 of Magic scan buffer C11602X1 StartMagicScanPreT
22. 8M 80 100K nCount How many AD data can be got in one batch time from selected scan channel Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board number is 0 Control SetFirstCardChannelConfig O 1 0 Gei the FirstCard channel configuration Control SetFirstCardChannelConfig 1 1 0 Gei the FirstCard channel1 configuration Control SetFirstCardChannelConfig 2 1 0 Gei the FirstCard channel2 configuration Control FirstCardStartScan 80 AdNumber Set the parameter and start continuous capture of function FirstCard RetValue Control GetFirstCardChannelData Buf 0 Buf1 0 wStatus Get data and status of FirstCard IF RetValue 0 then Control FirstCardStop Stop the FirstCard End IF Comments Please refer to the demo13 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 57 PCI1800X PC11602X PCl1202X ActiveX Control User s Manual 3 10 3 GetFirstCardChannelData This method is used to return the first card scan states and get the AD data from continuous capture mechanism of CardO into two format The first format is in a circular queue of scan sequence control like 012 N012 N 012 N The second way is to put the scan analog input data in channel format like 00000 11111 22222 NNNNN Prototype short GetSecondCardChannelData short FAR nSBuf short FAR nCBuf short FAR nStatus Parameters
23. AD conversions by pacer trigger Function SetChannelConfig can be used to change channel or configuration code Then according to this setting ADMultiPacer can get Analog input data by hardware pacer trigger periodically These AD data can be used to reconstruct the waveform from analog input channel However software polling signal triggers the function ADMultiPolling and AD conversion operation is interrupted by system OS It is recommended to use ADMultiPacer if the input waveform reconstruction is needed Prototype void ADMultiPacer float FAR fAdsBuf long wNum short wSample Parameters fAdsBuf The starting address of AD data buffer 16 bits these data will be automatically computed based on the setting of the SetChannelConfig function wNum Number of AD conversions will be performed wSample AD sampling rate 8M wSample wSample 80 gt Sampling rate 8M 80 100K Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first Board to active Control SetChannelConfig 3 0 Setting channel 3 Configuration code 0 Control DelayUs 23 delay 23 us settling time Control ADMultiPacer fAdBuf 0 100 80 Start the ADMultiPacer function and save data into fAdBuf Date January 24 2002 Ver 1 0 Page 19 PC11800X PCI1602X PC11202X ActiveX Control User s Manual 3 6 4 ADMultiPolling This method performs multiple AD conversions by software polling trig
24. AddToMagicScan 0 0 1 0 0 0 Add CH 0 to scan in Magic Scan Control SaveMagicScan 0 wV0 0 Save data in place 0 of Magic scan buffer Control AddToMagicScan 2 0 1 0 0 O Add CH 2 to scan in Magic Scan Control SaveMagicScan 1 wV1 0 Save data in place 1 of Magic scan buffer Control StartMagicScanMiddleTrigger 24 100 250 0 Set parameters of Middle Trg Magic scan and start scan Comments Please also refer to the demo25 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 32 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 7 9 StopMagicScan This method is used to stop the MagicScan mechanism Prototype void StopMagicScan Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control ClearMagicScan Clear the scan data Control AddToMagicScan 0 0 1 0 0 0 Add CH 0 to scan in Magic Scan Control SaveMagicScan 0 wV0 0 Save data in place 0 of Magic scan buffer Control AddToMagicScan 2 0 1 0 0 0 Add CH 2 to scan in Magic Scan Control SaveMagicScan 1 wV1 0 Save data in place 1 of Magic scan buffer Control StartMagicScan 24 2000 0 Set parameters of magic scan and start scan While True Do while Status Control ReadMagicScanStatus Get the Magic Scan Status If Status gt 1 Then If the status gt 1 GoTo Over call the sub Over End If End if Sleep 10
25. DIrqStart 0 0 c2 Set the channel configuration code and sampling rate of the ADIrqStart method Control GetFloatBuffer DataNo WaveData 0 Set the parameter and get Interrupt data after ADIrqStart Control ADIrqStop Stop the analog convert to digital of Interrupt Comments Please refer to the Interrupt demo and it is only for PCI 1002 Date January 24 2002 Ver 1 0 Page 66 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 11 4 ADIrqStart This method is used to start the PCI 1002 card s interrupt for a specific AD channel programmable gain code and sampling rate Prototype void ADIrqStart short nChannel short nGain short wFreqDiv Parameters nChannel Select the AD channel nGain Set the Gain for selected channel refer to Hardware manual Section 3 2 7 wFreqDiv The sampling rate is 2M wFreqDiv Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control Installlrq hEvent 100 Install the event and counter Control ADIrqStart 0 0 100 the sampling rate is 20K Set the channel configuration code and sampling rate of the ADIrqStart method Control GetFloatBuffer DataNo WaveData 0 Set the parameter and get Interrupt data after the ADIrqStart function starts Control ADIrqStop Stop the AD Analog Digital Interrupt Comments Please refer to the Interrupt demo and it is only for PCI 1002 Date
26. Delphi 5 0 4 Installing Uninstalling the ActiveX Control into from Borland C Builder 3 0 Date January 24 2002 Ver 1 0 Page 5 PC11800X PC11602X PC11202X ActiveX Control User s Manual 2 Data Iype ActiveX Control Data Type Data Size BCB Delphi VB short 2 Bytes Short Smaillint Integer long 4 Bytes Long LongInt Long float 4 Bytes Float Single Single LPCTSTR Wchar_t String String BSTR AnsiString String String Date January 24 2002 Ver 1 0 Page 6 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 Interface of multifunction board The interface of multifunction boards is for PC11800X PC11602X PC11202X and PC11002X 3 1 General Properties Property Name Data Type Data Size Access mode Run time Only Description ErrorCode long 4 Bytes Read Write No Get set 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 PCI1800X1 or PCI1800X2 2 PCI1602X1 or PCI1602X2 3 PC11202X1 or PCI1202X2 4 PC11002X1 or PCI1002X2 iS for PCI1800X OCX 1S for PCI1602X OCX is for PCI1202X OCX is for PCI1002XK OCX Date January 24 2002 Ver 1 0 Page 7 PC11800X PCI1602X PC11202X ActiveX C
27. E E O64 eg A KE e aea a 3 6 5 e ge gt RE Date January 24 2002 Ver 1 0 Page PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 6 6 GONR GURAT ON CODE eege 22 ee NEE 24 3 7 1 AddToMagicScan zelil ilkeli dilli lekeleri dele nad 25 3 7 2 ClearMagicScan H AR 26 3 7 3 HR adMagiCS Can Stalls E 27 Soria Ee e EE 28 3 7 5 otlar MiGO CANA DEE 29 ob StartMagicScanP ostro EE 30 3 7 7 o GiartMaoic canbrefroi 31 3 7 8 olamMadgcocanMidedle Tig eee la ale Seli gali de a ee Selek 32 3 74 97 SSIODNIAGICSCAN sins amli im m Ai an Mi SAM 33 3 8 M Function Detten mele mlm sessed ibne led li deene 34 3 8 1 eene ia Parametleri DEE 35 3 8 2 Eat ee 36 38 3 SeaMF n2Parameter E 37 3 8 4 SeIMPUM2D AY DE 38 3 8 5 Sokak RL MER eege EA 39 3 8 6 GetMFUun2Buf EEN 40 3 8 7 SetMFun3Parameter E 41 3 8 8 SelMFunsChannelGontig nvecaiecancn Atco 42 BOO StatMFUNS EE 43 3 9 Special TWoMA OneMA Methode Abee 44 3 9 1 e ENEE reene 45 3 9 2 lt SelOneEMAPALAMCICR EE 46 3 93 e Eeer 47 3 9 4 OneMAReadStatus un 48 3 9 5 REES EYE 49 2505 SetTwoMAChannelConfig A E 50 39 7 SCEIWOMAP AlaMeler EE 51 3 9 8 le e E nt EE 52 3 9 TWOMARGAOSISIUS EE 53 Date January 24 2002 Ver 1 0 Page 3 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 9 10 TwoMAStop EE 54 3 10 The Continuous Capture Meibodes AEN 55 3 10 1 SetFirstCardChannelConfig e 56 3 10 2 FirstCardStartScan
28. OBuf1 0 Start TwoMA and store the data into buffer RetValue Control woMAReadStatus Read the TwoMA status IF RetValue 128 Then Control TwoMAStop Stop TwoMA function End IF Comments Please refer to the demo20 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 53 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 9 10 TwoMAStop This method is used to stop the TwoMA capture data mechanism Prototype void TwoMAStop Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board number is 0 Control SetTwoMAChannelConfig 0 1 0 0 1 0 Gei the TwoMA channel configuration Control SetTwoMAChannelConfig 1 1 0 1 1 0 Control SetTwoMAChannelConfig 2 1 0 2 1 0 Control SetTwoMAParameter wClockDiv wClockDiv 20000 20000 Priority Set the parameters of TwoMA function Control TwoMAStart Card0Buf0 0 CardO0Buf1 0 Start TwoMA and store the data into buffer RetValue Control woMAReadStatus Read the TwoMA status IF RetValue 128 Then Control TwoMAStop Stop TwoMA function End IF Comments Please refer to the demo20 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 54 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 10 The Continuous Capture Methods The following functions are used to continuously capture analog input data from multifunction boards
29. OL SetMFun2DavVal ii Str amp H800 Set data No and value Elself ii gt 191 And ii lt 256 Then CONTROL SetMFun2DavVal ii Str amp H800 64 8 Set data No and value Else CONTROL SetMFun2DaVal ii Str amp H800 Set data No and value End If Next ii CONTROL StartMFun2 Start MFun2 Function CONTROL GetMFun2Buf wAd 0 Get MFun2 AD Buffer data Comments Please refer to the demo7 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 40 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 8 7 SetMFun3Parameter This method provides a function to set up the configuration code of Mfun3 This subroutine can be used to set the frequency of DA output how many DA waveforms can be generated during one working cycle the Amplitude of DA output AD sampling rate how many AD data can be read during one working cycle and the value of LowAlarm and HighAlarm for continuous waveform generation and capture of function MFun3 Prototype void SetWFun3Parameter short nDaFrequency short nDaWave float fDaAmplitude short nAdClock short nAdNumber float fLowAlarm float fHighAlarm Parameters nDaFrequency DA output frequency 1 8M wDaFrequency Pentium 120 nDaWave How many number of DA wave form to be generated nDaAmplitude Amplitude of DA output Note the hardware J1 must be selected as 10V nAdClock AD sampling clock samples sec 8M nAdClock nAdNumber How many number of AD data to b
30. PC11800X PC11602X PC11202X ActiveX Control User s Manual ActiveX Control OCX for PCl Bus multifunction boards User s Manual Version 1 0 PC11800X OCX is for PCI1800L PCI1800H PC11800X OCX is for PCI1802L PCI1802H PC11602X OCX is for PC11602 PCI1602F PC11202X OCX is for PGI1202L PC11202H PC11002X OCX is for PGI1002L PC11002H Date January 24 2002 Ver 1 0 Page 1 PC11800X PC11602X PC11202X ActiveX Control User s Manual Table of Contents 1 rg A sed EA ENEN 2 Data TY eee bien ie Belki Stem Rien ilimli esimi 3 nterfaceofmultifunctionboard MMMAA m m e gt ez ZzZzZzZeZn m gt gt gt m gt m 3 1 General ee ge gosta ciichecntaertmnydenntemiineereueteteniaiemdenedereutunddeadlumissaniuedscalbemeianntannde 3 1 1 Err rC ONG EE ee ed e EN e 3 1 3 Table of ErrorCode and Errortztng EE 3 2 oe AY 2 ig 0 Seka ks e am anki ekl eee 3 2 1 Bi eT E E 3 2 2 GetDLLVErSIOn EE 923 GetDriverVersion E De AYO Sh WE 3 29 REM Jos ee ee la eee ere ee A E 3 3 General Geen 3 3 1 ActiveB ard name an ee me mee ey ee narsi e 3 4 Digital Input Output MethodS c2ec2cccocnrsess2cccenrrenneostaredaunsoonedhdentdaacdennneebnebianiessatades 3 4 1 Digitall E 34 2 e 5 3 5 Analog Output ge setciegetegegzdegedeug ktegeudedede eege edEd eege ee dededeeegetere 3 5 1 Tele EE 3 6 Analog input EENEG gege eagere eege eege ege 3 6 1 et ei e e a lm m m sl ml en BA 3 6 2 ADPOMMG EE 3 6 3 RT
31. T 1 THREAD_PRIORITY_BELOW_NORMAL THREAD_PRIORITY_NORMAL THREAD_PRIORITY_ABOVE_NORMAL THREAD_PRIORITY_HIGHEST 15 THREAD_PRIORITY_TIME_CRITICAL others THREAD_PRIORITY_NORMAL Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board number is 0 Control SetTwoMAChannelConfig 0 1 0 0 1 0 Gei the TwoMA channel configuration Control SetTwoMAChannelConfig 1 1 0 1 1 0 Control SetTwoMAChannelConfig 2 1 0 2 1 0 Control SetTwoMAParameter wClockDiv wClockDiv 20000 20000 Priority Set the parameters of TwoMA function Control TwoMAStart Card0Buf0 0 CardOBuf1 0 Start TwoMA and store the data into buffer RetValue Control TwoMAReadStatus Read the TwoMA status IF RetValue 128 Then Control TwoMAStop Stop TwoMA function Comments Please refer to the demo20 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 51 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 9 8 TwoMAStart This method is used to start the function TwoMA to capture data and store into buffer Prototype void TwoMAStart short FAR CardoBuffer short FAR Card Buffer Parameters CardOBuffer Buffer for storing AD data from Card Card1 Buffer Buffer for storing AD data from Card1 Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Se
32. User s Manual 3 9 Special TwoMA OneMA Methods These functions provide a method to allow user to define how many data can be got and store into main memory Due to the magicscan function is used the following method is not suitable for PCI 1002 multifunction card OneMA is for One board operating TwoMA is for two boards operating simultaneously Data type of Pe Method Name Descriptions returned value SetOneMAChannelConfig Void Set channel configuration of OneMA SetOneMAParameter Void Set up the parameter of OneMA OneMAStart Void Start OneMA and store the data into buffer OneMAReadStatus short Get the status of OneMA OneMAStop Void Stop the Function of OneMA SetTwoMAChannelConfig Void Set channel configuration of CardO and Card1 SetTwoMAParameter Void Set the parameter of TwoMA TwoMAStart Void Start TwoMA and store the data into buffer TwoMAReadStatus short Get the status of TwoMA TwoMAStop Void Stop the Function of TwoMA The procedures for how to use these methods of OneMA TwoMA function are shown as following 1 The operation procedure for OneMA OneMA SetOneMAChannelConfig gt SetOneMAParameter gt OneMAStart gt OneMAReadStatus gt OneMAStop 2 The operation procedure for TwoMA TwoMA SetTwoMAChannelConfig gt SetTwoMAParameter gt TwoMAStart gt IwoMAReadStatus gt TwoMAStop Date January 24 2002 Ver 1 0 Page 44 PC11800X PCI160
33. al trigger Prototype void StartMagicScanPostTrigger short Se Ss k wSampleRateDiv long dwNum short nPriority External post trigger timing Parameters wSampleRateDiv AD sampling rate 8M wSampleRateDiv wSampleRate 24 gt sampling rate 8M 24 330K dwNum Number of MagicScan cycle performed nPriority Be used to adjust the priority of the thread For example to prevent the lock of CPU users can try to use the lower priority ID Description THREAD_PRIORITY_LOWEST THREAD_PRIORITY_BELOW_NORMAL THREAD_PRIORITY_NORMAL THREAD_PRIORITY_ABOVE_NORMAL THREAD_PRIORITY_HIGHEST 15 THREAD_PRIORITY_TIME_CRITICAL others THREAD_PRIORITY_NORMAL Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control ClearMagicScan Clear the scan data Control AddToMagicScan 0 0 1 0 0 0 Add CH 0 to scan in Magic Scan Control SaveMagicScan 0 wV0 0 Save data in place 0 of Magic scan buffer Control AddToMagicScan 2 0 1 0 0 O Add CH 2 to scan in Magic Scan Control SaveMagicScan 1 wV1 0 Save data in place 1 of Magic scan buffer Control StartMagicScanPostTrigger 24 100 0 Set parameters of Post Trigger Magic scan and start scan Comments Please refer to the demo23 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 30 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3
34. alize the driver and get the total boards Control ActiveBoard 1 Set the active board number is 1 Control SetSecondCardChannelConfig 0 1 0 Get the SecondCardchannel0 configuration Control SetSecondCardChannelConfig 1 1 0 Get the SecondCardchannel1 configuration Control SetSecondCardChannelConfig 2 1 0 Get the SecondCardchannel2 configuration Control SecondCardStartScan 80 AdNumber Set the parameter and start continuous capture of function SecondCard RetValue Control GetSecondCardChannelData Buf 0 Bur 0 wStatus Get data and status of SecondCard IF RetValue 0 then Control SecondCardStop Stop the SecondCard End IF Comments Please refer to the demo14 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 62 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 10 8 SecondCardStop This method is used to stop SecondCard continuously capturing analog input data from the second board Prototype void SecondCardStop Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 1 Set the active board number is 1 Control SetSecondCardChannelConfig 0 1 0 Gei the SecondCardchannel0 configuration Control SetSecondCardChannelConfig 1 1 0 Gei the SecondCardchannel1 configuration Control SetSecondCardChannelConfig 2 1 0 Gei the SecondCardchannel2 configuration Control SecondCardStartScan 80 AdNumber Set the parameter and
35. ard 0 Set the active board number is 0 Control SetFirstCardChannelConfig O 1 0 Gei the FirstCard channel configuration Control SetFirstCardChannelConfig 1 1 0 Gei the FirstCard channel1 configuration Control SetFirstCardChannelConfig 2 1 0 Gei the FirstCard channel2 configuration Control FirstCardStartScan 80 AdNumber Set the parameter and start continuous capture of function FirstCard RetValue Control GetFirstCardChannelData Buf 0 Buf1 0 wStatus Get data and status of FirstCard IF the RetValue 0 then Control FirstCardStop Stop the FirstCard EndIF Comments Please refer to the demo13 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 59 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 10 5 SetSecondCardChannelConfig This method is used to set up the Channel Configuration of function SecondCard for the second board Note that function SecondCard only can be used when Function firstCard is used firstly Prototype void SetSecondCardChannelConfig short nChannel short nChannelVal short nConfig Parameters nChannel Select the scan channel for second card nChannelVal Set up scan 1 or no scan 0 for card1 selected channel nConfig Configuration code for selected channel Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 1 Set the active board number is 1 Control SetSecondCardChannelConfig 0
36. configuration Control SetOneMAParameter 80 2000000 0 Set the parameters of function Control OneMAStart Card0Buf0 0 Start OneMA and store the data into buffer RetValue Control OneMAReadStatus Get the status of OneMA IF RetValue 128 Then Control OneMAStop Stop OneMA function End IF Comments Please refer to the demo21 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 49 PC11800X PC11602X PCI1202X ActiveX Control User s Manual 3 9 6 SetTwoMAChannelConfig This method sets up the AD channel to be scanned or not and configuration code of selected channel for the first and second multifunction boards Prototype void SetTwoMAChannelConfig short COChannel short COChannelVal short COChannelConfig short C1 Channel short C1ChannelVal short C1 ChannelConfig Parameters COChannel Select the Card0 scan channel COChannelVal Set up scan 1 or no scan 0 for card0 selected channel COChannelConfig Configuration code for card0 selected channel C1Channel Select the Card1 scan channel CiChannelVal Set up scan 1 or no scan 0 for card1 selected channel C1ChannelConfig Configuration code for card1 selected channel Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board number is 0 Control SetTwoMAChannelConfig 0 1 0 0 1 0 Gei the TwoMA channel configuration Control SetTwoMAChannelConfig 1 1 0
37. ction users need to call function Control ActiveBoard to activate selected PCI multifunction board Prototype void AddToMagicScan short nAdChannel short nConfig short nAverage short nLowAlarm short nHighAlarm short nAlarmType Parameters nAdChannel Set channel number nConfig Configuration code refer to Section 3 6 9 Configuration Table for details nAverage The factor of digital average filter nLowAlarm 12 bits low alarm data nHighAlarm 12 bits high alarm data nAlarmType Ozno alarm 1 high alarm 2 low alarm 3 in alarm 4 out alarm Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control ClearMagicScan Clear the scan data Control AddToMagicScan 0 0 1 0 0 0 Add CH 0 to scan in Magic Scan Control SaveMagicScan 0 wV0 0 Save data in place 0 of Magic scan buffer Control AddToMagicScan 2 0 1 0 0 O Add CH 2 to scan in Magic Scan Control SaveMagicScan 1 wV1 0 Save data in place 1 of Magic scan buffer Control StartMagicScan 24 2000 0 Set parameters of magic scan and start scan Comments Please refer to the demo11 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 25 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 7 2 ClearMagicScan This method initializes the MagicScan controller of current active PCI multifunction board into the Initial state Users ne
38. e Stop and close the OCX Driver of PCI multifunction 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 Driverlnit initia driver Control ActiveBoard 0 select action board 0 Control DriverClose release the device resource Date January 24 2002 Ver 1 0 Page 13 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 3 General Properties Data type of ae Properties Name Descriptions returned value Get or select active multifunction boards installed in ActiveBoard short the system 3 3 1 ActiveBoard This property is used to activate one of the multifunction boards installed in the system This function must be called once before the Digitalln DigitalOut Analogin AnalogOut functions are used It allow user 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 January 24 2002 Ver 1 0 Page 14 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 4 Digital Input Output Methods Data type of CH Method Name Data size Descriptions returned value Digitalin short 2 Byte
39. e and sampling rate for Start ADIrqStart method Control GetFloatBuffer DataNo WaveData 0 Set the parameter and get Interrupt data after ADIrqStart Control ADIrqStop Stop the AD Analog Digital Interrupt Comments Please refer to the Interrupt demo and it is only for PCI 1002 Date January 24 2002 Ver 1 0 Page 70 PC11800X PCI11602X PC11202X ActiveX Control User s Manual 3 12 General Events The PC11800X PC11602X PCl1202X PC11002X has only one Event as shown in the following 3 12 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 lErrorCode Arguments lErrorCode 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 lErrorCode Chr 13 Error Message Control ErrorString Date January 24 2002 Ver 1 0 Page 71
40. e read nLowAlarm Low alarm limit if value lt fLowAlarm gt LowAlarm nHighAlarm High alarm limit if value gt fHighAlarm gt HighAlarm Example Control ActiveBoard 0 Set the active board Control SetMFun3ChannelConfig 0 1 0 Set Mfun3 channel configuration Control SetMFun3ChannelConfig 1 1 0 Set Mfun3 channel configuration Control SetMFun3ChannelConfig 2 1 0 Set Mfun3 channel configuration Set Mfun3 parameter Control SetMFun3Parameter 90 10 4 5 24 100 10 10 Control StartMFUN3 AdBuf 0 Start MFun3 function and get the MFun3 buffer Comments Please refer to the demo9 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 41 PC11800X PC11602X PCI1202X ActiveX Control User s Manual 3 8 8 SetMFun3ChannelConfig This method is used to set up which AD channel is used to obtain the analog input data and its corresponding configuration code input range for MFun3 Prototype void SetMFun3ChannelConfig short nChannel short nChannelVal short nConfig Parameters nChannel Define the analog input channel nChannelVal Define the analog input channel the first parameter is read or not nConfig Configuration code Refer to Section 3 6 5 Configuration Table Example Control ActiveBoard 0 Set the active board Control SetMFun3ChannelConfig 0 1 0 Set Mfun3 channel configuration Control SetMFun3ChannelConfig 1 1 0 Set Mfun3 channel configuration Control SetMFun3ChannelCon
41. ed to call Control ActiveBoard method to activate selected PCI multifunction board in advance Prototype void ClearMagicScan Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control ClearMagicScan Clear the scan data Control AddToMagicScan 0 0 1 0 0 0 Add CH 0 to scan in Magic Scan Control SaveMagicScan 0 wV0 0 Save data in place 0 of Magic scan buffer Control AddToMagicScan 2 0 1 0 0 O Add CH 2 to scan in Magic Scan Control SaveMagicScan 1 wV1 0 Save data in place 1 of Magic scan buffer Control StartMagicScan 24 2000 0 Set parameters of magic scan and start scan While True Do while Status Control ReadMagicScanStatus Get the Magic Scan Status If Status gt 1 Then If the status gt 1 GoTo Over call the sub Over End If End if Sleep 10 Wend Over Control StopMagicScan Stop magic scan Comments Please refer to the demo 11 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 26 PC11800X PCI11602X PC11202X ActiveX Control User s Manual 3 7 3 ReadMagicScanStatus This method obtains the status of the MagicScan operation for current active multifunction board Prototype short ReadMagicScanStatus Return MagicScan status Status Description 0x00 MagicScan initial condition idle state 0x01 MagicScan is working 0x02 MagicScan stage
42. ffer wBuffer The first address of the wBuffer buffer word Array that store the AD value in HEX format Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control Installlrq hEvent 100 Install the event and counter Control ADIrqStart 0 0 c2 Set the channel configuration code and sampling rate for Start ADIrqStart method Control GetBuffer DataNo WaveData 0 Set the parameter and get Interrupt data after ADIrqStart Control ADIrqStop Stop the AD Analog Digital Interrupt Comments Please refer to the Interrupt demo and it is only for PCI 1002 Date January 24 2002 Ver 1 0 Page 69 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 11 7 GetFloatBuffer This subroutine is used to transfer analog input data obtained from interrupt method into the user s buffer by floating point format Prototype void GetFloatBuffer long dwNum float FAR fAdVal Parameters dwNum The total number to be transferred into user s buffer fAdVal The first address of the fAdVals buffer float Array that store the analog input value into floating point format Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control Installlrq hEvent 100 Install the event and counter Control ADIrqStart 0 0 c2 Set the channel configuration cod
43. fig 2 1 0 Set Mfun3 channel configuration Control SetMFun3Parameter 90 10 4 5 24 100 10 10 Set Mfun3 parameter Control StartMFun3 AdBuf 0 Start MFun3 function and get the MFun3 buffer Comments Please refer to the demo9 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 42 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 8 9 StartMFun3 This function is used to start the defined work of MFun3 to generate the sine waveform image automatically and obtain analog input data from the defined AD channel Refer to multifunction boards Hardware Manual chapter 5 for details where the analog output channel is channel 0 and analog input channel and its corresponding gain is programmable Prototype void StartMFun3 float FAR fAdBuf Parameters fAdBuf the beginning address of fAdBuf which AD data is stored Example Control ActiveBoard 0 Set the active board Control SetMFun3ChannelConfig 0 1 0 Set Mfun3 channel configuration Control SetMFun3ChannelConfig 1 1 0 Set Mfun3 channel configuration Control SetMFun3ChannelConfig 2 1 0 Set Mfun3 channel configuration Set Mfun3 parameter Control SetMFun3Parameter 90 10 4 5 24 100 10 10 Control StartMFun3 AdBuf 0 Start MFun3 function and get the MFun3 buffer Comments Please refer to the demo9 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 43 PC11800X PC11602X PC11202X ActiveX Control
44. form by user square waveform If ii gt 128 And ii lt 192 Then CONTROL SetMFun2DavVal ii Str amp H800 Set data No and value Elself ii gt 191 And ii lt 256 Then CONTROL SetMFun2DavVal ii Str amp H800 64 8 Set data No and value Else CONTROL SetMFun2DavVal ii Str amp H800 Set data No and value End If Next ii CONTROL StartMFun2 Start MFun2 Function CONTROL GetMFun2Buf wAd 0 Get MFun2 AD Buffer data Comments Please refer to the demo7 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 39 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 8 6 GetMFun2Buf The method is used to get the Analog input data from data buffer of MFun2 Prototype void GetMFun2Buf short FAR MFun2Buf Parameters MFun2Buf The beginning address of MFun2Buf which AD data is stored Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board is 0 Control SetMFun2Parameter 320 50 80 510 0 Set Mfun2 s Parameter For ti 0 To 127 produce arbitrary waveform by user triangle waveform If ii lt 64 Then CONTROL SetMFun2DavVal ii Str amp H800 ii 16 Set data No and value Else CONTROL SetMFun2DavVal ii Str amp H800 128 ii 16 Set data No and value End If Next ii For ii 128 To 319 produce arbitrary waveform by user square waveform If ii gt 128 And ii lt 192 Then CONTR
45. ger during one batch time Function SetChannelConfig can be used to change channel or configuration code And the ADMultiPolling function bases on the setting of SetChannelConfig to get AD data This function also refer to the current active multifunction board by using the function Control ActiveBoard Prototype void ADMultiPolling float FAR fAdBuf long wNum Parameters fAdsBuf Starting address of AD data buffer 16 bits these data will be automatically computed based on the setting of the SetChannelConfig function wNum 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 SetChannelConfig 3 0 2 5V range Control DelayUs 23 delay 23 us settling time Control ADMultiPolling fAdBuf 0 100 Start the ADMultiPolling function and save data into fAdBuf Date January 24 2002 Ver 1 0 Page 20 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 6 5 ADPollingHex This method performs the AD conversion by polling method Function Control SetChannelConfig can be used to set up or change analog input channel and configuration code And then Control ADPollingHex bases on those configuration to obtain analog input value from defined channel according to active multifunction board In first users need to call Control ActiveBoard method to activate selected PCI multifunctio
46. i the SecondCardchannel1 configuration Control SetSecondCardChannelConfig 2 1 0 Gei the SecondCardchannel2 configuration Control SecondCardStartScan 80 AdNumber Set the parameter and start continuous capture of function SecondCard RetValue Control GetSecondCardChannelData Buf 0 Buf1 0 wStatus Get data and status of SecondCard IF RetValue 0 then Control SecondCardStop Stop the SecondCard End IF Comments Please refer to the demo14 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 61 PC11800X PCI1602X PC11202X ActiveX Control User s Manual 3 10 7 GetSecondCardChannelData This method is used to return the second card scan states and get the AD data of the second card from continuous capture mechanism of Card into two format The first format is in a circular gueue of scan seguence control like 012 N012 N 012 N The second way is to put the scan analog input data in channel format like 000 111 222 NNN Prototype short GetSecondCardChannelData short FAR nSBuf short FAR nCBuf short FAR nStatus Parameters nSBuf Data buffer which store data in scan seguence order format 012 N012 N 012 N nCBuf Data buffer which store data in channel seguence order format 000 111 222 NNN nStatus 1 thread start 2 TimeOut 8 FIFO overflow 0x80 thread finish Return 0 Data is ready 1 Data not ready Example wTotalBoard Control Driverlnit Initi
47. l short nChannelVal short nConfig Parameters nChannel O Select the scan channel for first card nChannelVal Set up scan 1 or no scan 0 for card0 selected channel nConfig Configuration code for selected channel Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board number is 0 Control SetFirstCardChannelConfig 0 1 0 Gei the FirstCardchannelO configuration Control SetFirstCardChannelConfig 1 1 0 Gei the FirstCard channel1 configuration Control SetFirstCardChannelConfig 2 1 0 Gei the FirstCard channel2 configuration Control FirstCardStartScan 80 AdNumber Set the parameter and start continuous capture of function FirstCard RetValue Control GetFirstCardChannelData Buf 0 Buf1 0 wStatus Get data and status of FirstCard IF RetValue 0 then Control FirstCardStop Stop the FirstCard End IF Comments Please refer to the demo13 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 56 PC11800X PC11602X PCI1202X ActiveX Control User s Manual 3 10 2 FirstCardStartScan This method is used to start continuous data capture mechanism of FirstCard by the configuration of AD sampling rate and how many data can be got from the selected channel Prototype void FirstCardStartScan short nSampleRate short nCount Parameters nSampleRate AD sampling rate 8M nSampleRate nSampleRate 80 gt sampling rate
48. leRateDiv 24 gt sampling rate 8M 24 330K dwNum Number of MagicScan cycle performed nPriority Be used to adjust the priority of the thread For example to prevent the lock of CPU users can try to use the lower priority ID Description THREAD_PRIORITY_LOWEST THREAD_PRIORITY_BELOW_NORMAL THREAD_PRIORITY_NORMAL THREAD_PRIORITY_ABOVE_NORMAL THREAD_PRIORITY_HIGHEST 15 THREAD_PRIORITY_TIME_CRITICAL others THREAD_PRIORITY_NORMAL Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control ClearMagicScan Clear the scan data Control AddToMagicScan 0 0 1 0 0 0 Add CH 0 to scan in Magic Scan Control SaveMagicScan 0 wV0 0 Save data in place 0 of Magic scan buffer Control AddToMagicScan 2 0 1 0 0 O Add CH 2 to scan in Magic Scan Control SaveMagicScan 1 wV1 0 Save data into Magic scan buffer Control StartMagicScan 24 2000 0 Set parameters of Magic scan and start scan Comments Please also refer to the demo11 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 29 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 7 6 StartMagicScanPostTrg This method starts the post trigger operation of MagicScan for current active multifunction board Users can utilize the method ReadMagicScanStatus to check the operation state of StartMagicScanPostTrg function Extern
49. mments Please refer to the demo21 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 46 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 9 3 OneMAStart This method is used to start the function OneMA to capture analog input data and store into main memory Prototype void OneMAStart short FAR CardBuffer Parameters CardBuffer Buffer for storing AD data from Card Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board number is 0 Control SetOneMAChannelConfig 0 1 0 Gei the OneMA channel configuration Control SetOneMAChannelConfig 1 1 0 Gei the OneMA channel configuration Control SetOneMAChannelConfig 2 1 0 Gei the OneMA channel configuration Control SetOneMAParameter 80 2000000 0 Set the parameters of function Control OneMAStart Card0Buf0 0 Start OneMA and store the data into buffer RetValue Control OneMAReadStatus Get the status of OneMA IF RetValue 128 Then Control OneMAStop Stop OneMA function End IF Comments Please refer to the demo21 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 47 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 9 4 OneMAReadStatus This method is used to get the status of capturing data mechanism of function OneMA Prototype short OneMAReadStatus Return 0 Data is notready 1 Function OneMA
50. n board Prototype short ADPollingHex Return Analog input value which is automatically computed based on the setting of Control SetChannelConfig Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first Board to active Control SetChannelConfig 0 0 Channel 0 5V range V0 Control ADPollingHex VO Channel 0 analog value Date January 24 2002 Ver 1 0 Page 21 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 6 6 CONFIGURATION CODE PCI1202L PCI 1800L PCI1802L Configuration Code Table Bipolar Unipolar Input Signal Range Settling Time Configuration Code Bipolar 5V 3 US 0x00 Bipolar 2 5V 3 US 0x01 Bipolar 1 25V 3 US 0x02 Bipolar 0 625V 3 US 0x03 Bipolar 10V 3 US 0x04 Bipolar 5V 3 US 0x05 Bipolar 2 5V 3 US 0x06 Bipolar 1 25V 3 US 0x07 Unipolar OV 10V 3 US 0x08 Unipolar OV 5V 3 US 0x09 Unipolar OV 2 5V 3 US Ox0A Unipolar OV 1 25V PCI 1602 Configuration Code Table Bipolar Unipolar Input Signal Range 3 US Settling Time 0x0B Configuration Code Bipolar 10V 10 us 0 Bipolar 5V 10 us 1 Bipolar 2 5V 10us 2 Bipolar 1 25V PCI 1602F Configu
51. ontrol 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 after using any function Return long 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 Get the error message Date January 24 2002 Ver 1 0 Page 8 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 1 3 Table of ErrorCode and ErrorString Error ID Error String Comment NoError OK No Error DriverHandleError Device driver opened error DriverCallError Got the error while calling the driver functions ADControllerError Embedded controller handshake error ConfigCodeError Refer to Section 3 6 9 Configuration Code ADPollingTimeOut Hardware timeout error FindBoardError Can t find the multifunction board on the system ADChannelError The valid range is 0 to 31 DAChannelError The valid channel numbe
52. r must be 0 or 1 O ON Ol oF A Gi Mi InvalidateDelay The valid range of dwDelayUs is lt 8191 zech Oo DelayTimeOut Timeout wh InvalidateData Invalid Data a N TimeOut Timeout ExceedBoardNumber Invalidate board number Valid range 0 to TotalBoards 1 NotFoundBoard Can t detect any multifunction board on the system OpenError Not Used FindTwoBoardError Can t find out two multifunction boards AllocateMemoryError Fail to allocate the memory buffer M FunExecError Fail to execute the M Functions not for 1002 FreguencyComputeError Not Used not for 1002 HighAlarm Analog input value gt High Alarm value not for 1002 LowAlarm Analog input value lt Low Alarm value not for 1002 AlarmTypeError The valid range is 0 to 4 not for 1002 FifoOverflow FIFO overflow not for 1002 ThreadCreateError Fail to create thread not for 1002 StopError Stop Error not for 1002 DriverNoOpen Driver not open for 1002 only GetintCountError Get counter of interrput error for 1002 only InstalllrqError Install IRQ Error for 1002 only RemovelrqError Remove IRQ Error for 1002 only ClearIntCountError Clear counter value Error for 1002 only Date January 24 2002 Ver 1 0 Page 9 PC11800X PC11602X PC11202X ActiveX Control User
53. ration Code Table Bipolar Unipolar Input Signal Range 10 us Settling Time Configuration Code Bipolar 10V 5 us 0 Bipolar 5V 5 us 1 Bipolar 2 5V 5 us Bipolar 1 25V 5 us Date January 24 2002 Ver 1 0 Page 22 PC11800X PC11602X PC11202X ActiveX Control User s Manual PCI1202H PCI 1800H PCI1802H Configuration Code Table Bipolar Unipolar Input Signal Range Gain Settling Time Configuration Code Bipolar 5V 1 23 US 0x10 Bipolar 0 5V 10 28 US 0x11 Bipolar 0 05V 100 140 us 0x12 Bipolar 0 005V 1000 1300 us 0x13 Bipolar 10V 0 5 23 us 0x14 Bipolar 1V 5 28 us 0x15 Bipolar 0 1V 50 140 us 0x16 Bipolar 0 01V 1300 us 0x17 Unipolar OV 10V 23 us 0x18 Unipolar OV 1V 28 US 0x19 Unipolar OV 0 1V 140 us Ox1A Unipolar OV 0 01V PCI 1002L Configuration Code Table Bipolar Unipolar Input Signal Range 1300 us Max Switching Frequency 0x1B Configuration Code Bipolar 5V 110K s 0x00 Bipolar 2 5V 110K s 0x01 Bipolar 1 25V 110K s 0x02 Bipolar 0 625 PCI 1002H Configuration Code Table Bipolar Unipolar Input Signal Gain Range 1
54. rigger 24 100 0 Set parameters of Pre Trigger Magic scan and start scan Comments Please also refer to the demo24 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 31 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 7 8 StartMagicScanMiddleTrg This method will start the middle trigger operation of MagicScan for current active multifunction board Users can use the method ReadMagicScanStatus to check the operation state of StartMagicScanMiddleTrg function External trigger CH Prototype void StartMagicScanMiddleTrigger short wSampleRateDiv long dwN1 long dwN2 Start g End short nPriority External middle trigger Parameters wSampleRateDiv AD sampling rate 8M wSampleRateDiv wSampleRate 24 gt sampling rate 8M 24 330K dwN1 Number of MagicScan cycle performed dwN2 Number of MagicScan cycle performed nPriority Be used to adjust the priority of the thread For example to prevent the lock of CPU users can try to use the lower priority ID Description THREAD_PRIORITY_LOWEST THREAD_PRIORITY_BELOW_NORMAL THREAD_PRIORITY_NORMAL THREAD_PRIORITY_ABOVE_NORMAL THREAD_PRIORITY_HIGHEST 15 THREAD_PRIORITY_TIME_CRITICAL others THREAD_PRIORITY_NORMAL Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board 0 Control ClearMagicScan Clear the scan data Control
55. s Get digital input value DigitalOut void Output digital value 3 4 1 Digitalin This method is used to obtain the digital input value from active multifunction board Prototype 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 3 4 2 DigitalOut This method is used to output the digital value throught active multifunction board Prototype void DigitalOut long wDo Parameters wDo Digital output value by Hex format 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 value Date January 24 2002 Ver 1 0 Page 15 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 5 Analog Output Methods Data type of l A Method Name Data size Descriptions returned value AnalogOut void This method is used to output analog value 3 5 1 AnalogOut This method is used to output 12 bits DA data to DA port through current active PCI multifunction board Firstly users need to call Control ActiveBoard method to activate selected PCI multifunction board and then use this function to output analog value The analog output value is in Hex format Prototype
56. sed to set up the sampling rate how many data can be read and priority of OneMA for the only one multifunction board The priority setting is described in below Prototype void SetOneMAParameter short nClock0Div long dwMaxCount0 short nPriority Parameters nClockODiv define Card0 AD sampling rate which is 8M nCard0ClockDiv dwMaxCount0 Set how many analog input data can be read from the Card0 nPriority Set the thread s priority Here the thread is used to get the AD data from this PCI multifunction board Priority Value Priority ID 2 THREAD_PRIORITY_LOWEST 1 THREAD PRIORITY BELOW NORMAL THREAD PRIORITY NORMAL THREAD PRIORITY ABOVE NORMAL THREAD PRIORITY HIGHEST 15 THREAD PRIORITY TIME CRITICAL others THREAD PRIORITY NORMAL Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board number is 0 Control SetOneMAChannelConfig 0 1 0 Gei the OneMA channel configuration Control SetOneMAChannelConfig 1 1 0 Gei the OneMA channel configuration Control SetOneMAChannelConfig 2 1 0 Gei the OneMA channel configuration Control SetOneMAParameter 80 2000000 0 Set the parameters of function Control OneMAStart Card0Buf0 0 Start OneMA and store the data into buffer RetValue Control OneMAReadStatus Get the status of OneMA IF RetValue 128 Then Control OneMAStop Stop OneMA function End IF Co
57. start continuous capture of function SecondCard RetValue Control GetSecondCardChannelData Buf 0 Buf1 0 wStatus Get data and status of SecondCard IF RetValue 0 then Control FirstCardStop Stop the SecondCard End IF Comments Please refer to the demo14 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 63 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 11 Interrupt Methods Note that the following methods can t be used with other series multifunction board except PCI 1002 because interrupt method is adapted Data type of Method Name Data size Descriptions returned value GetirgNo short 2 bytes Get the IRQ number of the active PCI 1002 board Obtain the number of times which interrupt have happened ADIrqStop void Stop the interrupt ADIrqStart void Start the interrupt GetirgCount long 4 bytes Installlrq void Install interrupt handler for a specific IRQ Transfer analog input data obtained from GetBuffer void interrupt method into the user s buffer by word format Transfer analog input data obtained from GetFloatBuffer void interrupt method into the user s buffer by floating point format Date January 24 2002 Ver 1 0 Page 64 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 11 1 GetirgNo This method is used to get the IRQ number of the active PCI 1002 board installed in the system It can let you known what IRQ number
58. t the active board number is 0 Control SetTwoMAChannelConfig 0 1 0 0 1 0 Gei the TwoMA channel configuration Control SetTwoMAChannelConfig 1 1 0 1 1 0 Control SetTwoMAChannelConfig 2 1 0 2 1 0 Control SetTwoMAParameter wClockDiv wClockDiv 20000 20000 Priority Set the parameters of TwoMA function Control twoMAStart CardOBuf0 0 CardOBuf1 0 Start TwoMA and store the data into buffer RetValue Control woMAReadStatus Read the TwoMA status IF RetValue 128 Then Control TwoMAStop Stop TwoMA function End IF Comments Please refer to the demo20 and it is not for PCI 1002 Date January 24 2002 Ver 1 0 Page 52 PC11800X PCI11602X PC11202X ActiveX Control User s Manual 3 9 9 TwoMAReadStatus This method is used to get the status of capture data mechanism by function TwoMA Prototype short TwoMAReadStatus Return 0 Data is notready 1 Function TwoMA is working 8 Data overflow 128 Completely capture data Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board number is 0 Control SetTwoMAChannelConfig 0 1 0 0 1 0 Gei the TwoMA channel configuration Control SetTwoMAChannelConfig 1 1 0 1 1 0 Control SetTwoMAChannelConfig 2 1 0 2 1 0 Control SetTwoMAParameter wClockDiv wClockDiv 20000 20000 Priority Set the parameters of TwoMA function Control twoMAStart CardOBuf0 0 Card
59. tion code Refer to Section 3 6 9 Configuration Table for details Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the first Board to active Control SetChannelConfig 0 0 Channel 0 5V range Control DelayUs 23 delay 23 us settling time V0 Control ADPolling VO Channel 0 analog value Date January 24 2002 Ver 1 0 Page 17 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 6 2 ADPolling This method performs the AD conversion by polling method Function Control SetChannelConfig can be used to set up or change analog input channel and configuration code And then Control ADPolling bases on this configuration to obtain analog input value from defined channel by the float format according to active multifunction board In first users need to call Control ActiveBoard method to activate selected PCI multifunction board Prototype float ADPolling 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 SetChannelConfig 0 0 Channel 0 5V range Control DelayUs 23 delay 23 us settling time V0 Control ADPolling VO Channel 0 analog value Date January 24 2002 Ver 1 0 Page 18 PC11800X PC11602X PC11202X ActiveX Control User s Manual 3 6 3 ADMultiPacer This method performs multiple
60. vides a function to set up configuration code of function Mfun2 This subroutine can be used to set how much data of DA samples can be outputted during one waveform how many DA waveforms can be outputted in one batch time AD sampling rate how many AD data can be read during one working cycle and the configuration code of AD input range for continuous waveform generation and capture of MFun2Function Prototype void SetMFun2Parameter short nDaNumber short nDaWave short nAdClock short nAdNumber short nAdConfig Parameters nDaNumber Number of DA samples in one waveform nDaWave Number of DA waveform to be output nAdClock AD sampling clock samples sec 8M nAdClock nAdNumber Number of AD data to be read nAdConfig AD input range configuration code Refer to Section 3 6 5 Example wTotalBoard Control Driverlnit Initialize the driver and get the total boards Control ActiveBoard 0 Set the active board is 0 Control SetMFun2Parameter 320 50 80 510 0 Set Mfun2 s Parameter For ii 0 To 127 produce arbitrary waveform by user triangle waveform If ii lt 64 Then CONTROL SetMFun2DavVal ii Str amp H800 ii 16 Set data No and value Else CONTROL SetMFun2DavVal ii Str amp H800 128 ii 16 Set data No and value End If Next ii For ti 128 To 319 produce arbitrary waveform by user square waveform If ii gt 128 And ii lt 192 Then CONTROL SetMFun2DavVal ii Str amp H800 Set data
Download Pdf Manuals
Related Search
Related Contents
User Guide Guía del Usuario Samsung WS-28A116D User Manual Mode d`emploi manuel d`utilisation magic flight launch box 取扱説明書 - ご家庭のお客さま/大阪ガス Drücken Sie die Programmiertaste. - mbm Copyright © All rights reserved.
Failed to retrieve file