« Close

Datasheets and User Guides

App Notes

Software & Driver

 

13.1 DIO Extended Features

DIO Extended Features Overview

Digital extended features measure and generate digital waveforms. Almost every digital I/O line can be assigned a feature and many can be active simultaneously. Features include things like PWM, Quadrature, and pulse generation. Features are assigned to DIOs using their type index, and configured using the options, and value registers.

The table below lists the features available on each DIO.  The Digital I/O of the LabJack are on the top of the table, with the features to the left.

Table 13.1-1. Digital I/O Extended Features

FIO (0-7) EIO (0-7) CIO (0-3) MIO (0-2)
DIO
Feature Index# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
PWM Out 0
PWM Out with Phase 1
Pulse Out 2
Frequency In 3,4
Pulse Width In 5
Line-to-Line In 6
High-Speed Counter 7
Interrupt Counter 8
Interrupt Counter with Debounce 9
Quadrature In 10
Interrupt Frequency In 11
Conditional Reset 12
  • PWM Out - Produces a rectangular output with variable frequency and variable duty cycle.
  • PWM Out with Phase - Allows a phase difference between multiple PWM outputs.
  • Pulse Out - You can specify the number of pulses, frequency of pulses, and pulse-width.
  • Frequency In - Measures the period/frequency.
  • Pulse Width In - Measures the high and low time, and thus also measures duty cycle.
  • Line-to-Line In - Measures the time between edges on 2 different DIO lines.
  • High-Speed Counter - Hardware-based edge counter.
  • Interrupt Counter - A hardware edge counter that must service an interrupt for each edge.
  • Interrupt Counter with Debounce - Use to avoid counting bounces from mechanical switches.
  • Quadrature In - Tracks the forward/reverse count provided by a quadrature signal.
  • Interrupt Frequency In - Frequency measurement that must service an interrupt for each edge.
  • Conditional Reset - Stops or Resets a DIO_EF on a different channel when specified conditions are met.

All counters are 32-bit.

Each digital IO has a set of registers dedicated to the configuration of and results produced by the Extended Features. These registers are used to perform four operations on the Extended Feature: Configure, Read, Update, and Reset. Below you will find general descriptions of the four operations. Details about each feature can be found in their corresponding sections.

 

Configure:
Configuration is the initial setup of the Extended Feature. Configuration requires that any EF running at the pin in question first be disabled. Options can then be loaded. Then the EF can be enabled. The following seven registers are used for configuration:

DIO#_EF_ENABLE – 0 = Disable, 1 = Enable
DIO#_EF_INDEX – Index number specifying the Extended Feature
DIO#_EF_OPTIONS – Bits 2-0: Specifies the clock source to use
DIO#_EF_CONFIG_A – Extended Feature specific value
DIO#_EF_CONFIG_B – Extended Feature specific value
DIO#_EF_CONFIG_C – Extended Feature specific value
DIO#_EF_CONFIG_D – Extended Feature specific value

 

Read:
Some Extended Features produce results or provide status information that can be read. This information is usually a binary integer. When possible, the LabJack will convert the binary integer into a real-world unit such as seconds. When available, converted values can be read from the registers designated with “_F.” The following registers are used to read results from a DIO Extended Feature:

DIO#_EF_READ_A – Extended feature specific value. Reading this value takes a snapshot of READ_B, READ_B_F.
DIO#_EF_READ_B – Extended feature specific value. Reading this returns the snapshot acquired by READ_A.
DIO#_EF_READ_A_F – Returns READ_A converted to a real-world value and takes a snapshot of READ_B, READ_B_F.
DIO#_EF_READ_B_F – Returns the READ_B snapshot converted to a real-world value.

 

Update:
Some Extended Features can be updated while running. Updating allows the Extended Feature to change its operation parameters without restarting. Note that the ClockSource and Feature Index can not be changed in an update. Depending on the feature, reads and writes to the update registers have small differences.  See the Update portion of each features dedicated section for more information. The following four registers can be used to update an active Extended Feature:

DIO#_EF_CONFIG_A – Extended feature specific value
DIO#_EF_CONFIG_B – Extended feature specific value
DIO#_EF_CONFIG_C – Extended feature specific value
DIO#_EF_CONFIG_D – Extended feature specific value

 

