Add Rust SCPI example for Thorlabs PMxxx power meters on Linux (USBTMC) - #51
Closed
youziLab wants to merge 1 commit into
Closed
Add Rust SCPI example for Thorlabs PMxxx power meters on Linux (USBTMC)#51youziLab wants to merge 1 commit into
youziLab wants to merge 1 commit into
Conversation
Rust port of the C++ NI-VISA SCPI example (PMXXX_SCPI.cpp) that talks to the Linux kernel USBTMC driver (/dev/usbtmc*) directly instead of NI-VISA: - device auto-discovery by Thorlabs USB vendor id (0x1313) via sysfs - blocking one-shot acquisition (MEASure?) with temperature readout - continuous non-blocking acquisition (INIT:CONT + FETC:BINA?) following the manual's "Continuous Measurements" flow - USB488 Remote Enable (REN) handling required by PM100D2/PM100D3 handheld meters, mirroring the NI-VISA session ritual (ioctl via the nix crate) - udev rule for user-space access to Thorlabs usbtmc devices Includes a README with build/run instructions and firmware quirks observed on a PM100D2 (fw 1.0.7); items not further verified are marked as reference-only.
youziLab
force-pushed
the
rust-pmxxx-usbtmc-example
branch
from
September 1, 2026 05:38
fdaeadc to
4251dbc
Compare
Contributor
|
Thank you very much for your contribution! We appreciate the time and effort you put into this work. Since Rust is not currently a supported language within our example repository, we have decided not to proceed with this change at this time. That said, we believe this example could be valuable for some customers. We therefore plan to add a link to your repository to our internal notes as a reference for Linux and Rust users. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rust port of the C++ NI-VISA SCPI example (
C++/Thorlabs PMxxx Power Meters/scpi/PMXXX_SCPI.cpp)that talks to the Linux kernel USBTMC driver (
/dev/usbtmc*) directly instead of NI-VISA:0x1313) via sysfsMEASure?) with temperature readoutINIT:CONT+FETC:BINA?) following themanual's "Continuous Measurements" flow
mirroring the NI-VISA session ritual (ioctl via the
nixcrate)Includes a README with build/run instructions and firmware quirks observed on a
PM100D2 (fw 1.0.7); items not further verified are marked as reference-only.