Skip to content

Document NI TTL channel mapping on the DA_Ephys page#2703

Open
Copilot wants to merge 8 commits into
mainfrom
copilot/add-dac-ttl-channels-docs
Open

Document NI TTL channel mapping on the DA_Ephys page#2703
Copilot wants to merge 8 commits into
mainfrom
copilot/add-dac-ttl-channels-docs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

Thanks for opening a PR in MIES ✨!

  • Code can only be merged if the continous integration tests pass
  • Please ensure that the branch is named correctly. See
    here for the detailed explanation.

This PR adds DA_Ephys user documentation for how MIES maps NI TTL outputs to DIO Port 0, describes how those TTL channels are used for pipette pressure control, and clarifies the role of PFI pins (internal timing/triggering and multi-board acquisition synchronization) versus Port 0 (MIES TTL output channels).

  • User docs

    • add Packages/doc/daephys_ttl_ni.rst
    • document TTL0–TTL7 to /{DeviceName}/port0/line0..7 and P0.0..P0.7
    • note fixed use of HARDWARE_NI_TTL_PORT = 0
    • add a dedicated "Pipette pressure control" section explaining that the MIES TTL output channels on Port 0 serve as control lines for actuating solenoid valves that regulate pipette pressure, enabling switching of the pipette tip between user-applied pressure, the pressure regulator, and atmospheric pressure
    • explain PFI vs Port 0 usage in a single paragraph: MIES utilizes PFI pins internally to manage timing and triggering tasks; specifically, MIES uses PFI pins to synchronize data acquisition across multiple NI boards (e.g., combining two NI PCIe-6343 boards to obtain 8 analog output channels by sharing start triggers and the sample clock over PFI lines). The P0.x pins are the MIES TTL output channels controlled from the DA_Ephys TTL tab
    • describe enabling TTL channels from the DA_Ephys TTL tab
    • add NI hardware-specific notes, including USB-6356 coverage
  • DA_Ephys page integration

    • include the new TTL section at the end of Packages/doc/daephys.rst so it renders under daephys.html
  • Sphinx source layout

    • exclude the include-only fragment from standalone source discovery in Packages/doc/conf.py to avoid duplicate label generation
.. include:: daephys_ttl_ni.rst
Original prompt

Goal

Add a new user documentation section explaining how MIES uses TTL channels on NI DAC devices. This section should appear under the DA_Ephys documentation page at https://alleninstitute.github.io/MIES/daephys.html.

Background

The documentation is built with Sphinx from .rst files in Packages/doc/. The main DA_Ephys page is Packages/doc/daephys.rst. Existing patterns in the repo (e.g. databrowser_artefactremoval.rst, databrowser_channelselection.rst) show that sub-topics are written as small standalone .rst files that are included with .. include:: directives in the parent page.

What to do

1. Create a new file Packages/doc/daephys_ttl_ni.rst

Write it in reStructuredText following the style of the existing documentation in this repo. The content should cover:

  • Overview: MIES supports up to 8 TTL output channels on NI DAC devices, delivered via Digital I/O (DIO) Port 0.

  • Physical connections: A table mapping MIES TTL channel numbers (TTL0–TTL7) to NI DAQmx channel names (/{DeviceName}/port0/line0line7) and physical connector labels (P0.0P0.7). Include notes that:

    • {DeviceName} is the NI-assigned device name as shown in NI MAX (e.g. Dev1).
    • The exact physical pin number for each P0.x label depends on the device model and terminal block accessory in use; users should consult the NI device pinout diagram and terminal block documentation.
    • MIES always uses Port 0 (HARDWARE_NI_TTL_PORT = 0) — this is fixed in the source code and cannot be changed from the GUI.
  • PFI pins: Explain that NI devices also expose PFI (Programmable Function Interface) pins (e.g. PFI0, PFI1 …). These are digital lines but are not the TTL data channels used by MIES. PFI pins are used internally by MIES for timing and triggering (e.g. acquisition start triggers during pressure control). Users should not connect experimental TTL signals to PFI pins; use the P0.x pins instead.

  • Enabling TTL channels in MIES: Brief steps — open the DA_Ephys panel, go to the TTL tab, check the channel, select a stimulus set from the drop-down.

  • Hardware notes:

    • MIES uses Port 0 exclusively on all supported NI devices.
    • The NI USB-6356 provides 8 DIO lines on Port 0 (P0.0–P0.7), supporting all 8 MIES TTL channels.
    • TTL channels are output-only during data acquisition; do not drive these pins externally while MIES is running.
    • Each TTL channel is independent and can carry a different stimulus waveform.

