element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Test & Tools
  • Technologies
  • More
Test & Tools
Blog PST.. Release 4 for the Pico SCPI labTool firmware (experimental functionality release): what's new?
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Test & Tools to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 30 Sep 2023 10:00 AM Date Created
  • Views 1301 views
  • Likes 11 likes
  • Comments 7 comments
  • pico_usbtmc_scpi
  • pico
  • USBTMC
  • Pico SCPI labTool
  • labview
  • scpi
Related
Recommended

PST.. Release 4 for the Pico SCPI labTool firmware (experimental functionality release): what's new?

Jan Cumps
Jan Cumps
30 Sep 2023

The Pico SCPI labTool (PST) allows you to connect your PC to equipment to control and monitor all sorts of things. It runs on a Raspberry Pico.

image

In this post: new functionality available in the Release 4.

What's new?

This release adds experimental functionality.

Release 4 adds these new SCPI functions:

digital input in: registers instrument specific registers for digital input pins

STATus:OPERation:DIGItal:INPut:CONDition?
STATus:OPERation:DIGItal:INPut:PTRansition
STATus:OPERation:DIGItal:INPut:PTRansition?
STATus:OPERation:DIGItal:INPut:NTRansition
STATus:OPERation:DIGItal:INPut:NTRansition?
STATus:OPERation:DIGItal:INPut:EVENt?
STATus:OPERation:DIGItal:INPut:ENABle
STATus:OPERation:DIGItal:INPut:ENABle?

Other functionality added:

refactoring closer integration of usbtmc and scpi parser library

More info on the experimental functionality:

 PST.. Experimental event / trigger support for Pico SCPI labTool - 1: investigate
PST.. Experimental event / trigger support for Pico SCPI labTool - 2: design the registers
PST.. Experimental event / trigger support for Pico SCPI labTool - 3: Instrument Specific Registers Test
PST.. Experimental event / trigger support for Pico SCPI labTool - 4: let TinyUSB USBTMC code use SCPI-LIB's Status Byte register
PST.. Experimental event / trigger support for Pico SCPI labTool - 5: Propagation to IEEE488.2 SCPI Registers Test

How to get the software (binary included)

check this post for a "how to install firmware and run the first LabVIEW process" video.

download link info
Pico firmware backwards compatible with previous versions. includes the .uf2 file to program your Pico right away
LabVIEW driver backwards compatible with previous versions. driver blocks for new functionality and extra examples

Command reference

This section describes the added commands. It lists

  • the SCPI syntax,
  • LabVIEW Virtual Instrument driver block
  • the pins that are used, 
  • parameters, return values.
digital input registers query the registers of a digital input, set filter and fan-out to IEEE488.2 Operation Status register

bits:

0: GP20
1: GP21
2: GP27

registers:

CONDition
PTRansition
NTRansition
EVENt
ENABle

fan-out to IEEE488.2:

Operation Status[0]

SCPI STATus:OPERation:DIGItal:INPut:CONDition?
STATus:OPERation:DIGItal:INPut:PTRansition
STATus:OPERation:DIGItal:INPut:PTRansition?
STATus:OPERation:DIGItal:INPut:NTRansition
STATus:OPERation:DIGItal:INPut:NTRansition?
STATus:OPERation:DIGItal:INPut:EVENt?
STATus:OPERation:DIGItal:INPut:ENABle
STATus:OPERation:DIGItal:INPut:ENABle?

VI Use LabVIEW VISA write and read

For the compete reference:  PST.. Program the Pico SCPI labTool? 

LabVIEW

This version doesn't include LabVIEW changes. I cut a driver release, to keep the versions in sync.

link to all posts

  • Sign in to reply

Top Comments

  • Jan Cumps
    Jan Cumps over 2 years ago in reply to ggabe +1
    > Is raising SRQ expected, or yet to be coming? To do. I could not get it to work. The code knows when to fire the SRQ, but I don't know (yet?) what to do in usbtmc to send correct data back > Also…
  • Jan Cumps
    Jan Cumps over 2 years ago in reply to Jan Cumps

    (add:)

    The advanced functionality isn't required for this device. It's my attempt to grow "building SCPI firmware" skills. That's the reason why I called them experimental. And took care to not let them interfere with standard functionality.

    I'm convinced that this design is a valuable lab instrument as it is.
    And I like to use it to get some niche SCP skills - both for LabVIEW and instrument firmware development.

    I'm trying to keep all of that in the open - publishing my (sometimes naive) code and LabVIEW drivers. The only way to get good feedback is by publishing what you do - and hope that it gets challenged/reviewed.

    But my goal is not just to build a SCPI instrument. I also want to improve my own capabilities. That's why you'll see  a mix of needed functionality and fancy stuff.
    If you have similar goals, feel free to contribute to the core. Or to use this project to grow your own professional skills.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 2 years ago in reply to DAB

    Don't worry, DAB . All releases are incremental. This firmware is still compatible with the initial release. And with all previous versions of the SCPI driver.

    in essence, there is

    • a set of simple functionality. With a LabVIEW block to support each of them:
      • digital in and out
      • analogue in and out
    • a medium advanced function. Still supported by a LabVIEW block, but requires you to connect an ADC IC to the Pico:
      • high precision analogue in
    • advanced functionality, supported by lower level LabVIEW write and read blocks:
      • the instrument specific registers

    All of this works in isolation. You can get a useful design by just using the simple functions.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 2 years ago in reply to dougw

    hehe. We use a backlog

    image

    We don't scrum,

    We have milestones that represent release trains / schedules

    image

    image

    and we do peer code reviews. Here's an example of shabaz reviewing my code:

    image

    (all actions below Shabaz review are performed by github automation)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 2 years ago in reply to ggabe

    > Is raising SRQ expected, or yet to be coming? 

    To do. I could not get it to work. The code knows when to fire the SRQ, but I don't know (yet?) what to do in usbtmc to send correct data back

    > Also, am I correctly doing the setup for SRQ be fired up? 

    Looks correct.

    To make (example) pin 2 (also bit 2 of the custom register) fan out from CONDITION to EVENT:

    1 set the edge filter. Positive, negative, or both

    STATus:OPERation:DIGItal:INPut:NTRansition 4
    STATus:OPERation:DIGItal:INPut:PTRansition 4

    If you use the first statement, negative edge will set the EVENT bit 2. If you use query 2, a positive transition will do that. If you call both, any state transition on pin 2 will fan out to the event register.

    2 enable fan out of EVENT register sum to OPERation status register, bit 0:

    STATus:OPERation:DIGItal:INPut:ENABle 4

    3 From then on, to fan out to the OPER bit of the Status Byte register (bit 7):

    STATus:OPERation:ENABle 1

    4 And to call the SRQ when the OPER bit is set (that does not answer correctly at the moment):

    *SRE 128

     This will actually call my function setControlReply(). I have developed attempts to reply the correct answer, but the reply wasn't spotted by the SCPI client (LabVIEW, or the Interactive test tool from NI). 
    Currently its implementation is empty. I'm studying the TinyUSB code to see how I can put the state machine in the right state that it sends the data.
    At this moment, I only managed to send data after I received a command. The service request is different - I have to reply on an internal firmware status change. And I haven't managed to get that working yet.

    TL;DR: Custom registers work. Fanout works. OPER and STATUS BYTE work. SRE does not work.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 2 years ago

    Jan, you are moving much faster than I can keep up.

    Don't stop, I will work with which ever version I can get into my Pico.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube