PCI-8124-C Advanced 4-CH Encoder Card with High-speed Triggering Function User’s Manual Manual Rev. 2.00 Revision Date: April 27, 2009 Part No: 50-11162-1000 Advance Technologies; Automate the World.
Copyright 2009 ADLINK TECHNOLOGY INC. All Rights Reserved. The information in this document is subject to change without prior notice in order to improve reliability, design, and function and does not represent a commitment on the part of the manufacturer. In no event will the manufacturer be liable for direct, indirect, special, incidental, or consequential damages arising out of the use or inability to use the product or documentation, even if advised of the possibility of such damages.
Getting Service from ADLINK Contact us should you require any service or assistance. ADLINK Technology Inc. Address: 9F, No.166 Jian Yi Road, Chungho City, Taipei County 235, Taiwan קᗼխࡉؑ৬ԫሁ 166 ᇆ 9 ᑔ Tel: +886-2-8226-5877 Fax: +886-2-8226-5717 Email: service@adlinktech.com Ampro ADLINK Technology Inc. Address: 5215 Hellyer Avenue, #110, San Jose, CA 95138, USA Tel: +1-408-360-0200 Toll Free: +1-800-966-5200 (USA only) Fax: +1-408-360-0222 Email: info@adlinktech.
ADLINK Technology Inc. (German Liaison Office) Address: Nord Carree 3, 40477 Duesseldorf, Germany Tel: +49-211-495-5552 Fax: +49-211-495-5557 Email: emea@adlinktech.com ADLINK (French Liaison Office) Address: 15 rue Emile Baudot, 91300 MASSY Cedex, France Tel: +33 (0) 1 60 12 35 66 Fax: +33 (0) 1 60 12 35 66 Email: france@adlinktech.com ADLINK Technology Japan Corporation Address: 151-0072 ᧲੩ㇺᷦ⼱ᐈ䊱⼱㩷 1-1-2 ᦺᣣ↢ᐈ䊱⼱䊎䊦 8F Asahiseimei Hatagaya Bldg.
Table of Contents Table of Contents..................................................................... i List of Tables.......................................................................... iv List of Figures ......................................................................... v 1 Introduction ........................................................................ 1 1.1 1.2 1.3 Features............................................................................... 3 Specifications..............
4.2 4.3 4.4 Homing with EZ Signal ................................................. 31 Trigger Pulse Width ...................................................... 31 Linear Function ............................................................. 31 FIFO .............................................................................. 32 PWM & Mapping ........................................................... 32 Digital Filter ...................................................................
6.8 6.9 6.10 6.11 6.12 6.13 6.14 6.15 Linear Comparing .............................................................. Manual Trigger................................................................... Digital Input........................................................................ Latch .................................................................................. Timer.................................................................................. Interrupt ......................................
List of Tables Table 2-1: CN1 Pin Assignments ............................................. 13 Table 2-2: CN2 Pin Assignments: TTL Output ......................... 14 Table 6-1: Data Type Definitions .............................................
List of Figures Figure 1-1: PCI-8124-C Block Diagram ....................................... 2 Figure 2-1: PCI-8124-C PCB Layout .........................................
vi List of Figures
1 Introduction The PCI-8124-C is an advanced quadrature encoder counter board with position compare and high speed trigger pulse output capability. With a state-of-the-art of FPGA, it can meet most machine maker requirements – high frequency encoder input and trigger pulse output. Typically, most machine makers design motion control systems and vision inspection systems individually.
ADLINK provides a Windows WDM driver for users. Users can use DLL function library to build up the application. The block diagram of PCI-8124-C is as follows.
1.1 Features PCI Rev 2.2, 32-bit/33Mhz Compliment Support both PCI-X (3.3V) and PCI (5V) slots Support 4-bit board ID for multiple boards in one system 4 differential quardrature encoder counter input channels Each encoder counter input pair supports 1/2/4x A/B phase, dual pulse (CW/CCW) and signed pulse (OUT/DIR) modes Internal digital filter 4 trigger output channels via both open collector and TTL pins Trigger pulse width is software programmable from 0.1µs to 3.
1.2 Specifications Main Chip Chip Vendor: ACTEL Model No: A3P1000 Power usage: 3.3V and 1.
Trigger Output: Number of channels: 4 Maximum output frequency: 5Mhz Output types: Open collector or TTL Open collector Isolated photo-coupler: PS9115 Open collector Isolated: 2500 Vrms Continuous triggering method: Timer, FIFO or Linear function data reloading Interrupt: Yes, when triggered Trigger counter: Yes Comparator FIFO: Number of FIFO: 4 FIFO depth: 1023x32bits Interrupt type: Empty/full/low (1/4,1/2,3/4) Auto reload: Yes, auto reload next FIFO data to
TTL Input Number of input pins: 4 Photo-coupler Isolated: No TTL input mode: General purpose or timer synchronous start signal TTL output Number of output pins: 4 Photo-coupler Isolated: No TTL output mode: General purpose output or trigger output General Specifications Connectors: 50-pin SCSI-type connector Operating Temperature: 0C - 70C Storage Temperature: -20C - 80C Humidity: 5 - 85%, non-condensing Power Consumption Slot power supply (input): +5V DC 5%,
1.3 Supported Software 1.3.1 Programming Library ADLINK provides Windows WDM driver and DLL function library for the PCI-8124-C. These function libraries are shipped with the board. It supports for Windows 2000/XP/Vista.
8 Introduction
2 Installation This chapter describes how to install the PCI-8124-C. Please follow these steps below: Check what you have (Section 2.1) Check the PCB (Section 2.2) Install the hardware (Section 2.3) Install the software driver (Section 2.4) Understanding the I/O signal connections (Chapter 3) and their operation (Chapter 4) 2.
2.
2.3 PCI-8124-C Hardware Installation 2.3.1 Hardware Configuration The PCI-8124-C is fully Plug and Play compliant. Hence memory allocation (I/O port locations) and IRQ channel of the PCI card are assigned by the system BIOS. The address assignment is done on a board-by-board basis for all PCI cards in the system. 2.3.2 PCI Slot Selection Your computer system may have both PCI and ISA slots. Do not force the PCI card into a PC/AT slot. The PCI-8124-C can be used in any PCI slot.
Check the control panel of the Windows system if the card is listed by the system. If not, check the PCI settings in the BIOS or use another PCI slot. 2.4 Software Driver Installation Using the All-In-One CD with PCI-8124-C package and execute the following steps: 1. Autorun the ADLINK All-In-One CD. 2. Follow the procedures of the installer. 3. After setup installation is completed, restart windows.
2.5 CN1 Pin Assignments CN1 is the 50-pin SCSI type connector for I/O signals. No. Name I/O Function No.
2.6 CN2 Pin Assignments: TTL Output CN2 is a 6-pin header as follows: No. Name I/O Function 1 +5V - +5V power supply 2 TTL-OUT1 O TTL output signal 3 TTL-OUT2 O TTL output signal 4 TTL-OUT3 O TTL output signal 5 TTL-OUT4 O TTL output signal 6 DGND - TTL signal ground Table 2-2: CN2 Pin Assignments: TTL Output Note: +5V and DGND pins are provided by the PCI-Bus. Therefore, these signals are not isolated. 2.
3 Signal Connections Signal connections of all I/O’s are described in this chapter. Refer to the contents of this chapter before wiring any cables between the PCI-8124-C and the end device. This chapter contains the following sections: Section 3.1 Connector (CN1) Pin Definition Section 3.2 Isolated Input Ports (LTC, INCOM) Section 3.3 Isolated Encoder Differential Input Section 3.4 Isolated Output Ports (TRG, EGND) Section 3.5 TTL Input Ports Section 3.
3.1 Connector (CN1) Pin Definition There are 4 Isolated Latch Inputs, 4 A-B-Z Encoder Inputs, 4 TTL level Inputs, 4 TTL level outputs and 4 Isolated Outputs on PCI8124-C. The following table shows the pin assignment of CN1. 16 CN1No.
CN1No.
3.2 Isolated Input Ports (LTC, INCOM) There are 4 pairs of isolated input ports on PCI-8124-C. Each pair has two terminals. One is INCOMx, and the other is LTCx. Because the input port of the photo coupler utilized on PCI-8124-C is single-directional, LTC signal must be lower than INCOM signal. When there is a differential voltage between LTCx and corresponding INCOMx, the photo coupler will turn on immediately. There is an internal resistor in the PCI-8124-C circuit as figure shows below.
3.3 Isolated Encoder Differential Input There are 4 pairs of A-B-Z encoder signal inputs on PCI-8124-C. The pin assignment of these encoder inputs are listed in the following table. The typical forward voltage of the input diode is 1.65V. And the forward current of the input diode is 7.5mA to 12.5mA. There is an internal resistor in the PCI-8124-C circuit as figure shows below.
3.4 Isolated Output Ports (TRG, EGND) There are 4 independent isolated output ports on PCI-8124-C. Because the use of photo coupler PS9115, the output pull high is not needed. The pin assignment of the isolated output ports on PCI-8124-C is as follows, and PS9115 output characteristics are described in the following figure. CN1 Pin No.
inside PCI-8124 Outside PCI-8124 220Ω TRGx Signal Connections 21
3.5 TTL Input Ports There are 4 single ended TTL-level input ports on PCI-8124-C. The following table shows the pin assignment of these TTL inputs. CN1 Pin No. Name Description 21 TTL-IN1 TTL Level Input port 1 22 TTL-IN2 TTL Level Input port 2 46 TTL-IN3 TTL Level Input port 3 47 TTL-IN4 TTL Level Input port 4 25, 50 DGND TTL Input reference GND The maximum input voltage of TTL-level input ports is 4.6VDC. So user should not apply signals over this limitation.
3.6 TTL Output Ports There are 4 single ended TTL-level output ports on PCI-8124-C. The following table shows the pin assignment of these TTL outputs. CN1 Pin No. Name Description 23 TTL-OUT1 TTL Level Output port 1 24 TTL-OUT2 TTL Level Output port 2 48 TTL-OUT3 TTL Level Output port 3 49 TTL-OUT4 TTL Level Output port 4 25, 50 DGND TTL Input reference GND The maximum output or sink current of each channel is 25mA. And the maximum output voltage is D5V.
24 Signal Connections
4 Operation Theory This chapter describes the detail operation of the PCI-8124-C board. Contents of the following sections are as follows: Section 4.1: The trigger board overview Section 4.2: Trigger board operation Section 4.3: Multiple boards operation Section 4.
4.1 Trigger Board Overview The input and output relationships are shown as follows: Inside the PCI-8124-C, all the position comparison and mapping tasks will be executed within the FPGA.
and FIFO individually. Due to the mapping mechanism, several combinations are provided for users to continuously send out the trigger pulse with isolation or non-isolation channels. Latch signal can let users retain and retrieve the position data at very short time. Linear function will automatically load the next comparing points with a fixed incremental value into 32-bit comparator.
4.1.1 Encoder Channel The PCI-8124-C has four 32-bit binary up/down counters to keep the present feedback position from each encoder channel. The counter counts signal inputs from the EA and EB pins. The counter source could be assigned to internal timer. It accepts 3 types of pulse inputs: (1). Single pulse mode (OUT/ DIR) (2) Dual pulse mode (CW/CCW) (3) 90° phase shifted signals (AB phase mode). 90° phase shifted signals maybe multiplied by a factor of 1, 2 or 4.
Dual Pulse Mode (CW/CCW Mode) In this mode, EA is dedicated to count the pulses from external source and view it as clockwise direction (CW). EB is dedicated to count the pulses from external source and view it as counterclockwise direction (CCW). Simply put, EA counts up and EB counts down. User can decide the normal high or normal low for those two channels according to users’ devices. The following diagrams show the normal high and normal low cases individually.
90° phase shifted signals (AB phase Mode) In this mode, EA signal is a 90° phase leading or lagging to EB signal. “Lead” or “lag” of phase difference between two signals is caused by the turning direction of the motor. The up/down counters counts up when the phase of EA signal leads the phase of EB signal. The following diagram shows the waveform. 4.1.2 Index Input (EZ) The index input (EZ) signals of the encoders are used as the “ZERO” reference. This signal is common on most rotational motors.
4.1.3 Homing with EZ Signal The PCI-8124-C can clear the counter value as zero according to the edge of EZ signal. Homing by edge can let users meet best homing positioning purpose. Rising or falling edge is supported. The following diagram shows the case about the homing by rising edge. 4.1.4 Trigger Pulse Width For different applications, the trigger pulse width requirement is different. As for this reason, the trigger pulse width can be adjustable. The available values are from 0.1µs to 3.2765ms.
4.1.6 FIFO FIFO is first-in-first-out storage. It is used for storing some preset position data for comparing. Every time the position is compared, a new data is retrieve from FIFO into comparator. This mechanism makes a the continuous triggering function. 4.1.7 PWM & Mapping PWM is used for adjusting pulse width of trigger. It could also be switched to a toggle mode. In this mode, the pulse level will change from low to high or high to low at every time when compared.
such as a missing encoder signal, a cable becoming disconnected, abnormal trigger levels, etc. One method to reduce maintenance time is by direct observation of the trigger output pulse quantity from the embedded trigger counter inside the on-board FPGA.
4.2 Trigger Board Operation This section describes the operation theory for users to know more about PCI-8124-C. 4.2.1 Position Comparison The PCI-8124-C provides position comparison functions for each channel. Once the counter reaches a preset value set by the user, the PCI-8124-C will generate the trigger pulse. TRGx pins are for trigger pulse output channels. Users can also choose TTL Output pins for this purpose. TRG is an open collector pin. The comparing method is “equal”.
4.2.2 Position Latch The position latch function is fulfilled by LTC signal. Once the LTC signal is active, the counter value of its latch channel will be saved to latched register at the same time. User’s can read the latch register any time. 4.2.3 Linear Function There are 10 linear functions in PCI-8124-C. Each function is independent. It means that linear function range overlapped is possible when operation.
4.2.4 FIFO Mode Continuous triggering is fulfilled by linear function and FIFO. These two modes have their own comparators and can be used at the same time. The FIFO mode is usually used on random comparing data condition. Users can preset these data into FIFO and perform continuous triggering. Each FIFO has 1023 random comparing data space. If users have more random data than 1023, try to polling FIFO empty status or wait interrupt event and refill reset random data. 4.2.
4.3 Multiple Boards Operation The maximum installation in one PC system is up to 16 pieces. This means user can have 64 channels for triggering purpose. Since the PCI-8124-C is Plug-and-Play compatible, the base address and IRQ settings for card are automatically assigned by the BIOS of the system when it is powered on. When multiple cards are applied to a system, user can select the unique index number with S1. With this benefit, users can control each board accordingly without any confusion.
4.4 Interrupt Control The PCI-8124-C can generate an INT signal to the host PC. Users have to enable the interrupt service with this function call, _8124_set_int_factor. On the contrary, the parameter of intFactor of function is set to 0 to disable the interrupt service. There are 7 kinds of factors could triggered the PCI-8124-C interrupt. The factors include: 1. PWM: When PWM received a comparing trigger include manual trigger, it will make an interrupt to host PC. 2.
Bit 0 1 2 3 4 5 6 7 8 9 -(*) - - - CH 0 PWM0 FIFO0 Level FIFO0 Empty FIFO_0 Full LTC0 TTL-IN0 1 PWM1 FIFO1 Level FIFO1 Empty FIFO1 Full LTC1 TTL-IN1 - - - - 2 PWM2 FIFO2 Level FIFO2 Empty FIFO2 Full LTC2 TTL-IN2 - - - - 3 PWM3 FIFO3 Level FIFO3 Empty FIFO3 Full LTC3 TTL-IN3 - - - - 4 LIN0 LIN1 LIN2 LIN3 LIN4 LIN5 LIN6 LIN7 LIN8 LIN9 * (-) : reserved bit (set to 0) Use wait function we provided to wait interrupts under Windows To detect an interrupt signal fro
Steps: 1. Enable the interrupt factors that you want to be wait. “_8124_get_int_factor” 2. Using wait function to wait the specified interrupt. “_8124_wait_single_int” 3. In the end of interrupt process, you should disable the interrupt service.
5 TriggerMaster Utility After installing the hardware (Chapters 2 and 3), it is necessary to correctly configure all cards and double check the system before running. This chapter gives guidelines for establishing a control system and manually testing the cards to verify correct operation. The TriggerMaster software provides a simple yet powerful means to setup, configure, test, and debug for trigger system, like a line scan system that uses 8124-C cards.
5.3 TriggerMaster Form Introduction 5.3.
5.3.2 Main Form 2 4 6 5 3 1 7 1. Card Selected: Choose the card to operate. Note: the card must be selected first. 2. Show Channel Status: CNT_# Value: Display the value of encoder counter. The related function is _8124_get_encoder_value. Trir_# Times: Display the value of trigger counter. The related function is _8124_get_pwm_trigger_count. Next FCMP_# Values: Display the next compared value in FIFO comparator. The related function is _8124_get_comparator_data.
5. Set Sources: TRG_# and TTL_# Source: Display the Set_TRG_&_TTL_Out form to set source, logic and mode for TRG output and TTL output for TRG_# and TTL_# output. The related functions are _8124_set_trigger_source, _8124_set_trgOut_logic, and _8124_set_ttlOut_source. PWM_# Source: Display the Choose_PWM_Source form to set the source for PWM_#. The related function is _8124_set_pwm_source. LCMP Source: Display the Set_Linear_Comparator form to set each linear comparator.
5.3.
5.3.4 Sketch_of_setting Form This Sketch_of_setting form allows you to conveniently observe the all settings. When changing any settings, the Sketch_of_setting form updates immediately. 1 2 3 4 5 1. Sketch for Card #: Describe which card is showing. 2. TRG and TTL Source: Describe the status of setting of TRG-OUT and TTL-OUT sources. The light green means the source is chosen. 3. PWM Source: Describe the status of setting of PWM source. The light blue means the source is chosen.
5.3.5 Set_TRG_&_TTL_Out Form In this form, you can set operation logic, operation mode, source, and En/Disable options for TRG-OUT and TLL-OUT. 1 2 3 1. Set TRG_# source and mode: Set En/Disable and operation logic for the TRG-OUT. The related function is _8124_set_trgOut_logic. 2. Select PWM source for TRG_#: Select the PWM source for TRG-OUT. The related function is _8124_set_trigger_source. 3. Set TTL_# Mode: Set the TTL-OUT mode to be general output or be TRG-OUT.
5.3.6 Choose_PWM_Source Form In this form, you can choose the source for PWM. Note: the manual_Trigger is always selected. The related function is _8124_set_pwm_source.
5.3.7 Set_Linear_Comparator Form In this form, you can set the En/Disable, choose source, and set parameters for each linear comparator. 1 2 1. En/Disable: Set En/Disable for each linear comparator. The related function is _8124_enable_linear_set. 2. Set the source and parameters for linear comparator: Set the source and start point, repeat times and interval to the linear comparator. The related function is _8124_set_linear_compare.
5.3.8 Set_CNT_Source Form In this form, you can set the source for the encoder counter. There are total eight kinds of input sources for encoder counter on PCI8124-C. Only one type can be selected at the same time. The related function is _8124_set_counter_source.
5.3.9 Encoder_# Mode Enter Set mode and logic tab by clicking the Set mode and logic tag as show below: 2 1 3 4 5 6 1. Encoder_# Mode: Set the encoding mode for encoder including OUT/DIR, CW/CCW, 1xAB phase, 2xAB phase and 4xAb phase. The related function is _8124_set_encoder_input_mode. 2. CNT_# Mode: Set the count mode counting up or counting down for counter. The related function is _8124_set_encoder_up_down_count. 3. EZ_# Clear: En/Disable the EZ clear function.
5.3.10 Set_Interrupt_Source Form In this form, you can set the various interrupt events for each channel and linear comparator interrupt event for all channels. 1 2 1. Only for Channel_#: Set the various interrupt events for channel_#. The related function is _8124_set_int_factor. 52 PWM_#: Set the PWM event to the interrupt factor. This interrupt event occurs when the PWM receives a trigger single. FIFO_# Level: Set the FIFO_# level event to the interrupt factor.
FIFO_# Empty: Set the FIFO_# empty event to the interrupt factor. This interrupt event occurs when the FIFO is empty. FIFO_# Full: Set the FIFO_# full event to the interrupt factor. This interrupt event occurs when FIFO is full. LTC_#: Set the LTC_# event to the interrupt factor. This interrupt event occurs when specified latch contition meet. TTL_IN_#: Set the TTL_IN_# event to the interrupt factor. This interrupt event occurs when TTL_IN_# receives a signal. 2.
5.3.11 Set_Interrupt_Source form Enter Operation tab by clicking the Operation tag show as below: 1 2 3 51 4 1. Interrupt parameters: Time Out (ms): Set the time out for waiting interrupt. WaitBitNo: Input the bit number which user want to wait the interrupt. Wait_INT: Start to wait interrupt. The related function is _8124_wait_single_int. 2. FCMP_# Input Single Data: Input single one data into FIFO comparator. 3.
5. Buttons: Start Timer_#: Start the interval timer. Reset CNT_#: Reset the counter value. Reset Trir CNT_#: Reset the trigger counter value. Manual Trir_#: Trigger pulse manually. TTL_# Out: TTL_out output high or low. If TTL_Out mode is trg-out, it can’t be operated.
56 TriggerMaster Utility
6 Function Library This chapter describes the supporting software for PCI-8124-C. User can use these functions to develop programs in C, C++, or Visual Basic. 6.1 List of Functions This section details all the functions. The function prototypes and common data types are declared in pci_8124.h and type_def.h. We suggest you use these data types in your application programs. The following table shows the data type names and their range. .
System: Section 5.2 Function Name Description _8124_initialSw PCI-8124-C Cards Initialization _8124_close Release the resources of PCI-8124-C Cards _8124_get_version Get the hardware and software versions Encoder & Counter: Section 5.
FIFO Comparing: Section 5.7 Function Name _8124_reset_fifo Description Reset FIFO data _8124_get_fifo_sts Get the current FIFO status _8124_set_fifo_data Set a comparing data to FIFO _8124_set_fifo_array Set comparing data array to FIFO _8124_set_fifo_shift Shift the FIFO data to comparator _8124_set_fifo_level Set the FIFO low level _8124_get_fifo_level Get the FIFO low level Linear Comparing: Section 5.
Function Name _8124_start_timer Description Start the timer manually Interrupt Control: Section 5.13 Function Name Description _8124_set_int_factor Set (Enable) the interrupt factors _8124_get_int_factor Get the setting of interrupt factors _8124_wait_single_int Wait the single interrupt event _8124_reset_int Set the interrupt event to a non-signaled state Filtering & Monitoring: Section 5.
6.2 System & Initialization @ Name _8124_initialSw PCI-8124-C Cards Initialization _8124_close Release the resources of PCI-8124-C Cards _8124_get_version Get the hardware and software versions @ Description _8124_initialSw: This function is used to initialize the PCI-8124-C cards in your system. All PCI-8124-C cards must be initialized by this function before calling other functions. The ID of cards can be assigned by system automatically or dip switch (SW1) manually.
@ Syntax C/C++ (Windows 2000/XP) I16 _8124_initialSw( I16 *CardIdInBit, I16 ManualId, I16 DefaultSw ); I16 _8124_close(); I16 _8124_get_version(I16 CardId, I32 *Firmware_ver, I32 *Driver_ver, I32 *DLL_ver); Visual Basic (Windows 2000/XP) B_8124_initialSw (CardIdInBit As Integer, ByVal ManualId As Integer, ByVal DefaultSw As Integer) As Integer B_8124_close () As Integer B_8124_get_version (ByVal CardId As Integer, Firmware_ver As Long, Driver_ver As Long, DLL_ver As Long) As Integer @ Arguments I16 *CardI
6.
_8124_set_counter_source: This function is used to set the counter source. The source could be one of the EA/EB input channels or timers. The default counter source is EA/EB. About timer, please refer the section 5.12 Timer.
B_8124_set_counter_source (ByVal CardId As Integer, ByVal Channel As Integer, ByVal CtnSrc As Integer) As Integer @ Argument I16 CardId: The PCI-8124-C card’s ID number. I16 Channel: The specified channel number. (0 – 3) I16 IptMode: The pulse input mode. 0: OUT/DIR (default) 1: CW/CCW 2: 1x AB-Phase 3: 2x AB-Phase 4: 4x AB-Phase I32 EncValue: The encoder (counter) value.
6.4 PWM Configuration @ Name _8124_set_pwm_source Set the source of PWM _8124_set_pwm_mode Set the mode of PWM ( Pulse or Toggle output) _8124_set_pwm_pulse_width Set the output pulse width _8124_set_pwm_toggle_dir Set the count direction to toggle the level output @ Description _8124_set_pwm_source: This function is used to set the PWM source (trigger source). A PWM has 3 kinds of source, LIN, CMP and timer respectively. Those three kind of sources are independently.
I16 _8124_set_pwm_mode( I16 CardId, I16 Channel, I16 PulseOrToggle ); I16 _8124_set_pwm_pulse_width( I16 CardId, I16 Channel, I16 WidthPara ); I16 _8124_set_pwm_toggle_dir( I16 CardId, I16 Channel, I16 ToggleDir ); Visual Basic (Windows 2000/XP) B_8124_set_pwm_source (ByVal CardId As Integer, ByVal Channel As Integer, ByVal CmpEn As Integer, ByVal LinearEn As Integer, ByVal TimerEn As Integer) As Integer B_8124_set_pwm_mode (ByVal CardId As Integer, ByVal Channel As Integer, ByVal PulseOrToggle As Integer)
I16 ToggleDir: Toggled condition select 68 0: Directionless 1: Count up 2: Count down Function Library
6.5 TRG-OUT & TTL-OUT Configuration @ Name _8124_set_trigger_source Set the source of TRG-OUT _8124_set_trgOut_logic Set the logic of TRG-OUT _8124_set_ttlOut_source Set the source of TTL-OUT _8124_set_ttlOut Set the TTL-OUT when it is as a digital output @ Description _8124_set_trigger_source: There are two kinds of TGR sources. One is from SW2 setting, the other is from PWM or DI signals.
@ Syntax C/C++ (Windows 2000/XP) I16 _8124_set_trigger_source( I16 CardId, I16 Channel, I16 GroupSel, I16 PwmInBit, I16 TtlInInBit, I16 EzInBit ); I16 _8124_set_ttlOut_source( I16 CardId, I16 Channel, I16 TtlOutSrc ); I16 _8124_set_ttlOut( I16 CardId, I16 Channel, I16 TtlOutValue ); Visual Basic (Windows 2000/XP) B_8124_set_trigger_source (ByVal CardId As Integer, ByVal Channel As Integer, ByVal GroupSel As Integer, ByVal PwmInBit As Integer, ByVal TtlInInBit As Integer, ByVal EzInBit As Integer) As Intege
I16 EzInBit: The source of EZ channel in bit format. Ex: EzInBit = 0x1, means EZ_0 I16 TtlOutSrc: The TTL-OUT output source 0: use as Digital output 1: Follow TRG-OUT I16 TtlOutValue: TTL-OUT output control 0: DGND. 1: D5V.
6.6 Comparator @ Name _8124_set_comparator_data Set the comparing data to the comparator _8124_get_comparator_data Get current comparing data from the comparator @ Description _8124_set_comparator_data: This function is used to override the current comparing data to the comparator (CMP). _8124_get_comparator_data: This function is used to get the current comparing data from comparator (CMP).
6.7 FIFO Comparing @ Name _8124_reset_fifo Reset FIFO data _8124_get_fifo_sts Get the current FIFO status _8124_set_fifo_data Set a comparing data to FIFO _8124_set_fifo_array Set comparing data array to FIFO _8124_set_fifo_shift Shift the FIFO data to comparator _8124_set_fifo_level Set the FIFO low level _8124_get_fifo_level Get the FIFO low level @ Description _8124_reset_fifo: This function is used to reset (clear) the FIFO.
_8124_set_fifo_data: This function is used to set the specified comparing data to the FIFO. The capacity of FIFO is 1023. When the status of FIFO is full, the data cannot be set into FIFO. This function won’t check the FIFO status. _8124_set_fifo_array: This function is used to set comparing data array to the FIFO. _8124_set_fifo_shift: This function is used to shift the FIFO data to comparator (CMP) manually.
Visual Basic (Windows 2000/XP) B_8124_reset_fifo (ByVal CardId As Integer, ByVal Channel As Integer) As Integer B_8124_get_fifo_sts (ByVal CardId As Integer, ByVal Channel As Integer, FifoSts As Integer) As Integer B_8124_set_fifo_data (ByVal CardId As Integer, ByVal Channel As Integer, ByVal FifoData As Long) As Integer B_8124_set_fifo_array (ByVal CardId As Integer, ByVal Channel As Integer, DataArr As Long, ByVal ArraySize As Integer) As Integer B_8124_set_fifo_shift (ByVal CardId As Integer, ByVal Chann
I16 Level: The FIFO low level setting.
6.8 Linear Comparing @ Name _8124_set_linear_compare Set the linear comparing function _8124_set_linear_source Set the trigger output sources for linear functions _8124_enable_linear_set Enable/Disable the linear set @ Description _8124_set_linear_compare: This function is used to configure the linear comparing trigger function. Before using linear comparing function, you should enable the source of PWM from linear function by “_8124_set_pwm_source”.
_8124_enable_linear_set: The PCI-8124-C has 10 linear sets. Before using these linear sets, enable the linear set by this function. When linear sets are no longer needed, it is recommended that the the linear set be disabled, or it could be unexpectedly triggered.
I16 Enable: Enable/Disable linear set 0: disable, 1: enable Function Library 79
6.9 Manual Trigger @ Name _8124_manual_trigger Set the trigger output manually @ Description _8124_manual_trigger: This function is used to generate one pulse manually. @ Syntax C/C++ (Windows 2000/XP) I16 _8124_manual_trigger( I16 CardId, I16 Channel ); Visual Basic (Windows 2000/XP) B_8124_manual_trigger (ByVal CardId As Integer, ByVal Channel As Integer) As Integer @ Argument I16 CardId: The PCI-8124-C card’s ID number.
6.10 Digital Input @ Name _8124_get_di_sts Get the digital input signal’s status @ Description _8124_get_di_sts: This function is used to get the status of digital inputs. The digital inputs include TTL-IN, LTC and EZ. The parameters are showed as bit format. The former four bits of parameters represent 4 channels of each digital input.
6.11 Latch @ Name _8124_set_latch Configure the latch function _8124_get_latch_event_sts Get the latch event status _8124_get_latch_value Get the latched value @ Description _8124_set_latch: This function is used to enable or disable the high-speed position capture (latch) function and set the latch condition. Whenever the users enable it and configure the latch condition (Rising or falling active) correctly, the current position will be latched when it receive the latch signal.
Visual Basic (Windows 2000/XP) B_8124_set_latch (ByVal CardId As Integer, ByVal Channel As Integer, ByVal Enable As Integer, ByVal EdgeSel As Integer) As Integer B_8124_get_latch_event_sts (ByVal CardId As Integer, LatchEventInBit As Integer) As Integer B_8124_get_latch_value (ByVal CardId As Integer, ByVal Channel As Integer, LatchValue As Long) As Integer @ Argument I16 CardId: The PCI-8124-C card’s ID number.
6.12 Timer @ Name _8124_set_Timer Configure the Timer _8124_start_timer Start the timer manually @ Description _8124_set_Timer: This function is used to configure the timer. The timer can be start by external signal (TTL-IN signal) or by software function. If the timer was triggered, users can stop the timer by issue the function ”_8124_start_timer”. _8124_start_timer: This function is used to start/stop timer manually.
I16 WaitTtlIn: Enable TTL-IN start timer (0: Disable, 1: Enable) I16 TtlTrigLogic: TTL-IN start timer condition 0: Falling edge of TTL-IN signal 1: Rising edge of TTL-IN signal I16 Interval: Timer interval ( 0 – 16383) Timer tick interval = (Interval x 16 + 4) x 25 (ns) I16 Start: Start timer 0: Stop timer 1: Start timer Function Library 85
6.13 Interrupt @ Name _8124_set_int_factor Set (Enable) the interrupt factors _8124_get_int_factor Get the setting of interrupt factors _8124_wait_single_int Wait the single interrupt event _8124_reset_int Set the interrupt event to a non-signaled state @ Description _8124_set_int_factor: This function is used to enable/disable the interrupt source. Users can use the function, “_8124_wait_single_int” to wait the specified interrupt.
function was time out. This function returns when one of the following occurs: 1. The specified interrupt factor is in the signaled state. 2. The time-out interval elapses. This function checks the current state of the specified interrupt factor. If the state is non-signaled, the calling thread enters the wait state. It uses no processor time while waiting for the INT state to become signaled or the time-out interval to elapse.
@ Argument I16 IntFactorsInBit: Interrupt event factor setting in bit format. I16 FactorBitNum: Specified the bit number of the IntFactorsInBit. I32 TimeOutMs: Specify the time-out interval, in milliseconds. If TimeOutMs is zero, the function tests the states of the specified event and returns immediately.
6.14 Filtering & Monitoring @ Name _8124_set_input_filter_enable Enable digital input signal filter _8124_get_noise_detect Get noise detection status _8124_get_pwm_trigger_count Get PWM triggered counter _8124_reset_pwm_trigger_count Reset PWM triggered counter _8124_get_linear_next_compare Get next linear compare data _8124_get_linear_remain_trigger_count Get remaining linear trigger count @ Description _8124_set_input_filter_enable: This function is used to enable the digital filter.
_8124_get_linear_next_compare: This function is used to get the next linear compare data. This function is only for debug used. It does not have register latch protection (high word (16-31 bits) latch) of counter when register read. Therefore, it could be a problem when counter is count up at mean time you read the counter. This function is available after Firmware version: 0x13. _8124_get_linear_remain_trigger_count: This function is used to get remaining triggered counter.
I16 Enable: 0: Disable (Default) 1: Enable I16 *DetectStatus: Status in bit format.
6.15 Return Errors The following table provides a list of possible return value in our library. If the return value is not zero, it means there are some errors occurred. This could help you to check the program easier and make it correctly.