Use a Sphinx label .. _daephys_ttl_ni: at the top of the file so it can be cross-referenced.

2. Edit Packages/doc/daephys.rst

Append an .. include:: daephys_ttl_ni.rst directive at the end of the file to pull the new content into the DA_Ephys page.

Reference information (verified from source code)

  • HARDWARE_NI_TTL_PORT = 0 — defined in Packages/MIES/MIES_Constants.ipf
  • TTL channel name construction: "/" + deviceName + "/port" + num2str(HARDWARE_NI_TTL_PORT) + "/line" + num2str(channelNumber) — from Packages/MIES/MIES_DAC-Hardware.ipf
  • PFI pins used for pressure control triggering: pfi0 and pfi1 used as trigger inputs for DAQmx_Scan and DAQmx_WaveformGen — from Packages/MIES/MIES_PressureControl.ipf
  • For NI hardware, one TTL config row per channel (up to 8); channel number stored directly in ChannelNumber column of DAQConfigWave — from Packages/MIES/MIES_WaveDataFolderGetters.ipf and Packages/MIES/MIES_DataConfigurator.ipf

Existing file to modify

Packages/doc/daephys.rst currently ends at line 60 with:

.. figure:: svg/oodDAQ-delays.svg
   :align: left

Add the include directive after this last line.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: In MIES, when using an NI DAC, what are the NI channel names that correspond to TTL0?

Assistant: The answer is found directly in the hardware preparation code in MIES_DAC-Hardware.ipf and the constant definition in MIES_Constants.ipf.

TTL0 on an NI DAC maps to the channel name: /{DeviceName}/port0/line0

Here's how it's constructed:

case XOP_CHANNEL_TYPE_TTL:
    TTLStr += "/" + realDeviceOrPressure + "/port" + num2str(HARDWARE_NI_TTL_PORT) + "/line" + num2str(config[i][%ChannelNumber]) + ","

The port is always fixed to HARDWARE_NI_TTL_PORT = 0:

/// We always use this DIO p...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

Copilot AI self-assigned this May 7, 2026
Copilot AI review requested due to automatic review settings May 7, 2026 19:09
Copilot AI review requested due to automatic review settings May 7, 2026 19:09
Agent-Logs-Url: https://github.com/AllenInstitute/MIES/sessions/3e7a10b3-1840-482b-b9fb-96ec8083424e

Co-authored-by: timjarsky <5693697+timjarsky@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 7, 2026 19:25
Copilot AI changed the title [WIP] Add user documentation for TTL channels on NI DAC devices Document NI TTL channel mapping on the DA_Ephys page May 7, 2026
Copilot AI requested a review from timjarsky May 7, 2026 19:26
Comment thread Packages/doc/daephys_ttl_ni.rst Outdated
data channels used by MIES.

MIES uses PFI pins internally for timing and triggering tasks, for example
acquisition start triggers during pressure control. Users should not connect
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot we actually use these TTL signals to control solenoid valves used for pressure regulation. They control pressure access to the pipette tip between the user, the pressure regulator, and atmosphere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the correction. Updated in 8d2a72e: the overview now describes pipette pressure regulation (switching the tip between user-applied pressure, the pressure regulator, and atmosphere) as a typical use of these TTL outputs, and I removed the inaccurate "acquisition start triggers during pressure control" example from the PFI section so it no longer implies pressure control runs over PFI.

Rendered preview of the updated section:

daephys-ttl-ni

Copilot AI requested review from Copilot and removed request for Copilot May 8, 2026 17:18
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 8, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5263 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.qPdrOn --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,17881242104276520221,13515608869748577825,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,13315917740219765415,10529657461889756560,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --hide-scrollbars --window-size=1100,1750 --screenshot=/tmp/daephys-ttl-ni.png file:///tmp/daephys_ttl_ni.html (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5263 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.qPdrOn --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,17881242104276520221,13515608869748577825,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,13315917740219765415,10529657461889756560,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --hide-scrollbars --window-size=1100,1750 --screenshot=/tmp/daephys-ttl-ni.png file:///tmp/daephys_ttl_ni.html (dns block)
  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5263 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.qPdrOn --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,17881242104276520221,13515608869748577825,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,13315917740219765415,10529657461889756560,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --hide-scrollbars --window-size=1100,1750 --screenshot=/tmp/daephys-ttl-ni.png file:///tmp/daephys_ttl_ni.html (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5263 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.qPdrOn --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,17881242104276520221,13515608869748577825,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,13315917740219765415,10529657461889756560,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --hide-scrollbars --window-size=1100,1750 --screenshot=/tmp/daephys-ttl-ni.png file:///tmp/daephys_ttl_ni.html (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from timjarsky May 8, 2026 17:19