Reset:
Some Extended Features can be reset while they are running. Resetting can have different results depending on the feature. For instance counters are reset to zero. There is only one register associated with resetting:

DIO#_EF_READ_A_AND_RESET – Extended feature specific value. Reading this resets the Extended Feature and takes a snapshot of READ_B so that it can be read as in the Read section. Values are read before the reset.
DIO#_EF_READ_A_F_AND_RESET – Returns the same information as DIO#_EF_READ_A_F. Reading this resets the Extended Feature and takes a snapshot of READ_B_F. Values are read before the reset.

 Register Listing

Digital Extended Features
Name Start Address Type Access
DIO#(0:22)_EF_ENABLE 44000 UINT32 R/W
DIO#(0:22)_EF_INDEX 44100 UINT32 R/W
DIO#(0:22)_EF_OPTIONS 44200 UINT32 R/W
DIO#(0:22)_EF_CONFIG_A 44300 UINT32 R/W
DIO#(0:22)_EF_CONFIG_B 44400 UINT32 R/W
DIO#(0:22)_EF_CONFIG_C 44500 UINT32 R/W
DIO#(0:22)_EF_CONFIG_D 44600 UINT32 R/W
DIO#(0:22)_EF_READ_A 3000 UINT32 R
DIO#(0:22)_EF_READ_A_AND_RESET 3100 UINT32 R
DIO#(0:22)_EF_READ_B 3200 UINT32 R
DIO#(0:22)_EF_ENABLE
- Starting Address: 44000
1 = enabled. 0 = disabled. Must be disabled during configuration. Note that DIO-EF reads work when disabled and do not return an error.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
Expanded Names Addresses
DIO0_EF_ENABLE, DIO1_EF_ENABLE, DIO2_EF_ENABLE, DIO3_EF_ENABLE, DIO4_EF_ENABLE, DIO5_EF_ENABLE, DIO6_EF_ENABLE, DIO7_EF_ENABLE, DIO8_EF_ENABLE, DIO9_EF_ENABLE, DIO10_EF_ENABLE, DIO11_EF_ENABLE, DIO12_EF_ENABLE, DIO13_EF_ENABLE, DIO14_EF_ENABLE, DIO15_EF_ENABLE, DIO16_EF_ENABLE, DIO17_EF_ENABLE, DIO18_EF_ENABLE, DIO19_EF_ENABLE, DIO20_EF_ENABLE, DIO21_EF_ENABLE, DIO22_EF_ENABLE Show All 44000, 44002, 44004, 44006, 44008, 44010, 44012, 44014, 44016, 44018, 44020, 44022, 44024, 44026, 44028, 44030, 44032, 44034, 44036, 44038, 44040, 44042, 44044 Show All
DIO#(0:22)_EF_INDEX
- Starting Address: 44100
An index to specify the feature you want.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
Expanded Names Addresses
DIO0_EF_INDEX, DIO1_EF_INDEX, DIO2_EF_INDEX, DIO3_EF_INDEX, DIO4_EF_INDEX, DIO5_EF_INDEX, DIO6_EF_INDEX, DIO7_EF_INDEX, DIO8_EF_INDEX, DIO9_EF_INDEX, DIO10_EF_INDEX, DIO11_EF_INDEX, DIO12_EF_INDEX, DIO13_EF_INDEX, DIO14_EF_INDEX, DIO15_EF_INDEX, DIO16_EF_INDEX, DIO17_EF_INDEX, DIO18_EF_INDEX, DIO19_EF_INDEX, DIO20_EF_INDEX, DIO21_EF_INDEX, DIO22_EF_INDEX Show All 44100, 44102, 44104, 44106, 44108, 44110, 44112, 44114, 44116, 44118, 44120, 44122, 44124, 44126, 44128, 44130, 44132, 44134, 44136, 44138, 44140, 44142, 44144 Show All
DIO#(0:22)_EF_OPTIONS
- Starting Address: 44200
Function dependent on selected feature index.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
Expanded Names Addresses
DIO0_EF_OPTIONS, DIO1_EF_OPTIONS, DIO2_EF_OPTIONS, DIO3_EF_OPTIONS, DIO4_EF_OPTIONS, DIO5_EF_OPTIONS, DIO6_EF_OPTIONS, DIO7_EF_OPTIONS, DIO8_EF_OPTIONS, DIO9_EF_OPTIONS, DIO10_EF_OPTIONS, DIO11_EF_OPTIONS, DIO12_EF_OPTIONS, DIO13_EF_OPTIONS, DIO14_EF_OPTIONS, DIO15_EF_OPTIONS, DIO16_EF_OPTIONS, DIO17_EF_OPTIONS, DIO18_EF_OPTIONS, DIO19_EF_OPTIONS, DIO20_EF_OPTIONS, DIO21_EF_OPTIONS, DIO22_EF_OPTIONS Show All 44200, 44202, 44204, 44206, 44208, 44210, 44212, 44214, 44216, 44218, 44220, 44222, 44224, 44226, 44228, 44230, 44232, 44234, 44236, 44238, 44240, 44242, 44244 Show All
DIO#(0:22)_EF_CONFIG_A
- Starting Address: 44300
Function dependent on selected feature index.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
Expanded Names Addresses
DIO0_EF_CONFIG_A, DIO1_EF_CONFIG_A, DIO2_EF_CONFIG_A, DIO3_EF_CONFIG_A, DIO4_EF_CONFIG_A, DIO5_EF_CONFIG_A, DIO6_EF_CONFIG_A, DIO7_EF_CONFIG_A, DIO8_EF_CONFIG_A, DIO9_EF_CONFIG_A, DIO10_EF_CONFIG_A, DIO11_EF_CONFIG_A, DIO12_EF_CONFIG_A, DIO13_EF_CONFIG_A, DIO14_EF_CONFIG_A, DIO15_EF_CONFIG_A, DIO16_EF_CONFIG_A, DIO17_EF_CONFIG_A, DIO18_EF_CONFIG_A, DIO19_EF_CONFIG_A, DIO20_EF_CONFIG_A, DIO21_EF_CONFIG_A, DIO22_EF_CONFIG_A Show All 44300, 44302, 44304, 44306, 44308, 44310, 44312, 44314, 44316, 44318, 44320, 44322, 44324, 44326, 44328, 44330, 44332, 44334, 44336, 44338, 44340, 44342, 44344 Show All
DIO#(0:22)_EF_CONFIG_B
- Starting Address: 44400
Function dependent on selected feature index.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
Expanded Names Addresses
DIO0_EF_CONFIG_B, DIO1_EF_CONFIG_B, DIO2_EF_CONFIG_B, DIO3_EF_CONFIG_B, DIO4_EF_CONFIG_B, DIO5_EF_CONFIG_B, DIO6_EF_CONFIG_B, DIO7_EF_CONFIG_B, DIO8_EF_CONFIG_B, DIO9_EF_CONFIG_B, DIO10_EF_CONFIG_B, DIO11_EF_CONFIG_B, DIO12_EF_CONFIG_B, DIO13_EF_CONFIG_B, DIO14_EF_CONFIG_B, DIO15_EF_CONFIG_B, DIO16_EF_CONFIG_B, DIO17_EF_CONFIG_B, DIO18_EF_CONFIG_B, DIO19_EF_CONFIG_B, DIO20_EF_CONFIG_B, DIO21_EF_CONFIG_B, DIO22_EF_CONFIG_B Show All 44400, 44402, 44404, 44406, 44408, 44410, 44412, 44414, 44416, 44418, 44420, 44422, 44424, 44426, 44428, 44430, 44432, 44434, 44436, 44438, 44440, 44442, 44444 Show All
DIO#(0:22)_EF_CONFIG_C
- Starting Address: 44500
Function dependent on selected feature index.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
Expanded Names Addresses
DIO0_EF_CONFIG_C, DIO1_EF_CONFIG_C, DIO2_EF_CONFIG_C, DIO3_EF_CONFIG_C, DIO4_EF_CONFIG_C, DIO5_EF_CONFIG_C, DIO6_EF_CONFIG_C, DIO7_EF_CONFIG_C, DIO8_EF_CONFIG_C, DIO9_EF_CONFIG_C, DIO10_EF_CONFIG_C, DIO11_EF_CONFIG_C, DIO12_EF_CONFIG_C, DIO13_EF_CONFIG_C, DIO14_EF_CONFIG_C, DIO15_EF_CONFIG_C, DIO16_EF_CONFIG_C, DIO17_EF_CONFIG_C, DIO18_EF_CONFIG_C, DIO19_EF_CONFIG_C, DIO20_EF_CONFIG_C, DIO21_EF_CONFIG_C, DIO22_EF_CONFIG_C Show All 44500, 44502, 44504, 44506, 44508, 44510, 44512, 44514, 44516, 44518, 44520, 44522, 44524, 44526, 44528, 44530, 44532, 44534, 44536, 44538, 44540, 44542, 44544 Show All
DIO#(0:22)_EF_CONFIG_D
- Starting Address: 44600
Function dependent on selected feature index.
  • Data type: UINT32  (type index = 1)
  • Readable and writable