Comment thread Packages/doc/daephys_ttl_ni.rst Outdated
MIES supports up to 8 TTL output channels on NI DAC devices. On NI hardware
these TTL channels are delivered through Digital I/O (DIO) Port 0.

A typical use of these TTL outputs is to control solenoid valves for pipette
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot This applies to PFI pins, not MIES TTL / Port 0 pins.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it — fixed in a09da43. The solenoid valve / pipette pressure regulation description is no longer in the Port 0 overview at the top of the page; it is now described in the PFI pins section, where it correctly applies.

Rendered preview of the updated page:

daephys-ttl-ni v2

Copilot AI requested review from Copilot and removed request for Copilot May 8, 2026 17:23
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 8, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5413 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.8Ue9x5 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,18163135603359855465,7108393713082284041,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,2400994309336807150,8952775086565623856,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --hide-scrollbars --window-size=1100,1600 --screenshot=/tmp/daephys-ttl-ni-v2.png file:///tmp/daephys_ttl_ni.html (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5413 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.8Ue9x5 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,18163135603359855465,7108393713082284041,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,2400994309336807150,8952775086565623856,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --hide-scrollbars --window-size=1100,1600 --screenshot=/tmp/daephys-ttl-ni-v2.png file:///tmp/daephys_ttl_ni.html (dns block)
  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5413 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.8Ue9x5 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,18163135603359855465,7108393713082284041,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,2400994309336807150,8952775086565623856,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --hide-scrollbars --window-size=1100,1600 --screenshot=/tmp/daephys-ttl-ni-v2.png file:///tmp/daephys_ttl_ni.html (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5413 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.8Ue9x5 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,18163135603359855465,7108393713082284041,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,2400994309336807150,8952775086565623856,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --hide-scrollbars --window-size=1100,1600 --screenshot=/tmp/daephys-ttl-ni-v2.png file:///tmp/daephys_ttl_ni.html (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI review requested due to automatic review settings May 8, 2026 20:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds NI-specific DA_Ephys user documentation describing how MIES maps TTL output channels to NI DAQmx DIO Port 0 lines, and integrates that content into the rendered daephys.html page while avoiding Sphinx duplicate-label issues from standalone discovery.

Changes:

  • Added a new included documentation fragment describing TTL0–TTL7 ↔ /{DeviceName}/port0/line0..7 (P0.0..P0.7) and related NI hardware notes.
  • Included the new TTL documentation section at the end of daephys.rst so it renders under the DA_Ephys page.
  • Updated Sphinx exclude_patterns to prevent the include-only fragment from being built/discovered as a standalone source file.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Packages/doc/daephys.rst Includes the new NI TTL mapping documentation fragment into the DA_Ephys page.
Packages/doc/daephys_ttl_ni.rst New NI TTL mapping and usage documentation (TTL vs PFI explanation, enabling steps, hardware notes).
Packages/doc/conf.py Excludes the include-only fragment from Sphinx source discovery to avoid duplicate-label issues.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Packages/doc/daephys_ttl_ni.rst Outdated
@timjarsky
Copy link
Copy Markdown
Collaborator

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com

    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5121 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.hLFCc8 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,12330903695953271207,10401601174114741166,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,8212804907684111222,4910365525005876212,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --hide-scrollbars --window-size=1100,1600 --screenshot=/tmp/daephys-ttl-ni-v3.png file:///tmp/daephys_ttl_ni.html (dns block)
  • clients2.google.com

    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5121 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.hLFCc8 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,12330903695953271207,10401601174114741166,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,8212804907684111222,4910365525005876212,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --hide-scrollbars --window-size=1100,1600 --screenshot=/tmp/daephys-ttl-ni-v3.png file:///tmp/daephys_ttl_ni.html (dns block)
  • redirector.gvt1.com

    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5121 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.hLFCc8 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,12330903695953271207,10401601174114741166,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,8212804907684111222,4910365525005876212,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --hide-scrollbars --window-size=1100,1600 --screenshot=/tmp/daephys-ttl-ni-v3.png file:///tmp/daephys_ttl_ni.html (dns block)
  • www.google.com

    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5121 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.hLFCc8 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,12330903695953271207,10401601174114741166,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,8212804907684111222,4910365525005876212,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /usr/bin/chromium chromium --headless --disable-gpu --no-sandbox --hide-scrollbars --window-size=1100,1600 --screenshot=/tmp/daephys-ttl-ni-v3.png file:///tmp/daephys_ttl_ni.html (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@copilot I added the appropriate URLs or hosts to the custom allowlist in this repository.