Expanded Names Addresses
DIO0_EF_CONFIG_D, DIO1_EF_CONFIG_D, DIO2_EF_CONFIG_D, DIO3_EF_CONFIG_D, DIO4_EF_CONFIG_D, DIO5_EF_CONFIG_D, DIO6_EF_CONFIG_D, DIO7_EF_CONFIG_D, DIO8_EF_CONFIG_D, DIO9_EF_CONFIG_D, DIO10_EF_CONFIG_D, DIO11_EF_CONFIG_D, DIO12_EF_CONFIG_D, DIO13_EF_CONFIG_D, DIO14_EF_CONFIG_D, DIO15_EF_CONFIG_D, DIO16_EF_CONFIG_D, DIO17_EF_CONFIG_D, DIO18_EF_CONFIG_D, DIO19_EF_CONFIG_D, DIO20_EF_CONFIG_D, DIO21_EF_CONFIG_D, DIO22_EF_CONFIG_D Show All 44600, 44602, 44604, 44606, 44608, 44610, 44612, 44614, 44616, 44618, 44620, 44622, 44624, 44626, 44628, 44630, 44632, 44634, 44636, 44638, 44640, 44642, 44644 Show All
DIO#(0:22)_EF_READ_A
- Starting Address: 3000
Reads an unsigned integer value. The meaning of the integer is dependent on selected feature index.
  • Data type: UINT32  (type index = 1)
  • Read-only
  • This register may be streamed
Expanded Names Addresses
DIO0_EF_READ_A, DIO1_EF_READ_A, DIO2_EF_READ_A, DIO3_EF_READ_A, DIO4_EF_READ_A, DIO5_EF_READ_A, DIO6_EF_READ_A, DIO7_EF_READ_A, DIO8_EF_READ_A, DIO9_EF_READ_A, DIO10_EF_READ_A, DIO11_EF_READ_A, DIO12_EF_READ_A, DIO13_EF_READ_A, DIO14_EF_READ_A, DIO15_EF_READ_A, DIO16_EF_READ_A, DIO17_EF_READ_A, DIO18_EF_READ_A, DIO19_EF_READ_A, DIO20_EF_READ_A, DIO21_EF_READ_A, DIO22_EF_READ_A Show All 3000, 3002, 3004, 3006, 3008, 3010, 3012, 3014, 3016, 3018, 3020, 3022, 3024, 3026, 3028, 3030, 3032, 3034, 3036, 3038, 3040, 3042, 3044 Show All
DIO#(0:22)_EF_READ_A_AND_RESET
- Starting Address: 3100
Reads the same value as DIO#(0:22)_EF_READ_A and forces a reset.
  • Data type: UINT32  (type index = 1)
  • Read-only
  • This register may be streamed
Expanded Names Addresses
DIO0_EF_READ_A_AND_RESET, DIO1_EF_READ_A_AND_RESET, DIO2_EF_READ_A_AND_RESET, DIO3_EF_READ_A_AND_RESET, DIO4_EF_READ_A_AND_RESET, DIO5_EF_READ_A_AND_RESET, DIO6_EF_READ_A_AND_RESET, DIO7_EF_READ_A_AND_RESET, DIO8_EF_READ_A_AND_RESET, DIO9_EF_READ_A_AND_RESET, DIO10_EF_READ_A_AND_RESET, DIO11_EF_READ_A_AND_RESET, DIO12_EF_READ_A_AND_RESET, DIO13_EF_READ_A_AND_RESET, DIO14_EF_READ_A_AND_RESET, DIO15_EF_READ_A_AND_RESET, DIO16_EF_READ_A_AND_RESET, DIO17_EF_READ_A_AND_RESET, DIO18_EF_READ_A_AND_RESET, DIO19_EF_READ_A_AND_RESET, DIO20_EF_READ_A_AND_RESET, DIO21_EF_READ_A_AND_RESET, DIO22_EF_READ_A_AND_RESET Show All 3100, 3102, 3104, 3106, 3108, 3110, 3112, 3114, 3116, 3118, 3120, 3122, 3124, 3126, 3128, 3130, 3132, 3134, 3136, 3138, 3140, 3142, 3144 Show All
DIO#(0:22)_EF_READ_B
- Starting Address: 3200
Reads an unsigned integer value. The meaning of the integer is dependent on selected feature index.
  • Data type: UINT32  (type index = 1)
  • Read-only
  • This register may be streamed
Expanded Names Addresses
DIO0_EF_READ_B, DIO1_EF_READ_B, DIO2_EF_READ_B, DIO3_EF_READ_B, DIO4_EF_READ_B, DIO5_EF_READ_B, DIO6_EF_READ_B, DIO7_EF_READ_B, DIO8_EF_READ_B, DIO9_EF_READ_B, DIO10_EF_READ_B, DIO11_EF_READ_B, DIO12_EF_READ_B, DIO13_EF_READ_B, DIO14_EF_READ_B, DIO15_EF_READ_B, DIO16_EF_READ_B, DIO17_EF_READ_B, DIO18_EF_READ_B, DIO19_EF_READ_B, DIO20_EF_READ_B, DIO21_EF_READ_B, DIO22_EF_READ_B Show All 3200, 3202, 3204, 3206, 3208, 3210, 3212, 3214, 3216, 3218, 3220, 3222, 3224, 3226, 3228, 3230, 3232, 3234, 3236, 3238, 3240, 3242, 3244 Show All

 

How-To: Use a digital extended feature

  1. Disable features on the DIO using ..._EF_ENABLE
  2. Select a feature, and assign the corresponding type index to ..._EF_INDEX
  3. Write to ..._EF_OPTIONS (if necessary)
  4. Write to ..._EF_CONFIG_A, ..._EF_CONFIG_B, ..._EF_CONFIG_C, ..._EF_CONFIG_D (if necessary)
  5. Enable feature on the DIO using ..._EF_ENABLE
  6. Read results using ..._EF_READ_A, ..._EF_READ_B, or ..._EF_READ_A_AND_RESET

 

6 comments

Hello,

excuse me but I just dont get it. I am thinking that MIO is available to connect a Multiplexer to get up to 112 analog inputs..Is this right?

The thing I didnt understand is what are the EIO for? Can you explain that to me please?

With friendly regards

MT

FIO, EIO, CIO, and MIO, are all just different names for different groups of digital I/O.  If you find that confusing, just ignore that names and call them all DIO (DIO0-DIO22).

All 23 lines can simply be used as digital I/O, which can be set to 1 of 3 states:  input, output-high, and output-low.  The only substantial difference is that DIO0-DIO7 (FIO) have higher source impedance than the rest (about 550 ohms versus 180 ohms), which means they are more protected from overvoltages but cannot source/sink as much current.

DIO20-DIO22 (MIO) are used to control a multiplexer (e.g. Mux80) if you do reads from extended analog inputs AIN16-AIN127, so if you do a read from any of AIN16-AIN127 the T7 will automatically set the 3 MIO to output and control the state as needed.

The DIO Extended Features (DIO EF) system can use DIO0-DIO7 (FIO) and DIO16-DIO19 (CIO) if any of those EF are enabled.

Can I read DIO state while using an EF on the same Index? Say:

DIO0_EF_ENABLE = 0
DIO0_EF_INDEX = 3 or 4  // Select rising or falling edges.
DIO0_EF_ENABLE = 1      // Turn on the DIO_EF

DIO0_EF_READ_A=0       //

FIO0=0                         //Read state of FIO0

 

It is possible to read the DIO state while a DIO_EF is running. However, care needs to be taken to prevent changing the DIO's direction. The single bit registers such as FIO#(0:7) will automatically set the direction of the DIO. The port registers will not set direction, so you will need to read the states of all the FIO using the FIO_STATE register.

I cannot get the counters to work.

When I start the stream I get an error HW_CNTR3_NOT_AVAILABLE.  Is this a problem with the units specifications or a software set-up error.

CounterD (or CNTR3) is shared with stream mode, so you can't stream and use CounterD at the same time.  See towards the beginning of Section 13.1.8.