@timjarsky
Copy link
Copy Markdown
Collaborator

@copilot can you share the markdown rendering of the new documentation in this conversation?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 8, 2026

@copilot can you share the markdown rendering of the new documentation in this conversation?

Sure — here is the new documentation rendered as Markdown (source is Packages/doc/daephys_ttl_ni.rst):


TTL channels on NI DAC devices

MIES supports up to 8 TTL output channels on NI DAC devices. On NI hardware these TTL channels are delivered through Digital I/O (DIO) Port 0.

Physical connections

The mapping between MIES TTL channel numbers, NI DAQmx channel names, and the connector labels used on NI hardware is:

MIES TTL channel NI DAQmx channel name Physical connector label
TTL0 /{DeviceName}/port0/line0 P0.0
TTL1 /{DeviceName}/port0/line1 P0.1
TTL2 /{DeviceName}/port0/line2 P0.2
TTL3 /{DeviceName}/port0/line3 P0.3
TTL4 /{DeviceName}/port0/line4 P0.4
TTL5 /{DeviceName}/port0/line5 P0.5
TTL6 /{DeviceName}/port0/line6 P0.6
TTL7 /{DeviceName}/port0/line7 P0.7
  • {DeviceName} is the NI-assigned device name shown in NI MAX, for example Dev1.
  • The exact physical pin number for each P0.x label depends on the device model and the terminal block accessory in use. Consult the NI device pinout diagram and the documentation for the connected terminal block.
  • MIES always uses Port 0 (HARDWARE_NI_TTL_PORT = 0). This is fixed in the source code and cannot be changed from the GUI.

PFI pins

NI devices also provide PFI (Programmable Function Interface) pins such as PFI0 and PFI1. These pins are digital lines, but they are not the TTL data channels exposed by MIES on Port 0.

MIES utilizes PFI pins internally to manage timing and triggering tasks. These pins serve as control lines for actuating solenoid valves that regulate pipette pressure, enabling switching of the pipette tip between user-applied pressure, the pressure regulator, and atmospheric pressure.

MIES also uses PFI pins to synchronize data acquisition across multiple NI boards. For example, two NI PCIe-6343 boards can be combined to obtain 8 analog output channels by sharing start triggers and the sample clock over PFI lines.

The P0.x pins listed above are the MIES TTL output channels and are controlled from the DA_Ephys TTL tab.

Enabling TTL channels in MIES

To enable TTL output channels in MIES:

  1. Open the DA_Ephys panel.
  2. Go to the TTL tab.
  3. Check the TTL channel that you want to enable.
  4. Select a stimulus set for that channel from the drop-down menu.

Hardware notes

  • MIES uses Port 0 exclusively on all supported NI devices.
  • The NI USB-6356 provides 8 DIO lines on Port 0 (P0.0 to P0.7), supporting all 8 MIES TTL channels.
  • TTL channels are output-only during data acquisition. Do not drive these pins externally while MIES is running.
  • Each TTL channel is independent and can carry a different stimulus waveform.

Comment thread Packages/doc/daephys_ttl_ni.rst Outdated
data channels exposed by MIES on Port 0.

MIES utilizes PFI pins internally to manage timing and triggering tasks.
These pins serve as control lines for actuating solenoid valves that regulate
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot lines 62, 63 and 64 should be moved to a new section that describes the use of TTL channels for pressure control.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 1f9149d. Moved the solenoid valve / pipette pressure description out of the PFI section into a new "Pipette pressure control" section under the TTL channels (Port 0) content.

Copilot AI requested review from Copilot and removed request for Copilot May 8, 2026 20:27
Copilot AI requested a review from timjarsky May 8, 2026 20:28
@timjarsky
Copy link
Copy Markdown
Collaborator

@MichaelHuth this link should work

Comment thread Packages/doc/daephys_ttl_ni.rst Outdated

MIES utilizes PFI pins internally to manage timing and triggering tasks.

MIES also uses PFI pins to synchronize data acquisition across multiple NI
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot This should read: "Specifically, MIES uses PFI pins to......"

it should be in the same paragraph as line 61.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e04cc06. Merged the multi-board sync sentence into the same paragraph as line 61, starting with "Specifically, MIES uses PFI pins to...".

Copilot AI requested review from Copilot and removed request for Copilot May 8, 2026 20:40
Copilot AI requested a review from timjarsky May 8, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants